From f0543f418f63fb2eb09e35c763ff5b6e57684e23 Mon Sep 17 00:00:00 2001 From: james-rae Date: Sun, 28 May 2023 16:08:30 -0400 Subject: [PATCH] :package: beta build v0.1.0 --- play/deckbuilder.html | 3989 +++++++++++++++++++++++++++++++++++++++++ play/dist/solforge.js | 1 + play/index.html | 111 ++ 3 files changed, 4101 insertions(+) create mode 100644 play/deckbuilder.html create mode 100644 play/dist/solforge.js create mode 100644 play/index.html diff --git a/play/deckbuilder.html b/play/deckbuilder.html new file mode 100644 index 0000000..d82090c --- /dev/null +++ b/play/deckbuilder.html @@ -0,0 +1,3989 @@ + + + + + + + + + + + + + + Dirty Deckbuilder - Solforge - Mimicwurm Edition + + + + +
+

Dirty Deckbuilder

+ A proper one is in the works. Link to a + Google Sheet + with card data.
Copy in Google or export to a spreadsheet, then sort search and filter to your heart's content. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Abraxas, Avatar of Kadras + + 0
Aegis Conscript + + 0
Aegis Knight + + 0
Aegis Pulse + + 0
Aerial Surge + + 0
Aetherforge Oracle + + 0
Aetherguard + + 0
Aether Root + + 0
Agamemnon + + 0
Alloyin General + + 0
Alloyin Highlander + + 0
Alloyin Strategist + + 0
Anvillon Enforcer + + 0
Apocrymancer + + 0
Aquatic Embrace + + 0
Arboris, Grove Dragon + + 0
Arcflight Squadron + + 0
Ashurian Brawler + + 0
Ashurian Mystic + + 0
Asir's Blessing + + 0
Avalanche Guardian + + 0
Avalanche Invoker + + 0
Battle Techtician + + 0
Binben, Lightning Herald + + 0
Blightskull Phantasm + + 0
Blight Walker + + 0
Bonescythe Reaver + + 0
Borean Mystic + + 0
Botanimate + + 0
Brambleaxe Warrior + + 0
Bramblewood Guardian + + 0
Branchweaver Druid + + 0
Brightsteel Gargoyle + + 0
Brightsteel Sentinal + + 0
Brighttusk Sower + + 0
Bullwark Bash + + 0
Byzerak Drake + + 0
Byzerak Frostmaiden + + 0
Byzerak Spitemage + + 0
Cadaverous Thicket + + 0
Call the Lightning + + 0
Cavern Hydra + + 0
Cercee, Hand of Varna + + 0
Charnel Titan + + 0
Chistlehearth Archer + + 0
Chistlehearth Hunter + + 0
Chrogias + + 0
Cinder Colossus + + 0
Cinderfist Brawler + + 0
Cinder Mystic + + 0
Cindersmoke Wyvern + + 0
Cloudcleaver Titan + + 0
Conflagrate + + 0
Contagion Surge + + 0
Corpse Crawler + + 0
Corpulent Shambler + + 0
Crucible Colossus + + 0
Crypt Conjurer + + 0
Cull the Weak + + 0
Cultivate + + 0
Cypien Augmentation + + 0
Cypien Battlesuit + + 0
Cypien Infiltrator + + 0
Cypien Steelgraft + + 0
Darkfrost Reaper + + 0
Darkheart Wanderer + + 0
Darkshaper Savant + + 0
Death Current + + 0
Death Seeker + + 0
Deepbranch Ancient + + 0
Deepbranch Prowler + + 0
Deepmoss Raptor + + 0
Deepwood Bear Rider + + 0
Delpha, Chronosculptor + + 0
Digitize + + 0
Disintigrate + + 0
Dissolve + + 0
Doomwing, Dire Drake + + 0
Dreadbolt + + 0
Dr. Frankenbaum + + 0
Drix, the Mindwelder + + 0
Druid's Chant + + 0
Duskspire Zombie + + 0
Dryad's Boon + + 0
Ebonskull Knight + + 0
Echowisp + + 0
Electro Net + + 0
Emberwind Evoker + + 0
Energy Prison + + 0
Energy Surge + + 0
Enrage + + 0
Epidemic + + 0
Esperian Scarab + + 0
Esperian Steelplate + + 0
Esperian Wartusk + + 0
Ether Hounds + + 0
Everflame Mystic + + 0
Everflame Phoenix + + 0
Explosive Demise + + 0
Fangwood Bear + + 0
Fangwood Ravager + + 0
Fell Walker + + 0
Feral Instinct + + 0
Ferocious Roar + + 0
Fervent Assault + + 0
Firefist Uranti + + 0
Firemane Steed + + 0
Firestorm + + 0
Flameblade Champion + + 0
Flamebreak Invoker + + 0
Flamefury Shaman + + 0
Flame Lance + + 0
Flameshaper Savant + + 0
Flame Speaker + + 0
Flamestoke Shaman + + 0
Fleshfiend + + 0
Flowsteel Prototype + + 0
Flowstone Primordial + + 0
Forcefield + + 0
Forge Guardian Alpha + + 0
Forge Guardian Beta + + 0
Forge Guardian Gamma + + 0
Forgeplate Sentry + + 0
Frostshatter Strike + + 0
Frostwild Tracker + + 0
Frozen Solid + + 0
Gemheart Sprout + + 0
Gemhide Basher + + 0
Ghastly Renewal + + 0
Ghastly Touch + + 0
Ghostscale Cobra + + 0
Ghox, Metamind Paragon + + 0
Glaceus, Tundra Tyrant + + 0
Glacial Colossus + + 0
Glacial Crush + + 0
Gloomfiend + + 0
Gloomreaper Witch + + 0
Gloomspire Wurm + + 0
Glowhive Siren + + 0
Glowstride Stag + + 0
Graveborn Glutton + + 0
Grave Geist + + 0
Grave Ghast + + 0
Grave Pact + + 0
Grimgaunt Devourer + + 0
Grimgaunt Predator + + 0
Grimgaunt Spectre + + 0
Group Meal + + 0
Grove Huntress + + 0
Grove Matriarch + + 0
Heart Tree + + 0
Heavy Artillery + + 0
Hellforged Avatar + + 0
Hinterland Watchman + + 0
Hungering Strike + + 0
Hunting Pack + + 0
Iceborn Fortitude + + 0
Ice Torrent + + 0
Ionic Warcharger + + 0
Ironbeard, Hammer of Anvillon + + 0
Ironmind Acolyte + + 0
Jet Pack + + 0
Kas, Arcweaver + + 0
Keeper of the Damned + + 0
Korok, Khan of Kadras + + 0
Leafkin Progenitor + + 0
Legion Titan + + 0
Lifeblood Dryad + + 0
Lifeshaper Savant + + 0
Lightbringer Cleric + + 0
Lightning Brand + + 0
Lightning Spark + + 0
Lightning Wyrm + + 0
Lightshield Patrol + + 0
Lyria, Muse of Varna + + 0
Lysian Hydra + + 0
Magma Hound + + 0
Marrow Fiend + + 0
Master of Elements + + 0
Matrix Warden + + 0
Mending Spring + + 0
Metamind Adept + + 0
Metamind Explorer + + 0
Metamind Operator + + 0
Metamind Overseer + + 0
Metasculpt + + 0
Metasight + + 0
Metatransfer + + 0
Mimicleaf + + 0
Mimicwurm + + 0
Mossbeard Patriarch + + 0
Munitions Drone + + 0
Nargath Bruiser + + 0
Natural Selection + + 0
Necroslime + + 0
Necrotic Wurm + + 0
Necrovive + + 0
Nether Embrace + + 0
Nethershriek + + 0
Nexus Core + + 0
Nexus Pilot + + 0
Nexus Techtician + + 0
Nightgaunt + + 0
Noxious Cloud + + 0
Nuada, Faith's Flourish + + 0
Nyrali Ooze + + 0
Nyrali Symbiote + + 0
Omnomnom + + 0
Onyxium Allomancer + + 0
Onyxium Marauder + + 0
Onyxium Phantasm + + 0
Oreian Battledroid + + 0
Oreian Fieldmarshal + + 0
Oreian Justicar + + 0
Oreian Peacekeeper + + 0
Oreian Warwalker + + 0
Organ Harvester + + 0
Oros, Deepwood's Chosen + + 0
Ossuary Spirit + + 0
Overwhelming Force + + 0
Oxidon Spitter + + 0
Palladium Hindermind + + 0
Palladium Pulsemage + + 0
Palladium Simulacrum + + 0
Phalanx Squadron + + 0
Phytobomb + + 0
Poisoncoil + + 0
Power Torrent + + 0
Primal Surge + + 0
Primordial Slam + + 0
Pyre Giant + + 0
Pyre Song + + 0
Rageborn Hellion + + 0
Razortooth Stalker + + 0
Restless Wanderers + + 0
Riftlasher + + 0
Rimehorn Charger + + 0
Rite of the Grimgaunt + + 0
Rootforged Avatar + + 0
Runebark Guardian + + 0
Runegrove Guardian + + 0
Runescarred Zombie + + 0
Sap + + 0
Savage Oath + + 0
Scatterspore Eidolon + + 0
Scavenger Scorpion + + 0
Scorchmane Dragon + + 0
Scourgeflame Sorcerer + + 0
Scout Drone + + 0
Scrapforge Titan + + 0
Seismic Adept + + 0
Shallow Grave + + 0
Shardplate Delver + + 0
Shardplate Mutant + + 0
Shardthief Druid + + 0
Shimmerfang Serpent + + 0
Sigmund Fraud + + 0
Skyknight Glider + + 0
Solstice Reveler + + 0
Sonic Burst + + 0
Sonic Pulse + + 0
Soothing Radiance + + 0
Sorrow Harvester + + 0
Soul Drinker + + 0
Soul Harvest + + 0
Sparkblade Assassin + + 0
Spark Bot + + 0
Sparkbrand Asir + + 0
Spiritbloom Dryad + + 0
Spiritflame Mystic + + 0
Spiritforge Sentinel + + 0
Spiritfrost Shaman + + 0
Spiritleash + + 0
Spirit Reaver + + 0
Spirit Torrent + + 0
Spitesower Acolyte + + 0
Spore Torrent + + 0
Spring Dryad + + 0
Static Shock + + 0
Statis Warden + + 0
Steelforged Avatar + + 0
Steelscale Dragon + + 0
Steelshaper Savant + + 0
Steelwelder Medic + + 0
Stone Brand + + 0
Stonefist Giant + + 0
Storm Bringer + + 0
Storm Caller + + 0
Stormforged Avatar + + 0
Stouthide Stegadon + + 0
Stranglevine Hydra + + 0
Strength In Numbers + + 0
Stygian Lotus + + 0
Swampmoss Lurker + + 0
Synapsis Oracle + + 0
Talin Stampede + + 0
Talisin, Bard of Abundance + + 0
Tanglesprout + + 0
Tarsian Pact + + 0
Tarsus Deathweaver + + 0
Technognome + + 0
Technosmith + + 0
Tech Upgrade + + 0
Thundergale Invoker + + 0
Thundersaur + + 0
Touch Of Blight + + 0
Tower Scout + + 0
Tower Vanguard + + 0
Toxic Spores + + 0
Tremorcharge + + 0
Turnabout + + 0
Twinstrength + + 0
Umbraglim Mantis + + 0
Umbruk Glider + + 0
Umbruk Icecrusher + + 0
Umbruk Lasher + + 0
Unrelenting Dead + + 0
Uranti Bolt + + 0
Uranti Cryomancer + + 0
Uranti Heartseeker + + 0
Uranti Icemage + + 0
Uranti Warlord + + 0
Uranti Warstoker + + 0
Uterradon Mauler + + 0
Uterradon Rex + + 0
Uterradon Ridgeback + + 0
Uterra Packmaster + + 0
Varna's Pact + + 0
Vault Blockade + + 0
Vault Technician + + 0
Vengeful Spirit + + 0
Venomfang + + 0
Venomous Netherscale + + 0
Verdant Grace + + 0
Volcanic Giant + + 0
Vyric Ebonskull + + 0
Vyric's Embrace + + 0
Wallbreaker Yeti + + 0
Warbringer Uranti + + 0
War Merchant + + 0
Warmonger Mod + + 0
Water Walker + + 0
Weirwood Patriarch + + 0
Wildfire Maiden + + 0
Wildwood Sower + + 0
Windborn Hellion + + 0
Windcaller Shaman + + 0
Wind Primordial + + 0
Witherfrost Banshee + + 0
Witherfrost Succubus + + 0
Woebringer + + 0
Xithian Crusher + + 0
Xithian Host + + 0
Xithian Hulk + + 0
Xithian Rotfiend + + 0
Xithian Shambler + + 0
Xrath, Dreadnight Of Varna + + 0
Xrath's Will + + 0
Yeti Warcaller + + 0
Yuru, the Necrosage + + 0
Zephyr Mage + + 0
Zimus, the Undying + + 0
Zombie Infantry + + 0
Zyx, Storm Herald + + 0
+
+
+ + + +    + +
+ + diff --git a/play/dist/solforge.js b/play/dist/solforge.js new file mode 100644 index 0000000..a0253c2 --- /dev/null +++ b/play/dist/solforge.js @@ -0,0 +1 @@ +(function(){"use strict";const re=["A","N","T","U"];const Kt=["C","R","H","L"];const wt=[{crd:"AAK",fct:"T",rty:"L",set:1,typ:"C"},{crd:"AGC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"AGK",fct:"A",rty:"L",set:2.1,typ:"C"},{crd:"AGP",fct:"A",rty:"C",set:1.1,typ:"S"},{crd:"ASG",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AFO",fct:"A",rty:"C",set:2.1,typ:"C"},{crd:"ATG",fct:"A",rty:"C",set:2,typ:"C"},{crd:"ART",fct:"U",rty:"H",set:2.1,typ:"C"},{crd:"AGM",fct:"T",rty:"L",set:2.2,typ:"C"},{crd:"ALG",fct:"A",rty:"R",set:1,typ:"C"},{crd:"AHL",fct:"A",rty:"H",set:1,typ:"C"},{crd:"ALS",fct:"A",rty:"H",set:2,typ:"C"},{crd:"AEN",fct:"A",rty:"C",set:2,typ:"C"},{crd:"APM",fct:"A",rty:"H",set:2,typ:"C"},{crd:"AQE",fct:"T",rty:"C",set:1,typ:"S"},{crd:"AGD",fct:"U",rty:"L",set:1,typ:"C"},{crd:"AFS",fct:"A",rty:"L",set:1,typ:"C"},{crd:"ABR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"AMY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ABL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"AGU",fct:"T",rty:"R",set:2.1,typ:"C"},{crd:"AIV",fct:"T",rty:"H",set:1,typ:"C"},{crd:"BTN",fct:"A",rty:"H",set:1,typ:"C"},{crd:"BLH",fct:"T",rty:"L",set:2,typ:"C"},{crd:"BSP",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"BWK",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BSR",fct:"N",rty:"R",set:1,typ:"C"},{crd:"BMY",fct:"T",rty:"H",set:2.1,typ:"C"},{crd:"BTM",fct:"U",rty:"H",set:1,typ:"S"},{crd:"BAW",fct:"U",rty:"R",set:2,typ:"C"},{crd:"BWG",fct:"U",rty:"C",set:1,typ:"C"},{crd:"BWD",fct:"U",rty:"C",set:2,typ:"C"},{crd:"BSG",fct:"A",rty:"L",set:1,typ:"C"},{crd:"BSS",fct:"A",rty:"L",set:1,typ:"C"},{crd:"BTS",fct:"U",rty:"C",set:1.1,typ:"C"},{crd:"BWH",fct:"A",rty:"R",set:1,typ:"S"},{crd:"BZD",fct:"N",rty:"R",set:2,typ:"C"},{crd:"BFM",fct:"N",rty:"H",set:2.3,typ:"C"},{crd:"BSM",fct:"T",rty:"H",set:2,typ:"C"},{crd:"CDT",fct:"U",rty:"R",set:1,typ:"C"},{crd:"CTL",fct:"T",rty:"L",set:1,typ:"S"},{crd:"CHY",fct:"U",rty:"C",set:1,typ:"C"},{crd:"CHV",fct:"N",rty:"L",set:2,typ:"C"},{crd:"CTI",fct:"N",rty:"C",set:1.1,typ:"C"},{crd:"CHA",fct:"U",rty:"R",set:2.1,typ:"C"},{crd:"CHH",fct:"U",rty:"C",set:2,typ:"C"},{crd:"CHR",fct:"U",rty:"L",set:1,typ:"C"},{crd:"CDC",fct:"T",rty:"C",set:2,typ:"C"},{crd:"CFB",fct:"T",rty:"H",set:1,typ:"C"},{crd:"CNM",fct:"T",rty:"C",set:2,typ:"C"},{crd:"CSW",fct:"T",rty:"L",set:2.3,typ:"C"},{crd:"CCT",fct:"T",rty:"R",set:2,typ:"C"},{crd:"CFG",fct:"T",rty:"C",set:2,typ:"S"},{crd:"CSU",fct:"N",rty:"R",set:1,typ:"S"},{crd:"CCR",fct:"N",rty:"C",set:1,typ:"C"},{crd:"CSB",fct:"N",rty:"C",set:2,typ:"C"},{crd:"CRC",fct:"A",rty:"R",set:2,typ:"C"},{crd:"CYC",fct:"N",rty:"H",set:2,typ:"C"},{crd:"CTW",fct:"N",rty:"C",set:1,typ:"S"},{crd:"CTV",fct:"U",rty:"H",set:1,typ:"S"},{crd:"CAG",fct:"A",rty:"R",set:1,typ:"S"},{crd:"CBS",fct:"A",rty:"C",set:2.1,typ:"S"},{crd:"CIN",fct:"A",rty:"R",set:1.1,typ:"C"},{crd:"CSG",fct:"A",rty:"C",set:2,typ:"S"},{crd:"DFR",fct:"N",rty:"H",set:2,typ:"C"},{crd:"DHW",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DSS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DCR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"DSK",fct:"N",rty:"C",set:1,typ:"C"},{crd:"DBA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"DBP",fct:"U",rty:"C",set:1,typ:"C"},{crd:"DMR",fct:"U",rty:"C",set:2,typ:"C"},{crd:"DBR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"DCS",fct:"A",rty:"L",set:2,typ:"C"},{crd:"DGZ",fct:"A",rty:"R",set:2,typ:"S"},{crd:"DIS",fct:"T",rty:"R",set:1,typ:"S"},{crd:"DSV",fct:"U",rty:"R",set:2,typ:"S"},{crd:"DDD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"DBT",fct:"N",rty:"H",set:1,typ:"S"},{crd:"DFB",fct:"N",rty:"R",set:1,typ:"C"},{crd:"DMW",fct:"A",rty:"L",set:1.1,typ:"C"},{crd:"DCH",fct:"U",rty:"C",set:1,typ:"S"},{crd:"DSZ",fct:"N",rty:"C",set:2,typ:"C"},{crd:"DYB",fct:"U",rty:"R",set:2,typ:"S"},{crd:"ESK",fct:"N",rty:"H",set:2,typ:"C"},{crd:"EHW",fct:"U",rty:"L",set:1,typ:"C"},{crd:"ETN",fct:"A",rty:"C",set:1,typ:"S"},{crd:"EWE",fct:"T",rty:"H",set:2,typ:"C"},{crd:"ENP",fct:"A",rty:"H",set:1,typ:"S"},{crd:"ESU",fct:"A",rty:"R",set:1,typ:"S"},{crd:"ENR",fct:"U",rty:"C",set:1,typ:"S"},{crd:"EPD",fct:"N",rty:"H",set:1,typ:"S"},{crd:"ESC",fct:"A",rty:"H",set:2,typ:"C"},{crd:"ESP",fct:"U",rty:"H",set:2.3,typ:"C"},{crd:"EWT",fct:"U",rty:"R",set:2,typ:"C"},{crd:"EHN",fct:"U",rty:"C",set:1,typ:"C"},{crd:"EFM",fct:"T",rty:"L",set:2.1,typ:"C"},{crd:"EFP",fct:"T",rty:"L",set:1,typ:"C"},{crd:"EXD",fct:"N",rty:"H",set:1,typ:"S"},{crd:"FWB",fct:"U",rty:"C",set:2.3,typ:"C"},{crd:"FWR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"FWK",fct:"N",rty:"C",set:1,typ:"C"},{crd:"FIN",fct:"U",rty:"C",set:1,typ:"S"},{crd:"FRR",fct:"U",rty:"H",set:1,typ:"S"},{crd:"FVA",fct:"T",rty:"H",set:1,typ:"S"},{crd:"FFU",fct:"T",rty:"H",set:1,typ:"C"},{crd:"FMS",fct:"T",rty:"C",set:2,typ:"C"},{crd:"FSM",fct:"T",rty:"H",set:1,typ:"S"},{crd:"FBC",fct:"T",rty:"L",set:1,typ:"C"},{crd:"FBI",fct:"T",rty:"H",set:2.2,typ:"C"},{crd:"FFS",fct:"T",rty:"R",set:2,typ:"C"},{crd:"FLN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"FSS",fct:"T",rty:"R",set:1,typ:"C"},{crd:"FLS",fct:"T",rty:"C",set:1,typ:"C"},{crd:"FSH",fct:"T",rty:"R",set:1,typ:"C"},{crd:"FFD",fct:"N",rty:"H",set:1,typ:"C"},{crd:"FSP",fct:"A",rty:"L",set:1,typ:"C"},{crd:"FPR",fct:"T",rty:"C",set:2.1,typ:"C"},{crd:"FFL",fct:"A",rty:"C",set:1,typ:"S"},{crd:"FGA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FGB",fct:"A",rty:"R",set:1,typ:"C"},{crd:"FGG",fct:"A",rty:"H",set:1,typ:"C"},{crd:"FPS",fct:"A",rty:"C",set:1,typ:"C"},{crd:"FSK",fct:"T",rty:"C",set:2.3,typ:"S"},{crd:"FWT",fct:"U",rty:"H",set:1,typ:"C"},{crd:"FZS",fct:"T",rty:"R",set:1,typ:"S"},{crd:"GHS",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"GHB",fct:"U",rty:"R",set:1,typ:"C"},{crd:"GRN",fct:"N",rty:"C",set:2,typ:"S"},{crd:"GTH",fct:"N",rty:"C",set:1,typ:"S"},{crd:"GSC",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GMP",fct:"A",rty:"L",set:1,typ:"C"},{crd:"GTT",fct:"T",rty:"L",set:2,typ:"C"},{crd:"GCL",fct:"T",rty:"C",set:1,typ:"C"},{crd:"GCR",fct:"T",rty:"C",set:2,typ:"S"},{crd:"GLF",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GRW",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GSW",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GVS",fct:"U",rty:"C",set:2,typ:"C"},{crd:"GSS",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GBG",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GGE",fct:"N",rty:"C",set:2,typ:"C"},{crd:"GGH",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GRP",fct:"N",rty:"R",set:1,typ:"S"},{crd:"GGD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"GGP",fct:"N",rty:"H",set:1,typ:"C"},{crd:"GGS",fct:"N",rty:"C",set:1,typ:"C"},{crd:"GRM",fct:"N",rty:"R",set:2,typ:"S"},{crd:"GHT",fct:"U",rty:"C",set:1,typ:"C"},{crd:"GMR",fct:"U",rty:"C",set:1,typ:"C"},{crd:"HTR",fct:"U",rty:"L",set:1,typ:"C"},{crd:"HAR",fct:"A",rty:"C",set:1,typ:"C"},{crd:"HFA",fct:"N",rty:"H",set:1,typ:"C"},{crd:"HWM",fct:"A",rty:"L",set:1,typ:"C"},{crd:"HGS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"HTP",fct:"U",rty:"C",set:1,typ:"C"},{crd:"IBF",fct:"T",rty:"R",set:1,typ:"S"},{crd:"ITO",fct:"T",rty:"R",set:2,typ:"S"},{crd:"IWC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"IHA",fct:"A",rty:"L",set:2,typ:"C"},{crd:"IMA",fct:"A",rty:"L",set:2.3,typ:"C"},{crd:"JPK",fct:"A",rty:"C",set:1,typ:"S"},{crd:"KAW",fct:"T",rty:"L",set:1.1,typ:"C"},{crd:"KOD",fct:"N",rty:"L",set:1,typ:"C"},{crd:"KKK",fct:"T",rty:"L",set:2,typ:"C"},{crd:"LKP",fct:"U",rty:"L",set:1,typ:"C"},{crd:"LGT",fct:"N",rty:"R",set:2.3,typ:"C"},{crd:"LBD",fct:"U",rty:"H",set:1,typ:"C"},{crd:"LSS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"LBL",fct:"U",rty:"R",set:1,typ:"C"},{crd:"LBR",fct:"T",rty:"C",set:1,typ:"S"},{crd:"LSK",fct:"T",rty:"C",set:1,typ:"S"},{crd:"LWY",fct:"T",rty:"C",set:1,typ:"C"},{crd:"LSP",fct:"A",rty:"C",set:1,typ:"C"},{crd:"LMV",fct:"N",rty:"L",set:1,typ:"C"},{crd:"LHY",fct:"U",rty:"C",set:2,typ:"C"},{crd:"MMH",fct:"T",rty:"C",set:1,typ:"C"},{crd:"MRF",fct:"N",rty:"C",set:1,typ:"C"},{crd:"MOE",fct:"T",rty:"H",set:1,typ:"C"},{crd:"MXW",fct:"A",rty:"C",set:1,typ:"C"},{crd:"MSP",fct:"U",rty:"R",set:2,typ:"S"},{crd:"MMA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"MMX",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMO",fct:"A",rty:"C",set:2,typ:"C"},{crd:"MMV",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"MSC",fct:"A",rty:"H",set:1,typ:"S"},{crd:"MTS",fct:"A",rty:"C",set:1.1,typ:"S"},{crd:"MTT",fct:"A",rty:"C",set:2,typ:"S"},{crd:"MML",fct:"U",rty:"H",set:2,typ:"C"},{crd:"MMW",fct:"U",rty:"L",set:2.2,typ:"C"},{crd:"MBP",fct:"U",rty:"H",set:1,typ:"C"},{crd:"MND",fct:"A",rty:"R",set:1,typ:"C"},{crd:"NGB",fct:"T",rty:"C",set:1,typ:"C"},{crd:"NSL",fct:"U",rty:"R",set:1,typ:"S"},{crd:"NCS",fct:"N",rty:"R",set:1,typ:"C"},{crd:"NCW",fct:"N",rty:"C",set:1,typ:"C"},{crd:"NCV",fct:"N",rty:"C",set:1,typ:"S"},{crd:"NEM",fct:"N",rty:"C",set:1,typ:"S"},{crd:"NSH",fct:"N",rty:"L",set:2.3,typ:"S"},{crd:"NXC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXP",fct:"A",rty:"C",set:1,typ:"C"},{crd:"NXT",fct:"A",rty:"H",set:2,typ:"C"},{crd:"NGT",fct:"N",rty:"R",set:2,typ:"C"},{crd:"NCL",fct:"U",rty:"R",set:1.1,typ:"S"},{crd:"NFF",fct:"U",rty:"L",set:2,typ:"C"},{crd:"NOZ",fct:"N",rty:"R",set:2,typ:"C"},{crd:"NSY",fct:"N",rty:"C",set:2.1,typ:"C"},{crd:"ONN",fct:"N",rty:"H",set:1.1,typ:"S"},{crd:"OXA",fct:"A",rty:"H",set:2.3,typ:"C"},{crd:"OXM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"OXP",fct:"N",rty:"H",set:2,typ:"C"},{crd:"OBD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"OFM",fct:"A",rty:"R",set:2.1,typ:"C"},{crd:"OJC",fct:"A",rty:"H",set:1.1,typ:"C"},{crd:"OPK",fct:"A",rty:"R",set:2,typ:"C"},{crd:"OWW",fct:"A",rty:"L",set:1,typ:"C"},{crd:"OHV",fct:"N",rty:"R",set:2,typ:"C"},{crd:"ODC",fct:"U",rty:"L",set:2,typ:"C"},{crd:"OSP",fct:"N",rty:"R",set:2,typ:"C"},{crd:"OWF",fct:"A",rty:"H",set:2,typ:"S"},{crd:"OXS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"PHM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"PPM",fct:"A",rty:"R",set:1,typ:"C"},{crd:"PSM",fct:"A",rty:"L",set:2.2,typ:"C"},{crd:"PHS",fct:"A",rty:"R",set:2.2,typ:"C"},{crd:"PTB",fct:"U",rty:"H",set:1,typ:"S"},{crd:"PSC",fct:"U",rty:"R",set:2,typ:"C"},{crd:"PTR",fct:"A",rty:"R",set:2,typ:"S"},{crd:"PSG",fct:"U",rty:"R",set:1,typ:"S"},{crd:"PMS",fct:"T",rty:"C",set:1,typ:"S"},{crd:"PYG",fct:"T",rty:"H",set:1,typ:"C"},{crd:"PYS",fct:"T",rty:"C",set:1.1,typ:"S"},{crd:"RBH",fct:"T",rty:"L",set:1,typ:"C"},{crd:"RTS",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"RLW",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RFL",fct:"T",rty:"R",set:1,typ:"C"},{crd:"RHC",fct:"T",rty:"C",set:1,typ:"C"},{crd:"ROG",fct:"N",rty:"H",set:1,typ:"S"},{crd:"RFA",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RBG",fct:"U",rty:"H",set:2,typ:"C"},{crd:"RGG",fct:"U",rty:"H",set:1,typ:"C"},{crd:"RSZ",fct:"N",rty:"R",set:1.1,typ:"C"},{crd:"SAP",fct:"A",rty:"C",set:2,typ:"S"},{crd:"SVO",fct:"U",rty:"C",set:2.1,typ:"S"},{crd:"SSE",fct:"U",rty:"L",set:2.1,typ:"C"},{crd:"SCS",fct:"N",rty:"C",set:1,typ:"C"},{crd:"SMD",fct:"T",rty:"L",set:1,typ:"C"},{crd:"SFS",fct:"N",rty:"L",set:1,typ:"C"},{crd:"SCD",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SFT",fct:"A",rty:"H",set:1,typ:"C"},{crd:"SAD",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SHG",fct:"N",rty:"L",set:2,typ:"S"},{crd:"SPD",fct:"U",rty:"R",set:1,typ:"C"},{crd:"SPM",fct:"U",rty:"L",set:1,typ:"C"},{crd:"STD",fct:"A",rty:"H",set:2.2,typ:"C"},{crd:"SHS",fct:"U",rty:"R",set:2.2,typ:"C"},{crd:"SGF",fct:"N",rty:"H",set:2.2,typ:"C"},{crd:"SKG",fct:"A",rty:"C",set:2,typ:"C"},{crd:"SSR",fct:"U",rty:"L",set:2,typ:"C"},{crd:"SNB",fct:"A",rty:"C",set:2.3,typ:"S"},{crd:"SNP",fct:"A",rty:"H",set:1,typ:"S"},{crd:"SRD",fct:"U",rty:"C",set:1,typ:"S"},{crd:"SRH",fct:"N",rty:"C",set:2.3,typ:"C"},{crd:"SDN",fct:"N",rty:"L",set:1,typ:"C"},{crd:"SHV",fct:"N",rty:"H",set:1,typ:"S"},{crd:"SBA",fct:"A",rty:"C",set:1,typ:"C"},{crd:"SKB",fct:"A",rty:"C",set:1,typ:"C"},{crd:"SBR",fct:"T",rty:"C",set:2,typ:"C"},{crd:"SBD",fct:"U",rty:"C",set:2.1,typ:"C"},{crd:"SFM",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SSN",fct:"A",rty:"C",set:2.2,typ:"C"},{crd:"SSM",fct:"T",rty:"C",set:2.2,typ:"C"},{crd:"SLH",fct:"N",rty:"C",set:2,typ:"S"},{crd:"SRV",fct:"N",rty:"R",set:2.2,typ:"C"},{crd:"STR",fct:"N",rty:"R",set:2,typ:"S"},{crd:"SSA",fct:"N",rty:"H",set:2.1,typ:"C"},{crd:"STO",fct:"U",rty:"R",set:2,typ:"S"},{crd:"SDR",fct:"U",rty:"R",set:1,typ:"C"},{crd:"SHK",fct:"T",rty:"H",set:1,typ:"S"},{crd:"SWR",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SFA",fct:"A",rty:"H",set:1,typ:"C"},{crd:"STG",fct:"A",rty:"L",set:2,typ:"C"},{crd:"SSS",fct:"A",rty:"R",set:1,typ:"C"},{crd:"SWM",fct:"A",rty:"R",set:2,typ:"C"},{crd:"STN",fct:"T",rty:"R",set:2,typ:"S"},{crd:"SGI",fct:"T",rty:"C",set:1,typ:"C"},{crd:"SBG",fct:"T",rty:"L",set:1,typ:"C"},{crd:"SCL",fct:"T",rty:"C",set:1,typ:"C"},{crd:"SGA",fct:"T",rty:"H",set:1,typ:"C"},{crd:"SSG",fct:"U",rty:"C",set:2,typ:"C"},{crd:"SVH",fct:"U",rty:"C",set:2.3,typ:"C"},{crd:"SIN",fct:"U",rty:"C",set:1.1,typ:"S"},{crd:"SYL",fct:"U",rty:"H",set:2.2,typ:"C"},{crd:"SML",fct:"U",rty:"C",set:1,typ:"C"},{crd:"SYO",fct:"A",rty:"L",set:1,typ:"C"},{crd:"TST",fct:"T",rty:"C",set:2,typ:"S"},{crd:"TBA",fct:"U",rty:"L",set:1,typ:"C"},{crd:"TGS",fct:"U",rty:"C",set:2,typ:"C"},{crd:"TPT",fct:"N",rty:"C",set:2.1,typ:"S"},{crd:"TDW",fct:"N",rty:"R",set:1.1,typ:"C"},{crd:"TGN",fct:"A",rty:"C",set:2,typ:"C"},{crd:"TSM",fct:"A",rty:"C",set:1,typ:"C"},{crd:"TUP",fct:"A",rty:"R",set:1,typ:"S"},{crd:"TGI",fct:"T",rty:"R",set:2,typ:"C"},{crd:"TDS",fct:"U",rty:"L",set:1.1,typ:"C"},{crd:"TOB",fct:"N",rty:"R",set:1,typ:"S"},{crd:"TWS",fct:"A",rty:"C",set:2,typ:"C"},{crd:"TVG",fct:"A",rty:"R",set:1.1,typ:"C"},{crd:"TXS",fct:"U",rty:"C",set:1,typ:"S"},{crd:"TCG",fct:"T",rty:"C",set:2.1,typ:"S"},{crd:"TRN",fct:"T",rty:"H",set:2,typ:"S"},{crd:"TWG",fct:"U",rty:"C",set:2,typ:"S"},{crd:"UGM",fct:"U",rty:"C",set:2.2,typ:"C"},{crd:"UGL",fct:"T",rty:"R",set:2,typ:"C"},{crd:"UIC",fct:"T",rty:"H",set:2.3,typ:"C"},{crd:"ULR",fct:"U",rty:"H",set:2,typ:"C"},{crd:"URD",fct:"N",rty:"H",set:1,typ:"C"},{crd:"UBL",fct:"T",rty:"R",set:1,typ:"S"},{crd:"UCM",fct:"T",rty:"R",set:1,typ:"C"},{crd:"UHS",fct:"T",rty:"H",set:2,typ:"C"},{crd:"UIM",fct:"T",rty:"C",set:2,typ:"C"},{crd:"UWL",fct:"T",rty:"H",set:2,typ:"C"},{crd:"UWS",fct:"T",rty:"R",set:2.3,typ:"C"},{crd:"UTM",fct:"U",rty:"C",set:2,typ:"C"},{crd:"UTR",fct:"U",rty:"H",set:2,typ:"C"},{crd:"URB",fct:"U",rty:"L",set:2.3,typ:"C"},{crd:"UPM",fct:"U",rty:"L",set:1,typ:"C"},{crd:"VRP",fct:"N",rty:"L",set:2,typ:"S"},{crd:"VBK",fct:"A",rty:"R",set:2,typ:"C"},{crd:"VTC",fct:"A",rty:"C",set:1,typ:"C"},{crd:"VGN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"VNF",fct:"U",rty:"R",set:1.1,typ:"C"},{crd:"VNS",fct:"U",rty:"H",set:2,typ:"C"},{crd:"VGR",fct:"U",rty:"C",set:2,typ:"S"},{crd:"VCG",fct:"T",rty:"C",set:1,typ:"C"},{crd:"VES",fct:"N",rty:"L",set:2.1,typ:"C"},{crd:"VYE",fct:"N",rty:"C",set:2,typ:"S"},{crd:"WBY",fct:"T",rty:"R",set:2,typ:"C"},{crd:"WBU",fct:"T",rty:"C",set:1.1,typ:"C"},{crd:"WMR",fct:"A",rty:"H",set:2.1,typ:"C"},{crd:"WMM",fct:"A",rty:"H",set:1,typ:"C"},{crd:"WTW",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WWP",fct:"U",rty:"H",set:1.1,typ:"C"},{crd:"WFM",fct:"T",rty:"H",set:1.1,typ:"C"},{crd:"WWS",fct:"U",rty:"R",set:1,typ:"C"},{crd:"WBH",fct:"T",rty:"R",set:1.1,typ:"C"},{crd:"WCS",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WPD",fct:"T",rty:"C",set:1,typ:"C"},{crd:"WFB",fct:"N",rty:"C",set:1.1,typ:"C"},{crd:"WFS",fct:"N",rty:"H",set:1,typ:"C"},{crd:"WBG",fct:"N",rty:"L",set:1.1,typ:"C"},{crd:"XCR",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XHS",fct:"N",rty:"C",set:2.2,typ:"C"},{crd:"XHU",fct:"N",rty:"C",set:1,typ:"C"},{crd:"XRF",fct:"N",rty:"C",set:2,typ:"C"},{crd:"XSH",fct:"N",rty:"L",set:1,typ:"C"},{crd:"XDV",fct:"N",rty:"H",set:1,typ:"C"},{crd:"XRW",fct:"N",rty:"H",set:2,typ:"S"},{crd:"YWC",fct:"T",rty:"C",set:2,typ:"C"},{crd:"YNS",fct:"N",rty:"L",set:2.2,typ:"C"},{crd:"ZPM",fct:"T",rty:"R",set:1.1,typ:"C"},{crd:"ZTU",fct:"N",rty:"L",set:1,typ:"C"},{crd:"ZIN",fct:"N",rty:"C",set:1,typ:"C"},{crd:"ZSH",fct:"T",rty:"L",set:1,typ:"C"}],be=[["ASQ",["SLG","SLG"]],["CGL",["CGF"]],["DHC",["DYF"]],["DTD",["TOT"]],["FGD",["FGA","FGB","FGG"]],["IBA",["AVB"]],["IZK",["IFL","IFR"]],["RHU",["RSC"]],["SLS",["MMY"]],["TSL",["FUN"]],["WHR",["WHC"]]],h=(o,t)=>({card:o,num:t}),ve={name:"Official",id:"SBE",decks:[{name:"Alloyin Starter",factions:["A"],cards:[h("SYO",1),h("BSS",1),h("SFT",2),h("SNP",2),h("TSM",2),h("SSS",2),h("ALG",2),h("MXW",3),h("TUP",3),h("FPS",3),h("MND",3),h("IWC",3),h("SKB",3)]},{name:"Nekrium Starter",factions:["N"],cards:[h("SFS",1),h("GGD",1),h("FFD",3),h("EPD",2),h("CCR",2),h("HGS",2),h("DSS",2),h("BWK",2),h("GBG",3),h("DSK",3),h("GRP",3),h("VGN",3),h("XHU",3)]},{name:"Tempys Starter",factions:["T"],cards:[h("FBC",1),h("RBH",1),h("CFB",3),h("FSM",2),h("FSH",2),h("FSS",2),h("PMS",2),h("RFL",2),h("UBL",3),h("WPD",3),h("SGI",3),h("AMY",3),h("WCS",3)]},{name:"Uterra Starter",factions:["U"],cards:[h("UPM",1),h("EHW",1),h("FRR",3),h("SPD",2),h("HTP",2),h("LSS",2),h("SDR",2),h("SRD",2),h("FWR",3),h("DBP",3),h("GHT",3),h("GSS",3),h("TXS",3)]},{name:"Cruel Corrosion",factions:["A","N"],cards:[h("IHA",1),h("WBG",1),h("OXP",1),h("DFR",1),h("APM",1),h("SNP",1),h("GRM",2),h("ETN",2),h("DHW",2),h("OXM",2),h("AEN",2),h("ATG",2),h("CTI",2),h("CTW",2),h("FPS",2),h("GRW",2),h("MTT",2),h("SAP",2)]},{name:"Death March",factions:["N","T"],cards:[h("ZTU",1),h("VRP",1),h("GGP",1),h("EPD",1),h("DBT",1),h("BSM",1),h("TDW",2),h("NGT",2),h("UBL",2),h("FWK",2),h("BZD",2),h("CSB",2),h("SLH",2),h("MMH",2),h("LSK",2),h("GBG",2),h("CFG",2),h("DSK",2)]},{name:"Dinosaurs!",factions:["T","U"],cards:[h("TDS",1),h("SSR",1),h("FRR",1),h("ULR",1),h("UTR",1),h("BTM",1),h("UGL",2),h("EHN",2),h("SPD",2),h("GHB",2),h("FLN",2),h("SML",2),h("RFL",2),h("OXS",2),h("UTM",2),h("TWG",2),h("ENR",2),h("DBP",2)]},{name:"Wyvern's Wrath",factions:["T","U"],cards:[h("CSW",1),h("SMD",1),h("FRR",1),h("UIC",1),h("CFB",1),h("UGL",2),h("FSH",2),h("FLN",2),h("WPD",1),h("TWG",2),h("TCG",2),h("TGS",2),h("SVH",1),h("SCL",2),h("RTS",1),h("FWB",1),h("ENR",2),h("ABR",2)]},{name:"Ironmind Intuition",factions:["A","N"],cards:[h("IMA",1),h("GMP",1),h("OXA",1),h("EPD",1),h("OJC",1),h("ESU",2),h("OXM",2),h("MMA",2),h("SAP",1),h("AFO",2),h("GBG",2),h("CTW",2),h("SRH",1),h("TSM",2),h("SLH",1),h("MTT",1),h("DCR",1),h("DFB",1),h("BSR",1),h("LGT",1),h("XRF",2),h("MMX",1)]},{name:"Nethershriek Negation",factions:["N","T"],cards:[h("SBG",1),h("NSH",1),h("FFU",1),h("EWE",1),h("BFM",1),h("WBH",1),h("UWS",1),h("TGI",2),h("RFL",2),h("GRM",1),h("ASG",1),h("YWC",2),h("XRF",2),h("WPD",2),h("WCS",2),h("WBU",2),h("TCG",1),h("FSK",1),h("SLH",2),h("CFG",1),h("RTS",2)]},{name:"Ridgeback's Rage",factions:["A","U"],cards:[h("URB",1),h("AGK",1),h("ESP",1),h("FRR",1),h("NXT",1),h("ALG",1),h("FGB",1),h("PHS",2),h("TUP",1),h("EWT",2),h("PTR",1),h("VBK",1),h("AGC",1),h("AEN",2),h("ETN",1),h("FPS",2),h("MXW",2),h("GHT",1),h("TWG",2),h("SNB",1),h("SML",1),h("JPK",1),h("ENR",1),h("IWC",1)]}]},Ae={name:"Sept 2013 Reddit Tourney",id:"T1309",decks:[{name:"Axel: Lifegain",factions:["T","U"],cards:[h("AGD",3),h("EHW",3),h("FRR",3),h("FIN",1),h("UPM",1),h("LKP",2),h("BTM",2),h("LBL",3),h("GSS",3),h("RFA",3),h("GHB",3),h("EFP",3)]},{name:"Foxhull: Grow Wide",factions:["U"],cards:[h("DBP",3),h("EHW",2),h("FRR",3),h("FWT",3),h("UPM",3),h("LKP",2),h("BTM",3),h("HTR",2),h("LBD",2),h("RFA",3),h("GHB",2),h("SDR",2)]},{name:"Phoenyx: Free Spell Dmg",factions:["T","U"],cards:[h("SHK",3),h("MOE",3),h("FRR",3),h("LSK",3),h("FFU",3),h("UBL",3),h("WWS",3),h("FSS",3),h("ENR",3),h("MMH",3)]},{name:"Klaven: Mono-N",factions:["N"],cards:[h("SCS",3),h("ROG",1),h("GGP",1),h("GGD",3),h("WFS",1),h("DSS",3),h("ZTU",1),h("GBG",3),h("HFA",3),h("EXD",1),h("EPD",1),h("BSR",1),h("MRF",2),h("HGS",3),h("GTH",3)]},{name:"Shabbit: Zimus",factions:["N","T"],cards:[h("FSS",3),h("GGD",2),h("GGP",3),h("KOD",1),h("MOE",2),h("ZTU",3),h("EFP",2),h("LSK",2),h("FVA",1),h("EPD",3),h("CTW",1),h("SHV",1),h("UBL",3),h("SHK",3)]},{name:"Technogeek5000: Grow Wide",factions:["N","U"],cards:[h("DBP",2),h("EHW",2),h("FRR",3),h("HTP",2),h("UPM",3),h("LKP",2),h("GHT",3),h("GGP",2),h("LBD",1),h("EPD",2),h("DBT",2),h("SPD",3),h("SDR",3)]},{name:"Thematik: Level Up",factions:["A","T"],cards:[h("IWC",3),h("FSS",3),h("ETN",1),h("WPD",2),h("FSM",1),h("AHL",1),h("UBL",3),h("SMD",2),h("BTN",3),h("LSK",1),h("MMH",3),h("FFU",1),h("TSM",3),h("ALG",3)]},{name:"TinyGrimes: NT Shapers",factions:["N","T"],cards:[h("DSS",3),h("FSS",3),h("EPD",2),h("GTH",3),h("FSM",1),h("MOE",1),h("UBL",3),h("GGP",3),h("GBG",1),h("LSK",3),h("HGS",1),h("CTW",1),h("SHK",3),h("GGD",1),h("DBT",1)]}]},ke={name:"June 2014 FWIQ Top 8",id:"T1406",decks:[{name:"CarlChu: Dreadbots",factions:["A","N"],cards:[h("MXW",1),h("TDW",3),h("BSG",3),h("BSS",2),h("IWC",1),h("OJC",2),h("EPD",3),h("ALS",3),h("ESK",2),h("OWF",2),h("CHV",3),h("VRP",3),h("BTN",2)]},{name:"Derk: Metaminds",factions:["A"],cards:[h("OJC",3),h("DMW",3),h("MMV",3),h("JPK",3),h("MMO",3),h("GMP",3),h("ALS",3),h("MMA",3),h("SFA",3),h("BTN",3)]},{name:"Hans: Farmer Tarsus",factions:["N","U"],cards:[h("LKP",2),h("CHR",2),h("FRR",3),h("VRP",3),h("SHG",2),h("SSE",3),h("EPD",3),h("SYL",3),h("WWP",3),h("NFF",3),h("TDW",3)]},{name:"Hectares: Dino Attack",factions:["A","U"],cards:[h("ALS",3),h("TDS",3),h("FRR",3),h("WWP",3),h("SML",2),h("BSG",3),h("JPK",2),h("ODC",3),h("NXT",2),h("WMM",3),h("GHB",3)]},{name:"Jabor: Control",factions:["N","T"],cards:[h("CTW",2),h("BSM",3),h("SCL",3),h("EPD",3),h("VYE",3),h("ESK",3),h("UWL",3),h("SMD",3),h("ZTU",3),h("EFP",3),h("DBT",1)]},{name:"StillHadAllDeez: Necromancer",factions:["N","U"],cards:[h("ZTU",3),h("CTW",2),h("FRR",3),h("VRP",3),h("SHG",2),h("ESK",3),h("EPD",3),h("SYL",3),h("ODC",3),h("GGD",2),h("TDW",3)]},{name:"Tetrarain: Big n Small",factions:["N","U"],cards:[h("ZTU",2),h("TDS",3),h("ODC",3),h("WWP",3),h("CTW",1),h("SSE",1),h("EHW",2),h("EPD",3),h("GGD",2),h("CHA",2),h("ESK",3),h("CHV",2),h("FRR",3)]},{name:"Zecrus: Necro Growwide",factions:["N","U"],cards:[h("EHW",3),h("SSR",2),h("FRR",2),h("VRP",3),h("SHG",2),h("ESK",2),h("EPD",2),h("LBD",3),h("SSE",3),h("BWD",2),h("GGD",1),h("ZTU",1),h("SYL",1),h("TDW",3)]}]},Te={name:"July 2014 FWIQ Top 8",id:"T1407",decks:[{name:"Bryan: Knightbots",factions:["A","U"],cards:[h("AGK",3),h("AFS",3),h("BSG",2),h("BSS",3),h("JPK",3),h("VBK",2),h("FRR",3),h("TDS",3),h("WWP",3),h("MXW",2),h("OJC",3)]},{name:"Busti: Tempo",factions:["N","T"],cards:[h("GGP",3),h("FZS",1),h("EPD",2),h("EFP",3),h("GGD",1),h("FBI",3),h("ZTU",2),h("FLN",3),h("LSK",3),h("ESK",3),h("SHK",3),h("KKK",1),h("CHV",1),h("GCR",1)]},{name:"Khaldrogo: Knightmind",factions:["A"],cards:[h("AGK",2),h("DMW",3),h("BSG",3),h("BSS",3),h("JPK",1),h("MMO",1),h("STD",2),h("GMP",3),h("ALS",3),h("MMA",3),h("SFA",3),h("BTN",3)]},{name:"Klematisse: Flamebreak",factions:["N","T"],cards:[h("GTT",3),h("FZS",2),h("EPD",2),h("SMD",3),h("UBL",2),h("FBI",3),h("ZTU",3),h("FLN",2),h("LSK",2),h("ESK",3),h("SHK",3),h("GCR",2)]},{name:"SilverTail: Dreadbots",factions:["A","N"],cards:[h("MXW",2),h("ZTU",3),h("BSG",3),h("BSS",3),h("GGD",2),h("OJC",2),h("EPD",3),h("ALS",3),h("ESK",3),h("CHV",3),h("BTN",3)]},{name:"Skitzo: Yeti",factions:["T","U"],cards:[h("WBY",3),h("TDS",3),h("FRR",3),h("WWP",3),h("ODC",2),h("UWL",3),h("SSR",1),h("RBH",1),h("EFP",2),h("UIM",3),h("UBL",3),h("GCR",3)]},{name:"V3ng3vin3: Farmer Tarsus",factions:["N","U"],cards:[h("LKP",2),h("CHR",2),h("FRR",3),h("VRP",3),h("SHG",2),h("SSE",3),h("EPD",3),h("SYL",3),h("WWP",3),h("NFF",3),h("TDW",3)]},{name:"Zwaxor: Control",factions:["N","T"],cards:[h("BSM",3),h("DBT",1),h("EPD",3),h("EFP",3),h("GGD",1),h("VYE",3),h("ZTU",3),h("SMD",3),h("SCL",3),h("ESK",3),h("CTW",2),h("SHG",1),h("GCR",1)]}]},Ce={name:"The Forge Season 1",id:"TG10",decks:[{name:"Aje8: Dinobots",factions:["A","U"],cards:[h("HTR",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"Btenant: Dinobots",factions:["A","U"],cards:[h("JPK",1),h("OWW",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",2),h("MXW",3),h("GHB",3)]},{name:"DarkSoulSP: Grim Debuff",factions:["N","U"],cards:[h("BWK",3),h("TDS",2),h("FRR",3),h("WWP",3),h("GGP",3),h("GGD",3),h("DBT",1),h("WFS",3),h("CTW",3),h("EPD",3),h("GHB",3)]},{name:"MingisTheKing: Mobility",factions:["N","T"],cards:[h("DDD",3),h("DBT",3),h("EPD",3),h("EFP",3),h("GGP",3),h("LSK",3),h("SHK",3),h("UBL",3),h("WCS",3),h("ZTU",3)]},{name:"Noetherian: Tempo",factions:["T","U"],cards:[h("RBH",3),h("TDS",3),h("FRR",3),h("WWP",3),h("EFP",3),h("AMY",2),h("FVA",2),h("ENR",3),h("ZSH",3),h("EHW",3),h("GHB",2)]},{name:"PTKtempo: Dinobots",factions:["A","U"],cards:[h("EHW",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"SeomanReborn: Metamind Control",factions:["A","N"],cards:[h("MSC",1),h("JPK",1),h("ZTU",3),h("GGD",2),h("DBT",3),h("CTW",3),h("BSG",2),h("GMP",3),h("DMW",3),h("MMA",3),h("MXW",3)]},{name:"StillHadAllDeez: Dinobots",factions:["A","U"],cards:[h("OJC",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",3),h("MXW",3),h("GHB",3)]},{name:"Technonaut: Woebringer",factions:["N","T"],cards:[h("LSK",2),h("WBG",3),h("EPD",3),h("DDD",3),h("SHK",3),h("EFP",3),h("ZTU",2),h("GGD",2),h("GGP",3),h("CTW",3),h("DBT",3)]},{name:"Zrandles: Dinobots",factions:["A","U"],cards:[h("HTR",1),h("JPK",1),h("TDS",3),h("FRR",3),h("WWP",3),h("AFS",3),h("BSG",3),h("BTM",2),h("BSS",3),h("BTN",2),h("MXW",2),h("GHB",2),h("OWW",2)]}]},Se={name:"The Forge Season 2.1",id:"TG21",decks:[{name:"Dbatterskull: Control",factions:["N","T"],cards:[h("CTW",2),h("GCR",1),h("VYE",2),h("ESK",3),h("SMD",3),h("EFP",3),h("ZTU",3),h("FLN",2),h("BSM",3),h("EPD",3),h("GGP",3),h("CHV",2)]},{name:"EvilWeevil: Control",factions:["N","U"],cards:[h("ZTU",3),h("TDS",3),h("GGP",3),h("WWP",3),h("CTW",2),h("EHW",2),h("EPD",3),h("GGD",2),h("DBT",2),h("ESK",3),h("CHV",2),h("FRR",2)]},{name:"EvilWeevil: Dino Knightbots",factions:["A","U"],cards:[h("AGK",3),h("GHB",1),h("NXT",2),h("BSG",3),h("BSS",3),h("JPK",2),h("VBK",2),h("WMM",1),h("FRR",3),h("TDS",3),h("WWP",3),h("MXW",2),h("BTM",1),h("OJC",1)]},{name:"Hans: Yetis",factions:["T","U"],cards:[h("UWL",3),h("FFU",3),h("WBY",3),h("UIM",3),h("WBU",3),h("SSR",1),h("TRN",1),h("GTT",1),h("GCR",3),h("FRR",3),h("UBL",3),h("WWP",3)]},{name:"Hans: Dino Knightbots",factions:["A","U"],cards:[h("AGK",3),h("ALS",3),h("BTN",2),h("BSG",3),h("BSS",3),h("JPK",2),h("VBK",2),h("WMM",3),h("FRR",3),h("TDS",3),h("WWP",3)]},{name:"Jran74: Control",factions:["N","T"],cards:[h("CTW",2),h("GGD",3),h("SHK",3),h("EPD",3),h("GGP",3),h("DCR",2),h("UBL",2),h("SMD",3),h("ZTU",3),h("EFP",3),h("DBT",3)]},{name:"Piquadore: Zombies",factions:["N","T"],cards:[h("BWK",2),h("KOD",2),h("CYC",3),h("GRM",3),h("VYE",3),h("XRW",3),h("MOE",2),h("ZTU",3),h("BSM",3),h("EPD",3),h("DSS",3)]},{name:"S1al: Tempo",factions:["T","U"],cards:[h("FSS",3),h("SCL",3),h("FRR",3),h("MOE",3),h("EFP",3),h("EHW",3),h("FLN",3),h("SHK",3),h("LSK",3),h("TCG",3)]},{name:"Zrandles: Tempo",factions:["N","T"],cards:[h("CTW",1),h("GCR",1),h("CFG",1),h("FZS",1),h("FBI",3),h("MOE",3),h("EFP",3),h("LSK",3),h("FLN",3),h("SHK",3),h("RTS",3),h("GGP",3),h("UBL",2)]},{name:"Zrandles: Metaminds",factions:["A","N"],cards:[h("DMW",3),h("GMP",3),h("MMA",3),h("MMV",2),h("TDW",3),h("VRP",3),h("EPD",3),h("SHG",2),h("OJC",2),h("ESK",2),h("CHV",2),h("CTW",2)]}]},we={name:"The Forge Season 2.2",id:"TG22",decks:[{name:"ErrorAsh: Burn",factions:["N","T"],cards:[h("UBL",2),h("EFM",2),h("FBI",3),h("ESK",3),h("FLN",3),h("EFP",3),h("MOE",3),h("FSS",3),h("SHK",3),h("EPD",3),h("CHV",2)]},{name:"ErrorAsh: Farmer Tarsus",factions:["N","U"],cards:[h("WWS",3),h("DYB",3),h("FRR",3),h("SYL",3),h("EPD",3),h("SSE",2),h("NSH",2),h("TDW",3),h("NFF",2),h("CHR",2),h("LKP",2),h("EXD",1)]},{name:"ErrorAsh: Necro Mobiltiy",factions:["N","T"],cards:[h("NSH",2),h("SMD",2),h("DDD",3),h("TDW",3),h("VRP",3),h("WCS",3),h("BSM",3),h("SHG",2),h("TGI",2),h("EPD",3),h("FVA",2),h("DBT",1),h("TRN",1)]},{name:"Noetherian: Shambler",factions:["N","U"],cards:[h("XSH",3),h("SPM",3),h("FRR",3),h("ODC",3),h("SSE",3),h("ESK",3),h("TGS",3),h("XRF",3),h("VRP",3),h("URB",3)]},{name:"Stautmeister: Yeti Mobility",factions:["T","U"],cards:[h("AGM",3),h("TDS",2),h("FRR",3),h("WWP",3),h("CSW",3),h("FLN",3),h("EFP",2),h("UWL",3),h("WBY",2),h("WCS",2),h("EHW",2),h("SHS",2)]},{name:"Stautmeister: Necro Bigstuff",factions:["N","U"],cards:[h("ESK",3),h("CTW",2),h("FRR",2),h("SSE",3),h("EPD",3),h("WBG",3),h("DBT",2),h("SHG",3),h("XSH",2),h("GGD",2),h("EHW",2),h("KOD",3)]},{name:"Technonaut: Steelscale",factions:["A","T"],cards:[h("UHS",2),h("FLN",3),h("STG",3),h("CRC",3),h("SHK",3),h("EFP",2),h("WMR",2),h("WMM",3),h("JPK",3),h("SMD",3),h("FVA",3)]},{name:"Tetrarain: Aggro",factions:["T","U"],cards:[h("SMD",2),h("TDS",3),h("FRR",2),h("WWP",3),h("ODC",2),h("UWL",3),h("SSE",2),h("RBH",3),h("EFP",2),h("KKK",2),h("AAK",2),h("IBF",2)]},{name:"V3ng3vin3: Attack Plants",factions:["A","U"],cards:[h("CHR",1),h("JPK",1),h("FRR",3),h("ALS",2),h("ODC",3),h("SSE",3),h("BTN",2),h("SYL",3),h("TDS",3),h("WWP",3),h("NFF",2),h("GHB",1),h("WMM",1),h("OJC",2)]},{name:"V3ng3vin3: Control",factions:["N","U"],cards:[h("GGD",1),h("CTW",2),h("FRR",3),h("CHV",3),h("ODC",3),h("SSE",2),h("EPD",3),h("SYL",3),h("TDS",3),h("WWP",3),h("NFF",1),h("SHS",3)]}]},Ee={name:"Set 1 Fundecks",id:"FUN1",decks:[{name:"Frankenbomb",factions:["N"],cards:[h("DFB",3),h("BSR",3),h("HGS",3),h("HFA",3),h("FFD",3),h("XSH",3),h("XHU",3),h("WBG",3),h("GBG",3),h("CTI",3)]},{name:"Hangry Beasts",factions:["T","U"],cards:[h("TBA",3),h("TDS",3),h("MBP",3),h("FSH",3),h("RBH",3),h("FBC",3),h("LBR",3),h("CFB",3),h("AAK",3),h("FRR",1),h("FIN",1),h("IBF",1)]},{name:"Metamind Zapper",factions:["A","T"],cards:[h("MMA",3),h("DMW",3),h("GMP",3),h("SYO",3),h("KAW",3),h("SHK",3),h("CTL",2),h("CAG",2),h("MSC",2),h("MTS",2),h("ASG",2),h("ESU",2)]},{name:"Plant Party",factions:["N","U"],cards:[h("CTV",3),h("TDW",3),h("BTS",3),h("CHR",3),h("GMR",3),h("KOD",2),h("LKP",2),h("SHV",2),h("DBA",2),h("CCR",2),h("PTB",2),h("FIN",1),h("DBT",2)]},{name:"Voltron",factions:["A"],cards:[h("FGA",3),h("FGB",3),h("FGG",3),h("AFS",3),h("BSG",3),h("BSS",3),h("SCD",2),h("TUP",3),h("JPK",2),h("BWH",2),h("SFT",3)]},{name:"Whacky Whinds",factions:["N","T"],cards:[h("DDD",3),h("WBH",3),h("ZPM",3),h("WCS",3),h("GGP",3),h("SAD",3),h("SDN",3),h("WFB",3),h("SBG",3),h("ZSH",3)]},{name:"WWP 4 Victory",factions:["A","U"],cards:[h("WWP",3),h("EHN",3),h("SDR",3),h("HTR",3),h("HTP",3),h("MXW",3),h("MND",2),h("NXC",2),h("CDT",3),h("PTB",2),h("FIN",1),h("SYO",2)]},{name:"Zombies",factions:["N"],cards:[h("XDV",3),h("ONN",3),h("FWK",3),h("BWK",3),h("URD",3),h("KOD",3),h("DSS",3),h("TDW",3),h("GRP",3),h("SHV",3)]}]},Nt=[ve,Ae,ke,Te,Ce,Se,we,Ee];class xe{state;constructor(t){this.state=t}get adjacent(){return a.field.adjacentPositions(this.lane)}get attack(){return this.state.attack+this.modSum("AT")}get activationAvailable(){return this.state.negateActivate?!1:this.state.activationAvailable}set activationAvailable(t){this.state.activationAvailable=t}get aggressive(){return this.state.aggressive||this.modBool("AG")}set aggressive(t){this.state.aggressive=t}get armor(){return this.negateArmor?0:this.state.armor+this.modSum("AR")}get armorDmg(){return this.state.armorDmg}set armorDmg(t){this.state.armorDmg=t}get bonus(){return this.state.bonus}set bonus(t){this.state.bonus=t}get breakthrough(){return this.state.breakthrough||this.modBool("BT")}set breakthrough(t){this.state.breakthrough=t}get changed(){return this.state.changed||this.negateDefender||this.negateArmor||this.negateActivate||this.negateMobility||this.negateRegen}set changed(t){this.state.changed=t}get code(){return this.state.code}get defender(){return this.negateDefender?!1:this.state.defender||this.modBool("DF")}set defender(t){this.negateDefender||(this.state.defender=t,this.enforceEffects("DF"))}get effects(){return this.state.effects}get extraBattles(){return this.state.extraBattles}set extraBattles(t){this.state.extraBattles=t}get faction(){return a.cards.getCard(this.code).faction}get health(){return this.state.health+this.modSum("HL")}get id(){return this.state.id}get isActive(){return!this.sleeping||this.aggressive}isTribe(t){return a.cards.getCard(this.code).isTribe(t)}get level(){return a.cards.getCard(this.code).level}get maxHealth(){return this.state.maxHealth+this.modSum("MH")}get mobility(){return this.negateMobility?0:this.state.mobility+this.modSum("MB")}get mobilityAvailable(){return this.state.mobilityAvailable}set mobilityAvailable(t){this.state.mobilityAvailable=t}get mods(){return this.state.mods}get negateActivate(){return this.state.negateActivate}set negateActivate(t){this.state.negateActivate=t}get negateArmor(){return this.state.negateArmor||this.modBool("NA")}set negateArmor(t){this.state.negateArmor=t,this.enforceEffects("AR")}get negateDefender(){return this.state.negateDefender||this.modBool("ND")}set negateDefender(t){this.state.negateDefender=t,this.enforceEffects("DF")}get negateMobility(){return this.state.negateMobility||this.modBool("NM")}set negateMobility(t){this.state.negateMobility=t}get negateRegen(){return this.state.negateRegen||this.modBool("NM")}set negateRegen(t){this.state.negateRegen=t}get opposed(){const t=d.crTarg();return t.player=a.player.toTarget(!this.owner),t.lanes=a.field.oppositeLane(this.lane),a.field.creatByTarget(t)[0]}get owner(){return this.state.owner}get poison(){return this.state.poison+this.modSum("PN")}get lane(){return this.state.lane}get regen(){return this.negateRegen?0:this.state.regen+this.modSum("RG")}get sleeping(){return this.state.sleeping}set sleeping(t){this.state.sleeping=t}get status(){return this.state.status}set status(t){this.state.status=t}get triggers(){return this.state.triggers}buff(t,r,e=void 0){t!==0&&(this.state.attack+=t,this.enforceEffects("AT")),r!==0&&(this.state.health+=r,this.state.maxHealth+=r,this.enforceEffects("CH"),a.death.deathProdder(this,e))}addArmor(t){if(!this.negateArmor){const r=this.state.armor+t;this.state.armor=Math.max(0,r),this.enforceEffects("AR")}}addMobility(t){if(!this.negateMobility){const r=this.state.mobility+t;this.state.mobility=Math.max(0,r)}}addPoison(t){const r=this.state.poison+t;this.state.poison=Math.max(0,r)}addRegen(t){if(!this.negateRegen){const r=this.state.regen+t;this.state.regen=Math.max(0,r)}}heal(t){if(t===0)return 0;const r=Math.min(this.health+t,this.maxHealth)-this.health;return this.state.health+=r,r}hurt(t,r=!1){if(t<1)return[0,0];const e=Math.max(Math.min(t,this.armor-this.armorDmg),0);let s=t-e,c=this.health-s;this.state.armorDmg+=e;let u=0;return r&&c<0&&(u=s-this.health,s=this.health),s>0&&(this.state.health-=s),[s,u]}hurtBattle(t,r,e=!1){const s=this.hurt(t,e);return s[0]>0&&a.batch.addEvents(d.damageEvent(!0,s[0],!0,!0,this,r)),s[1]}hurtDirect(t,r,e=void 0){const s=this.hurt(t,!1);return s[0]>0&&(a.log.new().crd(r).txt(` dealt ${t} dmg to `).crd(this.code).txt(".").go(),a.batch.addEvents(d.damageEvent(!1,s[0],!1,!0,this,void 0)),a.death.deathProdder(this,e)),s[0]}modIdx(t){return this.mods.findIndex(r=>r.granter===t)}modEffectPropagator(t){t.type==="AT"?this.enforceEffects("AT"):t.type==="HL"?(this.enforceEffects("CH"),a.death.deathProdder(this)):t.type==="AR"||t.type==="NA"?this.enforceEffects("AR"):(t.type==="DF"||t.type==="ND")&&this.enforceEffects("DF")}modSum(t){return this.mods.filter(r=>r.type===t).map(r=>r.value).reduce((r,e)=>r+e,0)}modBool(t){return this.mods.some(r=>r.type===t&&r.value===1)}hasMod(t){return this.modIdx(t)>-1}addMod(t){this.mods.push(t),this.modEffectPropagator(t)}addModSafe(t){this.mods.findIndex(e=>e.granter===t.granter&&e.type===t.type)===-1&&this.addMod(t)}removeMod(t){const r=this.state.mods.filter(e=>e.granter===t);this.state.mods=this.state.mods.filter(e=>e.granter!==t),r.forEach(e=>this.modEffectPropagator(e))}removeModSafe(t){this.hasMod(t)&&this.removeMod(t)}expireMod(t){this.state.mods.splice(this.state.mods.indexOf(t),1)}endActivation(){this.state.activationAvailable=!1,a.death.deathCheck(),a.action.actionDone()}move(t){this.state.lane=t,a.effect.positionChange(this.owner),a.batch.addEvents(d.creatureEvent("MOV",this))}addEffect(t,r){const e=d.effect(t,r);return this.effects.push(e),e}enforceEffects(t,r=!1){this.effects.filter(e=>e.watch===t).filter(e=>e.area==="A"||e.area==="C"&&this.owner===r).forEach(e=>a.cards.getCard(e.logicCode).enforceEffect(e,this))}addTrigger(t,r){const e=d.trigger(t,r);return e.cardCode=this.code,e.creatId=this.id,this.triggers.push(e),e}removeTrigger(t){const r=this.triggers.indexOf(t);r>-1?this.triggers.splice(r,1):console.error("Wery curious, could not find trigger to remove",t)}wipeAll(){this.state.mods=[],this.state.triggers=[],this.state.effects=[],this.state.hints=[],this.state.armor=0,this.state.mobility=0,this.state.poison=0,this.state.regen=0,this.state.aggressive=!1,this.state.defender=!1,this.state.breakthrough=!1,this.state.defender=!1,this.state.negateDefender=!1,this.state.negateArmor=!1,this.state.bonus=0,this.state.changed=!0,this.state.negateActivate=!0,a.field.creatByTarget(d.crTarg()).forEach(t=>t.removeMod(this.id)),this.enforceEffects("AT"),this.enforceEffects("AR"),this.enforceEffects("CH"),a.effect.defenderChange(this.owner)}get hints(){return this.state.hints}aiHints(){return this.hints}}var G=(o=>(o[o.Never=-999]="Never",o[o.Horrid=-2]="Horrid",o[o.Bad=-1]="Bad",o[o.Noice=1]="Noice",o[o.Grand=2]="Grand",o))(G||{});const Ft=10218;class De{appMode="M";options={bark:!0,highHealth:!1,cheater:!1,legDraft:!1,fatPacks:!1,playerDeck:[],wasDrafting:!1};playerA=d.player(!0);playerB=d.player(!1);activePlayer=!0;isLocalA=!0;aiMode=!1;aiActive=!1;firstTurn=!0;winFlag=0;field=[];phase="ST";batch={type:"N0",events:[],triggerActions:[],deathCheck:!0};turn=d.freshTurn();ui=d.freshUI();deathOrder=[];birthOrder=[];graveyard=[];newGame(t,r){this.aiMode=!0,a.fight.barking=a.state.gs.options.bark,this.activePlayer=a.randInt(0,2)===0,this.aiActive=!this.activePlayer,this.playerA.name="Forgy McGhee",this.playerA.nameOffset=25;const e=a.player.nameOSaurus();this.playerB.name=e[0],this.playerB.nameOffset=e[1],a.log.setup(),a.action.actionHistory=[],this.graveyard=[],this.field=[],this.deathOrder=[],this.birthOrder=[],this.ui=d.freshUI(),this.firstTurn=!0,this.winFlag=0,this.playerA.turn=1,this.playerB.turn=1,this.playerA.rank=1,this.playerB.rank=1;const s=a.state.gs.options.highHealth?360:120;this.playerA.health=s,this.playerB.health=s,this.playerA.discard=[],this.playerB.discard=[],this.playerA.deck=a.deck.parseDeck(t),this.playerB.deck=a.deck.parseDeck(r),a.deck.shuffleDeck(!1),this.playerB.hand=this.playerB.deck.splice(0,5),a.deck.shuffleDeck(!0),this.playerA.hand=this.playerA.deck.splice(0,5),a.log.add("Ready...FIGHT!"),a.phase.startTurn()}}class d{static creatureState(t,r){return{activationAvailable:!0,aggressive:!1,armor:0,armorDmg:0,attack:0,bonus:0,breakthrough:!1,changed:!1,code:"",defender:!1,effects:[],extraBattles:0,health:0,hints:[],id:"",lane:r,maxHealth:0,mobility:0,mobilityAvailable:!0,mods:[],negateActivate:!1,negateArmor:!1,negateDefender:!1,negateMobility:!1,negateRegen:!1,owner:t,poison:0,regen:0,sleeping:!0,status:"A",triggers:[]}}static effect(t,r){return{area:"A",watch:t,logicCode:r}}static freeCard(){return{id:a.genId(),condition:d.target("TH")}}static mod(t,r,e=""){return{type:t,value:typeof r=="boolean"?r?1:0:r,granter:e,expiry:"NN"}}static player(t){return{hand:[],deck:[],discard:[],isPlayerA:t,health:120,name:"",nameOffset:0,turn:1,rank:1,avatar:Math.floor(Math.random()*17)}}static trigger(t,r){return{type:t,logicCode:r,cardCode:"",creatId:"",customCode:"",interactive:!1}}static triggerReaction(t,r,e,s){return{event:t,ownerPlayerA:e,creatId:"",cardCode:"",trigger:r,host:s}}static freshTurn(){return{mainBattle:!1,creaturesKilled:0,friendlyFightStarters:0,regularPlays:2,cardsPlayed:0,freeCards:[]}}static freshUI(){return{handScrollLeft:0,detailsMode:!1}}static fieldSelectAction(t,r=-1,e=!0){return{zone:"F",actionKey:t,playerA:e,lane:r,hostCard:"",param:""}}static handSelectAction(t,r="",e="",s=-1){return{zone:"H",actionKey:t,card:r,cost:e,position:s,hostCard:"",param:""}}static playerSelectAction(t,r){return{zone:"P",actionKey:t,playerA:r,hostCard:"",param:""}}static draftSelectAction(t,r,e){return{zone:"N",actionKey:t,index:r,pack:e,hostCard:"",param:""}}static fakeActivateAction(){return{zone:"N",actionKey:"ACTV",hostCard:"",param:""}}static menuButtonAction(t){return{zone:"N",actionKey:"MNBT",hostCard:"",param:t}}static creatureEvent(t,r){return{code:t,creature:r}}static enterFieldEvent(t){return{code:"ENT",creature:t,forged:!1}}static creatStatEvent(t,r,e){return{code:t,creature:r,newValue:e}}static playCardEvent(t,r){const e=d.playerEvent("PLC",r);return e.cardCode=t,e}static playerEvent(t,r){return{code:t,playerA:r}}static playerHealEvent(t,r,e){return{code:t,playerA:r,healAmt:e}}static damageEvent(t,r,e,s,c,u){return{code:"DMG",battle:t,dmg:r,creatureSrc:e,creatureTarg:s,target:c,source:u}}static actionifier(t,r,e,s=""){const c=t;return c.actionKey=r,c.hostCard=e,c.param=s,c}static target(t){return{target:t,level:"LA",faction:"X",player:"X",card:"A",field:"A",creatStatus:"A",tribe:"AN",notMe:"",hasArmor:!1,canArmor:!1,hasDefender:!1,canDefender:!1,hasMobility:!1,canMove:!1,hasPoison:!1,hasRegen:!1,canRegen:!1,cardCode:""}}static actionTarget(t,r,e,s=""){return d.actionifier(d.target(t),r,e,s)}static crTarg(){const t=d.target("TF");return t.field="O",t.creatStatus="V",t}static crActTarg(t,r,e=""){return d.actionifier(d.crTarg(),t,r,e)}static crNotMeTarg(t){const r=d.target("TF");return r.field="O",r.creatStatus="V",r.notMe=t,r}static crNotMeActTarg(t,r,e,s=""){return d.actionifier(d.crNotMeTarg(r),t,e,s)}static crFriendTarg(){const t=d.crTarg();return t.player="F",t}static crFriendActTarg(t,r,e=""){return d.actionifier(d.crFriendTarg(),t,r,e)}static crFriendNotMeTarg(t){const r=d.crNotMeTarg(t);return r.player="F",r}static crFriendNotMeActTarg(t,r,e,s=""){return d.actionifier(d.crFriendNotMeTarg(r),t,e,s)}static crEnemyTarg(){const t=d.crTarg();return t.player="E",t}static crEnemyActTarg(t,r,e=""){return d.actionifier(d.crEnemyTarg(),t,r,e)}static playerTarg(t){const r=d.target("TP");return r.player=a.player.toTarget(t),r}static playerActTarg(t,r,e,s=""){return d.actionifier(d.playerTarg(t),r,e,s)}static lvlHandActTarg(t,r=""){const e=this.actionTarget("TH","CARD",t,r);return e.player="F",e.level="LG",e}static actionEval(t,r,e){const s=e??[];return{type:r,hints:Array.isArray(s)?s:[s],vectors:[],action:t,final:!0,bonus:0}}static actionEvalPassive(t){const r=d.actionEval(t,"PS");return r.final=!1,r}static actionEvalDestroyN(t,r,e,s){const c=d.actionEval(t,"ST",s),u=d.evalVectorMod(r,e);return u.destroy=!0,c.vectors=[u],c}static actionEvalDestroyC(t,r,e){return d.actionEvalDestroyN(t,r.owner,r.lane,e)}static actionEvalCreatStatsN(t,r,e,s={},c){const u=d.actionEval(t,"ST",c);return u.vectors=[d.evalVectorMod(r,e,s)],u}static actionEvalCreatStatsC(t,r,e={},s){return d.actionEvalCreatStatsN(t,r.owner,r.lane,e,s)}static actionEvalBuffN(t,r,e,s=0,c=0,u){return d.actionEvalCreatStatsN(t,r,e,{att:s,hlt:c},u)}static actionEvalBuffC(t,r,e=0,s=0,c){return d.actionEvalCreatStatsC(t,r,{att:e,hlt:s},c)}static actionEvalReplace(t,r,e,s,c=!1){const u=d.actionEval(t,"PC"),m=a.cards.getCard(s);u.hints=m.aiHints();const y=d.evalVectorCreatureFromClass(m,r,e);return y.type="R",u.vectors.push(y),c&&(u.bonus=m.bonusPlay()),u}static evalVectorEmpty(t,r){return{shape:"B",type:"E",playerA:t,lane:r,destroy:!1,dirDmg:0,moveTo:0,health:0,attack:0,aggressive:!1,armor:0,armorDmg:0,breakthrough:!1,defender:!1,negateDefender:!1,poison:0,regen:0,sleeping:!1,bonus:0}}static evalVectorCreatureFromCode(t,r,e){const s=a.cards.getCard(t);return d.evalVectorCreatureFromClass(s,r,e)}static evalVectorCreatureFromClass(t,r,e){const s=t.generateCreature(r,e);return d.evalVectorCreature(s)}static evalVectorCreature(t){return{shape:"B",type:"C",playerA:t.owner,lane:t.lane,destroy:!1,dirDmg:0,moveTo:0,health:t.health,attack:t.attack,aggressive:t.aggressive,armor:t.armor,armorDmg:t.armorDmg,breakthrough:t.breakthrough,defender:t.defender,negateDefender:t.negateDefender,poison:t.poison,regen:t.regen,sleeping:t.sleeping,bonus:t.bonus}}static evalVectorPlayerLife(t,r){const e=d.evalVectorEmpty(t,0);return e.shape="P",e.type="M",e.health=r,e}static evalVectorPlayerDmg(t,r){const e=d.evalVectorEmpty(t,0);return e.shape="P",e.type="M",e.dirDmg=r,e}static evalVectorPlayer(t){const r=d.evalVectorEmpty(t,0);return r.shape="P",r.type="P",r}static evalVectorMod(t,r,e){const s=d.evalVectorEmpty(t,r);return s.type="M",e&&(s.attack=e.att??0,s.health=e.hlt??0,s.armor=e.arm??0,s.regen=e.rgn??0,s.poison=e.psn??0,s.dirDmg=e.dmg??0,s.defender=e.def??!1,s.breakthrough=e.brt??!1,s.aggressive=e.agr??!1,s.negateDefender=e.noD??!1),s}}class ht{constructor(t){this.code=t,this.level=parseInt(t.substring(3))}code;consistent=!1;faction="X";cardCode(){return ht.extractCardCode(this.code)}get image(){return this.type==="S"?this.fixedImage():this.leveledImage()}leveledImage(){return this.rawImage(this.code)}fixedImage(){return this.rawImage(this.cardCode())}rawImage(t){return`card/${this.faction}/${t}.jpg`}isFree=!1;level;maxLevel=3;name="";overload=!1;rarity="T";text="";get type(){return "C"}hints;aiHints(){return this.hints??[]}bonus;bonusPlay(){return this?.bonus?.play??0}bonusExist(){return this?.bonus?.exist??0}canLevel(){return this.level{c+=s[m]*e[0][m],u+=s[m]*e[1][m]}),[c,u]}static extractCardCode(t){return t.substring(0,3)}get boof123n(){return this.level*-1}get boof124(){return this.lValN([1,2,4])}get boof135(){return this.lValN([1,3,5])}get boof137(){return this.lValN([1,3,7])}get boof147(){return this.lValN([1,4,7])}get boof234(){return this.level+1}get boof235(){return this.lValN([2,3,5])}get boof236(){return this.lValN([2,3,6])}get boof246(){return this.level*2}get boof246n(){return this.level*-2}get boof247(){return this.lValN([2,4,7])}get boof247n(){return this.lValN([-2,-4,-7])}get boof248(){return this.lValN([2,4,8])}get boof258(){return this.lValN([2,5,8])}get boof2510(){return this.lValN([2,5,10])}get boof2612(){return this.lValN([2,6,12])}get boof357(){return this.lValN([3,5,7])}get boof358(){return this.lValN([3,5,8])}get boof359(){return this.lValN([3,5,9])}get boof3510(){return this.lValN([3,5,10])}get boof3612(){return this.lValN([3,6,12])}get boof369(){return this.level*3}get boof369n(){return this.level*-3}get boof3610(){return this.lValN([3,6,10])}get boof3711(){return this.lValN([3,7,11])}get boof3712(){return this.lValN([3,7,12])}get boof3713(){return this.lValN([3,7,13])}get boof3714(){return this.lValN([3,7,14])}get boof3814(){return this.lValN([3,8,14])}get boof468(){return this.lValN([4,6,8])}get boof469(){return this.lValN([4,6,9])}get boof4610(){return this.lValN([4,6,10])}get boof4612(){return this.lValN([4,6,12])}get boof4710(){return this.lValN([4,7,10])}get boof4711(){return this.lValN([4,7,11])}get boof4712(){return this.lValN([4,7,12])}get boof4713(){return this.lValN([4,7,13])}get boof4714(){return this.lValN([4,7,14])}get boof4812(){return this.level*4}get boof4812n(){return this.level*-4}get boof4813(){return this.lValN([4,8,13])}get boof4814(){return this.lValN([4,8,14])}get boof4815(){return this.lValN([4,8,15])}get boof4816(){return this.lValN([4,8,16])}get boof4914(){return this.lValN([4,9,14])}get boof4915(){return this.lValN([4,9,15])}get boof579(){return this.lValN([5,7,9])}get boof5711(){return this.lValN([5,7,11])}get boof5714(){return this.lValN([5,7,14])}get boof5812(){return this.lValN([5,8,12])}get boof5813(){return this.lValN([5,8,13])}get boof5814(){return this.lValN([5,8,14])}get boof5815(){return this.lValN([5,8,15])}get boof5914(){return this.lValN([5,9,14])}get boof5915(){return this.lValN([5,9,15])}get boof5916(){return this.lValN([5,9,16])}get boof5917(){return this.lValN([5,9,17])}get boof51014(){return this.lValN([5,10,14])}get boof51015(){return this.level*5}get boof51020(){return this.lValN([5,10,20])}get boof6812(){return this.lValN([6,8,12])}get boof6814(){return this.lValN([6,8,14])}get boof6912(){return this.lValN([6,9,12])}get boof6914(){return this.lValN([6,9,14])}get boof6916(){return this.lValN([6,9,16])}get boof61014(){return this.lValN([6,10,14])}get boof61015(){return this.lValN([6,10,15])}get boof61016(){return this.lValN([6,10,16])}get boof61017(){return this.lValN([6,10,17])}get boof61018(){return this.lValN([6,10,18])}get boof61117(){return this.lValN([6,11,17])}get boof61218(){return this.lValN([6,12,18])}get boof61224(){return this.lValN([6,12,24])}get boof7911(){return this.lValN([7,9,11])}get boof7914(){return this.lValN([7,9,14])}get boof71013(){return this.lValN([7,10,13])}get boof71014(){return this.lValN([7,10,14])}get boof71015(){return this.lValN([7,10,15])}get boof71116(){return this.lValN([7,11,16])}get boof71117(){return this.lValN([7,11,17])}get boof71118(){return this.lValN([7,11,18])}get boof81116(){return this.lValN([8,11,16])}get boof81117(){return this.lValN([8,11,17])}get boof81217(){return this.lValN([8,12,17])}get boof81220(){return this.lValN([8,12,20])}get boof81318(){return this.lValN([8,13,18])}get boof91420(){return this.lValN([9,14,20])}get boof91421(){return this.lValN([9,14,21])}get boof101520(){return this.lValN([10,15,20])}get boof255080(){return this.lValN([25,50,80])}}class x extends ht{constructor(t){super(t)}initHealth=0;initAttack=0;initAggro=!1;initArmor=0;initBT=!1;initDefend=!1;initMobile=0;initRegen=0;tribe=[];isTribe(t){return(Array.isArray(t)?t:[t]).every(e=>this.tribe.includes(e))}generateCreature(t,r){const e=d.creatureState(t,r);return e.id=a.genId(),e.code=this.code,e.health=this.initHealth,e.attack=this.initAttack,e.maxHealth=e.health,e.regen=this.initRegen,e.breakthrough=this.initBT,e.defender=this.initDefend,e.aggressive=this.initAggro,e.armor=this.initArmor,e.mobility=this.initMobile,e.hints=this.aiHints(),e.bonus=this.bonusExist(),new xe(e)}playTargets(){const t=super.playTargets(),r=d.actionTarget("TF","FORG",this.code);return r.player="F",t.push(r),t}canActivate(t){return!1}startActivation(t){console.error("encountered activation request for creature with no activate",t)}getsTriggered(t){return!1}}class J extends ht{constructor(t){super(t)}get type(){return "S"}logSpell(){a.log.new().txt("Casted ").crd(this.code).txt(".").go()}}class Pe extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Abraxas, Avatar of Kadras",this.initAttack=this.boof4712,this.initHealth=this.lValN([7,11,21]),this.tribe.push("HY"),this.hints=["LJ"];const r=this.lValS(["Give an adjacent creature","Each adjacent creature gets","Each other friendly creature gets"]);this.text=`Activate: ${r} 2x attack this turn.`}targ(t){const r=d.crFriendNotMeActTarg("CARD",t.id,this.code,t.id);return this.level<3&&(r.lanes=t.adjacent),r}canActivate(t){return a.field.creatByTarget(this.targ(t)).length>0}startActivation(t){if(this.level===1)a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t));else{const r=this.targ(t);a.field.creatByTarget(r).forEach(e=>{this.applyMod(e,t.id)}),t.endActivation()}}handleAction(t){const r=a.field.creatByFSA(t),e=a.field.creatById(t.param);this.applyMod(r,e.id),e.endActivation()}getCardActions(t,r){if(t.actionKey==="ACTV"){this.level>1&&console.error("Abraxis asking for activate actions after level 1. Something in your code is wrong");const e=r??a.field.creatById(t.param),s=this.targ(e);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}evaluateAction(t){const r=Ft+1,e=d.actionEval(t,"ST");if(t.actionKey==="ACTV")if(this.level>1){const s=a.field.creatById(t.param);let c;this.level===3?c=a.field.laneIdx.filter(u=>u!==s.lane):c=s.adjacent,e.vectors=c.map(u=>d.evalVectorMod(s.owner,u,{att:r}))}else return d.actionEvalPassive(t);else{const s=t;e.vectors.push(d.evalVectorMod(s.playerA,s.lane,{att:r}))}return e}applyMod(t,r){const e=d.mod("AT",t.attack,r);e.expiry="ET",t.addMod(e)}}class Fe extends x{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Apocrymancer",this.initAttack=this.boof3713,this.initHealth=this.initAttack+3,this.tribe.push("HM"),this.text="When you play an Alloyin spell, you may discard and level up a card."}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("PC",this.code),e}handleAction(t){a.turn.levelAndDiscard(t),a.action.actionDone(!0)}getsTriggered(t){if(t.event.code==="PLC"){const r=t.event;if(r.playerA===t.ownerPlayerA){const e=a.cards.getCard(r.cardCode);if(e.type==="S"&&e.faction==="A")return!0}}return!1}resolveTrigger(t){const r=d.lvlHandActTarg(this.code,t.creatId);a.action.setupActions(a.target.toActions([r,a.target.buttonTarget("NOTR")]))}evaluateAction(t){return t.actionKey==="CARD"?d.actionEval(t,"DC"):super.evaluateAction(t)}}class He extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Arboris, Grove Dragon",this.initAttack=this.lValN([5,9,20]),this.initHealth=this.initAttack,this.tribe.push("DG");const r=this.boof;this.text=`While you have over 120 health, Arboris gets ${a.log.buffText(r,r)}.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addEffect("PH",this.code),e}enforceEffect(t,r){if(a.state.getPlayer(r.owner).health>120&&r.status==="A"){const s=this.boof;r.addModSafe(d.mod("HL",s,r.id)),r.addModSafe(d.mod("MH",s,r.id)),r.addModSafe(d.mod("AT",s,r.id))}else r.removeModSafe(r.id)}get boof(){return this.lValN([4,8,80])}}class Lt extends x{constructor(t){super(t),this.rarity="H",this.initAttack=this.level+2,this.initHealth=this.initAttack;const r=this.cardCode();r==="SFA"?this.steel():r==="RFA"?this.root():r==="HFA"?this.hell():r==="SGA"&&this.storm(),this.hints=["P1",a.ai.alliedHint(this.faction)],this.text=`Forge: ${this.name} gets ${a.log.buffText(this.level,this.level)} for each ${a.log.factionText(this.faction)} card in your hand.`}hell(){this.faction="N",this.name="Hellforged Avatar",this.initRegen=this.level,this.tribe.push("AB")}root(){this.faction="U",this.name="Rootforged Avatar",this.initBT=!0,this.tribe.push("HM")}steel(){this.faction="A",this.name="Steelforged Avatar",this.initArmor=this.level,this.tribe.push("CY")}storm(){this.faction="T",this.name="Stormforged Avatar",this.initMobile=this.level,this.tribe.push("MT")}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e}resolveTrigger(t){const r=t.event,e=a.state.getPlayer(t.ownerPlayerA).hand.filter(s=>a.cards.getCard(s).faction===this.faction).length;if(e>0){const s=e*this.level;r.creature.buff(s,s)}a.batch.triggerDone()}}class N extends x{imgKey="";lookup(t){return{["BOS"]:()=>this.fixedSapling(3),["OOZ"]:()=>this.ooze(),["SPL"]:()=>this.minion(),["SXP"]:()=>this.fixedSapling(5),["SXD"]:()=>this.fixedSeedling(3),["SXT"]:()=>this.fixedTreefolk(7),["SDL"]:()=>this.minion(),["SPN"]:()=>this.nekSpirit(),["XYR"]:()=>this.yuruSpirit(),["TFK"]:()=>this.minion(),["TFD"]:()=>this.fixedTreefolk(this.boof5714),["TFF"]:()=>this.tfFight(),["ZTR"]:()=>this.zimus(),["ZBS"]:()=>this.threeZomb(),["ZMB"]:()=>this.commonZomb()}[t]}constructor(t){super(t),this.rarity="T";const r=this.cardCode();this.imgKey=r,this.lookup(r)()}get image(){return this.rawImage(this.imgKey)}fixedNekSpirit(t){this.faction="N",this.rarity="T",this.name="Spirit",this.tribe.push("ST"),this.initAttack=t,this.initHealth=t,this.imgKey=`${"SPN"}${this.level}`}nekSpirit(){this.fixedNekSpirit(this.boof51015)}yuruSpirit(){this.fixedNekSpirit(this.boof5814)}ooze(){this.faction="N",this.rarity="T",this.name="Oozeling",this.tribe.push("OZ"),this.initAttack=this.boof4711,this.initHealth=this.initAttack,this.imgKey="OOZ"}minion(){this.initAttack=N.minionBuff(this.level),this.plont(),this.name=N.minionName(this.level)}static minionCode(t){return(t===1?"SDL":t===2?"SPL":"TFK")+t}static minionName(t){return t===1?"Seedling":t===2?"Sapling":"Treefolk"}static minionBuff(t){return t===1?1:t===2?3:5}plont(){this.faction="U",this.initHealth=this.initAttack,this.tribe.push("PL")}fixedSapling(t){this.initAttack=t,this.plont(),this.name=N.minionName(2),this.imgKey="SPL"}fixedSeedling(t){this.initAttack=t,this.plont(),this.name=N.minionName(1),this.imgKey="SDL"}fixedTreefolk(t){this.initAttack=t,this.plont(),this.name=N.minionName(3),this.imgKey="TFK"}tfFight(){this.initAttack=this.boof91421,this.plont(),this.name=N.minionName(3),this.imgKey="TFK"}zimus(){this.faction="N",this.rarity="L",this.name="Zimus, the Returned",this.tribe.push("ZB"),this.initAttack=10,this.initHealth=5,this.imgKey=`${"ZTU"}2`}zomb(t,r){this.faction="N",this.rarity="T",this.name="Zombie",this.tribe.push("ZB"),this.initAttack=t,this.initHealth=r,this.imgKey="ZMB"}commonZomb(){const t=this.boof359;this.zomb(t,t)}threeZomb(){this.zomb(3,3)}}class Y extends J{lookup(t){return{["AGP"]:{c:()=>this.apulseC(),z:()=>this.apulseZ(),e:e=>this.apulseE(e)},["CTL"]:{c:()=>this.ctlC(),z:()=>this.ctlZ(),e:e=>this.ctlE(e)},["DCR"]:{c:()=>this.dcurC(),z:()=>this.dcurZ(),e:e=>this.dcurE(e)},["DGZ"]:{c:()=>this.digiC(),z:()=>this.digiZ(),e:e=>this.digiE(e)},["EPD"]:{c:()=>this.epiC(),z:()=>this.epiZ(),e:e=>this.epiE(e)},["FRR"]:{c:()=>this.roarC(),z:()=>this.roarZ(),e:e=>this.roarE(e)},["FSM"]:{c:()=>this.fstormC(),z:()=>this.fstormZ(),e:e=>this.fstormE(e)},["GRM"]:{c:()=>this.mealC(),z:()=>this.mealZ(),e:e=>this.mealE(e)},["IBF"]:{c:()=>this.ibfC(),z:()=>this.ibfZ(),e:e=>this.ibfE(e)},["NSH"]:{c:()=>this.shriekC(),z:()=>this.shriekZ(),e:e=>this.shriekE(e)},["NCL"]:{c:()=>this.noxC(),z:()=>this.noxZ(),e:e=>this.noxE(e)},["OWF"]:{c:()=>this.oforceC(),z:()=>this.oforceZ(),e:e=>this.oforceE(e)},["PTB"]:{c:()=>this.phyC(),z:()=>this.phyZ(),e:e=>this.phyE(e)},["PYS"]:{c:()=>this.pyreC(),z:()=>this.pyreZ(),e:e=>this.pyreE(e)},["SNP"]:{c:()=>this.pulseC(),z:()=>this.pulseZ(),e:e=>this.pulseE(e)},["SRD"]:{c:()=>this.sradC(),z:()=>this.sradZ(),e:e=>this.sradE(e)},["TST"]:{c:()=>this.talinC(),z:()=>this.talinZ(),e:e=>this.talinE(e)},["TRN"]:{c:()=>this.turnbC(),z:()=>this.turnbZ(),e:e=>this.turnbE(e)}}[t]}constructor(t){super(t),this.lookup(this.cardCode()).c()}get image(){return this.cardCode()==="NSH"?this.leveledImage():this.fixedImage()}playTargets(){const t=super.playTargets(),r=a.target.boardTarget("CARD",this.code);return t.push(r),t}handleAction(t){this.logSpell(),this.lookup(this.cardCode()).z(),a.turn.spellCast()}evaluateAction(t){return this.lookup(this.cardCode()).e(t)}apulseC(){this.faction="A",this.rarity="C",this.name="Aegis Pulse",this.text=`Each friendly creature gets Armor ${this.boof234}.`}apulseZ(){const t=this.boof234;a.field.qFriendCreats().forEach(r=>{r.addArmor(t)})}apulseE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.boof234;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{arm:s})),r}get ctlboof(){return(this.level-1)*2}ctlC(){this.faction="T",this.rarity="L",this.name="Call the Lightning";const t=this.level>1?` gets ${a.log.buffText(this.ctlboof,0)} this turn. Those creatures`:"";this.text=`Each friendly creature${t} battles an additional time this turn.`}ctlZ(){const t=this.ctlboof;a.field.qFriendCreats().forEach(r=>{const e=d.mod("AT",t,this.code);e.expiry="ET",r.addMod(e),r.extraBattles+=1})}ctlE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.ctlboof;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{att:s})),r}dcurC(){this.faction="N",this.rarity="R",this.name="Death Current";const t=this.lValS(["a level 2 or lower","an","two"]);this.text=`Destroy ${t} enemy creature at random.`}dcurZ(){const t=this.dCurrHunter(),r=t.length;if(r>0){const e=a.randInt(0,r),s=Date.now();a.death.destroy(t[e],this.code,s),this.level===3&&r>1&&(t.splice(e,1),a.death.destroy(t[a.randInt(0,r-1)],this.code,s))}}dcurE(t){let r;const e=this.dCurrHunter(),s=e.length;if(s>0){const c=a.randInt(0,s);if(r=d.actionEvalDestroyC(t,e[c]),this.level===3&&s>1){e.splice(c,1);const u=d.evalVectorMod(e[0].owner,a.randInt(0,s-1));u.destroy=!0,r.vectors.push(u)}}else r=d.actionEval(t,"NR");return r}dCurrHunter(){const t=d.crEnemyTarg();return t.level=a.target.levelMatchTarget(this.level+1),a.field.creatByTarget(t)}digiC(){this.faction="A",this.rarity="R",this.name="Digitize",this.text=`Each enemy creature gets ${a.log.buffText(this.boof4812n,0)}.`}digiZ(){const t=this.boof4812n;a.field.qEnemyCreats().forEach(r=>{r.buff(t,0)})}digiE(t){const r=d.actionEval(t,"ST"),e=!a.state.getActivePlayerB(),s=this.boof4812n;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{att:s})),r}epiC(){this.faction="N",this.rarity="H",this.name="Epidemic";const t=this.boof246n;this.text=`Each enemy creature gets ${a.log.buffText(t,t)}.`}epiZ(){const t=this.boof246n,r=d.crEnemyTarg();a.field.creatByTarget(r).forEach(e=>{e.buff(t,t)})}epiE(t){const r=d.actionEval(t,"ST"),e=!a.state.getActivePlayerB(),s=this.boof246n;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{att:s,hlt:s})),r}roarC(){this.faction="U",this.rarity="H",this.name="Ferocious Roar";const t=this.boof235;this.text=`Each friendly creature gets ${a.log.buffText(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}roarZ(){const t=this.boof235;a.field.qFriendCreats().forEach(r=>{r.buff(t,t),this.level===3&&(r.breakthrough=!0)})}roarE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.boof235,c=this.level===3;return r.vectors=a.field.laneIdx.map(u=>d.evalVectorMod(e,u,{att:s,hlt:s,brt:c})),r}get fszap(){return this.level+4}fstormC(){this.faction="T",this.rarity="H",this.name="Firestorm",this.text=`Deal ${this.fszap} damage to each creature.`}fstormZ(){const t=this.fszap,r=Date.now();a.field.qActiveCreats().forEach(e=>{e.hurtDirect(t,this.code,r)})}fstormE(t){const r=d.actionEval(t,"ST"),e=this.fszap;return r.vectors=[!0,!1].map(s=>a.field.laneIdx.map(c=>d.evalVectorMod(s,c,{dmg:e}))).flat(),r}mealC(){this.faction="N",this.rarity="R",this.name="Group Meal";const t=this.boof234;this.text=`Each enemy creature gets ${a.log.buffText(-1*t,0)}. Each friendly creature gets ${a.log.buffText(t,0)}.`}mealZ(){const t=this.boof234,r=a.state.getActivePlayerB();a.field.qActiveCreats().forEach(e=>{const s=e.owner===r?t:-1*t;e.buff(s,0)})}mealE(t){const r=d.actionEval(t,"ST"),e=this.boof234,s=a.state.getActivePlayerB();return r.vectors=[!0,!1].map(c=>a.field.laneIdx.map(u=>d.evalVectorMod(c,u,{att:c===s?e:-e}))).flat(),r}ibfC(){this.faction="T",this.rarity="R",this.name="Iceborn Fortitude",this.text=`Each friendly creature gets ${a.log.buffText(0,this.boof3510)}.`}ibfZ(){const t=this.boof3510,r=d.crFriendTarg();a.field.creatByTarget(r).forEach(e=>{e.buff(0,t)})}ibfE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.boof3510;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{hlt:s})),r}shriekC(){this.faction="N",this.rarity="L",this.name="Nethershriek";const t=this.boof4815;this.text=`Spawn a ${t}/${t} Netherdrake.`}shriekZ(){a.field.birthCreature(`${"NDR"}${this.level}`,"S",a.state.getActivePlayerB())}shriekE(t){const r=a.state.getActivePlayerB(),e=a.field.emptyLanes(r);if(e.length===0)return d.actionEval(t,"NR");{const s=d.actionEvalReplace(t,r,e[a.randInt(0,e.length)],`${"NDR"}${this.level}`);return s.type="ST",s.hints.push("ENF"),s}}noxC(){this.faction="U",this.rarity="R",this.name="Noxious Cloud",this.text=`Each enemy creature gets Poison ${this.boof246}.`}noxZ(){const t=this.boof246;a.field.qEnemyCreats().forEach(r=>{r.addPoison(t)})}noxE(t){const r=d.actionEval(t,"ST"),e=!a.state.getActivePlayerB(),s=this.boof246;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{psn:s})),r}oforceC(){this.faction="A",this.rarity="H",this.name="Overwhelming Force",this.text="Each friendly creature gets "+(this.level===3?"2x attack.":`${a.log.buffText(this.boof369,0)}.`)}oforceZ(){if(this.level===3)a.field.qFriendCreats().forEach(t=>{t.buff(t.attack,0)});else{const t=this.boof369;a.field.qFriendCreats().forEach(r=>{r.buff(t,0)})}}oforceE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.lValN([3,6,Ft+1]);return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{att:s})),r}phyC(){this.faction="U",this.rarity="H",this.name="Phytobomb";const t=N.minionBuff(this.level);this.text=`Put a ${t}/${t} ${N.minionName(this.level)} into each players available spaces.`}phyZ(){const t=N.minionCode(this.level),r=Date.now();[!0,!1].forEach(e=>{a.field.emptyLanes(e).forEach(s=>{a.field.birthCreature(t,"P",e,s,r)})})}phyE(t){const r=N.minionCode(this.level),e=d.actionEval(t,"ST");return e.vectors=[!0,!1].map(s=>a.field.emptyLanes(s).map(c=>{const u=d.evalVectorCreatureFromCode(r,s,c);return u.type="R",u})).flat(),e}pyreC(){this.faction="T",this.rarity="C",this.name="Pyre Song",this.text=`Each friendly creature deals ${this.level} damage to each enemy creature.`}pyreZ(){const t=this.level,r=Date.now(),e=a.field.qEnemyCreats();a.field.qFriendCreats().forEach(s=>{e.forEach(c=>{c.hurtDirect(t,s.code,r)})})}pyreE(t){const r=d.actionEval(t,"ST"),e=!a.state.getActivePlayerB(),s=this.level*a.field.qFriendCreats().length;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{dmg:s})),r}get spboof(){return(this.level+1)*-2}pulseC(){this.faction="A",this.rarity="H",this.name="Sonic Pulse",this.text=`Each enemy creature gets ${a.log.buffText(this.spboof,0)}.`}pulseZ(){const t=this.spboof;a.field.qEnemyCreats().forEach(r=>{r.buff(t,0)})}pulseE(t){const r=d.actionEval(t,"ST"),e=!a.state.getActivePlayerB(),s=this.spboof;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{att:s})),r}sradC(){this.faction="U",this.rarity="C",this.name="Soothing Radiance",this.text=`Heal ${this.boof61224} damage from each friendly creature.`}sradZ(){const t=this.boof61224;a.field.qFriendCreats().forEach(r=>{r.heal(t)})}sradE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.boof3612;return r.vectors=a.field.laneIdx.map(c=>d.evalVectorMod(e,c,{hlt:s})),r}talinC(){this.faction="T",this.rarity="C",this.name="Talin Stampede",this.text=`Each friendly Tempys creature gets ${a.log.buffText(this.boof5814,0)} this turn.`}talinZ(){const t=this.boof5814;this.talinTarg().forEach(r=>{const e=d.mod("AT",t);e.expiry="ET",r.addMod(e)})}talinE(t){const r=d.actionEval(t,"ST"),e=a.state.getActivePlayerB(),s=this.boof5814;return r.vectors=this.talinTarg().map(c=>d.evalVectorMod(e,c.lane,{att:s})),r}talinTarg(){const t=d.crFriendTarg();return t.faction="T",a.field.creatByTarget(t)}turnbC(){this.faction="T",this.rarity="H",this.name="Turnabout",this.isFree=this.level===3;const t=this.boof235;this.text=`Each creature gets ${a.log.buffText(t,-1*t)} this turn.`}turnbZ(){const t=this.boof235,r=-1*t;a.field.qActiveCreats().forEach(e=>{const s=d.mod("AT",t),c=d.mod("HL",r),u=d.mod("MH",r);s.expiry="ET",c.expiry="ET",u.expiry="ET",e.addMod(s),e.addMod(c),e.addMod(u)})}turnbE(t){const r=d.actionEval(t,"ST"),e=this.boof235,s=-1*e;return r.vectors=[!0,!1].map(c=>a.field.laneIdx.map(u=>d.evalVectorMod(c,u,{att:e,hlt:s}))).flat(),r}}class Ne extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Borean Mystic",this.initAttack=this.boof4814,this.initHealth=this.boof71118,this.tribe.push("WN","AS"),this.text=`Activate: Move another friendly creature to an available space adjacent to ${this.name}.`}canActivate(t){return this.emptySloots(t).length>0&&this.buddies(t.id).length>0}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{const e=a.field.creatById(r[1]);a.field.creatById(r[2]).move(t.lane),e.endActivation()}}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.creatById(t.param),s=this.buddies(e.id);return s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.field.creatByFSA(t),s=a.deTil(t.param),c=a.field.creatById(s[1]),u=this.emptySloots(c,e.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=d.actionEval(t,"ST"),s=t,c=a.field.creatById(r[2]),u=d.evalVectorMod(c.owner,c.lane);return u.moveTo=s.lane,e.vectors.push(u),e}}}emptySloots(t,r=""){return a.action.emptyAdjacents(t,a.enTil("P2",t.id,r))}buddies(t){return a.target.toActions(d.crFriendNotMeActTarg("CARD",t,this.code,a.enTil("P1",t)))}}class Be extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Brightsteel Gargoyle",this.initAttack=this.boof61016,this.initHealth=this.initAttack,this.initMobile=1,this.tribe.push("RB"),this.text=`At the end of your turn, ${this.name} gets Armor ${this.boof2510} and Defender until the end of the next turn.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("PT",this.code),e}getsTriggered(t){return t.trigger.type==="PT"?t.event.playerA===t.ownerPlayerA:!1}resolveTrigger(t){const r=d.mod("AR",this.boof2510,t.creatId),e=d.mod("DF",!0,t.creatId);r.expiry="ET",e.expiry="ET";const s=a.field.creatById(t.creatId);s.addMod(r),s.addMod(e),a.batch.triggerDone()}}class Me extends J{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Bullwark Bash",this.text=`Deal damage equal to ${this.level>1?this.level+"x ":""}the Armor on a friendly creature to an enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");r.hasArmor=!0,t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]);e.hurtDirect(s.armor*this.level,this.code),a.turn.spellCast()}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}getCardActions(t){const r=a.field.creatByFSA(t),e=this.enemyTargActions(r.id);return e.push(a.action.cancelAction()),e}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=t,s=a.field.creatById(r[1]);return d.actionEvalCreatStatsN(t,e.playerA,e.lane,{dmg:s.armor*this.level})}}}class Re extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Byzerak Spitemage",this.initAttack=this.boof369,this.initHealth=this.level,this.initAggro=!0,this.tribe.push("HM"),this.hints=["ALN"],this.bonus={play:this.level*.5},this.text=`Allied Nekrium: When ${this.name} ${a.log.dbdtac(this.level)}, destroy it.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&r.creatureSrc&&r.creatureTarg&&r.dmg>0&&r.source.id===t.creatId&&a.target.levelTestCommon(r.target.level,this.level)}else return!1}resolveTrigger(t){if(t.trigger.type==="FR"&&a.turn.allied("N")){const r=a.field.creatById(t.creatId);r.addTrigger("DM",this.code),r.hints.push("BX"),r.changed=!0}else if(t.trigger.type==="DM"){const e=t.event.target;a.death.destroy(e,this.code)}a.batch.triggerDone()}}class Ge extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Cercee, Hand of Varna",this.initAttack=this.lValN([1,3,5,7]),this.initHealth=this.lValN([6,10,20,40]),this.tribe.push("FB"),this.initMobile=1,this.maxLevel=4,this.level===4?this.hints=["OL","LKV","BX"]:this.hints=["OP","BX"];const r=this.level===4?`When ${this.name} ${a.log.dbdtap()}, deal damamge to that player equal to their health. `:"";this.text=r+`When ${this.name} ${a.log.dbdtac(this.level)}, destroy that creature.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("DM",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;if(r.battle&&r.creatureSrc&&r.source.id===t.creatId){if(this.level===4)return!0;if(r.creatureTarg){const e=r.target;return a.target.levelTestCommon(e.level,this.level)}}}return!1}resolveTrigger(t){const r=t.event;if(r.creatureTarg){const e=r.target;e.status==="A"&&a.death.destroy(e,this.code)}else{const e=a.player.toPlayer(r.target);a.player.hurtPlayerDirect(e,e.health,this.code)}a.batch.triggerDone()}}class ie extends x{constructor(t){super(t)}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("DM",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.creatureTarg&&r.target.id===t.creatId}return!1}}class Le extends ie{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Chrogias",this.initAttack=this.lValN([1,0,40]),this.initHealth=this.lValN([1,15,40]),this.tribe.push("PL"),this.level===1?(this.hints=["LV","ST"],this.bonus={play:1}):this.level===2?(this.initRegen=2,this.initDefend=!0,this.bonus={play:1}):this.level===3&&(this.initBT=!0,this.initRegen=5),this.level>1&&(this.hints=["DLK"],this.text="When Chrogias is dealt damage, you gain that much health.")}resolveTrigger(t){if(this.level>1){const r=t.event;a.player.healPlayer(t.ownerPlayerA,r.dmg)}a.batch.triggerDone()}}class z extends x{lookup(t){return{["FFU"]:{c:()=>this.ffuC(),a:(e,s)=>this.ffuA(e,s),t:e=>this.ffuT(e),e:(e,s)=>this.ffuE(e,s)},["FFS"]:{c:()=>this.ffsC(),a:(e,s)=>this.ffsA(e,s),t:e=>this.ffsT(e),e:(e,s)=>this.ffsE(e,s)},["FSH"]:{c:()=>this.fssC(),a:(e,s)=>this.fssA(e,s),t:e=>this.fssT(e),e:(e,s)=>this.fssE(e,s)},["KOD"]:{c:()=>this.kodC(),a:(e,s)=>this.kodA(e,s),t:e=>this.kodT(e),e:(e,s)=>this.kodE(e,s)},["MBP"]:{c:()=>this.mbpC(),a:(e,s)=>this.mbpA(e,s),t:e=>this.mbpT(e),e:(e,s)=>this.mbpE(e,s)},["MND"]:{c:()=>this.mndC(),a:(e,s)=>this.mndA(e,s),t:e=>this.mndT(e),e:(e,s)=>this.mndE(e,s)},["NCS"]:{c:()=>this.ncsC(),a:(e,s)=>this.ncsA(e,s),t:e=>this.ncsT(e),e:(e,s)=>this.ncsE(e,s)},["NFF"]:{c:()=>this.nffC(),a:(e,s)=>this.nffA(e,s),t:e=>this.nffT(e),e:(e,s)=>this.nffE(e,s)},["OHV"]:{c:()=>this.orghC(),a:(e,s)=>this.orghA(e,s),t:e=>this.orghT(e),e:(e,s)=>this.orghE(e,s)},["PPM"]:{c:()=>this.ppmC(),a:(e,s)=>this.ppmA(e,s),t:e=>this.ppmT(e),e:(e,s)=>this.ppmE(e,s)},["PSC"]:{c:()=>this.pcoilC(),a:(e,s)=>this.pcoilA(e,s),t:e=>this.pcoilT(e),e:(e,s)=>this.pcoilE(e,s)},["SGF"]:{c:()=>this.siggyC(),a:(e,s)=>this.siggyA(e,s),t:e=>this.siggyT(e),e:(e,s)=>this.siggyE(e,s)},["SSA"]:{c:()=>this.ssaC(),a:(e,s)=>this.ssaA(e,s),t:e=>this.ssaT(e),e:(e,s)=>this.ssaE(e,s)},["SWM"]:{c:()=>this.swmC(),a:(e,s)=>this.swmA(e,s),t:e=>this.swmT(e),e:(e,s)=>this.swmE(e,s)},["UCM"]:{c:()=>this.ucmC(),a:(e,s)=>this.ucmA(e,s),t:e=>this.ucmT(e),e:(e,s)=>this.ucmE(e,s)},["UIM"]:{c:()=>this.uimC(),a:(e,s)=>this.uimA(e,s),t:e=>this.uimT(e),e:(e,s)=>this.uimE(e,s)},["WMR"]:{c:()=>this.warmC(),a:(e,s)=>this.warmA(e,s),t:e=>this.warmT(e),e:(e,s)=>this.warmE(e,s)},["WFS"]:{c:()=>this.wfsC(),a:(e,s)=>this.wfsA(e,s),t:e=>this.wfsT(e),e:(e,s)=>this.wfsE(e,s)},["ZPM"]:{c:()=>this.zpmC(),a:(e,s)=>this.zpmA(e,s),t:e=>this.zpmT(e),e:(e,s)=>this.zpmE(e,s)}}[t]}targAction(t,r,e){this.lookup(t).a(r,e)}actTargets(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=t,e=a.field.creatById(t.param);return this.lookup(this.cardCode()).e(r,e)}}canActivate(t){return a.target.toActions(this.actTargets(this.cardCode(),t)).length>0}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.field.creatByFSA(t),e=a.field.creatById(t.param);this.targAction(this.cardCode(),r,e),e.endActivation()}makeCreatTarg(t){return d.crActTarg("CARD",this.code,t.id)}getsTriggered(t){return ht.extractCardCode(t.trigger.logicCode)==="KOD"&&(t.trigger.type==="PT"||t.trigger.type==="VN")?!0:super.getsTriggered(t)}resolveTrigger(t){if(t.trigger.type==="VN"){const r=t.event;a.field.birthCreature(r.creature.code,"S",t.ownerPlayerA),a.batch.triggerDone()}else if(t.trigger.type==="PT"){const r=t.trigger.customCode,e=a.field.creatById(t.creatId);e.triggers.filter(c=>c.customCode===r).forEach(c=>e.removeTrigger(c)),a.batch.triggerDone()}}getCardActions(t,r){const e=r??a.field.creatById(t.param);return a.target.toActions([this.actTargets(this.cardCode(),e),a.target.buttonTarget("CANC")])}ffuC(){this.faction="T",this.rarity="H",this.name="Firefist Uranti",this.initAttack=this.boof357,this.initHealth=this.boof71116,this.tribe.push("FR","YT"),this.text=`Activate: Deal damage equal to ${this.name}'s attack to a creature.`}ffuT(t){return this.makeCreatTarg(t)}ffuA(t,r){t.hurtDirect(r.attack,this.code)}ffuE(t,r){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:r.attack})}ffsC(){this.faction="T",this.rarity="R",this.name="Flamefury Shaman",this.initAttack=this.boof369,this.initHealth=this.boof81116,this.tribe.push("HM"),this.text=`Activate: Grant another creature ${a.log.buffText(this.initAttack,0)} this turn.`}ffsT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}ffsA(t,r){const e=d.mod("AT",this.initAttack,r.id);e.expiry="ET",t.addMod(e)}ffsE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.initAttack)}fssC(){this.faction="T",this.rarity="R",this.name="Flamestoke Shaman",this.initAttack=this.boof61218,this.initHealth=this.boof3712,this.tribe.push("HM"),this.text=`Activate: Grant an adjacent ${a.log.levelGateText(this.level,!0)}creature Aggressive.`}fssT(t){const r=this.makeCreatTarg(t);return r.level=a.target.levelMatchTarget(this.level),r.lanes=t.adjacent,r.player=a.player.toTarget(t.owner),r}fssA(t,r){t.aggressive=!0}fssE(t,r){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{agr:!0})}kodC(){this.faction="N",this.rarity="L",this.name="Keeper of the Damned",this.initAttack=this.boof5815,this.initHealth=this.boof61017,this.tribe.push("ZB"),this.text=`Activate: another friendly ${a.log.levelGateText(this.level,!0)}creature gets "Vengeance: Spawn this" this turn.`}kodT(t){const r=this.makeCreatTarg(t);return r.level=a.target.levelMatchTarget(this.level),r.player=a.player.toTarget(t.owner),r.notMe=t.id,r}kodA(t,r){const e=t.addTrigger("VN",this.code);e.customCode=r.id;const s=t.addTrigger("PT",this.code);s.customCode=r.id}kodE(t,r){const e=d.actionEvalCreatStatsN(t,t.playerA,t.lane,void 0,"LZ");return e.bonus=2,e}mbpC(){this.faction="U",this.rarity="H",this.name="Mossbeard Patriarch",this.initAttack=this.boof137,this.initHealth=this.boof81220,this.tribe.push("PL"),this.text=`Activate: Give another creature ${a.log.buffText(0,this.boof468)}.`}mbpT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}mbpA(t,r){t.buff(0,this.boof468)}mbpE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof468)}mndC(){this.faction="A",this.rarity="R",this.name="Munitions Drone",this.initAttack=this.boof137,this.initHealth=this.boof6814,this.tribe.push("RB"),this.text=`Activate: Give another creature ${a.log.buffText(this.boof357,0)}.`}mndT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}mndA(t,r){t.buff(this.boof357,0)}mndE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof357)}ncsC(){this.faction="N",this.rarity="R",this.name="Necroslime",this.initAttack=this.boof4814,this.initHealth=this.initAttack,this.tribe.push("OZ");const t=this.boof248;this.text=`Activate, deal 3 damage to another friendly creature: ${this.name} gets ${a.log.buffText(t,t)}.`}ncsT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.player="F",r}ncsA(t,r){const e=this.boof248;t.hurtDirect(3,this.code),r.buff(e,e)}ncsE(t,r){const e=this.boof248,s=d.actionEvalBuffC(t,r,e,e);return s.vectors.push(d.evalVectorMod(t.playerA,t.lane,{dmg:3})),s}nffC(){this.faction="U",this.rarity="L",this.name="Nuada, Faith's Flourish",this.initAttack=this.boof246,this.initHealth=this.lValN([10,17,25]),this.initDefend=!0,this.tribe.push("TK");const t=this.boof91421;this.text=`Activate: Give a friendly Plant with a ${t}/${t} Treefolk.`}nffT(t){const r=this.makeCreatTarg(t);return r.player="F",r.tribe="PL",r}nffA(t,r){a.field.birthCreature(`${"TFF"}${this.level}`,"R",r.owner,t.lane)}nffE(t,r){const e=d.actionEvalReplace(t,t.playerA,t.lane,`${"TFF"}${this.level}`);return e.hints=["RE"],e}orghC(){this.faction="N",this.rarity="R",this.name="Organ Harvester",this.initAttack=this.lValN([2,6,9]),this.initHealth=this.initAttack+1,this.tribe.push("AB"),this.text=`Activate, destroy ${this.name}: Destroy a ${a.log.levelGateText(this.level,!0)}creature.`}orghT(t){const r=this.makeCreatTarg(t);return r.level=a.target.levelMatchTarget(this.level),r.notMe=t.id,r}orghA(t,r){const e=Date.now();a.death.destroy(t,this.code,e),a.death.destroy(r,this.code,e)}orghE(t,r){const e=d.actionEvalDestroyN(t,t.playerA,t.lane),s=d.evalVectorMod(r.owner,r.lane);return s.destroy=!0,e.vectors.push(s),e}ppmC(){this.faction="A",this.rarity="R",this.name="Palladium Pulsemage",this.initAttack=this.lValN([2,8,12]),this.initHealth=this.lValN([7,12,15]),this.tribe.push("HM"),this.text=`Activate: give a creature ${a.log.buffText(this.boof4812n,0)} this turn.`}ppmT(t){return this.makeCreatTarg(t)}ppmA(t,r){const e=d.mod("AT",this.boof4812n,r.id);e.expiry="ET",t.addMod(e)}ppmE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof4812n)}pcoilC(){this.faction="U",this.rarity="R",this.name="Poisoncoil",this.initAttack=this.boof357,this.initHealth=this.boof71013,this.initDefend=!0,this.tribe.push("SN"),this.text=`Activate: Give another creature Poison ${this.boof135}.`}pcoilT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r}pcoilA(t,r){t.addPoison(this.boof135)}pcoilE(t,r){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{psn:this.boof135})}siggyC(){this.faction="N",this.rarity="H",this.name="Sigmund Fraud",this.initAttack=this.boof357,this.initHealth=this.lValN([9,14,19]),this.initDefend=!0,this.tribe.push("AB");const t=this.boof4812;this.text=`Activate, destroy another friendly creature: Deal ${t} damage to the enemy player and you gain ${t} health.`}siggyT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.player="F",r}siggyA(t,r){a.death.destroy(t,this.code);const e=this.boof4812;a.player.hurtPlayerDirect(!r.owner,e,this.code),a.player.healPlayer(r.owner,e)}siggyE(t,r){const e=d.actionEvalDestroyN(t,t.playerA,t.lane,"SD"),s=this.boof4812;return e.vectors.push(d.evalVectorPlayerDmg(!r.owner,s),d.evalVectorPlayerLife(r.owner,s)),e}ssaC(){this.faction="N",this.rarity="H",this.name="Spitesower Acolyte",this.initAttack=this.boof234,this.initHealth=this.lValN([8,14,22]),this.tribe.push("HM");const t=this.boof246n;this.text=`Activate, deal ${-t} damage to ${this.name}: Give a creature ${a.log.buffText(t,t)}.`}ssaT(t){return this.makeCreatTarg(t)}ssaA(t,r){const e=this.boof246n,s=Date.now();r.hurtDirect(-e,this.code,s),t.buff(e,e,s)}ssaE(t,r){const e=this.boof246n,s=d.actionEvalBuffN(t,t.playerA,t.lane,e,e);return s.vectors.push(d.evalVectorMod(r.owner,r.lane,{dmg:-e})),s}swmC(){this.faction="A",this.rarity="R",this.name="Steelwelder Medic",this.initAttack=this.lValN([3,5,13]),this.initHealth=this.boof61014,this.tribe.push("HM"),this.text=`Activate: Give another creature Armor ${this.level}.`}swmT(t){const r=this.makeCreatTarg(t);return r.notMe=t.id,r.canArmor=!0,r}swmA(t,r){t.addArmor(this.level)}swmE(t,r){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{arm:this.level})}ucmC(){this.faction="T",this.rarity="R",this.name="Uranti Cryomancer",this.initAttack=this.boof247,this.initHealth=this.lValN([8,13,17]),this.tribe.push("IC","YT"),this.text=`Activate: Deal ${this.boof135} damage to a creature.`}ucmT(t){return this.makeCreatTarg(t)}ucmA(t,r){t.hurtDirect(this.boof135,this.code)}ucmE(t,r){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:this.boof135})}uimC(){this.faction="T",this.rarity="C",this.name="Uranti Icemage",this.initAttack=this.lValN([2,5,9]),this.initHealth=this.lValN([8,13,20]),this.tribe.push("IC","YT"),this.text="Activate: Negate Defender this turn."}uimT(t){return this.makeCreatTarg(t)}uimA(t,r){const e=d.mod("ND",!0,r.id);e.expiry="ET",t.addMod(e)}uimE(t,r){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{noD:!0})}warmC(){this.faction="A",this.rarity="H",this.name="War Merchant",this.initAttack=this.boof468,this.initHealth=this.initAttack,this.initDefend=!0,this.tribe.push("HM"),this.text=`Activate: Give a creature in a center space ${a.log.buffText(this.initAttack,this.level===3?this.initAttack:0)}.`}warmT(t){const r=this.makeCreatTarg(t);return r.lanes=3,r}warmA(t,r){t.buff(this.initAttack,this.level===3?this.initAttack:0)}warmE(t,r){return d.actionEvalBuffN(t,t.playerA,t.lane,this.initAttack,this.level===3?this.initAttack:0)}wfsC(){this.faction="N",this.rarity="H",this.name="Witherfrost Succubus",this.initAttack=this.boof147,this.initHealth=this.boof61018,this.tribe.push("DM");const t=-this.boof357;this.text=`Activate: Give a creature ${a.log.buffText(t,t)} this turn.`}wfsT(t){return this.makeCreatTarg(t)}wfsA(t,r){const e=-this.boof357,s=d.mod("AT",e,r.id);s.expiry="ET",t.addMod(s);const c=d.mod("HL",e,r.id);c.expiry="ET",t.addMod(c);const u=d.mod("MH",e,r.id);u.expiry="ET",t.addMod(u)}wfsE(t,r){const e=-this.boof357;return d.actionEvalBuffN(t,t.playerA,t.lane,e,e)}zpmC(){this.faction="T",this.rarity="R",this.name="Zephyr Mage",this.initAttack=this.boof4813,this.initHealth=this.boof61017,this.tribe.push("WN","AS"),this.text=`Activate: Give another ${a.log.levelGateText(this.level,!0)}creature Mobility ${this.level}.`}zpmT(t){const r=this.makeCreatTarg(t);return r.level=a.target.levelMatchTarget(this.level),r.notMe=t.id,r.canMove=!0,r}zpmA(t,r){t.addMobility(this.level)}zpmE(t,r){const e=d.actionEvalCreatStatsN(t,t.playerA,t.lane);return e.bonus=.5,e}}class Q extends x{lookup(t){return{["AGC"]:{c:()=>this.aconC(),f:(e,s)=>this.aconF(e,s),e:e=>this.aconE(e)},["BSR"]:{c:()=>this.bsrC(),f:(e,s)=>this.bsrF(e,s),e:e=>this.bsrE(e)},["BAW"]:{c:()=>this.bawC(),f:(e,s)=>this.bawF(e,s),e:e=>this.bawE(e)},["CHA"]:{c:()=>this.chaC(),f:(e,s)=>this.chaF(e,s),e:e=>this.chaE(e)},["CCR"]:{c:()=>this.ccC(),f:(e,s)=>this.ccF(e,s),e:e=>this.ccE(e)},["GLF"]:{c:()=>this.gfiendC(),f:(e,s)=>this.gfiendF(e,s),e:e=>this.gfiendE(e)},["GRW"]:{c:()=>this.grwC(),f:(e,s)=>this.grwF(e,s),e:e=>this.grwE(e)},["GHT"]:{c:()=>this.grhC(),f:(e,s)=>this.grhF(e,s),e:e=>this.grhE(e)},["MMH"]:{c:()=>this.houndC(),f:(e,s)=>this.houndF(e,s),e:e=>this.houndE(e)},["MXW"]:{c:()=>this.mtxC(),f:(e,s)=>this.mtxF(e,s),e:e=>this.mtxE(e)},["NGB"]:{c:()=>this.ngbC(),f:(e,s)=>this.ngbF(e,s),e:e=>this.ngbE(e)},["PHS"]:{c:()=>this.phxsC(),f:(e,s)=>this.phxsF(e,s),e:e=>this.phxsE(e)},["STD"]:{c:()=>this.stdC(),f:(e,s)=>this.stdF(e,s),e:e=>this.stdE(e)},["VNF"]:{c:()=>this.vnfC(),f:(e,s)=>this.vnfF(e,s),e:e=>this.vnfE(e)},["WBY"]:{c:()=>this.wbyC(),f:(e,s)=>this.wbyF(e,s),e:e=>this.wbyE(e)},["WBU"]:{c:()=>this.wbuC(),f:(e,s)=>this.wbuF(e,s),e:e=>this.wbuE(e)}}[t]}targAction(t,r,e){this.lookup(t).f(r,e)}targEval(t,r){return this.lookup(t).e(r)}playTarg;optional=!1;notme=!1;ftext="";forges=!0;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c(),this.forges&&(this.text="Forge: "+this.ftext),this.ftext=""}generateCreature(t,r){const e=super.generateCreature(t,r);if(this.forges){const s=e.addTrigger("FR",this.code);s.interactive=!0}return e}handleAction(t){const r=a.field.creatByFSA(t),e=a.field.creatById(t.param);this.targAction(this.cardCode(),r,e),a.action.actionDone(!0)}resolveTrigger(t){this.notme&&(this.playTarg.notMe=t.creatId);const r=a.target.toActions(this.playTarg);r.length>0?(r.forEach(e=>{e.param=t.creatId}),this.optional&&r.push(a.action.noneEndTrigger()),a.action.setupActions(r)):a.batch.triggerDone()}evaluateAction(t){return this.targEval(this.cardCode(),t)}aconC(){this.faction="A",this.rarity="C",this.name="Aegis Conscript",this.initAttack=this.boof3612,this.initHealth=this.lValN([6,9,15]),this.tribe.push("HM"),this.hints=["FRO"],this.bonus={play:this.boardFormula(0,this.boof248,0,0)},this.playTarg.canArmor=!0,this.playTarg.player="F",this.ftext=`Give a friendly creature Armor ${this.boof124}.`}aconF(t,r){t.addArmor(this.boof124)}aconE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{arm:this.boof124})}bsrC(){this.faction="N",this.rarity="R",this.name="Bonescythe Reaver",this.initAttack=this.boof5813,this.initHealth=this.boof3712,this.tribe.push("AB"),this.hints=["ENS"],this.bonus={play:this.avgCreatureFormula()},this.forges=this.level>1,this.playTarg.level=a.target.levelMatchTarget(this.level-1),this.playTarg.player="E",this.ftext=`You may destroy a ${a.log.levelGateText(this.level-1)} enemy creature.`,this.optional=!0}bsrF(t,r){a.death.destroy(t,this.code)}bsrE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane)}bawC(){this.faction="U",this.rarity="R",this.name="Brambleaxe Warrior",this.initAttack=this.boof61014,this.initHealth=this.initAttack-4,this.tribe.push("HM"),this.hints=["FRO"];const t=this.avgCreatureStats()[0];this.bonus={play:this.boardFormula(0,0,t,t)},this.ftext="Give a creature Breakthrough this turn."}bawF(t,r){const e=d.mod("BT",!0,r.id);e.expiry="ET",t.addMod(e)}bawE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{brt:!0})}chaC(){this.faction="U",this.rarity="R",this.name="Chistlehearth Archer",this.initAttack=this.boof2510,this.initHealth=this.initAttack+7,this.tribe.push("HM"),this.hints=["ENS"];const t=this.boof4816;this.bonus={play:this.boardFormula(0,t/2,0,0)},this.playTarg.player="E",this.playTarg.hasMobility=!0,this.ftext=`Deal ${t} damage to an enemy creature with Mobility. Negate Mobility from that creature.`}chaF(t,r){t.hurtDirect(this.boof4816,this.code),t.negateMobility=!0}chaE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:this.boof4816})}ccC(){this.faction="N",this.rarity="C",this.name="Corpse Crawler",this.initAttack=this.boof81220,this.initHealth=this.initAttack+1,this.tribe.push("AB"),this.hints=["SD"],this.playTarg.player="F",this.ftext="Destroy a friendly creature."}ccF(t,r){a.death.destroy(t,this.code)}ccE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane,"SD")}get fiendBof(){return this.lValN([-1,-2,-5])}gfiendC(){this.faction="N",this.rarity="C",this.name="Gloomfiend",this.initAttack=this.boof4812,this.initHealth=this.initAttack,this.tribe.push("AB"),this.hints=["ENS"],this.playTarg.player="E";const t=this.fiendBof;this.ftext=`You may give an enemy creature ${a.log.buffText(t,t)}.`,this.optional=!0,this.bonus={play:this.boardFormula(0,-2*t,-t,0)}}gfiendF(t,r){const e=this.fiendBof;t.buff(e,e)}gfiendE(t){const r=this.fiendBof;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}grwC(){this.faction="N",this.rarity="C",this.name="Gloomreaper Witch",this.initAttack=this.boof5915,this.initHealth=this.initAttack,this.tribe.push("HM"),this.hints=["ENS"],this.bonus={play:this.avgCreatureFormula()/4};const t=this.boof147;this.playTarg.maxAttack=t,this.playTarg.player="E",this.ftext=`You may destroy an enemy creature with ${t} or less attack.`,this.optional=!0}grwF(t,r){a.death.destroy(t,this.code)}grwE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane)}grhC(){this.faction="U",this.rarity="C",this.name="Grove Huntress",this.initAttack=this.boof4711,this.initHealth=this.initAttack-1,this.tribe.push("HM"),this.playTarg.player="F";const t=this.boof135;this.ftext=`Give a friendly creature ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,t*2,t,0)}}grhF(t,r){const e=this.boof135;t.buff(e,e)}grhE(t){const r=this.boof135;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}houndC(){this.faction="T",this.rarity="C",this.name="Magma Hound",this.initAttack=this.boof4813,this.initHealth=this.initAttack-1,this.tribe.push("ER","EL"),this.hints=["ENS"];const t=this.boof246;this.optional=!0,this.playTarg.player="E",this.ftext=`You may deal ${t} damage to an enemy creature.`,this.bonus={play:this.boardFormula(0,t,0,0)}}houndF(t,r){t.hurtDirect(this.boof246,this.code)}houndE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:this.boof246})}mtxC(){this.faction="A",this.rarity="C",this.name="Matrix Warden",this.initAttack=this.lValN([3,8,12]),this.initHealth=this.initAttack,this.tribe.push("RB");const t=this.boof3510;this.playTarg.player="F",this.ftext=`Give a friendly creature ${a.log.buffText(t,0)}.`,this.bonus={play:this.boardFormula(0,t,t,0)}}mtxF(t,r){t.buff(this.boof3510,0)}mtxE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof3510)}ngbC(){this.faction="T",this.rarity="C",this.name="Nargath Bruiser",this.initAttack=this.boof5814,this.initHealth=this.initAttack-1,this.tribe.push("ER","AS");const t=this.boof248;this.playTarg.player="F",this.ftext=`Give a friendly creature ${a.log.buffText(0,t)}.`,this.bonus={play:this.boardFormula(0,t,0,0)}}ngbF(t,r){t.buff(0,this.boof248)}ngbE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof248)}phxsC(){this.faction="A",this.rarity="R",this.name="Phalanx Squadron",this.initAttack=this.boof3714,this.initHealth=this.boof61117,this.tribe.push("HM"),this.hints=["FRO"],this.playTarg.hasArmor=!0,this.playTarg.player="F";const t=this.boof234;this.ftext=`Give a friendly creature with Armor ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,t,t/2,0)}}phxsF(t,r){const e=this.boof234;t.buff(e,e)}phxsE(t){const r=this.boof234;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}stdC(){this.faction="A",this.rarity="H",this.name="Shardthief Druid",this.initAttack=this.boof5813,this.initHealth=this.boof81318,this.tribe.push("MM"),this.hints=["ENS"],this.playTarg.canRegen,this.playTarg.player="E",this.ftext=`Negate and remove all Regenerate from an enemy creature. ${this.name} gets that much Renerate.`,this.bonus={play:this.boardFormula(0,2,0,0)}}stdF(t,r){const e=t.regen;t.negateRegen=!0,r.addRegen(e)}stdE(t){const r=a.field.creatByFSA(t);return d.actionEvalCreatStatsC(t,r,{rgn:-r.regen})}vnfC(){this.faction="U",this.rarity="R",this.name="Venomfang",this.initAttack=this.boof61014,this.initHealth=this.initAttack-2,this.tribe.push("SN");const t=this.boof246;this.playTarg.player="E",this.ftext=`Give an enemy creature Poison ${t}.`,this.bonus={play:this.boardFormula(0,t,0,0)}}vnfF(t,r){t.addPoison(this.boof246)}vnfE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{psn:this.boof246})}wbyC(){this.faction="T",this.rarity="R",this.name="Wallbreaker Yeti",this.initAttack=this.boof4712,this.initHealth=this.boof71116,this.tribe.push("ER","YT"),this.hints=["ENS"],this.bonus={play:this.avgCreatureFormula()/4},this.playTarg.player="E",this.playTarg.level=a.target.levelMatchTarget(this.level),this.playTarg.hasDefender=!0,this.ftext=`You may destroy a ${a.log.levelGateText(this.level,!0)}enemy creature with Defender.`,this.optional=!0}wbyF(t,r){a.death.destroy(t,this.code)}wbyE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane)}wbuC(){this.faction="T",this.rarity="C",this.name="Warbringer Uranti",this.initAttack=this.boof3711,this.initHealth=this.initAttack,this.tribe.push("LT","YT"),this.hints=["FRO"];const t=this.boof4812;this.notme=!0,this.playTarg.player="F",this.ftext=`Give another friendly creature ${a.log.buffText(t,0)} this turn.`,this.bonus={play:this.boardFormula(0,t,t,0)}}wbuF(t,r){const e=d.mod("AT",this.boof4812,r.id);e.expiry="ET",t.addMod(e)}wbuE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof4812)}}class P extends J{lookup(t){return{["ASG"]:{c:()=>this.asurgeC(),z:e=>this.asurgeZ(e),e:e=>this.asurgeE(e)},["AQE"]:{c:()=>this.aqatC(),z:e=>this.aqatZ(e),e:e=>this.aqatE(e)},["ABL"]:{c:()=>this.ablC(),z:e=>this.ablZ(e),e:e=>this.ablE(e)},["BTM"]:{c:()=>this.botC(),z:e=>this.botZ(e),e:e=>this.botE(e)},["CSU"]:{c:()=>this.csurgeC(),z:e=>this.csurgeZ(e),e:e=>this.csurgeE(e)},["CTW"]:{c:()=>this.cullC(),z:e=>this.cullZ(e),e:e=>this.cullE(e)},["CTV"]:{c:()=>this.cultC(),z:e=>this.cultZ(e),e:e=>this.cultE(e)},["CAG"]:{c:()=>this.cypaC(),z:e=>this.cypaZ(e),e:e=>this.cypaE(e)},["CBS"]:{c:()=>this.cypbC(),z:e=>this.cypbZ(e),e:e=>this.cypbE(e)},["DBT"]:{c:()=>this.dreadC(),z:e=>this.dreadZ(e),e:e=>this.dreadE(e)},["DYB"]:{c:()=>this.drybC(),z:e=>this.drybZ(e),e:e=>this.drybE(e)},["ETN"]:{c:()=>this.elnC(),z:e=>this.elnZ(e),e:e=>this.elnE(e)},["ENP"]:{c:()=>this.enpC(),z:e=>this.enpZ(e),e:e=>this.enpE(e)},["ENR"]:{c:()=>this.rageC(),z:e=>this.rageZ(e),e:e=>this.rageE(e)},["EXD"]:{c:()=>this.expdmC(),z:e=>this.expdmZ(e),e:e=>this.expdmE(e)},["FIN"]:{c:()=>this.feralC(),z:e=>this.feralZ(e),e:e=>this.feralE(e)},["FVA"]:{c:()=>this.fervassC(),z:e=>this.fervassZ(e),e:e=>this.fervassE(e)},["FLN"]:{c:()=>this.flncC(),z:e=>this.flncZ(e),e:e=>this.flncE(e)},["FFL"]:{c:()=>this.ffldC(),z:e=>this.ffldZ(e),e:e=>this.ffldE(e)},["FZS"]:{c:()=>this.frozC(),z:e=>this.frozZ(e),e:e=>this.frozE(e)},["GTH"]:{c:()=>this.ghastC(),z:e=>this.ghastZ(e),e:e=>this.ghastE(e)},["GCR"]:{c:()=>this.crushC(),z:e=>this.crushZ(e),e:e=>this.crushE(e)},["HAR"]:{c:()=>this.hartC(),z:e=>this.hartZ(e),e:e=>this.hartE(e)},["JPK"]:{c:()=>this.jpC(),z:e=>this.jpZ(e),e:e=>this.jpE(e)},["LBR"]:{c:()=>this.lbrandC(),z:e=>this.lbrandZ(e),e:e=>this.lbrandE(e)},["MSC"]:{c:()=>this.sculptC(),z:e=>this.sculptZ(e),e:e=>this.sculptE(e)},["NSL"]:{c:()=>this.natselC(),z:e=>this.natselZ(e),e:e=>this.natselE(e)},["NCV"]:{c:()=>this.nviveC(),z:e=>this.nviveZ(e),e:e=>this.nviveE(e)},["PTR"]:{c:()=>this.pwtorC(),z:e=>this.pwtorZ(e),e:e=>this.pwtorE(e)},["PSG"]:{c:()=>this.psurgeC(),z:e=>this.psurgeZ(e),e:e=>this.psurgeE(e)},["PMS"]:{c:()=>this.pslamC(),z:e=>this.pslamZ(e),e:e=>this.pslamE(e)},["ROG"]:{c:()=>this.rotgC(),z:e=>this.rotgZ(e),e:e=>this.rotgE(e)},["SAP"]:{c:()=>this.sapC(),z:e=>this.sapZ(e),e:e=>this.sapE(e)},["SVO"]:{c:()=>this.soathC(),z:e=>this.soathZ(e),e:e=>this.soathE(e)},["SHG"]:{c:()=>this.shgrC(),z:e=>this.shgrZ(e),e:e=>this.shgrE(e)},["SNB"]:{c:()=>this.snbC(),z:e=>this.snbZ(e),e:e=>this.snbE(e)},["SHV"]:{c:()=>this.sharvC(),z:e=>this.sharvZ(e),e:e=>this.sharvE(e)},["STR"]:{c:()=>this.sttorC(),z:e=>this.sttorZ(e),e:e=>this.sttorE(e)},["STO"]:{c:()=>this.sptorC(),z:e=>this.sptorZ(e),e:e=>this.sptorE(e)},["STN"]:{c:()=>this.stbrnC(),z:e=>this.stbrnZ(e),e:e=>this.stbrnE(e)},["SIN"]:{c:()=>this.sinC(),z:e=>this.sinZ(e),e:e=>this.sinE(e)},["TPT"]:{c:()=>this.tpactC(),z:e=>this.tpactZ(e),e:e=>this.tpactE(e)},["TUP"]:{c:()=>this.tugC(),z:e=>this.tugZ(e),e:e=>this.tugE(e)},["TOB"]:{c:()=>this.blightC(),z:e=>this.blightZ(e),e:e=>this.blightE(e)},["TXS"]:{c:()=>this.sporeC(),z:e=>this.sporeZ(e),e:e=>this.sporeE(e)},["TCG"]:{c:()=>this.tremcC(),z:e=>this.tremcZ(e),e:e=>this.tremcE(e)},["VGR"]:{c:()=>this.vgraC(),z:e=>this.vgraZ(e),e:e=>this.vgraE(e)},["VYE"]:{c:()=>this.vembC(),z:e=>this.vembZ(e),e:e=>this.vembE(e)},["UBL"]:{c:()=>this.uboltC(),z:e=>this.uboltZ(e),e:e=>this.uboltE(e)},["WMM"]:{c:()=>this.warC(),z:e=>this.warZ(e),e:e=>this.warE(e)},["XRW"]:{c:()=>this.xwillC(),z:e=>this.xwillZ(e),e:e=>this.xwillE(e)}}[t]}cardCast(t,r){this.lookup(t).z(r)}castEval(t,r){return this.lookup(t).e(r)}playTarg;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.cardCode()==="NSL"&&a.field.creatByTarget(d.crFriendTarg()).length<5||t.push(this.playTarg),t}handleAction(t){this.logSpell();const r=a.field.creatByFSA(t);this.cardCast(this.cardCode(),r),a.turn.spellCast()}evaluateAction(t){return this.castEval(this.cardCode(),t)}getsTriggered(t){const r=ht.extractCardCode(t.trigger.logicCode);if(r==="TOB"&&t.trigger.type==="DM"){const e=t.event;if(e.battle&&e.creatureTarg&&e.creatureSrc&&e.source.id===t.creatId)return this.level===3?!0:a.cards.getCard(e.target.code).level<=this.level}else if(r==="ABL"&&t.trigger.type==="DM"){const e=t.event;return e.battle&&!e.creatureTarg&&e.creatureSrc&&e.source.id===t.creatId}else if(r==="FZS"&&t.trigger.type==="DM"){const e=t.event;if(e.creatureTarg&&e.target.id===t.creatId)return!0}else if(r==="DYB"&&t.trigger.type==="EF"){const e=t.event;return t.trigger.creatId!==e.creature.id&&e.creature.owner===t.ownerPlayerA}else if(r==="FVA"&&t.trigger.type==="FK"||r==="ROG"&&t.trigger.type==="DS"||r==="SHG"&&(t.trigger.type==="PT"||t.trigger.type==="VN"))return!0;return!1}resolveTrigger(t){const r=ht.extractCardCode(t.trigger.logicCode);if(r==="TOB"){const s=t.event.target;a.death.destroy(s,this.code),a.batch.triggerDone()}else if(r==="ABL")a.field.creatById(t.creatId).buff(this.level,this.level),a.batch.triggerDone();else if(r==="FVA"){const e=a.field.creatById(t.creatId),s=a.field.searchByLane(a.field.oppositeLane(e.lane),!e.owner);s&&s.hurtDirect(this.boof3612,e.code),a.batch.triggerDone()}else if(r==="FZS"){const e=a.field.creatById(t.creatId);a.death.destroy(e,this.code),a.batch.triggerDone()}else if(r==="ROG"||r==="DYB")a.field.creatById(t.creatId).buff(this.level,this.level),a.batch.triggerDone();else if(r==="SHG"){if(t.trigger.type==="VN"){const e=t.event;a.field.birthCreature(e.creature.code,"S",t.ownerPlayerA),a.batch.triggerDone()}else if(t.trigger.type==="PT"){const e=t.trigger.customCode,s=a.field.creatById(t.creatId);s.triggers.filter(u=>u.customCode===e).forEach(u=>s.removeTrigger(u)),a.batch.triggerDone()}}else super.resolveTrigger(t)}asurgeC(){this.faction="T",this.rarity="R",this.name="Aerial Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg.canMove=!0,this.text=`Give a creature Mobility ${this.level}.`}asurgeZ(t){t.addMobility(this.level)}asurgeE(t){return d.actionEval(t,"ST","GM")}aqatC(){this.faction="T",this.rarity="C",this.name="Aquatic Embrace",this.text=`Give a creature ${a.log.buffText(0,this.boof51015)}.`}aqatZ(t){t.buff(0,this.boof51015)}aqatE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,0,this.boof51015)}ablC(){this.faction="T",this.rarity="R",this.name="Asir's Blessing",this.text=`Give a creature "When this creature ${a.log.dbdtap()}, it gets ${a.log.buffText(this.level,this.level)}."`}ablZ(t){t.changed=!0,t.addTrigger("DM",this.code),t.hints.push("OL")}ablE(t){const r=d.actionEval(t,"ST","OL");return r.bonus=.5,r}botC(){this.faction="U",this.rarity="H",this.name="Botanimate",this.text=`Replace an enemy ${a.log.levelGateText(this.level,!0)}creature with a 3/3 Sapling.`,this.playTarg.player="E",this.playTarg.level=a.target.levelMatchTarget(this.level)}botZ(t){a.field.birthCreature(`${"BOS"}${this.level}`,"R",t.owner,t.lane)}botE(t){const r=d.actionEvalReplace(t,t.playerA,t.lane,`${"BOS"}${this.level}`);return r.hints=["RE"],r}csurgeC(){this.faction="N",this.rarity="R",this.name="Contagion Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof123n;this.text=`Give a creature ${a.log.buffText(t,t)}.`}csurgeZ(t){const r=this.boof123n;t.buff(r,r)}csurgeE(t){const r=this.boof123n;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}cullC(){this.faction="N",this.rarity="C",this.name="Cull the Weak";const t=this.boof4814;this.text=`Destroy a creature with ${t} or less attack.`,this.playTarg.maxAttack=t}cullZ(t){a.death.destroy(t,this.code)}cullE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane)}cultC(){this.faction="U",this.rarity="H",this.name="Cultivate";const t=this.boof91421;this.text=`Replace a friendly Plant with a ${t}/${t} Treefolk.`,this.playTarg.player="F",this.playTarg.tribe="PL"}cultZ(t){a.field.birthCreature(`${"TFF"}${this.level}`,"R",t.owner,t.lane)}cultE(t){const r=d.actionEvalReplace(t,t.playerA,t.lane,`${"TFF"}${this.level}`);return r.hints=["RE"],r}cypaC(){this.faction="A",this.rarity="R",this.name="Cypien Augmentation",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]);const t=this.boof246;this.text=`Give a creature in a center space ${a.log.buffText(t,t)}.`,this.playTarg.lanes=3}cypaZ(t){const r=this.boof246;t.buff(r,r)}cypaE(t){const r=this.boof246;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}cypbC(){this.faction="A",this.rarity="C",this.name="Cypien Battlesuit",this.text=`Give an Alloyin creature ${a.log.buffText(this.boof51015,0)} and Armor ${this.boof124}.`,this.playTarg.faction="A"}cypbZ(t){t.buff(this.boof51015,0),t.addArmor(this.boof124)}cypbE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:this.boof51015,arm:this.boof124})}dreadC(){this.faction="N",this.rarity="H",this.name="Dreadbolt",this.hints=["LV"],this.text=`Destroy a ${a.log.levelGateText(this.level,!0)}creature.`,this.playTarg.level=a.target.levelMatchTarget(this.level)}dreadZ(t){a.death.destroy(t,this.code)}dreadE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane)}drybC(){this.faction="U",this.rarity="R",this.name="Dryad's Boon",this.text=`Give a creature ${a.log.buffText(this.level,this.level,!0)}, and "When another friendly creature enters play, this gets ${a.log.buffText(this.level,this.level)}."`}drybZ(t){t.buff(this.level,this.level),t.changed=!0,t.addTrigger("EF",this.code),t.hints.push("BF")}drybE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.level,this.level,"BF")}enpC(){this.faction="A",this.rarity="H",this.name="Energy Prison",this.isFree=this.level===3,this.text=`Give a ${a.log.levelGateText(this.level,!0)}creature Defender.`,this.playTarg.canDefender=!0}enpZ(t){t.defender=!0}enpE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{def:!0})}elnC(){this.faction="A",this.rarity="C",this.name="Electro Net",this.text=`Give a creature ${a.log.buffText(-this.boof51015,0)}.`}elnZ(t){t.buff(-this.boof51015,0)}elnE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,-this.boof51015)}rageC(){this.faction="U",this.rarity="C",this.name="Enrage";const t=this.boof3612;this.text=`Give a creature ${a.log.buffText(t,t)}.`}rageZ(t){const r=this.boof3612;t.buff(r,r)}rageE(t){const r=this.boof3612;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}expdmC(){this.faction="N",this.rarity="H",this.name="Explosive Demise",this.text=`Destroy a friendly ${a.log.levelGateText(this.level+1,!0)}creature. Deal damage equal to its attack to the enemy player.${this.level===3?" You gain that much health.":""}`,this.playTarg.level=a.target.levelMatchTarget(this.level+1),this.playTarg.player="F"}expdmZ(t){const r=t.attack;a.death.destroy(t,this.code),a.player.hurtPlayerDirect("E",r,this.code),this.level===3&&a.player.healPlayer("F",r)}expdmE(t){const r=a.field.creatByFSA(t),e=d.actionEvalDestroyC(t,r);return e.vectors.push(d.evalVectorPlayerDmg(!r.owner,r.attack)),this.level===3&&e.vectors.push(d.evalVectorPlayerDmg(r.owner,r.attack)),e}get fiboof(){return this.lValN([1,3,8])}feralC(){this.faction="U",this.rarity="C",this.name="Feral Instinct";const t=this.fiboof;this.text=`Give a creature ${a.log.buffText(t,t,!0)} and Breakthrough.`}feralZ(t){const r=this.fiboof;t.breakthrough=!0,t.buff(r,r)}feralE(t){const r=this.fiboof;return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:r,hlt:r,brt:!0})}fervassC(){this.faction="T",this.rarity="H",this.name="Fervent Assault",this.playTarg.player="F",this.text=`Give a friendly creature Mobility ${this.level} and "Flank: Deal ${this.boof3612} damage to the opposing creature.`}fervassZ(t){t.changed=!0,t.addMobility(this.level),t.addTrigger("FK",this.code),t.hints.push("FH")}fervassE(t){return d.actionEval(t,"ST","FH")}flncC(){this.faction="T",this.rarity="R",this.name="Flame Lance";const t=this.boof579;this.text=`Deal ${t} damage to an enemy creature and ${t} damage to the enemy player.`,this.playTarg.player="E"}flncZ(t){const r=this.boof579;t.hurtDirect(r,this.code),a.player.hurtPlayerDirect("E",r,this.code)}flncE(t){const r=this.boof579,e=d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:r});return e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r)),e}ffldC(){this.faction="A",this.rarity="C",this.name="Forcefield",this.playTarg.canArmor=!0,this.text=`Give a creature Armor ${this.boof51020} this turn.`}ffldZ(t){const r=d.mod("AR",this.boof51020,this.code);r.expiry="ET",t.addMod(r)}ffldE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{arm:this.boof51020})}frozC(){this.faction="T",this.rarity="R",this.name="Frozen Solid",this.playTarg.level=a.target.levelMatchTarget(this.level),this.text=`Give a ${a.log.levelGateText(this.level,!0)}creature "When this is dealt damage, destroy it".`}frozZ(t){t.changed=!0,t.addTrigger("DM",this.code),t.hints.push("DD")}frozE(t){return d.actionEval(t,"ST","DD")}ghastC(){this.faction="N",this.rarity="C",this.name="Ghastly Touch";const t=-this.boof3612;this.text=`Give a creature ${a.log.buffText(t,t)}.`}ghastZ(t){const r=-this.boof3612;t.buff(r,r)}ghastE(t){const r=-this.boof3612;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}crushC(){this.faction="T",this.rarity="C",this.name="Glacial Crush",this.isFree=this.level>1,this.isFree||(this.hints=["LV"]),this.playTarg.player="E",this.playTarg.hasDefender=!0,this.text=`Destroy an enemy creature with Defender.${this.level===3?" Deal damage equal to its health to the enemy player.":""}`}crushZ(t){const r=t.health;a.death.destroy(t,this.code),this.level===3&&a.player.hurtPlayerDirect(t.owner,r,this.code)}crushE(t){const r=a.field.creatByFSA(t),e=d.actionEvalDestroyC(t,r);return this.level===3&&e.vectors.push(d.evalVectorPlayerDmg(r.owner,r.health)),e}hartC(){this.faction="A",this.rarity="C",this.name="Heavy Artillery",this.text=`Give a creature ${a.log.buffText(this.boof51015,0)}.`}hartZ(t){t.buff(this.boof51015,0)}hartE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof51015)}jpC(){this.faction="A",this.rarity="C",this.name="Jet Pack",this.text=`Give a creature ${a.log.buffText(this.boof369,0)} and Mobility 1.`}jpZ(t){t.buff(this.boof369,0),t.addMobility(1)}jpE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof369,void 0,"GM")}lbrandC(){this.faction="T",this.rarity="C",this.name="Lightning Brand",this.playTarg.level=a.target.levelMatchTarget(this.level+1),this.text=`Give a ${a.log.levelGateText(this.level+1)}creature ${a.log.buffText(this.boof124,0)} and Aggressive this turn.`}lbrandZ(t){const r=d.mod("AT",this.boof124,this.code),e=d.mod("AG",!0,this.code);r.expiry="ET",e.expiry="ET",t.addMod(r),t.addMod(e)}lbrandE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:this.boof124,agr:!0})}sculptC(){this.faction="A",this.rarity="H",this.name="Metasculpt",this.isFree=this.level===3,this.playTarg.level=a.target.levelMatchTarget(this.level+1),this.text=`Remove all abilities from a ${a.log.levelGateText(this.level+1,!0)}creature.`}sculptZ(t){t.wipeAll()}sculptE(t){return d.actionEval(t,"ST","NT")}natselC(){this.faction="U",this.rarity="R",this.name="Natural Selection",this.text=`If there is a friendly creature in each space, destroy a ${a.log.levelGateText(this.level,!0)}creature.`,this.playTarg.level=a.target.levelMatchTarget(this.level)}natselZ(t){a.death.destroy(t,this.code)}natselE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane)}nviveC(){this.faction="N",this.rarity="C",this.name="Necrovive",this.playTarg.canRegen=!0,this.text=`Give a creature Regenerate ${this.boof3612}.`}nviveZ(t){t.addRegen(this.boof3612)}nviveE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{rgn:this.boof3612})}pwtorC(){this.faction="A",this.rarity="R",this.name="Power Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature ${a.log.buffText(this.boof234,0)}.`}pwtorZ(t){t.buff(this.boof234,0)}pwtorE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof234)}psurgeC(){this.faction="U",this.rarity="R",this.name="Primal Surge",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature ${a.log.buffText(this.level,this.level)}.`}psurgeZ(t){t.buff(this.level,this.level)}psurgeE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.level,this.level)}pslamC(){this.faction="T",this.rarity="C",this.name="Primordial Slam",this.text=`Give a creature ${a.log.buffText(this.boof71116,0)} this turn.`}pslamZ(t){const r=d.mod("AT",this.boof71116,this.code);r.expiry="ET",t.addMod(r)}pslamE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.boof71116)}rotgC(){this.faction="N",this.rarity="H",this.name="Rite of the Grimgaunt",this.text=`Give a creature "When a creature is destroyed, this gets ${a.log.buffText(this.level,this.level)}."`}rotgZ(t){t.changed=!0,t.addTrigger("DS",this.code),t.hints.push("BD")}rotgE(t){return d.actionEval(t,"ST","BD")}sapC(){this.faction="A",this.rarity="C",this.name="Sap",this.playTarg.level=a.target.levelMatchTarget(this.level),this.text=`Reduce a ${a.log.levelGateText(this.level,!0)}creature's attack to 0.`}sapZ(t){t.buff(-t.attack,0)}sapE(t){const r=a.field.creatByFSA(t);return d.actionEvalBuffC(t,r,-r.attack)}soathC(){this.faction="U",this.rarity="C",this.name="Savage Oath",this.level===1&&(this.hints=["LV"]);const t=this.saboof;this.text=`Give an Uterra creature ${a.log.buffText(t,t,!0)} and Breakthrough.`,this.playTarg.faction="U"}soathZ(t){const r=this.saboof;t.buff(r,r),t.breakthrough=!0}soathE(t){const r=this.saboof;return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:r,hlt:r,brt:!0})}get saboof(){return this.lValN([2,6,15])}shgrC(){this.faction="N",this.rarity="L",this.name="Shallow Grave",this.isFree=this.level===3,this.playTarg.level=a.target.levelMatchTarget(this.level+1),this.text=`Give a ${a.log.levelGateText(this.level+1,!0)}friendly creature "Vengeance: Spawn this" this turn.`}shgrZ(t){const r=a.genId(a.state.getActivePlayerB()),e=t.addTrigger("VN",this.code);e.customCode=r;const s=t.addTrigger("PT",this.code);s.customCode=r,t.hints.push("LZ")}shgrE(t){return d.actionEval(t,"ST","LZ")}sinC(){this.faction="U",this.rarity="C",this.name="Strength In Numbers",this.text=`Give a creature ${a.log.buffText(this.level,this.level)} for each friendly creature.`}sinZ(t){const r=this.level*a.field.qFriendCreats().length;t.buff(r,r)}sinE(t){const r=this.level*a.field.qFriendCreats().length;return d.actionEvalBuffN(t,t.playerA,t.lane,r,r)}get snbboof(){return-1*(this.level+7)}snbC(){this.faction="A",this.rarity="C",this.name="Sonic Burst",this.text=`Give a creature ${a.log.buffText(this.snbboof,0)}.`}snbZ(t){t.buff(this.snbboof,0)}snbE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,this.snbboof)}sharvC(){this.faction="N",this.rarity="H",this.name="Soul Harvest";const t=this.lValS(["an additional level 1 card","an additional card","two additional cards"]);this.text=`Destroy a friendly creature. You may play ${t} this turn.`,this.playTarg.player="F"}sharvZ(t){if(a.death.destroy(t,this.code),this.level===1){const r=d.freeCard();r.condition.level=a.target.levelMatchTarget(1),a.state.gs.turn.freeCards.push(r)}else a.state.gs.turn.regularPlays+=this.level-1}sharvE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane,["FRC","SD"])}sttorC(){this.faction="N",this.rarity="R",this.name="Spirit Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Regenerate ${this.boof234}.`,this.playTarg.canRegen=!0}sttorZ(t){t.addRegen(this.boof234)}sttorE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{rgn:this.boof234})}sptorC(){this.faction="U",this.rarity="R",this.name="Spore Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.text=`Give a creature Poison ${this.boof234}.`}sptorZ(t){t.addPoison(this.boof234)}sptorE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{psn:this.boof234})}stbrnC(){this.faction="T",this.rarity="R",this.name="Stone Brand";const t=this.boof579;this.text=`Give a creature with Defender ${a.log.buffText(t,t,!0)} and Negate Defender from it.`,this.playTarg.hasDefender=!0}stbrnZ(t){const r=this.boof579;t.buff(r,r),t.negateDefender=!0}stbrnE(t){const r=this.boof579;return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:r,hlt:r,noD:!0})}tpactC(){this.faction="N",this.rarity="C",this.name="Tarsian Pact";const t=this.boof235;this.text=`Give a Nekrium creature ${a.log.buffText(t,t,!0)} and Regenerate ${t}.`,this.playTarg.faction="N"}tpactZ(t){const r=this.boof235;t.buff(r,r),t.addRegen(r)}tpactE(t){const r=this.boof235;return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:r,hlt:r,rgn:r})}tugC(){this.faction="A",this.rarity="R",this.name="Tech Upgrade",this.playTarg.tribe="RB",this.text=`Give a Robot ${a.log.buffText(this.boof4612,0)} and Armor ${this.boof236}.`}tugZ(t){t.addArmor(this.boof236),t.buff(this.boof4612,0)}tugE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{att:this.boof4612,arm:this.boof236})}blightC(){this.faction="N",this.rarity="R",this.name="Touch Of Blight",this.text=`Give a creature "When this creature ${a.log.dbdtac(this.level)}, destroy that creature."`}blightZ(t){t.changed=!0,t.addTrigger("DM",this.code),t.hints.push("BX")}blightE(t){return d.actionEval(t,"ST","BX")}get tspois(){return this.lValN([5,7,12])}sporeC(){this.faction="U",this.rarity="C",this.name="Toxic Spores",this.text=`Give a creature Poison ${this.tspois}.`}sporeZ(t){t.addPoison(this.tspois)}sporeE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{psn:this.tspois})}tremcC(){this.faction="T",this.rarity="C",this.name="Tremorcharge",this.text=`Give a Tempys creature ${a.log.buffText(0,this.boof4812)} and Mobility ${this.level}.`,this.playTarg.faction="T"}tremcZ(t){t.buff(0,this.boof4812),t.addMobility(this.level)}tremcE(t){return d.actionEvalBuffN(t,t.playerA,t.lane,void 0,this.boof4812,"GM")}uboltC(){this.faction="T",this.rarity="R",this.name="Uranti Bolt",this.text=`Deal ${this.ubzap} damage to a creature. It gets Defender until the end of the next turn.`}uboltZ(t){t.hurtDirect(this.ubzap,this.code);const r=d.mod("DF",!0,this.code);r.expiry="EN",t.addMod(r)}uboltE(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:this.ubzap,def:!0})}get ubzap(){return this.lValN([3,10,20])}vgraC(){this.faction="U",this.rarity="C",this.name="Verdant Grace",this.playTarg.player="F",this.text=`Heal ${this.boof101520} damage from a friendly creature and ${this.boof246} health from each other friendly creature.`}vgraZ(t){t.heal(this.boof101520);const r=this.boof246;a.field.creatByTarget(d.crFriendNotMeTarg(t.id)).forEach(e=>{e.heal(r)})}vgraE(t){const r=this.boof246,e=a.field.creatByFSA(t),s=d.actionEvalBuffC(t,e,0,this.boof101520),c=a.field.creatByTarget(d.crFriendNotMeTarg(e.id)).map(u=>{const m=d.evalVectorMod(u.owner,u.lane);return m.health=r,m});return s.vectors.push(...c),s}vembC(){this.faction="N",this.rarity="C",this.name="Vyric's Embrace";const t=this.boof468,r=t*-1;this.text=`Give a creature ${a.log.buffText(r,r)}. You gain ${t} health.`}vembZ(t){const r=this.boof468,e=-r;t.buff(e,e),a.player.healPlayer(a.state.getActivePlayer(),r)}vembE(t){const r=this.boof468,e=-r,s=d.actionEvalBuffN(t,t.playerA,t.lane,e,e);return s.vectors.push(d.evalVectorPlayerLife(a.state.getActivePlayerB(),r)),s}warC(){this.faction="A",this.rarity="H",this.name="Warmonger Mod";let t=this.level,r=3;this.level===1&&(this.playTarg.level="LN",r=2,t=2),this.text=`Give a ${a.log.levelGateText(r,!0)}creature ${t}x attack.`}warZ(t){const r=this.level===3?2:1;t.buff(t.attack*r,0)}warE(t){const r=this.level===3?2:1;return d.actionEvalBuffN(t,t.playerA,t.lane,Ft+r)}xwillC(){this.faction="N",this.rarity="H",this.name="Xrath's Will";const t=this.boof3612;this.text=`Destroy an enemy creature with ${t} or less attack. You may play and additional Zombie this turn.`,this.playTarg.player="E",this.playTarg.maxAttack=t}xwillZ(t){a.death.destroy(t,this.code);const r=d.freeCard();r.condition.tribe="ZB",a.state.gs.turn.freeCards.push(r)}xwillE(t){return d.actionEvalDestroyN(t,t.playerA,t.lane,"FRZ")}}class $e extends J{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Dissolve",this.isFree=this.level===3,this.text=`Double the Poison on ${this.level===1?"an":"each"} enemy creature.`}playTargets(){const t=super.playTargets(),r=this.poisTarg();return this.level===1?t.push(r):a.field.creatByTarget(r).length>0&&t.push(a.target.boardTarget("CARD",this.code)),t}handleAction(t){if(this.logSpell(),this.level===1){const r=a.field.creatByFSA(t);r.addPoison(r.poison)}else a.field.creatByTarget(this.poisTarg()).forEach(e=>{e.addPoison(e.poison)});a.turn.spellCast()}poisTarg(){const t=d.crEnemyActTarg("CARD",this.code);return t.hasPoison=!0,t}evaluateAction(t){const r=Ft+1,e=d.actionEval(t,"ST"),s=!a.state.getActivePlayerB();let c;return t.zone==="R"?c=a.field.laneIdx:c=[t.lane],e.vectors=c.map(u=>d.evalVectorMod(s,u,{psn:r})),e}}class Ie extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Echowisp",this.initAttack=this.lValN([7,8,10]),this.initHealth=this.boof135,this.tribe.push("ST"),this.level===3?(this.text="Forge: Put a copy of Echowisp into each available space.",this.hints=["EML"]):(this.text="Forge: You may put a copy of Echowisp into an adjacent space.",this.hints=["EMA"])}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("FR",this.code);return s.interactive=this.level<3,e}resolveTrigger(t){const r=d.actionTarget("TF","CARD",this.code,t.trigger.creatId);if(r.player="F",r.field="E",this.level<3){const s=a.field.creatById(t.trigger.creatId);r.lanes=s.adjacent}let e=a.target.toActions(r);if(e.length>0)if(this.level<3)a.action.setupActions([a.action.noneEndTrigger(),...e]);else{const s=Date.now();e.forEach(c=>a.field.birthCreature(this.code,"P",c.playerA,c.lane,s)),a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){a.field.birthCreature(this.code,"P",t.playerA,t.lane),a.action.actionDone(!0)}evaluateAction(t){return d.actionEvalReplace(t,t.playerA,t.lane,this.code)}}class Ve extends x{lookup(t){return{["TVG"]:{c:()=>this.tvgC(),m:e=>this.tvgM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}armThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("AR",this.code);return s.area="A",e}enforceEffect(t,r){this.armThreshold<=r.armor?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}tvgC(){this.faction="A",this.rarity="R",this.name="Tower Vanguard",this.initAttack=this.lValN([3,6,11]),this.initHealth=this.lValN([7,13,21]),this.tribe.push("RB"),this.hints=["LKA"],this.armThreshold=1;const t=this.boof247;this.text=`While ${this.name} has Armor, it gets ${a.log.buffText(t,0)}.`,this.bonus={play:this.boardFormula(0,t,t,0)}}tvgM(t){return[d.mod("AT",this.boof247,t.id)]}}class Yt extends x{lookup(t){return{["CIN"]:{c:()=>this.cyinC(),m:e=>this.cyinM(e)},["HWM"]:{c:()=>this.hlwmC(),m:e=>this.hlwmM(e)},["LSP"]:{c:()=>this.lspC(),m:e=>this.lspM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}attThreshold=0;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=["ATH"]}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("AT",this.code);return s.area="A",e}enforceEffect(t,r){this.attThreshold<=r.attack?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}cyinC(){this.faction="A",this.rarity="R",this.name="Cypien Infiltrator",this.initAttack=this.boof61117,this.initHealth=this.initAttack-1,this.tribe.push("HM"),this.attThreshold=this.lValN([7,14,21]),this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Breakthrough.`}cyinM(t){return[d.mod("BT",!0,t.id)]}hlwmC(){this.faction="A",this.rarity="L",this.name="Hinterland Watchman",this.initAttack=this.lValN([4,7,15]),this.initHealth=this.lValN([7,10,20]),this.tribe.push("MC"),this.attThreshold=this.boof51020;const t=this.lValS(["Mobility 3","Armor 5 and Mobility 3","Armor 5, Breakthrough, Aggressive, Mobility 3, and Regenerate 5"]);this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets ${t}.`,this.bonus={exist:this.boardFormula(0,this.lValN([1,9,17]),0,0)*2}}hlwmM(t){const r=[d.mod("MB",3,t.id)];return this.level>1&&r.push(d.mod("AR",5,t.id)),this.level===3&&(r.push(d.mod("BT",!0,t.id)),r.push(d.mod("AG",!0,t.id)),r.push(d.mod("RG",5,t.id))),r}lspC(){this.faction="A",this.rarity="C",this.name="Lightshield Patrol",this.initAttack=this.lValN([4,7,15]),this.initHealth=this.boof51020,this.tribe.push("HM"),this.attThreshold=this.initHealth,this.text=`While ${this.name} has ${this.attThreshold} or more attack, it gets Armor ${this.boof234}.`}lspM(t){return[d.mod("AR",this.boof234,t.id)]}}class ae extends x{friendNotMe(t){const r=d.crNotMeTarg(t.id);return r.player=a.player.toTarget(t.owner),r}friendNone(t){const r=d.crTarg();return r.player=a.player.toTarget(t.owner),r.lanes=[],r}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforcementActive(t){return t.status==="A"}applyEffect(t,r,e){const s=this.friendNotMe(t),c=a.field.creatByTarget(s),u=a.field.creatByTarget(e);c.forEach(m=>{u.includes(m)?m.addModSafe(r):m.removeModSafe(t.id)})}}class qt extends ae{lookup(t){return{["HTR"]:{c:()=>this.hrtC(),m:e=>this.hrtM(e),t:e=>this.hrtT(e)},["KKK"]:{c:()=>this.kkkC(),m:e=>this.kkkM(e),t:e=>this.kkkT(e)},["XDV"]:{c:()=>this.xdvC(),m:e=>this.xdvM(e),t:e=>this.xdvT(e)}}[t]}createMod(t,r){return this.lookup(t).m(r)}effTargs(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}enforceEffect(t,r){const e=this.cardCode(),s=this.createMod(e,r),c=this.enforcementActive(r)?this.effTargs(e,r):this.friendNone(r);this.applyEffect(r,s,c)}hrtC(){this.faction="U",this.rarity="L",this.name="Heart Tree",this.initAttack=0,this.initHealth=this.lValN([10,15,30]),this.initRegen=this.boof246,this.initDefend=!0,this.tribe.push("PL"),this.hints=["FRS"],this.text=`Each other friendly creature gets Regenerate ${this.initRegen}.`,this.bonus={exist:this.boardFormula(0,this.initRegen,0,0)*2}}hrtM(t){return d.mod("RG",this.initRegen,t.id)}hrtT(t){return this.friendNotMe(t)}kkkC(){if(this.faction="T",this.rarity="L",this.name="Korok, Khan of Kadras",this.initAttack=this.lValN([4,7,12,18]),this.initHealth=this.lValN([7,12,18,26]),this.initAggro=!0,this.tribe.push("FB"),this.maxLevel=4,this.level>1){const t=this.lValS(["","friendly level 1","friendly level 2 or lower","other friendly"]);this.text=`Each ${t} creature gets Aggressive.`,this.hints=["FRS"],this.bonus={exist:(this.level-1)*.5}}}kkkM(t){return d.mod("AG",!0,t.id)}kkkT(t){const r=this.friendNotMe(t);return this.level===1?r.lanes=[]:r.level=a.target.levelMatchTarget(this.level-1),r}xdvC(){this.faction="N",this.rarity="H",this.name="Xrath, Dreadnight Of Varna",this.initAttack=this.boof5914,this.initHealth=this.initAttack+1,this.initRegen=this.boof248,this.tribe.push("ZB"),this.text=`Each other friendly Zombie gets Regenerate ${this.initRegen}`,this.bonus={exist:this.boardFormula(0,this.initRegen,0,0)}}xdvM(t){return d.mod("RG",this.initRegen,t.id)}xdvT(t){const r=this.friendNotMe(t);return r.tribe="ZB",r}}class Ue extends x{lookup(t){return{["AHL"]:{c:()=>this.ahlC(),m:e=>this.ahlM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforceEffect(t,r){const e=d.crNotMeTarg(r.id);e.player=a.player.toTarget(r.owner),a.field.creatByTarget(e).length===0?this.createMods(this.cardCode(),r).forEach(c=>{r.addModSafe(c)}):r.removeModSafe(r.id)}ahlC(){this.faction="A",this.rarity="H",this.name="Alloyin Highlander",this.initAttack=this.lValN([5,7,10]),this.initHealth=this.boof6914,this.tribe.push("HM"),this.text=`While ${this.name} is your only friendly creature, it gets ${a.log.buffText(this.boof4812,0)} and Armor ${this.boof248}.`}ahlM(t){return[d.mod("AT",this.boof4812,t.id),d.mod("AR",this.boof248,t.id)]}}class se extends x{lookup(t){return{["NXP"]:{c:()=>this.nxpC(),m:e=>this.nxpM(e)},["SKG"]:{c:()=>this.skgC(),m:e=>this.skgM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=["NX"]}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("PS",this.code);return s.area="C",e}enforceEffect(t,r){r.lane===3?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}nxpC(){this.faction="A",this.rarity="C",this.name="Nexus Pilot",this.initAttack=this.boof358,this.initHealth=this.boof4710,this.tribe.push("HM"),this.text=`While ${this.name} is in the center space, it gets ${a.log.buffText(this.initAttack,this.initHealth)}.`,this.bonus={play:this.boardFormula(0,this.initAttack+this.initHealth,this.initAttack,0)}}nxpM(t){return[d.mod("AT",this.initAttack,t.id),d.mod("HL",this.initHealth,t.id),d.mod("MH",this.initHealth,t.id)]}skgC(){this.faction="A",this.rarity="C",this.name="Skyknight Glider",this.initAttack=this.boof5916,this.initHealth=this.initAttack+1,this.tribe.push("HM"),this.text=`While ${this.name} is in the center space, it gets Mobility 2.`}skgM(t){return[d.mod("MB",2,t.id)]}}class Xt extends x{lookup(t){return{["CCT"]:{c:()=>this.cctC(),m:e=>this.cctM(e)},["GHB"]:{c:()=>this.ghbC(),m:e=>this.ghbM(e)},["PYG"]:{c:()=>this.pygC(),m:e=>this.pygM(e)}}[t]}createMods(t,r){return this.lookup(t).m(r)}likesOpposed=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=[this.likesOpposed?"OP":"OL"]}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("PS",this.code);return s.area="A",e}enforceEffect(t,r){!!r.opposed===this.likesOpposed?this.createMods(this.cardCode(),r).forEach(e=>{r.addModSafe(e)}):r.removeModSafe(r.id)}cctC(){this.faction="T",this.rarity="R",this.name="Cloudcleaver Titan",this.initAttack=this.boof4812,this.initHealth=this.lValN([7,10,16]),this.tribe.push("WN","GT"),this.initMobile=this.level;const t=this.boof246;this.bonus={play:this.boardFormula(0,t,t,0)},this.text=`While ${this.name} is unopposed, it gets ${a.log.buffText(t,0)}.`}cctM(t){return[d.mod("AT",this.boof246,t.id)]}ghbC(){this.faction="U",this.rarity="R",this.name="Gemhide Basher",this.initAttack=this.lValN([5,10,16]),this.initHealth=this.lValN([3,7,10]),this.tribe.push("DN"),this.likesOpposed=!0,this.text=`While ${this.name} is opposed, it gets Aggressive.`}ghbM(t){return[d.mod("AG",!0,t.id)]}pygC(){this.faction="T",this.rarity="H",this.name="Pyre Giant",this.initAttack=this.boof468,this.initHealth=this.boof234,this.tribe.push("FR","GT"),this.initAggro=!0,this.bonus={play:this.boardFormula(0,this.initAttack,this.initAttack,0)},this.text=`While ${this.name} is unopposed, it gets ${a.log.buffText(this.initAttack,0)}.`}pygM(t){return[d.mod("AT",this.initAttack,t.id)]}}class $t extends ae{lookup(t){return{["ALG"]:{c:()=>this.algnC(),m:e=>this.algnM(e)},["ALS"]:{c:()=>this.alstC(),m:e=>this.alstM(e)},["BTN"]:{c:()=>this.btcC(),m:e=>this.btcM(e)},["NXT"]:{c:()=>this.ntcC(),m:e=>this.ntcM(e)}}[t]}createMod(t,r){return this.lookup(t).m(r)}constructor(t){super(t),this.lookup(this.cardCode()).c(),this.hints=this.nexus?["NX"]:["LJ"]}nexus=!1;enforcementActive(t){return super.enforcementActive(t)?this.nexus?t.lane===3:!0:!1}enforceEffect(t,r){const e=this.cardCode(),s=this.createMod(e,r);let c;this.enforcementActive(r)?(c=this.friendNotMe(r),this.nexus?c.lanes=[1,2,4,5]:c.lanes=r.adjacent):c=this.friendNone(r),this.applyEffect(r,s,c)}algnC(){this.faction="A",this.rarity="R",this.name="Alloyin General",this.initAttack=this.boof246,this.initHealth=this.boof81318,this.tribe.push("HM"),this.text=`Adjacent creatures gets ${a.log.buffText(this.initAttack,0)}.`,this.bonus={exist:this.boardFormula(0,this.initAttack,this.initAttack,0)}}algnM(t){return d.mod("AT",this.initAttack,t.id)}alstC(){this.faction="A",this.rarity="H",this.name="Alloyin Strategist",this.initAttack=this.boof4814,this.initHealth=this.initAttack+1,this.initMobile=this.level,this.tribe.push("HM");const t=this.boof246;this.text=`Adjacent creatures gets ${a.log.buffText(t,0)}.`,this.bonus={exist:this.boardFormula(0,t,t,0)}}alstM(t){return d.mod("AT",this.boof246,t.id)}btcC(){this.faction="A",this.rarity="H",this.name="Battle Techtician",this.initAttack=this.boof3714,this.initHealth=this.boof71117,this.tribe.push("HM"),this.nexus=!0;const t=this.boof248;this.text=`While ${this.name} is in the center space, each other friendly creature gets ${a.log.buffText(t,0)}.`,this.bonus={exist:this.boardFormula(0,t,t,0)*2}}btcM(t){return d.mod("AT",this.boof248,t.id)}ntcC(){this.faction="A",this.rarity="H",this.name="Nexus Techtician",this.initHealth=this.boof6916,this.initAttack=this.initHealth-3,this.tribe.push("HM"),this.nexus=!0;const t=this.boof235;this.text=`While ${this.name} is in the center space, each other friendly creature gets Armor ${this.boof235}.`,this.bonus={exist:this.boardFormula(0,t,0,0)*4}}ntcM(t){return d.mod("AR",this.boof235,t.id)}}class It extends x{cardConstruct(t){({["BWD"]:()=>this.bwdC(),["BTS"]:()=>this.btsC(),["ESC"]:()=>this.escarC(),["EHN"]:()=>this.ethhC()})[t]()}targAction(t){a.field.birthCreature(this.spawnCode,"P",t.playerA,t.lane)}adjacent=!1;optional=!1;spawnCode="";ftext="";allied="X";constructor(t){super(t),this.cardConstruct(this.cardCode());const r=a.log.forglied(this.allied);this.text=r+": "+this.ftext}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("FR",this.code);return s.interactive=!0,e}resolveTrigger(t){if(this.allied==="X"||a.turn.allied(this.allied)){const r=d.actionTarget("TF","CARD",this.code,t.trigger.creatId);if(r.player="F",r.field="E",this.adjacent){const s=a.field.creatById(t.trigger.creatId);r.lanes=s.adjacent}const e=a.target.toActions(r);e.length>0?(this.optional&&e.push(a.action.noneEndTrigger()),a.action.setupActions(e)):a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){this.targAction(t),a.action.actionDone(!0)}evaluateAction(t){return d.actionEvalReplace(t,t.playerA,t.lane,this.spawnCode)}bwdC(){this.faction="U",this.rarity="C",this.name="Branchweaver Druid",this.initAttack=1,this.initHealth=1,this.tribe.push("HM"),this.hints=["EMO"],this.spawnCode=`${"TFD"}${this.level}`,this.optional=!0;const t=this.boof5714;this.ftext=`You may put a ${t}/${t} ${N.minionName(3)} into another space.`}btsC(){this.faction="U",this.rarity="C",this.name="Brighttusk Sower",this.initAttack=this.lValN([6,8,10]),this.initHealth=this.initAttack,this.tribe.push("TK"),this.hints=["EMA"],this.spawnCode=N.minionCode(this.level),this.optional=!0,this.adjacent=!0;const t=N.minionBuff(this.level);this.ftext=`You may put a ${t}/${t} ${N.minionName(this.level)} into an adjacent space.`}escarC(){this.faction="A",this.rarity="H",this.name="Esperian Scarab",this.initAttack=this.lValN([3,4,7]),this.initHealth=this.boof5711,this.initArmor=this.boof135,this.tribe.push("RB"),this.allied="U",this.hints=["EMO","ALU"],this.spawnCode=this.code,this.optional=!0,this.ftext=`You may but a copy of ${this.name} another space.`}ethhC(){this.faction="U",this.rarity="C",this.name="Ether Hounds",this.initAttack=this.boof369,this.initHealth=this.initAttack,this.tribe.push("ST"),this.hints=["EMO"],this.spawnCode=this.code,this.ftext="Put a copy of this into an available space."}}class We extends x{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Esperian Steelplate",this.initAttack=this.boof369,this.initHealth=this.boof6916,this.tribe.push("IN"),this.hints=["ALA"],this.text=`Activate: Heal ${this.boof358} damage from each other friendly creature. Allied Alloyin: Armor ${this.boof247}.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e}canActivate(t){const r=d.crFriendNotMeTarg(t.id);return a.field.creatByTarget(r).length>0}startActivation(t){const r=this.boof358,e=d.crFriendNotMeTarg(t.id);a.field.creatByTarget(e).forEach(s=>{s.heal(r)}),t.endActivation()}resolveTrigger(t){a.turn.allied("A")&&a.field.creatById(t.creatId).addArmor(this.boof247),a.batch.triggerDone()}}class Oe extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Everflame Phoenix",this.initAttack=this.lValN([7,0,22]),this.initHealth=this.lValN([6,1,15]),this.tribe.push("PX"),this.initMobile=this.lValN([1,0,2]),this.level===2?(this.initDefend=!0,this.text=`When you gain a rank, replace ${this.name} with a level 3 ${this.name}.`,this.hints=["RH","LV"],this.bonus={exist:this.boardFormula(1,37,22,0)}):this.level===3&&(this.text=`Vengeance: Put a level 2 ${this.name} into this space.`,this.bonus={exist:this.boardFormula(1,1,0,0)})}generateCreature(t,r){const e=super.generateCreature(t,r);return this.level===2?e.addTrigger("RU",this.code):this.level===3&&e.addTrigger("VN",this.code),e}getsTriggered(t){return t.trigger.type==="RU"?t.event.playerA===t.ownerPlayerA:super.getsTriggered(t)}resolveTrigger(t){if(t.trigger.type==="RU"){const r=a.field.creatById(t.creatId);a.field.birthCreature(`${"EFP"}3`,"R",r.owner,r.lane)}else if(t.trigger.type==="VN"){const e=t.event.creature;a.field.birthCreature(`${"EFP"}2`,"P",e.owner,e.lane)}a.batch.triggerDone()}}class Ze extends J{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Frostshatter Strike";const r=this.boof4711;this.text=`Deal ${r} damage to an enemy creature. Give a friendly creature ${a.log.buffText(r,0)} this turn.`}playTargets(){const t=super.playTargets();return this.friends().length>0&&t.push(d.crEnemyActTarg("CARD",this.code,"P1")),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]),c=this.boof4711;s.hurtDirect(c,this.code);const u=d.mod("AT",c,this.code);u.expiry="ET",e.addMod(u),a.turn.spellCast()}}friends(t=""){const r=d.crFriendActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}getCardActions(t,r){const e=a.field.creatByFSA(t),s=this.friends(e.id);return s.push(a.action.cancelAction()),s}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=this.boof359,s=d.actionEvalBuffN(t,t.playerA,t.lane,e),c=a.field.creatById(r[1]);return s.vectors.push(d.evalVectorMod(c.owner,c.lane,{dmg:e})),s}}}class ze extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Glaceus, Tundra Tyrant",this.initAttack=this.boof5916,this.initHealth=this.initAttack+2,this.tribe.push("IC","EL"),this.hints=["TL"];const r=`Gain Rank: each enemy ${a.log.levelGateText(this.level,!0)}creature gets "When this is dealt damage, destroy it."`,e=this.level===3?"At the start of each turn, deal 1 damage to each enemy creature. ":"";this.text=e+r}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("RU",this.code),this.level===3&&e.addTrigger("TS",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;if(r.creatureTarg&&r.target.id===t.creatId)return!0}return t.trigger.type==="RU"||t.trigger.type==="TS"}resolveTrigger(t){if(t.trigger.type==="RU"){const r=d.crEnemyTarg();r.level=a.target.levelMatchTarget(this.level),a.field.creatByTarget(r).forEach(e=>{e.addTrigger("DM",this.code),e.hints.push("DD"),e.changed=!0})}else if(t.trigger.type==="TS"){const r=Date.now();a.field.qEnemyCreats().forEach(e=>{e.hurtDirect(1,this.code,r)})}else if(t.trigger.type==="DM"){const r=a.field.creatById(t.creatId);a.death.destroy(r,this.code),a.batch.triggerDone()}a.batch.triggerDone()}}class Ke extends J{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Grave Pact",this.isFree=this.level===3,this.text=`Destroy a friendly creature. Destroy an ${a.log.levelGateText(this.level+1,!0)}enemy creature.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]),c=Date.now();a.death.destroy(s,this.code,c),a.death.destroy(e,this.code,c),a.turn.spellCast()}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return r.level=a.target.levelMatchTarget(this.level+1),a.target.toActions(r)}getCardActions(t,r){const e=a.field.creatByFSA(t),s=this.enemyTargActions(e.id);return s.push(a.action.cancelAction()),s}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=a.field.creatById(r[1]),s=d.actionEvalDestroyC(t,e,"SD"),c=d.evalVectorMod(t.playerA,t.lane);return c.destroy=!0,s.vectors.push(c),s}}}class Ye extends J{constructor(t){super(t),this.faction="N",this.rarity="R",this.name="Hungering Strike";const r=this.boof359;this.text=`Give a friendly creature +${r} attack. Give an enemy creature −${r} attack.`}playTargets(){const t=super.playTargets();if(this.enemyTargActions().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]),c=this.boof359;s.buff(c,0),e.buff(-c,0),a.turn.spellCast()}}getCardActions(t,r){const e=a.field.creatByFSA(t),s=this.enemyTargActions(e.id);return s.push(a.action.cancelAction()),s}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=d.actionEval(t,"ST"),s=a.field.creatByFSA(t),c=a.field.creatById(r[1]),u=this.boof359;return e.vectors.push(d.evalVectorMod(s.owner,s.lane,{att:-u}),d.evalVectorMod(c.owner,c.lane,{att:u})),e}}enemyTargActions(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r)}}class qe extends x{constructor(t){super(t),this.faction="U",this.rarity="C",this.name="Hunting Pack",this.initAttack=this.boof3612,this.initHealth=this.boof248,this.tribe.push("WF"),this.hints=["EML"],this.text=`When ${this.name} enters play, you have a 50% chance to put a copy of ${this.name} into an available space.`}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("EF",this.code);return s.interactive=!0,e}handleAction(t){a.field.birthCreature(this.code,"P",t.playerA,t.lane),a.action.actionDone(!0)}getsTriggered(t){return t.trigger.type==="EF"&&t.event.creature.id===t.creatId}resolveTrigger(t){if(a.randInt(0,2)===1){const e=d.actionTarget("TF","CARD",this.code);e.player="F",e.field="E";const s=d.actionTarget("TB","NOTR",this.code),c=a.target.toActions([e,s]);c.length===1?a.batch.triggerDone():a.action.setupActions(c)}else a.batch.triggerDone()}evaluateAction(t){return d.actionEvalReplace(t,t.playerA,t.lane,this.code)}}class Xe extends x{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Leafkin Progenitor",this.initAttack=this.boof3711,this.initHealth=this.initAttack,this.tribe.push("PL"),this.level===3?(this.text=`Activate: Put a level 1 ${this.name} into an adjacent available space.`,this.bonus={exist:this.boardFormula(1,6,3,0)}):(this.text=`Activate: Replace this with a level ${this.level+1} ${this.name}.`,this.bonus={exist:this.boardFormula(0,12*this.level,6*this.level,0)})}canActivate(t){return this.level===3?a.action.emptyAdjacents(t).length>0:!0}startActivation(t){this.level===3?a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t)):(a.field.birthCreature(this.leafCode(this.level+1),"R",t.owner,t.lane),t.endActivation())}handleAction(t){const r=a.field.creatById(t.param);a.field.birthCreature(this.leafCode(1),"P",t.playerA,t.lane),r.endActivation()}getCardActions(t,r){const e=r??a.field.creatById(t.param),s=a.action.emptyAdjacents(e);return s.push(a.action.cancelAction()),s}evaluateAction(t){if(t.actionKey==="ACTV"){if(this.level===3)return d.actionEvalPassive(t);{const r=a.field.creatById(t.param),e=d.actionEvalReplace(t,r.owner,r.lane,this.leafCode(this.level+1));return e.hints=["RE"],e}}else{const r=t;return d.actionEvalReplace(t,r.playerA,r.lane,this.leafCode(1))}}leafCode(t){return`${"LKP"}${t}`}}class ne extends x{cardConstruct(t){({["AFO"]:()=>this.aetorC(),["TSM"]:()=>this.tsmithC()})[t]()}targAction(t,r,e){({["AFO"]:(c,u)=>this.doNossing(c,u),["TSM"]:(c,u)=>this.doNossing(c,u)})[t](r,e)}playTarg;optional=!1;ftext="";forgeLevels=[1,2,3,4];constructor(t){super(t),this.playTarg=d.lvlHandActTarg(this.code),this.cardConstruct(this.cardCode()),this.forgeLevels.includes(this.level)&&(this.text="Forge: "+this.ftext)}generateCreature(t,r){const e=super.generateCreature(t,r);if(this.forgeLevels.includes(this.level)){const s=e.addTrigger("FR",this.code);s.interactive=!0}return e}handleAction(t){a.turn.levelAndDiscard(t);const r=a.field.creatById(t.param);this.targAction(this.cardCode(),t,r),a.action.actionDone(!0)}resolveTrigger(t){const r=a.target.toActions(this.playTarg);r.length>0?(r.forEach(e=>{e.param=t.creatId}),this.optional&&r.push(a.action.noneEndTrigger()),a.action.setupActions(r)):a.batch.triggerDone()}doNossing(t,r){}evaluateAction(t){return d.actionEval(t,"DC")}aetorC(){this.faction="A",this.rarity="C",this.name="Aetherforge Oracle",this.initAttack=this.boof61218,this.initHealth=this.boof246,this.tribe.push("HM"),this.playTarg.card="S",this.ftext="You may discard and level up a spell.",this.bonus={play:.5}}tsmithC(){this.faction="A",this.rarity="C",this.name="Technosmith",this.initAttack=this.boof5915,this.initHealth=this.initAttack-1,this.tribe.push("HM"),this.ftext=`You may ${a.log.daluac()}.`,this.bonus={play:.5}}}class je extends J{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Lightning Spark",this.text=`Deal ${this.boof6812} damage to a creature or player.`}playTargets(){const t=super.playTargets();return t.push(d.crActTarg("CARD",this.code)),t.push(d.actionTarget("TP","CARD",this.code)),t}handleAction(t){this.logSpell();const r=this.boof6812;t.zone==="P"?a.player.hurtPlayerDirect(t.playerA,r,this.code):a.field.creatByFSA(t).hurtDirect(r,this.code),a.turn.spellCast()}evaluateAction(t){const r=this.boof6812,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r));else{const s=t;e.vectors.push(d.evalVectorMod(s.playerA,s.lane,{dmg:r}))}return e}}class Je extends J{constructor(t){super(t),this.faction="A",this.rarity="C",this.name="Metasight",this.maxLevel=2,this.isFree=this.level===2,this.text="Discard two cards and level them."}playTargets(){const t=super.playTargets();return t.push(this.targParty("P1")),t}handleAction(t){if(t.position0}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.field.creatById(t.param);a.field.birthCreature(r.code,"P",t.playerA,t.lane),r.endActivation()}getCardActions(t,r){const e=r??a.field.creatById(t.param),s=a.action.emptyAdjacents(e);return s.push(a.action.cancelAction()),s}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=t;return d.actionEvalReplace(t,r.playerA,r.lane,this.code)}}}class tr extends x{constructor(t){if(super(t),this.faction="U",this.rarity="L",this.name="Mimicwurm",this.initAttack=7,this.initHealth=this.initAttack,this.tribe.push("WR"),this.level>1){this.hints=[this.level===2?"EMO":"EML"];const r=this.level-1;this.bonus={play:this.boardFormula(r,14*r,7*r,0)}}this.text=this.lValS(["","Forge: You may put a level 1 Mimicwurm into another space.","Forge: You may put a level 2 Mimicwurm into another space. Then you may put a level 1 Mimicwurm into another space."])}generateCreature(t,r){const e=super.generateCreature(t,r);if(this.level>1){const s=e.addTrigger("FR",this.code);s.interactive=!0}return e}handleAction(t){a.deTil(t.param)[0]==="P1"?this.level===3?(this.wurmsign(2,t),a.action.setupActions(this.getCardActions(t))):(this.wurmsign(1,t),a.action.actionDone(!0)):(this.wurmsign(1,t),a.action.actionDone(!0))}resolveTrigger(t){a.action.setupActions(this.fieldActions("P1",[t.event.creature.lane]))}fieldActions(t,r){const e=d.actionTarget("TF","CARD",this.code,a.enTil(t,r[0]));e.player="F",e.lanes=a.field.laneIdx.filter(c=>!r.includes(c));const s=a.target.toActions(e);return s.push(a.action.noneEndTrigger()),s}wurmsign(t,r){a.field.birthCreature(this.wurmCode(t),"R",r.playerA,r.lane)}wurmCode(t){return`${"MMW"}${t}`}getCardActions(t,r){const e=a.deTil(t.param),s=[t.lane,parseInt(e[1])];return this.fieldActions("P2",s)}evaluateAction(t){const r=a.deTil(t.param),e=this.level===2||r[0]==="P2"?1:2,s=d.actionEvalReplace(t,t.playerA,t.lane,this.wurmCode(e));return s.final=e===1,s.hints=["RE"],s}}class er extends x{constructor(t){super(t),this.faction="N",this.rarity="T",this.name="Netherdrake",this.initAttack=this.boof4815,this.initHealth=this.initAttack,this.initMobile=this.lValN([0,0,1]),this.tribe.push("DG"),this.hints=["FK"],this.text=`When this enters play or moves into a lane, destroy the opposing ${a.log.levelGateText(this.level,!0)}creature.`}get image(){return this.rawImage(`${"NSH"}${this.level}`)}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FK",this.code),e.addTrigger("EF",this.code),e}getsTriggered(t){return t.trigger.type==="EF"&&t.event.creature.id===t.creatId}resolveTrigger(t){const e=t.event.creature.opposed;e&&a.target.levelTestCommon(e.level,this.level)&&a.death.destroy(e,this.code),a.batch.triggerDone()}}class rr extends J{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Omnomnom";const r=this.boof246,e=r*-1;this.text=`Give a friendly Zombie ${a.log.buffText(r,r,!0)}, and Regenerate ${r}. Then give an enemy non-Zombie ${a.log.buffText(e,e)}.`}playTargets(){const t=super.playTargets();if(this.nonZombies().length>0){const r=d.crFriendActTarg("CARD",this.code,"P1");r.tribe="ZB",t.push(r)}return t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]),c=this.boof246;s.buff(c,c),s.addRegen(c),e.buff(-c,-c),a.turn.spellCast()}}nonZombies(t=""){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P2",t));return a.target.toActions(r).filter(e=>{const s=e;return!a.field.creatByFSA(s).isTribe("ZB")})}getCardActions(t,r){if(t.actionKey==="CARD"){const e=a.field.creatByFSA(t),s=a.action.cancelAction(),c=this.nonZombies(e.id);return c.push(s),c}return super.getCardActions(t,r)}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=a.field.creatById(r[1]),s=this.boof246,c=d.actionEvalCreatStatsC(t,e,{att:s,hlt:s,rgn:s});return c.vectors.push(d.evalVectorMod(t.playerA,t.lane,{att:-s,hlt:-s})),c}}}class ir extends x{constructor(t){super(t),this.faction="A",this.rarity="H",this.name="Onyxium Allomancer",this.initAttack=this.boof248,this.initHealth=this.boof61016,this.tribe.push("HM"),this.hints=["ALN","OL"];const r=this.boof358;this.text=`Activate: Discard and level up a card. Allied Nekrium: Regenerate ${r}.`,this.bonus={exist:this.boardFormula(0,r,0,0,.5)}}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e}canActivate(t){return a.state.getPlayer(t.owner).hand.some(e=>a.cards.getCard(e).canLevel())}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.field.creatById(t.param);a.turn.levelAndDiscard(t),r.endActivation()}resolveTrigger(t){a.turn.allied("N")&&a.field.creatById(t.creatId).addRegen(this.boof358),a.batch.triggerDone()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.creatById(t.param),s=d.lvlHandActTarg(this.code,e.id);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}evaluateAction(t){return t.actionKey==="ACTV"?d.actionEvalPassive(t):d.actionEval(t,"DC")}}class ar extends x{constructor(t){super(t),this.faction="N",this.rarity="H",this.name="Onyxium Phantasm",this.initAttack=this.boof246,this.initHealth=this.lValN([9,12,19]),this.initRegen=this.boof124,this.tribe.push("ST"),this.text=`Allied Alloyin: Activate: Give a creature ${a.log.buffText(this.boof4812n,0)}`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e}canActivate(t){return t.hasMod(t.id)}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.field.creatById(t.param);a.field.creatByFSA(t).buff(this.boof4812n,0),r.endActivation()}resolveTrigger(t){if(a.turn.allied("A")){const r=a.field.creatById(t.creatId);r.addMod(d.mod("AL",!0,r.id)),r.changed=!0}a.batch.triggerDone()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.creatById(t.param),s=d.crActTarg("CARD",this.code,e.id),c=a.target.toActions(s);return c.push(a.action.cancelAction()),c}return super.getCardActions(t,r)}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=t;return d.actionEvalBuffN(t,r.playerA,r.lane,this.boof4812n)}}}class jt extends x{hitCreature;constructor(t,r){super(t),this.hitCreature=r}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("DM",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&r.creatureTarg===this.hitCreature&&r.creatureSrc&&r.source.id===t.creatId}return!1}}class sr extends jt{constructor(t){super(t,!1),this.faction="U",this.rarity="L",this.name="Oros, Deepwood's Chosen",this.initAttack=this.lValN([7,11,16,0]),this.initHealth=this.initAttack,this.initBT=!0,this.maxLevel=4,this.tribe.push("FB"),this.hints=["OL","LKV"];const r=`When Oros ${a.log.dbdtap()}, you gain that much health.`,e=this.level===4?"Oros gets +attack and +health equal to your health. ":"";this.text=e+r}generateCreature(t,r){const e=super.generateCreature(t,r);return this.level===4&&e.addEffect("PH",this.code),e}resolveTrigger(t){const r=t.event;a.player.healPlayer(t.ownerPlayerA,r.dmg),a.batch.triggerDone()}enforceEffect(t,r){const e=a.state.getPlayer(r.owner).health;r.status==="A"&&(r.removeModSafe(r.id),r.addModSafe(d.mod("HL",e,r.id)),r.addModSafe(d.mod("MH",e,r.id)),r.addModSafe(d.mod("AT",e,r.id)))}}class nr extends x{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Oxidon Spitter",this.initAttack=this.boof7914,this.initHealth=this.boof3510,this.tribe.push("DN"),this.l3=this.level===3,this.text=`Forge: Negate Armor from ${this.l3?"each":"an"} enemy creature.`}l3;generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("FR",this.code);return s.interactive=!this.l3,e}resolveTrigger(t){if(this.l3)a.field.creatByTarget(d.crEnemyTarg()).forEach(r=>{r.negateArmor=!0}),a.batch.triggerDone();else{const r=d.crEnemyActTarg("CARD",this.code),e=a.target.toActions(r);e.length>0?a.action.setupActions(e):a.batch.triggerDone()}}handleAction(t){const r=a.field.creatByFSA(t);r.negateArmor=!0,a.action.actionDone(!0)}evaluateAction(t){const r=a.field.creatByFSA(t);return d.actionEvalCreatStatsC(t,r,{arm:-r.armor})}}class Ht extends x{lookup(t){return{["AFS"]:{c:()=>this.afsC(),a:e=>this.afsA(e),t:e=>this.afsT(e),e:e=>this.afsE(e)},["DMW"]:{c:()=>this.drixC(),a:e=>this.drixA(e),t:e=>this.drixT(e),e:e=>this.drixE(e)},["FGG"]:{c:()=>this.fggC(),a:e=>this.fggA(e),t:e=>this.fggT(e),e:e=>this.fggE(e)},["GHS"]:{c:()=>this.mvpC(),a:e=>this.mvpA(e),t:e=>this.mvpT(e),e:e=>this.mvpE(e)},["OWW"]:{c:()=>this.owwC(),a:e=>this.owwA(e),t:e=>this.owwT(e),e:e=>this.owwE(e)},["UPM"]:{c:()=>this.upakC(),a:e=>this.upakA(e),t:e=>this.upakT(e),e:e=>this.upakE(e)},["WFM"]:{c:()=>this.wfmC(),a:e=>this.wfmA(e),t:e=>this.wfmT(e),e:e=>this.wfmE(e)}}[t]}runAct(t,r){this.lookup(t).a(r)}testAct(t,r){return this.lookup(t).t(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}canActivate(t){return this.testAct(this.cardCode(),t)}startActivation(t){this.runAct(this.cardCode(),t),t.endActivation()}evaluateAction(t){return this.lookup(this.cardCode()).e(t)}evalAfterPlayCards(t){return a.state.gs.turn.regularPlays>0||a.state.gs.turn.freeCards.length>0?d.actionEval(t,"NR"):d.actionEval(t,"ST")}afsC(){this.faction="A",this.rarity="L",this.name="Arcflight Squadron",this.initAttack=this.boof4710,this.initHealth=this.initAttack+2,this.tribe.push("RB"),this.hints=["OL"],this.text=`Activate: You may play an additional ${a.log.levelGateText(this.level,!0)}Robot this turn.`}afsT(t){return!0}afsA(t){const r=d.freeCard();r.condition.tribe="RB",r.condition.level=a.target.levelMatchTarget(this.level),a.state.gs.turn.freeCards.push(r)}afsE(t){return d.actionEval(t,"ST")}drixC(){this.faction="A",this.rarity="L",this.name="Drix, the Mindwelder",this.initAttack=this.boof3612,this.initHealth=this.lValN([6,12,21]),this.tribe.push("MM"),this.text=`Activate, discard your hand: Each friendly Metamind gets ${a.log.buffText(this.level,0)} for each card discarded this way.`}drixT(t){return a.state.getActivePlayer().hand.length>0}drixA(t){const r=a.state.getPlayer(t.owner),e=r.hand.length*this.level;r.discard.push(...r.hand),r.hand=[];const s=d.crFriendTarg();s.tribe="MM",a.field.creatByTarget(s).forEach(c=>{c.buff(e,0)})}drixE(t){return this.evalAfterPlayCards(t)}fggC(){this.faction="A",this.rarity="H",this.name="Forge Guardian Gamma",this.initAttack=this.boof4816,this.initHealth=this.initAttack,this.tribe.push("RB","GD");const t=this.boof255080;this.text=`Activate, destroy five friendly Robot Guardians: Put a ${t}/${t} Forge Guardian Omega into this space.`}fggT(t){return a.field.creatByTarget(this.fggTarg()).length===5}fggA(t){const r=t.lane,e=t.owner,s=Date.now();a.field.creatByTarget(this.fggTarg()).forEach(c=>a.death.destroy(c,this.code,s)),a.field.birthCreature(`${"FGO"}${this.level}`,"P",e,r)}fggTarg(){const t=d.crFriendTarg();return t.tribe="GD",t}fggE(t){const r=a.field.creatById(t.param),e=d.actionEvalReplace(t,r.owner,r.lane,`${"FGO"}${this.level}`);return e.hints=["RE"],e.bonus=100,e.type="ST",e}mvpC(){this.faction="U",this.rarity="C",this.name="Gemheart Sprout",this.initAttack=this.boof357,this.initHealth=this.initAttack+this.level,this.initDefend=!0,this.tribe.push("PL"),this.text=`Activate: You gain health equal to ${this.level}x the number of friendly creatures.`}mvpT(t){return!0}mvpA(t){const r=a.field.qFriendCreats().length;a.player.healPlayer(t.owner,r*this.level)}mvpE(t){return this.evalAfterPlayCards(t)}owwC(){this.faction="A",this.rarity="L",this.name="Oreian Warwalker",this.initAttack=this.boof359,this.initHealth=this.boof61018,this.tribe.push("RB"),this.text=`Activate: ${this.name} gets ${this.owwbuff+1}x attack.`}owwT(t){return!0}owwA(t){t.buff(t.attack*this.owwbuff,0)}get owwbuff(){return this.lValN([1,1,2])}owwE(t){return this.evalAfterPlayCards(t)}upakC(){this.faction="U",this.rarity="L",this.name="Uterra Packmaster",this.initAttack=this.boof6914,this.initHealth=this.initAttack,this.tribe.push("HM");const t=this.boof124;this.text=`Activate: each other friendly Uterra creature gets ${a.log.buffText(t,t)}.`}upakT(t){return a.field.creatByTarget(this.upakTarg(t.id)).length>0}upakA(t){const r=this.boof124;a.field.creatByTarget(this.upakTarg(t.id)).forEach(e=>{e.buff(r,r)})}upakTarg(t){const r=d.crFriendNotMeTarg(t);return r.faction="U",r}upakE(t){return this.evalAfterPlayCards(t)}wfmC(){this.faction="T",this.rarity="H",this.name="Wildfire Maiden",this.initAttack=this.boof4610,this.initHealth=this.boof5814,this.tribe.push("FR","AS"),this.text=`Activate, destroy ${this.name}: Deal damage equal to its attack to each enemy creature.`}wfmT(t){return!0}wfmA(t){const r=Date.now();a.field.creatByTarget(d.crEnemyTarg()).forEach(e=>{e.hurtDirect(t.attack,this.code,r)}),a.death.destroy(t,this.code)}wfmE(t){const r=a.field.creatById(t.param),e=d.actionEvalDestroyC(t,r),s=!r.owner;return e.vectors.push(...a.field.laneIdx.map(c=>d.evalVectorMod(s,c,{dmg:r.attack}))),e}}class gt extends x{lookup(t){return{["FSP"]:{c:()=>this.fspC(),t:(e,s)=>this.fspT(e,s),b:(e,s)=>this.fspB(e,s)},["OJC"]:{c:()=>this.ocarC(),t:(e,s)=>this.ocarT(e,s),b:(e,s)=>this.ocarB(e,s)},["RLW"]:{c:()=>this.restwandC(),t:(e,s)=>this.restwandT(e,s),b:(e,s)=>this.restwandB(e,s)},["SDR"]:{c:()=>this.spdryC(),t:(e,s)=>this.spdryT(e,s),b:(e,s)=>this.spdryB(e,s)},["TDW"]:{c:()=>this.tdwC(),t:(e,s)=>this.tdwT(e,s),b:(e,s)=>this.tdwB(e,s)},["UTR"]:{c:()=>this.urexC(),t:(e,s)=>this.urexT(e,s),b:(e,s)=>this.urexB(e,s)}}[t]}testBirth(t,r){return this.lookup(t).t(r,r.event)}actBirth(t,r){this.lookup(t).b(r,r.event)}iTrigger=!0;constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r);return this.iTrigger&&e.addTrigger("EF",this.code),e}getsTriggered(t){return t.event.code==="ENT"?this.testBirth(this.cardCode(),t):!1}resolveTrigger(t){this.actBirth(this.cardCode(),t),a.batch.triggerDone()}fspC(){if(this.faction="A",this.rarity="L",this.name="Flowsteel Prototype",this.initAttack=this.lValN([3,6,8]),this.initHealth=this.lValN([8,15,20]),this.tribe.push("SS"),this.hints=["P1"],this.iTrigger=this.level>1,this.iTrigger){const t=a.log.levelGateText(this.level-1);this.text=`When you Forge a ${t} creature, ${this.name} gets +attack equal to that creature's attack.`;const r=this.avgCreatureStats(this.level-1);this.bonus={exist:this.boardFormula(0,r[0],r[0],0)*.5}}}fspT(t,r){return!!(r.forged&&r.creature.owner===t.ownerPlayerA&&a.cards.getCard(r.creature.code).levelthis.agamC(),h:(e,s,c,u)=>this.agamH(e,s,c,u)},["BWK"]:{c:()=>this.blwalkC(),h:(e,s,c,u)=>this.blwalkH(e,s,c,u)},["CDT"]:{c:()=>this.cadtC(),h:(e,s,c,u)=>this.cadtH(e,s,c,u)},["GSC"]:{c:()=>this.gcobC(),h:(e,s,c,u)=>this.gcobH(e,s,c,u)},["IHA"]:{c:()=>this.ibhaC(),h:(e,s,c,u)=>this.ibhaH(e,s,c,u)},["SHS"]:{c:()=>this.shimfC(),h:(e,s,c,u)=>this.shimfH(e,s,c,u)}}[t]}cardConstruct(t){this.hints=["OP"],this.lookup(t).c()}creatHit(t,r,e,s,c){this.lookup(t).h(r,e,s,c)}constructor(t){super(t,!0),this.cardConstruct(this.cardCode())}resolveTrigger(t){const r=t.event,e=r.source,s=r.target;e?this.creatHit(this.cardCode(),t,r,e,s):a.log.add("ERROR couldnt find creature - "+this.name),a.batch.triggerDone()}agamC(){this.faction="T",this.rarity="L",this.name="Agamemnon",this.initAttack=this.boof4814,this.initHealth=this.lValN([8,12,18]),this.level>1&&(this.initMobile=1,this.initAggro=this.level===3),this.tribe.push("GT"),this.text=`When ${this.name} ${a.log.dbdtac()} on your turn, this battles again.`}agamH(t,r,e,s){t.ownerPlayerA===a.state.getActivePlayerB()&&(e.extraBattles+=1)}blwalkC(){this.faction="N",this.rarity="R",this.name="Blight Walker",this.initAttack=this.boof137,this.initHealth=this.lValN([5,10,17]),this.tribe.push("ZB"),this.text=`When ${this.name} ${a.log.dbdtac(this.level)}, destroy that creature.`,this.hints.push("BX")}blwalkH(t,r,e,s){s.status==="A"&&a.target.levelTestCommon(s.level,this.level)&&a.death.destroy(s,this.code)}poisonText(t){return`When ${this.name} ${a.log.dbdtac()}, give that creature gets Poison ${t}.`}cadtC(){this.faction="U",this.rarity="R",this.name="Cadaverous Thicket",this.initAttack=this.boof135,this.initHealth=this.lValN([7,12,22]),this.tribe.push("PL"),this.text=this.poisonText(this.initAttack)}cadtH(t,r,e,s){s.addPoison(this.initAttack)}gcobC(){this.faction="U",this.rarity="C",this.name="Ghostscale Cobra",this.initAttack=this.boof4610,this.initHealth=this.boof135,this.tribe.push("SN"),this.text=this.poisonText(this.initAttack)}gcobH(t,r,e,s){s.addPoison(this.initAttack)}ibhaC(){this.faction="A",this.rarity="L",this.name="Ironbeard, Hammer of Anvillon",this.initAttack=this.lValN([4,7,12,15]),this.initHealth=this.lValN([7,11,17,25]),this.initArmor=this.lValN([1,3,5,20]),this.tribe.push("FB"),this.maxLevel=4;const t=this.level===4?"'s attack gets reduced to 0":` gets ${a.log.buffText(this.boof246n,0)}`;this.text=`When Ironbeard ${a.log.dbdtac()}, that creature${t}, and moves to an available enemy space at random.`}ibhaH(t,r,e,s){const c=this.level===4?s.attack*-1:this.boof246n;s.buff(c,0);const u=a.field.emptyLanes(s.owner),m=u.length;m>0&&s.move(u[a.randInt(0,m)])}shimfC(){this.faction="U",this.rarity="R",this.name="Shimmerfang Serpent",this.initAttack=this.boof357,this.initHealth=this.boof61016,this.tribe.push("SN"),this.text=`When ${this.name} ${a.log.dbdtac()}, that creatures gets that much Poison.`,this.hints.push("ATH")}shimfH(t,r,e,s){s.addPoison(r.dmg)}}class kt extends jt{lookup(t){return{["ABR"]:{c:()=>this.ashbC(),h:(e,s,c)=>this.ashyH(e,s,c)},["AMY"]:{c:()=>this.ashmC(),h:(e,s,c)=>this.ashyH(e,s,c)},["CFB"]:{c:()=>this.cfbC(),h:(e,s,c)=>this.cfbH(e,s,c)},["EFM"]:{c:()=>this.efmC(),h:(e,s,c)=>this.efmH(e,s,c)},["FBC"]:{c:()=>this.fbcC(),h:(e,s,c)=>this.fbcH(e,s,c)},["RTS"]:{c:()=>this.rzstC(),h:(e,s,c)=>this.rzstH(e,s,c)},["SVH"]:{c:()=>this.strhyC(),h:(e,s,c)=>this.strhyH(e,s,c)},["URB"]:{c:()=>this.uridC(),h:(e,s,c)=>this.uridH(e,s,c)},["VES"]:{c:()=>this.veskC(),h:(e,s,c)=>this.veskH(e,s,c)}}[t]}cardConstruct(t){this.hints=["OP","LKV"],this.lookup(t).c()}creatHit(t,r,e,s){this.lookup(t).h(r,e,s)}bothTurns=!0;constructor(t){super(t,!1),this.cardConstruct(this.cardCode())}resolveTrigger(t){const r=t.event,e=r.source;e&&(this.bothTurns||e.owner===a.state.getActivePlayerB())?this.creatHit(this.cardCode(),t,r,e):a.log.add("ERROR couldnt find creature - "+this.name),a.batch.triggerDone()}ashyC(){this.faction="T",this.rarity="C",this.tribe.push("FR","AS");const t=this.boof124;this.text=`When ${this.name} ${a.log.dbdtap()}, it gets ${a.log.buffText(t,t)}.`}ashyH(t,r,e){const s=this.boof124;e.buff(s,s)}ashbC(){this.name="Ashurian Brawler",this.initAttack=this.boof7911,this.initHealth=this.initAttack,this.ashyC()}ashmC(){this.name="Ashurian Mystic",this.initAttack=this.boof3610,this.initHealth=this.boof5812,this.initAggro=!0,this.ashyC()}cfbC(){this.faction="T",this.rarity="H",this.name="Cinderfist Brawler",this.initAttack=this.boof71014,this.initHealth=this.boof357,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${a.log.dbdtap()}, deal that much damage to that player again.`}cfbH(t,r,e){a.player.hurtPlayerDirect(!e.owner,r.dmg,e.code)}efmC(){this.faction="T",this.rarity="L",this.name="Everflame Mystic",this.initAttack=this.boof5813,this.initHealth=this.initAttack+1,this.tribe.push("FR","AS"),this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, you may play ${this.lValS(["one","two","three"])} spells this turn.`}efmH(t,r,e){if(a.state.getActivePlayerB()===e.owner)for(let s=0;sc.hurtDirect(r.dmg,this.code,s))}rzstC(){this.faction="T",this.rarity="C",this.name="Razortooth Stalker",this.initAttack=this.boof4812,this.initHealth=this.initAttack+1,this.initMobile=1,this.tribe.push("DN");const t=this.boof235;this.text=`When ${this.name} ${a.log.dbdtap()}, it gets ${a.log.buffText(t,t)}.`}rzstH(t,r,e){const s=this.boof235;e.buff(s,s)}strhyC(){this.faction="U",this.rarity="C",this.name="Stranglevine Hydra",this.initAttack=this.boof5815,this.initHealth=this.initAttack+1,this.tribe.push("HY"),this.text=`When ${this.name} ${a.log.dbdtap()}, it gets Regenerate ${this.level}.`}strhyH(t,r,e){e.addRegen(this.level)}uridC(){this.faction="U",this.rarity="L",this.name="Uterradon Ridgeback",this.initAttack=this.boof71117,this.initHealth=this.boof4713,this.initBT=!0,this.tribe.push("DN"),this.hints.push("FRS"),this.bothTurns=!1;const t=this.boof124;this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, each friendly creature gets ${a.log.buffText(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}uridH(t,r,e){const s=this.boof124,c=this.level===3;a.field.qFriendCreats().forEach(u=>{u.buff(s,s),c&&(u.breakthrough=!0)})}veskC(){this.faction="N",this.rarity="L",this.name="Vyric Ebonskull",this.initAttack=this.boof3713,this.initHealth=this.boof71117,this.tribe.push("VP"),this.text=`When Vyric ${a.log.dbdtap()}, destroy an enemy ${a.log.levelGateText(this.level,!0)} creature at random.${this.level===3?" Then Spawn a copy of that creature.":""}`}veskH(t,r,e){const s=d.crTarg();s.player=a.player.toTarget(r.target),s.level=a.target.levelMatchTarget(this.level);const c=a.field.creatByTarget(s);if(c.length>0){const u=Date.now(),m=c[a.randInt(0,c.length)];a.death.destroy(m,this.code,u),this.level===3&&a.field.birthCreature(m.code,"S",e.owner,void 0,u)}}}class mt extends x{lookup(t){return{["DFB"]:{c:()=>this.dfbC(),d:e=>this.dfbD(e)},["GGD"]:{c:()=>this.ggdC(),d:e=>this.ggdD(e)},["GGP"]:{c:()=>this.ggpC(),d:e=>this.ggpD(e)},["NGT"]:{c:()=>this.ngauntC(),d:e=>this.ngauntD(e)},["SRH"]:{c:()=>this.sharvC(),d:e=>this.sharvD(e)},["YNS"]:{c:()=>this.yuruC(),d:e=>this.yuruD(e)}}[t]}creatDied(t,r){this.lookup(t).d(r)}constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("DS",this.code),e}getsTriggered(t){return t.trigger.type==="DS"}resolveTrigger(t){this.creatDied(this.cardCode(),t),a.batch.triggerDone()}dfbC(){this.faction="N",this.rarity="R",this.name="Dr. Frankenbaum",this.initAttack=this.boof6914,this.initHealth=this.initAttack-1,this.tribe.push("AB");const t=this.boof234;this.text=`When a friendly Abomination is destroyed, deal ${t} damage to the enemy player.`,this.bonus={exist:this.boardFormula(0,0,0,t*2)}}dfbD(t){const r=a.field.creatById(t.creatId),s=t.event.creature;(r.id===s.id||s.owner===r.owner&&s.isTribe("AB")&&mt.itDiedFirst(s.id,r.id))&&a.player.hurtPlayerDirect(!r.owner,this.boof234,this.code)}ggdC(){this.faction="N",this.rarity="L",this.name="Grimgaunt Devourer",this.initAttack=this.boof579,this.initHealth=this.initAttack-2,this.tribe.push("GG"),this.hints=["OL"],this.text=`When a creature is destroyed, ${this.name} gets ${a.log.buffText(this.level,this.level)}.`,this.bonus={exist:this.boardFormula(0,this.level*2,this.level,0)*2}}ggdD(t){a.field.creatById(t.creatId).buff(this.level,this.level)}ggpC(){this.faction="N",this.rarity="H",this.name="Grimgaunt Predator",this.initAttack=this.boof5914,this.initHealth=this.initAttack,this.initMobile=1,this.tribe.push("GG"),this.hints=["OP"];const t=this.boof246;this.text=`When the opposing creature is destroyed, ${this.name} gets ${a.log.buffText(t,t)}.`,this.bonus={exist:this.boardFormula(0,2*t,t,0)}}ggpD(t){const r=a.field.creatById(t.creatId),e=a.field.oppositeLane(r.lane),s=t.event;if(s.creature.owner!==r.owner&&s.creature.lane===e){const c=this.boof246;r.buff(c,c)}}ngauntC(){this.faction="N",this.rarity="R",this.name="Nightgaunt",this.initAttack=this.boof4815,this.initHealth=this.initAttack+1,this.tribe.push("GG"),this.text=`When a creature is destroyed, ${this.name} gets Regenerate 1.`,this.bonus={exist:this.boardFormula(0,4,0,0)}}ngauntD(t){a.field.creatById(t.creatId).addRegen(1)}sharvC(){this.faction="N",this.rarity="C",this.name="Sorrow Harvester",this.initAttack=this.boof4814,this.initHealth=this.initAttack+2,this.tribe.push("AB"),this.text="When a friendly Abomination is destroyed on your turn, draw a card.",this.bonus={exist:.25}}sharvD(t){const e=t.event.creature;e.owner===t.ownerPlayerA&&e.isTribe("AB")&&a.state.getActivePlayerB()===t.ownerPlayerA&&mt.itDiedFirst(e.id,t.creatId)&&a.player.drawCard(t.ownerPlayerA,1)}yuruC(){this.faction="N",this.rarity="L",this.name="Yuru, the Necrosage",this.initAttack=3,this.initHealth=this.initAttack,this.initDefend=!0,this.tribe.push("HM"),this.hints=["LJ"];const t=this.boof5814;this.text=`When an adjacent non-Spirit creature is destroyed, put a ${t}/${t} Spirit into that space.`,this.bonus={exist:this.boardFormula(1,t*2,t,0)}}yuruD(t){const r=a.field.creatById(t.creatId),s=t.event.creature;s.owner===r.owner&&r.adjacent.includes(s.lane)&&!s.isTribe("ST")&&mt.itDiedFirst(s.id,r.id)&&a.field.birthCreature(`${"XYR"}${this.level}`,"P",r.owner,s.lane)}static itDiedFirst(t,r){if(t===r)return!0;let e=!1;const s=a.death.findDeathTime(r);if(a.isUn(s))e=!0;else{const c=a.death.findDeathTime(t);(a.isUn(c)||c<=s)&&(e=!0)}return e}}class B extends x{lookup(t){return{["AGK"]:{c:()=>this.agknitC(),f:e=>this.agknitF(e)},["BSS"]:{c:()=>this.bssC(),f:e=>this.bssF(e)},["BZD"]:{c:()=>this.bzdrC(),f:e=>this.bzdrF(e)},["BFM"]:{c:()=>this.bfmC(),f:e=>this.bfmF(e)},["CTI"]:{c:()=>this.charnC(),f:e=>this.charnF(e)},["CHH"]:{c:()=>this.chihC(),f:e=>this.chihF(e)},["CSW"]:{c:()=>this.chickenC(),f:e=>this.chickenF(e)},["DFR"]:{c:()=>this.dfrC(),f:e=>this.dfrF(e)},["DBA"]:{c:()=>this.dbaC(),f:e=>this.dbaF(e)},["DDD"]:{c:()=>this.dddC(),f:e=>this.dddF(e)},["EWT"]:{c:()=>this.espwrC(),f:e=>this.espwrF(e)},["FWT"]:{c:()=>this.fwtC(),f:e=>this.fwtF(e)},["GSW"]:{c:()=>this.gwurmC(),f:e=>this.gwurmF(e)},["GSS"]:{c:()=>this.gsC(),f:e=>this.gsF(e)},["IMA"]:{c:()=>this.iracoC(),f:e=>this.iracoF(e)},["LGT"]:{c:()=>this.legtitC(),f:e=>this.legtitF(e)},["LBD"]:{c:()=>this.lbdC(),f:e=>this.lbdF(e)},["LMV"]:{c:()=>this.lyrC(),f:e=>this.lyrF(e)},["MOE"]:{c:()=>this.moeC(),f:e=>this.moeF(e)},["MMA"]:{c:()=>this.mmaC(),f:e=>this.mmaF(e)},["NSY"]:{c:()=>this.nysymC(),f:e=>this.nysymF(e)},["OXM"]:{c:()=>this.onxmarC(),f:e=>this.onxmarF(e)},["OFM"]:{c:()=>this.ofmC(),f:e=>this.ofmF(e)},["OPK"]:{c:()=>this.orpC(),f:e=>this.orpF(e)},["PHM"]:{c:()=>this.phmC(),f:e=>this.phmF(e)},["PSM"]:{c:()=>this.palsC(),f:e=>this.palsF(e)},["SMD"]:{c:()=>this.scorchC(),f:e=>this.scorchF(e)},["SDN"]:{c:()=>this.souldrC(),f:e=>this.souldrF(e)},["SBD"]:{c:()=>this.sbdC(),f:e=>this.sbdF(e)},["SYL"]:{c:()=>this.lotusC(),f:e=>this.lotusF(e)},["TGI"]:{c:()=>this.tgiC(),f:e=>this.tgiF(e)},["UGL"]:{c:()=>this.umglidC(),f:e=>this.umglidF(e)},["UWL"]:{c:()=>this.uwarC(),f:e=>this.uwarF(e)},["UWS"]:{c:()=>this.ustokeC(),f:e=>this.ustokeF(e)},["UTM"]:{c:()=>this.umaulC(),f:e=>this.umaulF(e)},["VNS"]:{c:()=>this.vnsC(),f:e=>this.vnsF(e)},["WWP"]:{c:()=>this.wwpC(),f:e=>this.wwpF(e)},["WFB"]:{c:()=>this.wfbC(),f:e=>this.wfbF(e)}}[t]}cardForge(t,r){this.lookup(t).f(r)}ftext="";forges=!0;flanks=!1;allied="X";constructor(t){super(t),this.lookup(this.cardCode()).c();let r="";this.flanks&&(r="Flank"),this.forges&&(r?r="Forge/"+r:r=a.log.forglied(this.allied)),r&&(this.text=r+": "+this.ftext),this.ftext=""}generateCreature(t,r){const e=super.generateCreature(t,r);return this.forges&&e.addTrigger("FR",this.code),this.flanks&&e.addTrigger("FK",this.code),e}resolveTrigger(t){this.cardForge(this.cardCode(),t),a.batch.triggerDone()}agknitC(){this.faction="A",this.rarity="L",this.name="Aegis Knight",this.initAttack=this.boof5814,this.initHealth=this.initAttack,this.tribe.push("HM"),this.initArmor=this.lValN([1,2,5]),this.hints=["P2","OP"],this.bonus={play:this.boardFormula(0,this.initArmor*2,0,0)},this.ftext="Each friendly creature deals damage equal to its Armor to the opposing creature"}agknitF(t){const r=d.crFriendTarg();r.hasArmor=!0;const e=Date.now();a.field.creatByTarget(r).forEach(s=>{s.opposed&&s.opposed.hurtDirect(s.armor,s.code,e)})}bssC(){this.faction="A",this.rarity="L",this.name="Brightsteel Sentinal",this.initAttack=this.boof4914,this.initHealth=this.initAttack+1,this.tribe.push("RB"),this.hints=["P2","OP"];const t=this.boof51015;this.bonus={play:this.boardFormula(0,t*1.5,0,0)},this.ftext=`Each friendly Robot gets Armor ${t} this turn.`}bssF(t){const r=this.boof51015,e=d.crFriendTarg();e.tribe="RB",e.canArmor=!0,a.field.creatByTarget(e).forEach(c=>{const u=d.mod("AR",r,t.creatId);u.expiry="ET",c.addMod(u)})}bzdrC(){this.faction="N",this.rarity="R",this.name="Byzerak Drake",this.initAttack=this.boof4814,this.initHealth=this.initAttack+2,this.initRegen=this.level,this.allied="T",this.tribe.push("DG"),this.hints=["ALT"],this.ftext=`Mobility ${this.level}.`}bzdrF(t){a.turn.allied(this.allied)&&a.field.creatById(t.creatId).addMobility(this.level)}bfmC(){this.faction="N",this.rarity="H",this.name="Byzerak Frostmaiden",this.initAttack=this.boof135,this.initHealth=this.boof91420,this.tribe.push("HM"),this.hints=["ALT","OP","FH"],this.flanks=!0;const t=this.boof246;this.ftext=`If ${this.name} is opposed, the opposing creature gets ${a.log.buffText(-1*t,0)} and this gets ${a.log.buffText(t,0)}. Allied Tempys: Mobility ${this.level}.`;const r=this.boardFormula(0,t*2,t*2,0);this.bonus={play:r,exist:r/2}}bfmF(t){const e=t.event.creature;t.trigger.type==="FR"&&a.turn.allied("T")&&e.addMobility(this.level);const s=e.opposed;if(s){const c=this.boof246;s.buff(-1*c,0),e.buff(c,0)}}charnC(){this.faction="N",this.rarity="C",this.name="Charnel Titan",this.initAttack=this.boof359,this.initHealth=this.boof5814,this.tribe.push("AB");const t=this.boof357;this.ftext=`If there is an enemy creature with ${t} or less attack, ${this.name} gets ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,2*t,t,0)/2}}charnF(t){const r=this.boof357,e=d.crEnemyTarg();e.maxAttack=r,a.field.creatByTarget(e).length>0&&a.field.creatById(t.creatId).buff(r,r)}chihC(){this.faction="U",this.rarity="C",this.name="Chistlehearth Hunter",this.initAttack=this.lValN([2,6,11]),this.initHealth=this.boof81217,this.tribe.push("HM"),this.hints=["P2","FRF"],this.ftext=`${this.name} gets ${a.log.buffText(1,0)} for each other friendly creature.`,this.bonus={play:this.boardFormula(0,2,2,0)}}chihF(t){const r=a.field.qFriendCreats().length;r>1&&a.field.creatById(t.creatId).buff(r-1,0)}chickenC(){this.faction="T",this.rarity="L",this.name="Cindersmoke Wyvern",this.initAttack=this.boof3610,this.initHealth=this.lValN([7,12,17]),this.tribe.push("DG"),this.initMobile=this.boof124,this.hints=["FH"],this.forges=!1,this.flanks=!0,this.ftext="Deal damage equal to its attack to the opposing creature. If there is no opposing creature, deal that damage to the enemy player instead.",this.bonus={exist:this.boardFormula(0,this.initAttack,this.initAttack,0)}}chickenF(t){const r=t.event,e=r.creature.attack,s=r.creature.opposed;s?s.hurtDirect(e,this.code):a.player.hurtPlayerDirect(!t.ownerPlayerA,e,this.code)}dfrC(){this.faction="N",this.rarity="H",this.name="Darkfrost Reaper",this.initAttack=this.boof6916,this.initHealth=this.boof3713,this.tribe.push("SK"),this.ftext="Destroy each creature with 1 or less attack.",this.bonus={play:this.avgCreatureFormula()/5}}dfrF(t){const r=d.crTarg();r.maxAttack=1;const e=a.field.creatByTarget(r),s=Date.now();e.forEach(c=>{a.death.destroy(c,this.code,s)})}dbaC(){this.faction="U",this.rarity="H",this.name="Deepbranch Ancient",this.initAttack=this.boof4812,this.initHealth=this.initAttack,this.tribe.push("HY"),this.hints=["FRF"],this.ftext=`If there is a friendly creature in each space, ${this.name} gets ${a.log.buffText(this.initAttack,this.initHealth)}.`,this.bonus={play:this.boardFormula(0,this.initAttack*2,this.initAttack,0)/4}}dbaF(t){a.field.qFriendCreats().length===5&&a.field.creatById(t.creatId).buff(this.initAttack,this.initHealth)}dddC(){this.faction="N",this.rarity="L",this.name="Doomwing, Dire Drake",this.initAttack=this.boof61018,this.initHealth=this.lValN([2,6,10]),this.initMobile=this.level,this.tribe.push("DG"),this.hints=["FK"],this.forges=!1,this.flanks=!0,this.ftext=`Destroy the opposing ${a.log.levelGateText(this.level,!0)}creature.`,this.bonus={exist:this.avgCreatureFormula()/2}}dddF(t){const e=t.event.creature.opposed;e&&a.target.levelTestCommon(e.level,this.level)&&a.death.destroy(e,this.code)}espwrC(){this.faction="U",this.rarity="R",this.name="Esperian Wartusk",this.initAttack=this.boof5916,this.initHealth=this.initAttack-1,this.initBT=!0,this.allied="A",this.tribe.push("TK"),this.hints=["ALA"];const t=this.boof124;this.ftext=`Armor ${t}.`,this.bonus={play:this.boardFormula(0,t,0,0)}}espwrF(t){a.turn.allied(this.allied)&&a.field.creatById(t.creatId).addArmor(this.boof124)}fwtC(){this.faction="U",this.rarity="H",this.name="Frostwild Tracker",this.initAttack=this.boof4712,this.initHealth=this.boof248,this.tribe.push("TG"),this.forges=this.level>1;const t=this.level-1;this.ftext=`You may play an additional ${a.log.levelGateText(t)} creature this turn.`,this.level>1?this.bonus={play:this.avgCreatureFormula(t)}:this.hints=["LV"]}fwtF(t){const r=d.freeCard();r.condition.card="C",r.condition.level=a.target.levelMatchTarget(this.level-1),a.state.gs.turn.freeCards.push(r)}gwurmC(){this.faction="N",this.rarity="C",this.name="Gloomspire Wurm",this.initAttack=this.boof4813,this.initHealth=this.initAttack,this.tribe.push("WR"),this.hints=["ENN"],this.ftext=`If there are no enemy creatures, ${this.name} gets ${a.log.buffText(4,4)}.`}gwurmF(t){a.field.qEnemyCreats().length===0&&a.field.creatById(t.creatId).buff(4,4)}gsC(){this.faction="U",this.rarity="C",this.name="Glowstride Stag",this.initAttack=this.boof5812,this.initHealth=this.initAttack+this.level,this.tribe.push("ST");const t=this.boof51015;this.ftext=`You gain ${t} health.`,this.bonus={play:this.boardFormula(0,0,0,t)}}gsF(t){const r=this.boof51015;a.player.healPlayer(t.ownerPlayerA,r),a.log.add("Glowstride flexed for "+r)}iracoC(){this.faction="A",this.rarity="L",this.name="Ironmind Acolyte",this.initAttack=this.boof61015,this.initHealth=this.initAttack-2,this.tribe.push("GN"),this.hints=["P1"],this.ftext="If you have five or more cards in your hand, you may play an additional card this turn.",this.bonus={play:this.avgCreatureFormula()/5}}iracoF(t){a.player.toPlayer(t.ownerPlayerA).hand.length>4&&(a.state.gs.turn.regularPlays+=1)}legtitC(){this.faction="N",this.rarity="R",this.name="Legion Titan",this.initAttack=this.boof4812,this.initHealth=this.initAttack,this.tribe.push("ZB"),this.hints=["ENF"],this.ftext=`${this.name} gets ${a.log.buffText(this.level,this.level)} for each enemy creature with ${this.boof357} or less attack.`,this.bonus={play:this.boardFormula(0,this.level*2,this.level,0)/2}}legtitF(t){const r=d.crEnemyTarg();r.maxAttack=this.boof357;const e=a.field.creatByTarget(r);if(e.length>0){const s=this.level*e.length;a.field.creatById(t.creatId).buff(s,s)}}lbdC(){this.faction="U",this.rarity="H",this.name="Lifeblood Dryad",this.initAttack=this.lValN([4,7,9]),this.initHealth=this.initAttack,this.tribe.push("DY"),this.hints=["FRF"];const t=this.boof236;this.ftext=`If there is a friendly creature in each space, each other friendly creature gets ${a.log.buffText(t,t)}`,this.bonus={play:this.boardFormula(0,t*2,t,0)}}lbdF(t){const r=a.field.creatByTarget(d.crFriendNotMeTarg(t.creatId));if(r.length===4){const e=this.boof236;r.forEach(s=>s.buff(e,e))}}lyrC(){this.faction="N",this.rarity="L",this.name="Lyria, Muse of Varna",this.initAttack=this.boof5815,this.initHealth=this.boof4714,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=this.level===2?"Spawn a random creature that was destroyed this game.":"Put a random creature that was destroyed this game into each of your available spaces.",this.forges?(this.hints=["EML"],this.bonus={play:this.avgCreatureFormula(1)*(this.level-1)}):this.hints=["LV"]}lyrF(t){if(this.level===2){const r=a.death.gravedigger();r&&a.field.birthCreature(r,"S",t.ownerPlayerA)}else if(this.level===3){const r=a.field.emptyLanes(t.ownerPlayerA),e=r.map(s=>a.death.gravedigger());if(r.length>0&&e[0]){const s=Date.now();r.forEach((c,u)=>{a.field.birthCreature(e[u],"P",t.ownerPlayerA,c,s)})}}}moeC(){this.faction="T",this.rarity="H",this.name="Master of Elements",this.initAttack=this.boof5917,this.initHealth=this.initAttack,this.tribe.push("HM"),this.forges=this.level>1,this.ftext=`You may play an additional ${a.log.levelGateText(this.level-1)} spell this turn.`,this.forges&&(this.bonus={play:this.boardFormula(0,0,0,0,(this.level-1)/2)})}moeF(t){const r=d.freeCard();r.condition.card="S",r.condition.level=a.target.levelMatchTarget(this.level-1),a.state.gs.turn.freeCards.push(r)}mmaC(){this.faction="A",this.rarity="C",this.name="Metamind Adept",this.initAttack=this.boof5915,this.initHealth=this.boof4813,this.tribe.push("MM");const t=this.level===1?"":"s";this.ftext=`Draw ${this.level} card${t}.`,this.bonus={play:this.boardFormula(0,0,0,0,this.level/4)}}mmaF(t){a.player.drawCard(t.ownerPlayerA,this.level)}nysymC(){this.faction="N",this.rarity="C",this.name="Nyrali Symbiote",this.initAttack=this.boof51015,this.initHealth=this.initAttack,this.tribe.push("OZ"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets Regenerate ${t}.`,this.bonus={play:this.boardFormula(0,t,0,0)}}nysymF(t){const r=t.event;r.creature.opposed&&r.creature.addRegen(this.boof246)}ofmC(){this.faction="A",this.rarity="R",this.name="Oreian Fieldmarshal",this.initAttack=this.boof5914,this.initHealth=this.initAttack-2,this.tribe.push("HM"),this.hints=["FRS"];const t=this.boof135;this.ftext=`Each other friendly creature gets ${a.log.buffText(t,0)}.`,this.bonus={play:this.boardFormula(0,t*2,t*2,0)}}ofmF(t){const r=this.boof135;a.field.creatByTarget(d.crFriendNotMeTarg(t.creatId)).forEach(s=>{s.buff(r,0)})}orpC(){this.faction="A",this.rarity="R",this.name="Oreian Peacekeeper",this.initAttack=this.boof4816,this.initHealth=this.boof248,this.tribe.push("RB"),this.hints=["OP"],this.ftext=`${this.name} gets Armor ${this.initAttack} this turn.`,this.bonus={play:this.boardFormula(0,this.initAttack,0,0)}}orpF(t){const r=a.field.creatById(t.creatId),e=d.mod("AR",this.initAttack,t.creatId);e.expiry="ET",r.addMod(e)}onxmarC(){this.faction="A",this.rarity="R",this.name="Onyxium Marauder",this.initAttack=this.boof4714,this.initHealth=this.lValN([6,9,17]),this.initArmor=this.level,this.allied="N",this.tribe.push("HM"),this.hints=["ALN"],this.ftext=`Regenerate ${this.level}.`,this.bonus={play:this.boardFormula(0,this.level,0,0)}}onxmarF(t){a.turn.allied(this.allied)&&a.field.creatById(t.creatId).addRegen(this.level)}phmC(){this.faction="A",this.rarity="R",this.name="Palladium Hindermind",this.initAttack=this.boof2612,this.initHealth=this.boof61016,this.tribe.push("HM"),this.hints=["ENF"],this.ftext=`Each enemy creature gets ${a.log.buffText(this.boof123n,0)}.`;const t=this.level*2;this.bonus={play:this.boardFormula(0,t,t,0)}}phmF(t){const r=this.boof123n;a.field.qEnemyCreats().forEach(e=>{e.buff(r,0)})}palsC(){this.faction="A",this.rarity="L",this.name="Palladium Simulacrum",this.initAttack=this.boof4816,this.initHealth=this.boof248,this.initMobile=this.level-1,this.tribe.push("SS"),this.hints=["NX"],this.flanks=!0,this.ftext=`If ${this.name} is in the center space, Spawn a copy.`,this.bonus={play:this.boardFormula(1,this.initAttack+this.initHealth,this.initAttack,0)}}palsF(t){t.event.creature.lane===3&&a.field.birthCreature(this.code,"S",t.ownerPlayerA)}scorchC(){this.faction="T",this.rarity="L",this.name="Scorchmane Dragon",this.initAttack=this.lValN([0,12,24]),this.initHealth=this.boof61224,this.tribe.push("DG"),this.initDefend=this.level===1,this.initMobile=this.level-1,this.forges=this.level>1,this.ftext="Deal 5 damage to "+(this.level===2?"the opposing creature.":"each enemy creature and player."),this.level===1?this.hints=["LV"]:this.level===2?(this.hints=["OP"],this.bonus={play:this.boardFormula(0,5,0,0)}):this.bonus={play:this.boardFormula(0,10,0,5)}}scorchF(t){const r=t.event,e=!t.ownerPlayerA;if(this.level===2){const s=r.creature.opposed;s&&s.hurtDirect(5,this.code)}else if(this.level===3){const s=Date.now();a.field.qPlayerCreats(e).forEach(c=>c.hurtDirect(5,this.code,s)),a.player.hurtPlayerDirect(e,5,this.code)}}souldrC(){this.faction="N",this.rarity="L",this.name="Soul Drinker",this.initAttack=1,this.initHealth=this.boof4814,this.initMobile=this.level===3?1:0,this.tribe.push("VP"),this.hints=["OP"],this.flanks=this.level===3,this.ftext=`The opposing creature's attack gets reduced to 0 and ${this.name} gains that much attack.`;const t=this.avgCreatureStats()[0]*2;this.bonus={play:this.boardFormula(0,t,t,0)}}souldrF(t){const r=t.event,e=r.creature.opposed;if(e){const s=e.attack;r.creature.buff(s,0),e.buff(-1*s,0)}}sbdC(){this.faction="U",this.rarity="C",this.name="Spiritbloom Dryad",this.initAttack=this.boof6812,this.initHealth=this.initAttack+this.level,this.tribe.push("DY"),this.ftext=`Each player gains ${this.boof468} health.`}sbdF(t){const r=this.boof468;a.player.healPlayer(!0,r),a.player.healPlayer(!1,r)}lotusC(){this.faction="U",this.rarity="H",this.name="Stygian Lotus",this.initAttack=this.boof468,this.initHealth=this.initAttack-1,this.tribe.push("PL"),this.hints=["ENF","EML","OP"],this.ftext=`If ${this.name} is opposed, spawn a copy of it. Then repeat this for each copy.`,this.bonus={play:this.boardFormula(1,this.initAttack+this.initHealth,this.initAttack,0)}}lotusF(t){if(t.event.creature.opposed){let e=!0;for(;e;){const s=a.field.emptyLanes(t.ownerPlayerA),c=s.length;if(c===0)e=!1;else{const u=s[a.randInt(0,c)];a.field.birthCreature(this.code,"P",t.ownerPlayerA,u).opposed||(e=!1)}}}}tgiC(){this.faction="T",this.rarity="R",this.name="Thundergale Invoker",this.initAttack=this.boof3711,this.initHealth=this.initAttack,this.tribe.push("WN","GT"),this.hints=["LJ"],this.ftext=`Each creature adjacent to ${this.name} moves one space away if possible.`}tgiF(t){const r=a.field.creatById(t.creatId),e=r.lane,s=r.owner;if(e>2){const c=a.field.searchByLane(e-1,s);c&&(a.field.searchByLane(e-2,s)||c.move(e-2))}if(e<4){const c=a.field.searchByLane(e+1,s);c&&(a.field.searchByLane(e+2,s)||c.move(e+2))}}umglidC(){this.faction="T",this.rarity="R",this.name="Umbruk Glider",this.initAttack=this.boof71117,this.initHealth=this.initAttack-4,this.initMobile=this.level,this.allied="U",this.tribe.push("DN"),this.hints=["ALU"],this.ftext="Breakthrough."}umglidF(t){if(a.turn.allied(this.allied)){const r=a.field.creatById(t.creatId);r.breakthrough=!0}}uwarC(){this.faction="T",this.rarity="H",this.name="Uranti Warlord",this.initAttack=this.boof3713,this.initHealth=this.boof71117,this.tribe.push("FR","YT"),this.hints=["OP"],this.ftext=`Each friendly Yeti deals ${this.initAttack} damage to the opposing creature.`,this.bonus={play:this.boardFormula(0,this.initAttack,0,0)}}uwarF(t){const r=d.crFriendTarg();r.tribe="YT";const e=a.field.creatByTarget(r),s=Date.now();e.forEach(c=>{const u=c.opposed;u&&u.hurtDirect(this.initAttack,c.code,s)})}ustokeC(){this.faction="T",this.rarity="R",this.name="Uranti Warstoker",this.initAttack=this.boof6812,this.initHealth=this.initAttack-1,this.tribe.push("YT"),this.ftext=`Each other friendly Yeti get ${a.log.buffText(this.stokeboof,0)} this turn.`}ustokeF(t){const r=d.crFriendNotMeTarg(t.creatId);r.tribe="YT";const e=a.field.creatByTarget(r),s=this.stokeboof;e.forEach(c=>{const u=d.mod("AT",s,t.creatId);u.expiry="ET",c.addMod(u)})}get stokeboof(){return this.lValN([3,4,6])}umaulC(){this.faction="U",this.rarity="C",this.name="Uterradon Mauler",this.initAttack=this.boof4712,this.initHealth=this.initAttack,this.tribe.push("DN"),this.hints=["OP"];const t=this.boof246;this.ftext=`If ${this.name} is opposed, it gets ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,t*2,t,0)}}umaulF(t){const r=t.event;if(r.creature.opposed){const e=this.boof246;r.creature.buff(e,e)}}vnsC(){this.faction="U",this.rarity="H",this.name="Venomous Netherscale",this.initAttack=this.boof4713,this.initHealth=this.initAttack+4,this.tribe.push("NG"),this.ftext=`Double the Poison on each enemy creature${this.level===3?" and the enemy player":""}.`}vnsF(t){const r=d.crEnemyTarg();r.hasPoison=!0,a.field.creatByTarget(r).forEach(s=>{s.addPoison(s.poison)})}wwpC(){this.faction="U",this.rarity="H",this.name="Weirwood Patriarch",this.initAttack=this.boof5714,this.initHealth=this.lValN([7,10,17]),this.tribe.push("HM");const t=this.boof235;this.ftext=`Each friendly creature with ${this.boof357} or less attack gets ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,t,t,0)}}wwpF(t){const r=this.boof235,e=d.crFriendNotMeTarg(t.creatId);e.maxAttack=this.boof357,a.field.creatByTarget(e).forEach(s=>s.buff(r,r))}wfbC(){this.faction="N",this.rarity="C",this.name="Witherfrost Banshee",this.initAttack=this.boof3612,this.initHealth=this.initAttack,this.tribe.push("ST"),this.hints=["OP"],this.flanks=!0;const t=this.boof247n;this.ftext=`The opposing creature gets ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,t*2,t,0)}}wfbF(t){const e=t.event.creature.opposed;if(e){const s=this.boof247n;e.buff(s,s)}}}class oe extends x{lookup(t){return{["RBG"]:{c:()=>this.rbgC(),g:(e,s)=>this.rbgG(e,s)},["SRV"]:{c:()=>this.sprvC(),g:(e,s)=>this.sprvG(e,s)}}[t]}onGain(t,r){this.lookup(t).g(r,r.event)}hPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("LG",this.code),e}getsTriggered(t){return t.trigger.type==="LG"&&this.validPlayer(t)}resolveTrigger(t){this.onGain(this.cardCode(),t),a.batch.triggerDone()}validPlayer(t){if(this.hPlayer===0)return!0;const r=t.event;return this.hPlayer===1?t.ownerPlayerA===r.playerA:t.ownerPlayerA!==r.playerA}rbgC(){this.faction="U",this.rarity="H",this.name="Runebark Guardian",this.initAttack=this.boof5916,this.initHealth=this.initAttack,this.tribe.push("HM"),this.hPlayer=1;const t=this.boof135;this.text=`When you gain health, ${this.name} gets ${a.log.buffText(t,t)}.`,this.bonus={exist:this.boardFormula(0,t*2,t,0)*.5}}rbgG(t,r){const e=a.field.creatById(t.creatId),s=this.boof135;e.buff(s,s)}sprvC(){this.faction="N",this.rarity="R",this.name="Spirit Reaver",this.initAttack=this.boof4814,this.initHealth=this.initAttack+2,this.tribe.push("DM"),this.hPlayer=-1;const t=this.boof234;this.text=`When an enemy player gains health, ${this.name} gets ${a.log.buffText(t,t)}.`,this.bonus={exist:this.boardFormula(0,t*2,t,0)*.5}}sprvG(t,r){const e=a.field.creatById(t.creatId),s=this.boof234;e.buff(s,s)}}class he extends x{lookup(t){return{["EWE"]:{c:()=>this.eweC(),m:(e,s)=>this.eweM(e,s)},["WBH"]:{c:()=>this.rbgC(),m:(e,s)=>this.rbgM(e,s)}}[t]}onMove(t,r){this.lookup(t).m(r,r.event)}mPlayer=0;constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("MV",this.code),e}getsTriggered(t){return t.trigger.type==="MV"&&this.validPlayer(t)}resolveTrigger(t){this.onMove(this.cardCode(),t),a.batch.triggerDone()}validPlayer(t){if(this.mPlayer===0)return!0;const r=t.event;return this.mPlayer===1?t.ownerPlayerA===r.creature.owner:t.ownerPlayerA!==r.creature.owner}eweC(){this.faction="T",this.rarity="H",this.name="Emberwind Evoker",this.initAttack=this.boof4914,this.initHealth=this.initAttack+2,this.tribe.push("HM"),this.mPlayer=1;const t=this.boof124;this.text=`When a friendly creature moves, it gets ${a.log.buffText(t,t)}.`,this.bonus={exist:this.boardFormula(0,t*2,t,0)}}eweM(t,r){const e=this.boof124;r.creature.buff(e,e)}rbgC(){this.faction="T",this.rarity="R",this.name="Windborn Hellion",this.initAttack=this.boof4812,this.initHealth=this.boof81217,this.tribe.push("WN","EL"),this.mPlayer=1,this.text=`When a friendly creature moves, ${this.name} gets ${a.log.buffText(this.level,this.level)}.`,this.bonus={exist:this.boardFormula(0,this.level*2,this.level,0)}}rbgM(t,r){a.field.creatById(t.creatId).buff(this.level,this.level)}}class xt extends x{lookup(t){return{["ATG"]:{c:()=>this.agrdC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.agrdP(e,s)},["ART"]:{c:()=>this.arootC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"U"),p:(e,s)=>this.arootP(e,s)},["BLH"]:{c:()=>this.bblhC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.bblhP(e,s)},["CYC"]:{c:()=>this.ccC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"N"),p:(e,s)=>this.ccP(e,s)},["DHW"]:{c:()=>this.dhwC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.dhwP(e,s)},["FBI"]:{c:()=>this.fbiC(),t:(e,s)=>this.factionSpellMyTurn(e,s,"T"),p:(e,s)=>this.fbiP(e,s)},["FLS"]:{c:()=>this.flspkC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.flspkP(e,s)},["KAW"]:{c:()=>this.kasC(),t:(e,s)=>this.spellMyTurn(e,s),p:(e,s)=>this.kasP(e,s)}}[t]}testPlay(t,r){return this.lookup(t).t(r,r.event)}actPlay(t,r){this.lookup(t).p(r,r.event)}triggerLevels=[1,2,3,4];constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r);return this.triggerLevels.includes(this.level)&&e.addTrigger("PC",this.code),e}getsTriggered(t){return t.event.code==="PLC"?this.testPlay(this.cardCode(),t):t.event.code==="TRE"&&this.cardCode()==="BLH"}resolveTrigger(t){if(t.event.code==="PLC")this.actPlay(this.cardCode(),t);else{const r=a.field.creatById(t.creatId);a.death.destroy(r,this.code)}a.batch.triggerDone()}spellMyTurn(t,r){return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}factionSpellMyTurn(t,r,e){if(r.playerA===t.ownerPlayerA){const s=a.cards.getCard(r.cardCode);if(s.type==="S"&&s.faction===e)return!0}return!1}agrdC(){this.faction="A",this.rarity="C",this.name="Aetherguard",this.initAttack=this.boof6814,this.initHealth=this.initAttack-1,this.tribe.push("RB"),this.bonus={exist:this.boardFormula(0,this.level,0,0)},this.text=`When you play a spell, ${this.name} gets Armor ${this.level}.`}agrdP(t,r){a.field.creatById(t.trigger.creatId).addArmor(this.level)}arootC(){this.faction="U",this.rarity="H",this.name="Aether Root",this.initAttack=this.boof3610,this.initHealth=this.initAttack,this.tribe.push("PL");const t=this.boof234;this.text=`When you play an Uterra spell, ${this.name} gets ${a.log.buffText(t,t)}.`,this.bonus={exist:this.boardFormula(0,t*2,t,0)*.5}}arootP(t,r){const e=a.field.creatById(t.trigger.creatId),s=this.boof234;e.buff(s,s)}bblhC(){this.faction="T",this.rarity="L",this.name="Binben, Lightning Herald",this.initAttack=this.boof61017,this.initHealth=this.boof468,this.tribe.push("LT","AS");const t=this.boof4711,r=this.boof258;this.text=`When you play a spell, Spawn a ${t}/${r} Lightning Elemental. At the end of your turn, destroy it.`,this.bonus={exist:this.boardFormula(1,t+r,t,0)*.5}}bblhP(t,r){const e=a.field.birthCreature(`${"LWY"}${this.level}`,"S",t.ownerPlayerA);e&&e.addTrigger("TE",this.code)}ccC(){this.faction="N",this.rarity="H",this.name="Crypt Conjurer",this.initAttack=this.boof258,this.initHealth=this.lValN([8,14,20]),this.tribe.push("VP"),this.text=`When you play a Nekrium spell, deal ${this.initAttack} damage to the enemy player and you gain ${this.initAttack} health.`,this.bonus={exist:this.boardFormula(0,0,0,this.initAttack)}}ccP(t,r){a.player.hurtPlayerDirect(!t.ownerPlayerA,this.initAttack,t.cardCode),a.player.healPlayer(t.ownerPlayerA,this.initAttack)}dhwC(){this.faction="N",this.rarity="R",this.name="Darkheart Wanderer",this.initAttack=this.boof3612,this.initHealth=this.boof81116,this.tribe.push("HM");const t=this.boof124;this.text=`When you play a spell, ${this.name} gets Regenerate ${t}.`,this.bonus={exist:this.boardFormula(0,t,0,0)}}dhwP(t,r){a.field.creatById(t.trigger.creatId).addRegen(this.boof124)}fbiC(){this.faction="T",this.rarity="H",this.name="Flamebreak Invoker",this.initAttack=this.boof4814,this.initHealth=this.initAttack+2,this.tribe.push("FR","GT"),this.text=`When you play a Tempys spell, deal ${this.level} damage to each enemy creature.`,this.bonus={exist:this.boardFormula(0,this.level*2,0,0)*.5}}fbiP(t,r){const e=Date.now();a.field.qEnemyCreats().forEach(s=>{s.hurtDirect(this.level,this.code,e)})}flspkC(){this.faction="T",this.rarity="C",this.name="Flame Speaker",this.initAttack=this.lValN([2,6,13]),this.initHealth=this.level*6,this.tribe.push("HM");const t=this.boof235;this.text=`When you play a spell, deal ${t} damage to the enemy player.`,this.bonus={exist:this.boardFormula(0,0,0,t)*.5}}flspkP(t,r){a.player.hurtPlayerDirect(!t.ownerPlayerA,this.boof235,t.cardCode)}kasC(){this.faction="T",this.rarity="L",this.name="Kas, Arcweaver",this.initAttack=this.boof4814,this.initHealth=this.initAttack,this.tribe.push("LT","AS"),this.hints=["OL","LKV"],this.text="When you play a spell, Kas battles an additional time this turn.",this.bonus={exist:this.boardFormula(0,this.initAttack,this.initAttack,0)*.5}}kasP(t,r){const e=a.field.creatById(t.trigger.creatId);e.extraBattles+=1}}class et extends x{lookup(t){return{["CSB"]:{c:()=>this.corpsC(),v:e=>this.corpsV(e)},["DSK"]:{c:()=>this.dskC(),v:e=>this.dskV(e)},["FWK"]:{c:()=>this.fwlkC(),v:e=>this.fwlkV(e)},["FFD"]:{c:()=>this.ffC(),v:e=>this.ffV(e)},["GVS"]:{c:()=>this.ghsC(),v:e=>this.ghsV(e)},["GBG"]:{c:()=>this.ggC(),v:e=>this.ggV(e)},["GMR"]:{c:()=>this.gromC(),v:e=>this.gromV(e)},["MMX"]:{c:()=>this.mmeC(),v:e=>this.mmeV(e)},["NOZ"]:{c:()=>this.nyozC(),v:e=>this.nyozV(e)},["RSZ"]:{c:()=>this.rszC(),v:e=>this.rszV(e)},["SFM"]:{c:()=>this.spirmC(),v:e=>this.spirmV(e)},["VGN"]:{c:()=>this.vgfsC(),v:e=>this.vgfsV(e)},["XHS"]:{c:()=>this.xhostC(),v:e=>this.xhostV(e)},["ZTU"]:{c:()=>this.zimusC(),v:e=>this.zimusV(e)}}[t]}cardVengeance(t,r){this.lookup(t).v(r)}vtext="";venges=!0;fixedImgCreat=!1;constructor(t){super(t),this.lookup(this.cardCode()).c(),this.venges&&(this.text="Vengeance: "+this.vtext),this.vtext=""}get image(){return this.fixedImgCreat?this.fixedImage():super.image}generateCreature(t,r){const e=super.generateCreature(t,r);return this.venges&&e.addTrigger("VN",this.code),e}resolveTrigger(t){this.cardVengeance(this.cardCode(),t),a.batch.triggerDone()}corpsC(){this.faction="N",this.rarity="C",this.name="Corpulent Shambler",this.initAttack=this.lValN([5,7,15]),this.initHealth=this.initAttack,this.tribe.push("ZB"),this.vtext="Put a 3/3 Zombie into this space.",this.bonus={play:this.boardFormula(1,6,3,0)}}corpsV(t){const r=t.event,e=`${"ZBS"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}dskC(){this.faction="N",this.rarity="C",this.name="Death Seeker",this.initAttack=1,this.initHealth=1,this.tribe.push("HM"),this.fixedImgCreat=!0,this.hints=["ST"];const t=this.boof51015;this.vtext=`Put a ${t}/${t} Spirit into this space.`,this.bonus={play:this.boardFormula(1,t*2,t,0)}}dskV(t){const r=t.event,e=`${"SPN"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}fwlkC(){this.faction="N",this.rarity="C",this.name="Fell Walker",this.initAttack=this.boof359,this.initHealth=this.initAttack,this.tribe.push("ZB"),this.vtext=`Put a ${this.initAttack}/${this.initAttack} Zombie into this space.`,this.bonus={play:this.boardFormula(1,this.initAttack*2,this.initAttack,0)}}fwlkV(t){const r=t.event,e=`${"ZMB"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}ffC(){if(this.faction="N",this.rarity="H",this.name="Fleshfiend",this.initAttack=this.boof6812,this.initHealth=this.initAttack,this.tribe.push("AB"),this.venges=this.level>1,this.vtext=`Put a level ${this.level-1} ${this.name} into this space.`,this.venges){const t=this.lValN([0,6,15]);this.bonus={play:this.boardFormula(1,t*2,t,0)}}}ffV(t){const r=t.event,e=`${"FFD"}${this.level-1}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}ghsC(){this.faction="U",this.rarity="C",this.name="Glowhive Siren",this.initAttack=this.boof3814,this.initHealth=this.boof61117,this.tribe.push("IN"),this.vtext=`You gain ${this.boof124} to ${this.gghigh-1} health.`,this.bonus={play:this.boardFormula(0,0,0,this.boof258)}}ghsV(t){const r=a.randInt(this.boof124,this.gghigh);a.player.healPlayer(t.ownerPlayerA,r)}get gghigh(){return this.lValN([5,9,13])}ggC(){this.faction="N",this.rarity="C",this.name="Graveborn Glutton",this.initAttack=this.boof61117,this.initHealth=this.boof3814,this.tribe.push("AB"),this.vtext=`Deal ${this.boof124} to ${this.gghigh-1} damage to the enemy player.`,this.bonus={play:this.boardFormula(0,0,0,this.boof258)}}ggV(t){const r=a.randInt(this.boof124,this.gghigh);a.player.hurtPlayerDirect(!t.ownerPlayerA,r,this.code)}gromC(){this.faction="U",this.rarity="C",this.name="Grove Matriarch",this.initAttack=this.boof4814,this.initHealth=this.initAttack+2,this.tribe.push("PL");const t=N.minionBuff(this.level),r=N.minionName(this.level);this.vtext=`Put a ${t}/${t} ${r} into this space.`,this.bonus={play:this.boardFormula(1,t*2,t,0)}}gromV(t){const r=t.event,e=N.minionCode(this.level);a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}mmeC(){this.faction="A",this.rarity="C",this.name="Metamind Explorer",this.initAttack=this.boof3713,this.initHealth=this.initAttack+2,this.tribe.push("MM"),this.vtext=`Draw ${this.level} cards.`,this.bonus={play:this.boardFormula(0,0,0,0,this.level/4)}}mmeV(t){a.player.drawCard(t.ownerPlayerA,this.level)}nyozC(){this.faction="N",this.rarity="R",this.name="Nyrali Ooze",this.initAttack=this.boof247,this.initHealth=this.initAttack,this.tribe.push("OZ");const t=this.level+this.initAttack+1;this.vtext=`Put a ${t}/${t} Oozeling into this space.`,this.bonus={play:this.boardFormula(1,t*2,t,0)}}nyozV(t){const r=t.event,e=`${"OOZ"}${this.level}`;a.field.birthCreature(e,"P",r.creature.owner,r.creature.lane)}rszC(){this.faction="N",this.rarity="R",this.name="Runescarred Zombie",this.initAttack=this.lValN([5,8,16]),this.initHealth=this.boof359,this.tribe.push("ZB"),this.vtext=`Put a ${a.log.levelGateText(this.level,!0)}spell at random from your discard pile into your hand.`,this.bonus={play:this.boardFormula(0,0,0,0,.25)}}rszV(t){const r=a.player.toPlayer(t.ownerPlayerA),e=d.target("TD");e.player=a.player.toTarget(r),e.card="S",e.level=a.target.levelMatchTarget(this.level);const s=a.target.deckByTarget(e);if(s.length>0){const c=s[a.randInt(0,s.length)];r.discard.splice(c[1],1),r.hand.push(c[0])}}spirmC(){this.faction="T",this.rarity="H",this.name="Spiritflame Mystic",this.initAttack=this.boof6912,this.initHealth=this.initAttack-3,this.tribe.push("HM"),this.hints=["ENF","EML","OP"],this.vtext=`Deal ${this.boof246} damage to each creature.`}spirmV(t){const r=this.boof246,e=Date.now();a.field.qActiveCreats().forEach(s=>s.hurtDirect(r,this.code,e))}vgfsC(){this.faction="N",this.rarity="C",this.name="Vengeful Spirit",this.initAttack=this.boof357,this.initHealth=this.initAttack-2,this.tribe.push("ST"),this.hints=["OP"];const t=this.boof369n;this.vtext=`Give the opposing creature ${a.log.buffText(t,t)}.`,this.bonus={play:this.boardFormula(0,t*-2,-t,0)}}vgfsV(t){const e=t.event.creature.opposed;if(e){const s=this.boof369n;e.buff(s,s)}}xhostC(){this.faction="N",this.rarity="C",this.name="Xithian Host",this.initAttack=this.boof359,this.initHealth=this.boof135,this.tribe.push("AB"),this.vtext=`Deal ${this.initAttack} damage to the enemy player and you gain ${this.initAttack} health.`,this.bonus={play:this.boardFormula(0,0,0,this.initAttack*2)}}xhostV(t){const r=this.initAttack;a.player.hurtPlayerDirect(!t.ownerPlayerA,r,this.code),a.player.healPlayer(t.ownerPlayerA,r)}zimusC(){this.faction="N",this.rarity="L",this.name="Zimus, the Undying",this.initAttack=this.boof51014,this.initHealth=this.lValN([2,5,7]),this.tribe.push(this.level===1?"HM":"ZB"),this.venges=this.level>1,this.vtext=`Spawn a Zimus, the ${this.level===2?"Returned":"Undying"}.`,this.level<3?(this.hints=["LV"],this.level===2&&(this.bonus={play:this.boardFormula(1,15,10,0)})):(this.hints=["ST"],this.bonus={play:this.boardFormula(0,0,0,0,8)})}zimusV(t){let r;this.level===2?r=`${"ZTR"}2`:r=`${"ZTU"}3`,a.field.birthCreature(r,"S",t.ownerPlayerA)}}class Mt extends J{lookup(t){return{["DIS"]:{c:()=>this.disnC(),p:e=>this.disnZ(e),e:e=>this.disnE(e)},["DCH"]:{c:()=>this.dchantC(),p:e=>this.dchantZ(e),e:e=>this.dchantE(e)},["ESU"]:{c:()=>this.esrgC(),p:e=>this.esrgZ(e),e:e=>this.esrgE(e)},["ITO"]:{c:()=>this.itorC(),p:e=>this.itorZ(e),e:e=>this.itorE(e)},["MSP"]:{c:()=>this.mendC(),p:e=>this.mendZ(e),e:e=>this.mendE(e)},["NEM"]:{c:()=>this.netherC(),p:e=>this.netherZ(e),e:e=>this.netherE(e)}}[t]}cardCast(t,r){this.lookup(t).p(r)}playTarg;constructor(t){super(t),this.playTarg="X",this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return t.push(d.playerActTarg(this.playTarg,"CARD",this.code)),t}handleAction(t){this.logSpell();const r=a.state.getPlayer(t.playerA);this.cardCast(this.cardCode(),r),a.turn.spellCast()}evaluateAction(t){return this.lookup(this.cardCode()).e(t)}disnC(){this.faction="T",this.rarity="R",this.name="Disintigrate",this.playTarg="E",this.text=`Deal 1 to ${this.dshigh-1} damage to the enemy player.`}disnZ(t){a.player.hurtPlayerDirect(t,a.randInt(1,this.dshigh),this.code)}get dshigh(){return this.lValN([9,16,26])}disnE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerDmg(t.playerA,this.dshigh/2)],r}dchantC(){this.faction="U",this.rarity="C",this.name="Druid's Chant",this.playTarg="F",this.text=`You gain ${this.boof81220} health.`}dchantZ(t){a.player.healPlayer(t,this.boof81220)}dchantE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerLife(t.playerA,this.boof81220)],r}esrgC(){this.faction="A",this.rarity="R",this.name="Energy Surge",this.isFree=this.level>1,this.overload=this.level===3,this.level===1&&(this.hints=["LV"]),this.playTarg="F",this.text=`Draw ${this.level} card.`}esrgZ(t){a.player.drawCard(t,this.level)}esrgE(t){return d.actionEval(t,"ST")}itorC(){this.faction="T",this.rarity="R",this.name="Ice Torrent",this.isFree=this.level>1,this.level===1&&(this.hints=["LV"]),this.playTarg="E",this.text=`Deal ${this.boof234} damage to the enemy player.`}itorZ(t){a.player.hurtPlayerDirect(t,this.boof234,this.code)}itorE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerDmg(t.playerA,this.boof234)],r}mendC(){this.faction="U",this.rarity="R",this.name="Mending Spring",this.playTarg="F",this.text=`You gain 1 to ${this.mendboof} Health.`}mendZ(t){a.player.healPlayer(t,a.randInt(1,this.mendboof+1))}get mendboof(){return this.lValN([10,20,40])}mendE(t){const r=d.actionEval(t,"ST");return r.vectors=[d.evalVectorPlayerLife(t.playerA,this.mendboof/2)],r}netherC(){this.faction="N",this.rarity="C",this.name="Nether Embrace",this.playTarg="E";const t=this.boof4712;this.text=`Deal ${t} damage to the enemy player. You gain ${t} heal`}netherZ(t){const r=this.boof4712;a.player.hurtPlayerDirect(t,r,this.code),a.player.healPlayer(!t.isPlayerA,r)}netherE(t){const r=this.boof4712,e=d.actionEval(t,"ST");return e.vectors=[d.evalVectorPlayerLife(!t.playerA,r),d.evalVectorPlayerDmg(t.playerA,r)],e}}class or extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Rageborn Hellion",this.initAttack=this.boof469,this.initHealth=this.initAttack*2,this.tribe.push("FR","EL"),this.hints=["OL","LKV"],this.text=`When a friendly creature ${a.log.dbdtap()}, ${this.name} gets ${a.log.buffText(this.level,this.level)}.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("DM",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.owner===t.ownerPlayerA}return!1}resolveTrigger(t){a.field.creatById(t.creatId).buff(this.level,this.level),a.batch.triggerDone()}}class pt extends x{lookup(t){return{["AIV"]:{c:()=>this.avinvC(),r:e=>this.avinvR(e)},["BSP"]:{c:()=>this.bskphC(),r:e=>this.bskphR(e)},["CRC"]:{c:()=>this.crucC(),r:e=>this.crucR(e)},["ESK"]:{c:()=>this.ebknC(),r:e=>this.ebknR(e)},["MMV"]:{c:()=>this.mmovC(),r:e=>this.mmovR(e)},["RGG"]:{c:()=>this.runegC(),r:e=>this.runegR(e)},["SSR"]:{c:()=>this.solrevC(),r:e=>this.solrevR(e)},["SSM"]:{c:()=>this.spshamC(),r:e=>this.spshamR(e)},["SSG"]:{c:()=>this.snoutC(),r:e=>this.snoutR(e)},["UGM"]:{c:()=>this.mantisC(),r:e=>this.mantisR(e)}}[t]}rtext="";constructor(t){super(t),this.lookup(this.cardCode()).c(),this.text="Gain Rank: "+this.rtext}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("RU",this.code),e}getsTriggered(t){return t.trigger.type==="RU"?t.event.playerA===t.ownerPlayerA:!1}resolveTrigger(t){this.lookup(this.cardCode()).r(t),a.batch.triggerDone()}avinvC(){this.faction="T",this.rarity="H",this.name="Avalanche Invoker",this.initAttack=this.boof6914,this.initHealth=this.initAttack+1,this.tribe.push("ER","AS"),this.hints=["TL"],this.rtext=`Deal ${this.boof3612} damage to each non-Tempys creature.`}avinvR(t){const r=this.boof3612,e=Date.now();a.field.qActiveCreats().filter(s=>s.faction!=="T").forEach(s=>s.hurtDirect(r,this.code,e))}bskphC(){this.faction="N",this.rarity="C",this.name="Blightskull Phantasm",this.initAttack=this.boof5814,this.initHealth=this.boof61017,this.tribe.push("ST"),this.hints=["TL","OP"];const t=this.boof369n;this.rtext=`the opposing creature gets ${a.log.buffText(t,t)}.`}bskphR(t){const e=a.field.creatById(t.creatId).opposed;if(e){const s=this.boof369n;e.buff(s,s)}}crucC(){this.faction="A",this.rarity="R",this.name="Crucible Colossus",this.initAttack=this.boof61016,this.initHealth=this.initAttack+2,this.tribe.push("RB"),this.initDefend=!0,this.hints=["TL"],this.rtext=`Negate Defender from ${this.name}.`}crucR(t){const r=a.field.creatById(t.creatId);r.negateDefender=!0}ebknC(){this.faction="N",this.rarity="H",this.name="Ebonskull Knight",this.initAttack=this.lValN([9,13,18]),this.initHealth=this.initAttack-2,this.tribe.push("VP"),this.hints=["TL"],this.rtext=`Destroy ${this.name}.`}ebknR(t){const r=a.field.creatById(t.creatId);a.death.destroy(r,this.code)}mmovC(){this.faction="A",this.rarity="C",this.name="Metamind Overseer",this.initAttack=this.boof5915,this.initHealth=this.initAttack+1,this.tribe.push("MM"),this.hints=["TL"],this.rtext="Draw 2 cards."}mmovR(t){a.player.drawCard(t.ownerPlayerA,2)}runegC(){this.faction="U",this.rarity="H",this.name="Runegrove Guardian",this.initAttack=this.boof4814,this.initHealth=this.initAttack,this.tribe.push("PL"),this.hints=["TL"],this.rtext=`${this.name} gets ${a.log.buffText(this.initAttack,this.initAttack)}.`}runegR(t){a.field.creatById(t.creatId).buff(this.initAttack,this.initAttack)}solrevC(){this.faction="U",this.rarity="L",this.name="Solstice Reveler",this.initAttack=this.boof4816,this.initHealth=this.initAttack,this.tribe.push("HM"),this.hints=["TL","FRS"];const t=this.solbof;this.rtext=`each friendly creature gets ${a.log.buffText(t,t,this.level===3)}${this.level===3?", and Breakthrough":""}.`}solrevR(t){const r=this.solbof;a.field.qFriendCreats().forEach(e=>{e.buff(r,r),this.level===3&&(e.breakthrough=!0)})}get solbof(){return this.initAttack/2}spshamC(){this.faction="T",this.rarity="C",this.name="Spiritfrost Shaman",this.initAttack=this.boof71117,this.initHealth=this.boof4610,this.tribe.push("HM"),this.hints=["TL"],this.rtext=`Deal ${this.boof579} damage to the enemy player.`}spshamR(t){a.player.hurtPlayerDirect(!t.ownerPlayerA,this.boof579,this.code)}snoutC(){this.faction="U",this.rarity="C",this.name="Stouthide Stegadon",this.initAttack=this.boof4714,this.initHealth=this.boof71117,this.tribe.push("DN"),this.hints=["TL"],this.rtext=`Heal ${this.snoutbof} damage from ${this.name}.`}snoutR(t){a.field.creatById(t.creatId).heal(this.snoutbof)}get snoutbof(){return this.level*10}mantisC(){this.faction="U",this.rarity="C",this.name="Umbraglim Mantis",this.initAttack=this.boof6914,this.initHealth=this.initAttack-1,this.tribe.push("IN"),this.hints=["TL"],this.rtext=`You gain ${this.mantbof} health.`}mantisR(t){a.player.healPlayer(t.ownerPlayerA,this.mantbof)}get mantbof(){return this.lValN([8,10,12])}}class hr extends x{constructor(t){super(t),this.faction="T",this.rarity="R",this.name="Riftlasher",this.initAttack=this.boof359,this.initHealth=this.boof61016,this.tribe.push("FR","EL"),this.hints=["OL","LKV","ATH"],this.text=`When ${this.name} ${a.log.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.boardFormula(0,this.initAttack,0,0)}}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("DM",this.code);return s.interactive=!0,e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId&&t.ownerPlayerA===a.state.getActivePlayerB()}return!1}resolveTrigger(t){const r=t.event,e=a.target.toActions(d.crEnemyActTarg("CARD",this.code,a.enTil(t.creatId,r.dmg)));e.length>0?(e.push(a.action.noneEndTrigger()),a.action.setupActions(e)):a.batch.triggerDone()}handleAction(t){const r=a.deTil(t.param);a.field.creatByFSA(t).hurtDirect(parseInt(r[1]),this.code),a.action.actionDone(!0)}evaluateAction(t){const r=a.deTil(t.param);return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:parseInt(r[1])})}}class lr extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Scourgeflame Sorcerer",this.initAttack=this.boof358,this.initHealth=this.boof5914,this.tribe.push("ZB");const r=`Destroy a ${a.log.levelGateText(this.level+1,!0)}enemy creature.`,e=this.level===3?": ":", destroy another friendly creature: ";this.text=`Activate${e}${r}`}canActivate(t){return this.enemies(t).length>0?this.level===3?!0:this.friends(t).length>0:!1}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.deTil(t.param);if(r[1]==="P1")a.action.setupActions(this.getCardActions(t));else{const e=a.field.creatById(r[0]),s=Date.now();if(this.level<3){const u=a.field.creatById(r[2]);a.death.destroy(u,this.code,s)}const c=a.field.creatByFSA(t);a.death.destroy(c,this.code,s),e.endActivation()}}friends(t){const r=d.crFriendNotMeActTarg("CARD",t.id,this.code,a.enTil(t.id,"P1"));return a.target.toActions(r)}enemies(t,r=""){const e=d.crEnemyActTarg("CARD",this.code,a.enTil(t.id,"P2",r));return e.level=a.target.levelMatchTarget(this.level+1),a.target.toActions(e)}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.creatById(t.param);let s;return this.level===3?s=this.enemies(e):s=this.friends(e),s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.deTil(t.param),s=a.field.creatById(e[0]),c=a.field.creatByFSA(t),u=this.enemies(s,c.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=a.deTil(t.param);if(r[1]==="P1")return d.actionEvalPassive(t);{const e=t,s=d.actionEvalDestroyN(t,e.playerA,e.lane);if(this.level<3){const c=a.field.creatById(r[2]),u=d.evalVectorMod(c.owner,c.lane);u.destroy=!0,s.vectors.push(u)}return s}}}}class cr extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Seismic Adept",this.initAttack=this.boof4712,this.initHealth=this.boof61218,this.tribe.push("HM"),this.text="Activate: Move an enemy creature to another available enemy space.",this.bonus={exist:this.level*.5}}canActivate(t){return this.enemies(t).length>0&&this.empties(t).length>0}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{const e=a.field.creatById(r[1]);a.field.creatById(r[2]).move(t.lane),e.endActivation()}}empties(t,r=""){const e=d.actionTarget("TF","CARD",this.code,a.enTil("P2",t.id,r));return e.field="E",e.player="E",a.target.toActions(e)}enemies(t){const r=d.crEnemyActTarg("CARD",this.code,a.enTil("P1",t.id));return a.target.toActions(r)}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.creatById(t.param),s=this.enemies(e);return s.push(a.action.cancelAction()),s}else if(t.actionKey==="CARD"){const e=a.field.creatByFSA(t),s=a.deTil(t.param),c=a.field.creatById(s[1]),u=this.empties(c,e.id);return u.push(a.action.cancelAction()),u}return super.getCardActions(t,r)}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=d.actionEval(t,"ST"),s=t,c=a.field.creatById(r[2]),u=d.evalVectorMod(c.owner,c.lane);return u.moveTo=s.lane,e.vectors.push(u),e}}}}class Vt extends x{constructor(t){super(t),this.rarity="R",this.initAttack=this.boof4612,this.initHealth=this.boof61016;const r=this.cardCode();if(r==="SSS"?this.steel():r==="LSS"?this.life():r==="FSS"?this.flame():r==="DSS"&&this.dark(),this.level>1){const e=a.log.levelGateText(this.level-1);this.text=`When you play a ${e} ${a.log.factionText(this.faction)} card, you may ${this.tuxt}.`}else this.hints=["LV"];this.bonus={exist:this.level*.5},this.tuxt=""}tuxt="";dark(){this.faction="N",this.name="Darkshaper Savant",this.tribe.push("ZB");const t=-this.boof135;this.tuxt=`give an enemy creature ${a.log.buffText(t,t)}`}life(){this.faction="U",this.name="Lifeshaper Savant",this.tribe.push("SE");const t=this.boof135;this.tuxt=`give another friendly creature ${a.log.buffText(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`}generateCreature(t,r){const e=super.generateCreature(t,r);return this.level>1&&e.addTrigger("PC",this.code),e}getsTriggered(t){if(t.trigger.type==="PC"){const r=t.event;if(r.playerA===t.ownerPlayerA){const e=a.cards.getCard(r.cardCode);if(e.level0&&a.field.qActiveCreats().length>1&&t.push(r),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]),c=this.boof5814;a.death.destroy(s,this.code),e.buff(c,c),a.turn.spellCast()}}getCardActions(t,r){const e=a.field.creatByFSA(t),s=a.target.toActions(d.crNotMeActTarg("CARD",e.id,this.code,a.enTil("P2",e.id)));return s.push(a.action.cancelAction()),s}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=a.field.creatById(r[1]),s=d.actionEvalDestroyC(t,e,"SD"),c=this.boof5814;return s.vectors.push(d.evalVectorMod(t.playerA,t.lane,{att:c,hlt:c})),s}}}class ur extends x{constructor(t){super(t),this.faction="A",this.rarity="R",this.name="Statis Warden",this.initAttack=this.boof5915,this.initHealth=this.initAttack+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."}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("PC",this.code);return s.interactive=!0,e}handleAction(t){const r=a.field.creatByFSA(t),e=d.mod("DF",!0,t.param);e.expiry="EN",r.addMod(e),a.action.actionDone(!0)}getsTriggered(t){if(t.trigger.type==="PC"){const r=t.event;return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}return!1}resolveTrigger(t){const r=d.crFriendNotMeActTarg("CARD",t.creatId,this.code,t.creatId);r.canDefender=!0;const e=a.target.toActions(r);e.length===0?a.batch.triggerDone():(e.push(a.action.noneEndTrigger()),a.action.setupActions(e))}evaluateAction(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{def:!0})}}class fr extends J{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Static Shock",this.text=`Deal ${this.boof124} damage to a creature or player. You may play an additional ${a.log.levelGateText(this.level,!0)}spell this turn.`}playTargets(){const t=super.playTargets();return t.push(d.crActTarg("CARD",this.code),d.actionTarget("TP","CARD",this.code)),t}handleAction(t){this.logSpell(),t.zone==="P"?a.player.hurtPlayerDirect(t.playerA,this.boof124,this.code):a.field.creatByFSA(t).hurtDirect(this.boof124,this.code);const r=d.freeCard();r.condition.level=a.target.levelMatchTarget(this.level),r.condition.card="S",a.state.gs.turn.freeCards.push(r),a.turn.spellCast()}evaluateAction(t){const r=this.boof124,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r));else{const s=t;e.vectors.push(d.evalVectorMod(s.playerA,s.lane,{dmg:r}))}return e}}class gr extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Steelscale Dragon",this.initAttack=this.boof4812,this.initHealth=this.initAttack+2,this.tribe.push("RB","DG"),this.initMobile=this.level,this.text=`While each other friendly creature has Defender, ${this.name} gets ${a.log.buffText(this.initAttack,0)}, Armor ${this.boof246}, and Breakthrough.`}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addEffect("DF",this.code);s.area="C";const c=e.addEffect("PS",this.code);return c.area="C",e}enforceEffect(t,r){const e=d.crNotMeTarg(r.id);if(e.player=a.player.toTarget(r.owner),a.field.creatByTarget(e).some(c=>!c.defender))r.removeModSafe(r.id);else{const c=d.mod("AT",this.initAttack,r.id),u=d.mod("AR",this.boof246,r.id),m=d.mod("BT",!0,r.id);r.addModSafe(c),r.addModSafe(u),r.addModSafe(m)}}}class mr extends x{constructor(t){super(t),this.faction="T",this.rarity="L",this.name="Storm Bringer",this.initAttack=this.boof5814,this.initHealth=this.boof61018,this.tribe.push("WN","EL"),this.hints=["FH"];const r=this.boof246;this.bonus={exist:this.boardFormula(0,r+2,0,0)},this.text=`At the start of each turn, ${this.name} moves to an available space at random. Flank: Deal ${r} damage to the opposing creature.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("TS",this.code),e.addTrigger("FK",this.code),e}getsTriggered(t){return t.trigger.type==="TS"}resolveTrigger(t){if(t.trigger.type==="TS"){const r=a.field.emptyLanes(t.ownerPlayerA);r.length>0&&a.field.creatById(t.creatId).move(r[a.randInt(0,r.length)]),a.batch.triggerDone()}else if(t.trigger.type==="FK"){const e=t.event.creature.opposed;e&&e.hurtDirect(this.boof246,this.code),a.batch.triggerDone()}else super.resolveTrigger(t)}}class pr extends x{constructor(t){super(t),this.faction="A",this.rarity="L",this.name="Synapsis Oracle",this.initAttack=this.boof358,this.initHealth=this.lValN([9,15,24]),this.tribe.push("HM"),this.hints=["OL"];let r;this.level===3?(this.text="Activate: Level up a card in your hand.",r=1):(this.text=`Activate: ${a.log.daluac(!0)}.`,r=.5),this.bonus={exist:r}}canActivate(t){return a.state.getPlayer(t.owner).hand.some(e=>a.cards.getCard(e).canLevel())}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.field.creatById(t.param),e=a.state.getPlayer(r.owner);this.level===3?e.hand[t.position]=a.cards.getCard(t.card).levelUpCard():a.turn.levelAndDiscard(t),r.endActivation()}getCardActions(t,r){if(t.actionKey==="ACTV"){const e=r??a.field.creatById(t.param),s=d.lvlHandActTarg(this.code,e.id);return a.target.toActions([s,a.target.buttonTarget("CANC")])}return super.getCardActions(t,r)}evaluateAction(t){return t.actionKey==="ACTV"?d.actionEvalPassive(t):d.actionEval(t,"DC")}}class yr extends ie{constructor(t){super(t),this.faction="U",this.rarity="L",this.name="Thundersaur",this.initAttack=0,this.initHealth=this.level*12,this.tribe.push("DN"),this.initBT=!0,this.hints=["DLK","LKR"],this.text="When Thundersaur is dealt damage, it gets +1 attack for each damage dealt."}resolveTrigger(t){const r=t.event,e=r.target;e?e.buff(r.dmg,0):a.log.add("ERROR couldnt find creature - thundersaur trigger"),a.batch.triggerDone()}}class yt extends x{lookup(t){return{["DCS"]:{c:()=>this.delphC(),t:e=>this.delphT(e)},["GMP"]:{c:()=>this.gmpC(),t:e=>this.gmpT(e)},["LBL"]:{c:()=>this.lbcC(),t:e=>this.lbcT(e)},["SSE"]:{c:()=>this.sseC(),t:e=>this.sseT(e)},["SPD"]:{c:()=>this.spdC(),t:e=>this.spdT(e)},["SPM"]:{c:()=>this.spmC(),t:e=>this.spmT(e)},["TBA"]:{c:()=>this.tbaC(),t:e=>this.tbaT(e)},["VCG"]:{c:()=>this.vgC(),t:e=>this.vgT(e)},["WBG"]:{c:()=>this.woeC(),t:e=>this.woeT(e)},["ZSH"]:{c:()=>this.zyxC(),t:e=>this.zyxT(e)}}[t]}bothTurns=!1;constructor(t){super(t),this.lookup(this.cardCode()).c()}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("TS",this.code),e}getsTriggered(t){return t.trigger.type==="TS"?this.bothTurns?!0:t.event.playerA===t.ownerPlayerA:!1}resolveTrigger(t){this.lookup(this.cardCode()).t(t),a.batch.triggerDone()}delphC(){this.faction="A",this.rarity="L",this.name="Delpha, Chronosculptor",this.initAttack=this.boof7914,this.initHealth=this.initAttack,this.tribe.push("HM"),this.level>1&&(this.hints=["OL"],this.bonus={exist:this.boardFormula(0,9,4,0)},this.text=`At the start of your turn, level a ${this.level===2?"level 1 ":""}card in your hand at random.`)}delphT(t){if(this.level>1){const r=a.state.getPlayer(t.ownerPlayerA),e=r.hand.map((c,u)=>{const m=a.cards.getCard(c);return{idx:u,lvl:m.level,nxt:m.canLevel()?m.levelUpCard():""}}).filter(c=>c.nxt&&(this.level===3||c.lvl===1)),s=e.length;if(s>0){const c=e[a.randInt(0,s)];r.hand[c.idx]=c.nxt}}}gmpC(){this.faction="A",this.rarity="L",this.name="Ghox, Metamind Paragon",this.initAttack=this.boof4814,this.initHealth=this.boof61218,this.tribe.push("MM"),this.hints=["OL"];const t=this.level===1?"":"s";this.bonus={exist:this.boardFormula(0,0,0,0,this.level*.5)},this.text=`At the start of your turn, draw ${this.level} card${t}.`}gmpT(t){a.player.drawCard(t.ownerPlayerA,this.level)}lbcC(){this.faction="U",this.rarity="R",this.name="Lightbringer Cleric",this.initAttack=this.boof51015,this.initHealth=this.initAttack,this.tribe.push("TK"),this.hints=["OL"],this.bonus={exist:this.boardFormula(0,0,0,this.boof3610)},this.text=`At the start of your turn, you gain ${this.boof137} to ${this.boof5914-1} health.`}lbcT(t){a.player.healPlayer(t.ownerPlayerA,a.randInt(this.boof137,this.boof5914))}sseC(){this.faction="U",this.rarity="L",this.name="Scatterspore Eidolon",this.initAttack=8,this.initHealth=this.initAttack,this.tribe.push("PL"),this.hints=["OL","EMO","DL"];const t=this.boof357,r=N.minionName(this.level);this.bonus={exist:this.boardFormula(1,t*2,t,0)},this.text=`At the start of your turn, Spawn a ${t}/${t} ${r}.`}sseT(t){const r=this.lValS(["SXD","SXP","SXT"])+this.level.toString();a.field.birthCreature(r,"S",t.ownerPlayerA)}spdC(){this.faction="U",this.rarity="R",this.name="Shardplate Delver",this.initAttack=this.boof4612,this.initHealth=this.initAttack,this.tribe.push("DN"),this.hints=["OL"];const t=this.boof246;this.bonus={exist:this.boardFormula(0,t*2,t,0)},this.text=`At the start of your turn, ${this.name} gets ${a.log.buffText(t,t)}.`}spdT(t){const r=this.boof246;a.field.creatById(t.creatId).buff(r,r)}spmC(){this.faction="U",this.rarity="L",this.name="Shardplate Mutant",this.initAttack=this.boof91421,this.initHealth=this.initAttack,this.tribe.push("IN"),this.hints=["OP"],this.text="At the start of your turn, randomly discard down to two cards in your hand."}spmT(t){const r=a.state.getPlayer(t.ownerPlayerA);if(r.hand.length>2){let e=r.hand.slice(),s=[];for(;e.length>2;)s.push(e.splice(a.randInt(0,e.length),1)[0]);r.discard.push(...s),r.hand=e}}tbaC(){this.faction="U",this.rarity="L",this.name="Talisin, Bard of Abundance",this.initAttack=this.lValN([8,12,16]),this.initHealth=this.lValN([10,14,20]),this.tribe.push("SY"),this.bothTurns=this.lValB([!0,!0,!1]),this.hints=["OL"],this.level===3&&(this.bonus={exist:this.avgCreatureFormula()}),this.text=`At the start of ${this.bothTurns?"your":"each player's"} turn, ${this.bothTurns?"you":"that player"} may play an additional card.`}tbaT(t){a.state.gs.turn.regularPlays+=1}vgC(){this.faction="T",this.rarity="C",this.name="Volcanic Giant",this.initAttack=this.boof51015,this.initHealth=this.initAttack,this.tribe.push("ER","GT"),this.hints=["OL"],this.bonus={exist:this.boardFormula(0,0,0,this.boof3610)},this.text=`At the start of your turn, deals ${this.boof137} to ${this.boof5914-1} damage to the enemy player.`}vgT(t){const r=a.randInt(this.boof137,this.boof5914);a.player.hurtPlayerDirect(!t.ownerPlayerA,r,this.code)}woeC(){this.faction="N",this.rarity="L",this.name="Woebringer",this.initAttack=this.lValN([7,10,18]),this.initHealth=this.boof5815,this.tribe.push("AB"),this.text=`At the start of your turn, destroy the ${this.level===3?"enemy ":""}creature with the lowest attack. If there is a tie, one is chosen at random.`}woeT(t){const r=d.crTarg();this.level===3&&(r.player=a.player.toTarget(!t.ownerPlayerA));const e=a.field.creatByTarget(r);let s=99999,c=[];e.forEach(m=>{m.attack===s?c.push(m):m.attack0){const m=c[a.randInt(0,u)];a.death.destroy(m,this.code)}}zyxC(){this.faction="T",this.rarity="L",this.name="Zyx, Storm Herald",this.initAttack=this.boof4712,this.initHealth=this.lValN([6,9,20]),this.initMobile=1,this.tribe.push("LT","AS"),this.hints=["OL","ATH","LKV"],this.text="Zyx battles an additional time on your turn."}zyxT(t){const r=a.field.creatById(t.creatId);r.extraBattles+=1}}class Ut extends J{lookup(t){return{["CFG"]:{c:()=>this.confC(),z:(e,s)=>this.confZ(e,s),e:(e,s,c)=>this.confE(e,s,c)},["CSG"]:{c:()=>this.cystgC(),z:(e,s)=>this.cystgZ(e,s),e:(e,s,c)=>this.cystgE(e,s,c)},["GRN"]:{c:()=>this.grenC(),z:(e,s)=>this.grenZ(e,s),e:(e,s,c)=>this.grenE(e,s,c)},["TWG"]:{c:()=>this.twstrC(),z:(e,s)=>this.twstrZ(e,s),e:(e,s,c)=>this.twstrE(e,s,c)}}[t]}cardCast(t,r,e){this.lookup(t).z(r,e)}playTarg;constructor(t){super(t),this.playTarg=d.crActTarg("CARD",this.code),this.lookup(this.cardCode()).c()}playTargets(){const t=super.playTargets();return this.playTarg.param="P1",this.playTarg.notMe="",a.field.creatByTarget(this.playTarg).length>1&&t.push(this.playTarg),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")a.action.setupActions(this.getCardActions(t));else{this.logSpell();const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]);this.cardCast(this.cardCode(),s,e),a.turn.spellCast()}}getCardActions(t){const r=a.field.creatByFSA(t);return this.playTarg.notMe=r.id,this.playTarg.param=a.enTil("P2",r.id),a.target.toActions([this.playTarg,a.target.buttonTarget("CANC")])}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=a.field.creatByFSA(t),s=a.field.creatById(r[1]);return this.lookup(this.cardCode()).e(t,s,e)}}confC(){this.faction="T",this.rarity="C",this.name="Conflagrate",this.text=`Deal ${this.boof369} to two enemy creatures.`,this.playTarg.player="E"}confZ(t,r){const e=Date.now(),s=this.boof369;t.hurtDirect(s,this.code,e),r.hurtDirect(s,this.code,e)}confE(t,r,e){const s=this.boof369,c=d.actionEval(t,"ST");return c.vectors=[d.evalVectorMod(r.owner,r.lane,{dmg:s}),d.evalVectorMod(e.owner,e.lane,{dmg:s})],c}cystgC(){this.faction="A",this.rarity="C",this.name="Cypien Steelgraft",this.text=`Two friendly creatures get Armor ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canArmor=!0}cystgZ(t,r){const e=this.boof246;t.addArmor(e),r.addArmor(e)}cystgE(t,r,e){const s=this.boof246,c=d.actionEval(t,"ST");return c.vectors=[d.evalVectorMod(r.owner,r.lane,{arm:s}),d.evalVectorMod(e.owner,e.lane,{arm:s})],c}grenC(){this.faction="N",this.rarity="C",this.name="Ghastly Renewal",this.text=`Give two friendly creatures Regenerate ${this.boof246}.`,this.playTarg.player="F",this.playTarg.canRegen=!0}grenZ(t,r){const e=this.boof246;t.addRegen(e),r.addRegen(e)}grenE(t,r,e){const s=this.boof246,c=d.actionEval(t,"ST");return c.vectors=[d.evalVectorMod(r.owner,r.lane,{rgn:s}),d.evalVectorMod(e.owner,e.lane,{rgn:s})],c}get tsboof(){return this.level+2}twstrC(){this.faction="U",this.rarity="C",this.name="Twinstrength";const t=this.tsboof;this.text=`Two friendly creatures get ${a.log.buffText(t,t)}.`,this.playTarg.player="F"}twstrZ(t,r){const e=this.tsboof;t.buff(e,e),r.buff(e,e)}twstrE(t,r,e){const s=this.tsboof,c=d.actionEval(t,"ST");return c.vectors=[d.evalVectorMod(r.owner,r.lane,{att:s,hlt:s}),d.evalVectorMod(e.owner,e.lane,{att:s,hlt:s})],c}}class br extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Umbruk Icecrusher",this.initAttack=this.boof61014,this.initHealth=this.boof246,this.tribe.push("DN"),this.hints=["OL","ALU","ATH","LKV"],this.bonus={exist:this.boardFormula(0,5,this.initAttack+2,0)},this.text=`When ${this.name} ${a.log.dbdtap()}, deal that much damage to that player. Allied Uterra: This gets ${a.log.buffText(2,2,!0)}, and Breakthrough.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e.addTrigger("DM",this.code),e}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId}return!1}resolveTrigger(t){if(t.trigger.type==="FR"){if(a.turn.allied("U")){const r=a.field.creatById(t.creatId);r.breakthrough=!0,r.buff(2,2)}a.batch.triggerDone()}else if(t.trigger.type==="DM"){const r=t.event;a.player.hurtPlayerDirect(r.target,r.dmg,this.code),a.batch.triggerDone()}}}class vr extends x{constructor(t){super(t),this.faction="U",this.rarity="H",this.name="Umbruk Lasher",this.initAttack=this.boof71014,this.initHealth=this.initAttack-1,this.initBT=!0,this.tribe.push("DN"),this.hints=["OL","LKV","ATH","ALT"],this.text=`Allied Tempys: When ${this.name} ${a.log.dbdtap()} on your turn, you may deal that much damage to an enemy creature.`,this.bonus={exist:this.boardFormula(0,this.initAttack,0,0)}}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("FR",this.code),e}handleAction(t){a.field.creatByFSA(t).hurtDirect(parseInt(t.param),this.code),a.action.actionDone(!0)}getsTriggered(t){if(t.trigger.type==="DM"){const r=t.event;return r.battle&&!r.creatureTarg&&r.creatureSrc&&r.source.id===t.creatId&&r.source.owner===a.state.getActivePlayerB()}return!1}resolveTrigger(t){if(t.trigger.type==="FR"){if(a.turn.allied("T")){const r=a.field.creatById(t.creatId),e=r.addTrigger("DM",this.code);e.interactive=!0,r.changed=!0}a.batch.triggerDone()}else if(t.trigger.type==="DM"){const r=t.event,e=a.target.toActions(d.crEnemyActTarg("CARD",this.code,r.dmg.toString()));e.length>0?(e.push(a.action.noneEndTrigger()),a.action.setupActions(e)):a.batch.triggerDone()}}evaluateAction(t){return d.actionEvalCreatStatsN(t,t.playerA,t.lane,{dmg:parseInt(t.param)})}}class Ar extends x{constructor(t){super(t),this.faction="T",this.rarity="H",this.name="Uranti Heartseeker",this.initAttack=this.boof4915,this.initHealth=this.initAttack,this.initDefend=!0,this.tribe.push("YT"),this.text=`Activate: Deal ${this.initAttack} damage to an enemy creature or player with exactly ${this.initAttack} health.`}canActivate(t){return this.findVictims(t.id).length>0}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){if(t.zone==="F")a.field.creatByFSA(t).hurtDirect(this.initAttack,this.code);else{const e=t;a.player.hurtPlayerDirect(e.playerA,this.initAttack,this.code)}a.field.creatById(t.param).endActivation()}findVictims(t){const r=this.initAttack,e=d.crEnemyTarg(),c=a.field.creatByTarget(e).filter(m=>m.health===r).map(m=>d.fieldSelectAction("CARD",m.lane,m.owner)),u=a.player.toPlayer("E");return u.health===r&&c.push(d.playerSelectAction("CARD",u.isPlayerA)),c.forEach(m=>{m.hostCard=this.code,m.param=t}),c}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=this.initAttack,e=d.actionEval(t,"ST");if(t.zone==="P")e.vectors.push(d.evalVectorPlayerDmg(t.playerA,r)),e.bonus=9999;else{const s=t;e.vectors.push(d.evalVectorMod(s.playerA,s.lane,{dmg:r}))}return e}}getCardActions(t,r){const e=r??a.field.creatById(t.param),s=this.findVictims(e.id);return s.push(a.action.cancelAction()),s}}class D extends x{constructor(t){super(t),this.cardConstruct(this.cardCode())}cardConstruct(t){({["AEN"]:()=>this.anvenf(),["AGU"]:()=>this.avguard(),["BWG"]:()=>this.brambleguard(),["CHY"]:()=>this.cavernhyd(),["CDC"]:()=>this.cindcol(),["CNM"]:()=>this.cindmy(),["DBP"]:()=>this.prowler(),["DMR"]:()=>this.raptor(),["DBR"]:()=>this.bearride(),["DSZ"]:()=>this.duskzomb(),["FWB"]:()=>this.fangbear(),["FWR"]:()=>this.ravager(),["FMS"]:()=>this.firemane(),["FPR"]:()=>this.flop(),["FGA"]:()=>this.falpha(),["FGB"]:()=>this.fbeta(),["FGO"]:()=>this.fomega(),["FPS"]:()=>this.forgeplate(),["GGE"]:()=>this.geist(),["GGH"]:()=>this.ghast(),["GGS"]:()=>this.ggs(),["GCL"]:()=>this.glacial(),["IWC"]:()=>this.warcharger(),["LWY"]:()=>this.lwyrm(),["LHY"]:()=>this.lyshyd(),["MRF"]:()=>this.marrow(),["MMO"]:()=>this.mmop(),["NCW"]:()=>this.necrotic(),["NXC"]:()=>this.nexcore(),["OBD"]:()=>this.battledroid(),["OSP"]:()=>this.oss(),["RHC"]:()=>this.rime(),["SCS"]:()=>this.scorp(),["SCD"]:()=>this.scout(),["SFT"]:()=>this.scrap(),["SBA"]:()=>this.sparkblade(),["SKB"]:()=>this.sparkbot(),["SBR"]:()=>this.sparkass(),["SSN"]:()=>this.sfsent(),["SGI"]:()=>this.stonefist(),["SCL"]:()=>this.stormcall(),["SML"]:()=>this.lurker(),["TGS"]:()=>this.tsprout(),["TGN"]:()=>this.tgnome(),["TWS"]:()=>this.tscout(),["URD"]:()=>this.unrelenting(),["VBK"]:()=>this.vblock(),["VTC"]:()=>this.vtech(),["WTW"]:()=>this.waterwalk(),["WPD"]:()=>this.windprime(),["XCR"]:()=>this.xithcrush(),["XHU"]:()=>this.hulk(),["YWC"]:()=>this.yetiwar(),["ZIN"]:()=>this.zombinf()})[t]()}anvenf(){this.faction="A",this.rarity="C",this.name="Anvillon Enforcer",this.initAttack=this.boof5711,this.initHealth=this.initAttack-1,this.initArmor=this.boof246,this.tribe.push("RB")}avguard(){this.faction="T",this.rarity="R",this.name="Avalanche Guardian",this.initAttack=this.boof5915,this.initHealth=this.lValN([8,15,23]),this.initMobile=1,this.initDefend=!0,this.tribe.push("IC","EL")}battledroid(){this.faction="A",this.rarity="H",this.name="Oreian Battledroid",this.initAttack=this.lValN([5,7,17]),this.initHealth=1,this.initArmor=this.initAttack,this.tribe.push("RB")}bearride(){this.faction="U",this.rarity="C",this.name="Deepwood Bear Rider",this.initAttack=this.lValN([5,16,18]),this.initHealth=this.lValN([2,8,10]),this.tribe.push("LP")}brambleguard(){this.faction="U",this.rarity="C",this.name="Bramblewood Guardian",this.initAttack=this.boof2612,this.initHealth=this.lValN([9,14,24]),this.tribe.push("PL")}cavernhyd(){this.faction="U",this.rarity="C",this.name="Cavern Hydra",this.initAttack=this.boof4711,this.initHealth=this.boof71015,this.initRegen=this.boof135,this.tribe.push("HY")}cindcol(){this.faction="T",this.rarity="C",this.name="Cinder Colossus",this.initAttack=this.lValN([3,13,24]),this.initHealth=this.lValN([4,14,27]),this.initDefend=!0,this.level===1&&(this.hints=["LV"]),this.tribe.push("ER","EL")}cindmy(){this.faction="T",this.rarity="C",this.name="Cinder Mystic",this.initAttack=this.lValN([4,11,21]),this.initHealth=this.boof3714,this.tribe.push("FR","AS")}duskzomb(){this.faction="N",this.rarity="C",this.name="Duskspire Zombie",this.initAttack=this.lValN([2,5,16]),this.initHealth=this.lValN([5,8,19]),this.initRegen=4,this.tribe.push("ZB")}falpha(){this.faction="A",this.rarity="C",this.name="Forge Guardian Alpha",this.initAttack=this.lValN([4,8,20]),this.initHealth=this.lValN([8,14,26]),this.initDefend=!0,this.tribe.push("RB","GD")}fangbear(){this.faction="U",this.rarity="C",this.name="Fangwood Bear",this.initAttack=this.boof61016,this.initHealth=this.initAttack,this.tribe.push("BR")}fbeta(){this.faction="A",this.rarity="R",this.name="Forge Guardian Beta",this.initAttack=this.lValN([5,8,20]),this.initHealth=this.lValN([3,6,18]),this.initArmor=this.boof124,this.tribe.push("RB","GD")}firemane(){this.faction="T",this.rarity="C",this.name="Firemane Steed",this.initAttack=this.lValN([3,6,16]),this.initHealth=this.lValN([6,9,19]),this.initMobile=2,this.tribe.push("FR","EL")}flop(){this.faction="T",this.rarity="C",this.name="Flowstone Primordial",this.initAttack=this.lValN([6,7,15]),this.initHealth=this.initAttack+1,this.tribe.push("FR","EL")}fomega(){this.faction="A",this.rarity="L",this.name="Forge Guardian Omega",this.initAttack=this.boof255080,this.initHealth=this.initAttack,this.initMobile=this.boof124,this.initArmor=this.initMobile*10,this.initBT=!0,this.initAggro=!0,this.consistent=!0,this.tribe.push("RB","GD")}forgeplate(){this.faction="A",this.rarity="C",this.name="Forgeplate Sentry",this.initAttack=this.boof4915,this.initHealth=this.initAttack,this.initArmor=this.boof135,this.tribe.push("RB")}ggs(){this.faction="N",this.rarity="C",this.name="Grimgaunt Spectre",this.initAttack=this.lValN([3,11,14]),this.initHealth=this.initAttack,this.initMobile=1,this.hints=["LV"],this.tribe.push("GG")}geist(){this.faction="N",this.rarity="C",this.name="Grave Geist",this.initAttack=this.boof71118,this.initHealth=this.boof4711,this.tribe.push("ST")}ghast(){this.faction="N",this.rarity="C",this.name="Grave Ghast",this.initHealth=this.boof71013,this.initAttack=this.initHealth-2,this.initRegen=this.boof246,this.tribe.push("ZB")}glacial(){this.faction="T",this.rarity="C",this.name="Glacial Colossus",this.initAttack=this.boof61016,this.initHealth=this.lValN([8,13,19]),this.tribe.push("IC","EL"),this.initDefend=!0}hulk(){this.faction="N",this.rarity="C",this.name="Xithian Hulk",this.initAttack=this.boof4814,this.initHealth=this.initAttack+3,this.tribe.push("AB")}lurker(){this.faction="U",this.rarity="C",this.name="Swampmoss Lurker",this.initAttack=this.lValN([8,13,22]),this.initHealth=this.lValN([4,6,15]),this.tribe.push("DN")}lwyrm(){this.faction="T",this.rarity="C",this.name="Lightning Wyrm",this.initAttack=this.boof4711,this.initHealth=this.boof258,this.tribe.push("LT","EL"),this.initAggro=!0}lyshyd(){this.faction="U",this.rarity="C",this.name="Lysian Hydra",this.initAttack=this.boof5914,this.initHealth=this.initAttack+1,this.initRegen=this.level,this.tribe.push("HY")}marrow(){this.faction="N",this.rarity="C",this.name="Marrow Fiend",this.initAttack=this.boof81117,this.initHealth=this.lValN([1,5,13]),this.tribe.push("SK")}mmop(){this.faction="A",this.rarity="C",this.name="Metamind Operator",this.initAttack=this.boof4610,this.initHealth=this.lValN([10,14,18]),this.tribe.push("MM")}necrotic(){this.faction="N",this.rarity="C",this.name="Necrotic Wurm",this.initAttack=this.lValN([4,7,18]),this.initHealth=this.lValN([5,8,19]),this.tribe.push("WR")}nexcore(){this.faction="A",this.rarity="C",this.name="Nexus Core",this.initAttack=0,this.initHealth=this.lValN([15,25,40]),this.tribe.push("RB"),this.initDefend=!0}oss(){this.faction="N",this.rarity="R",this.name="Ossuary Spirit",this.initAttack=this.lValN([1,3,6]),this.initHealth=this.boof91420,this.initRegen=this.initAttack+2,this.tribe.push("ST")}prowler(){this.faction="U",this.rarity="C",this.name="Deepbranch Prowler",this.initAttack=this.lValN([8,9,10]),this.initHealth=this.initAttack,this.tribe.push("CT"),this.hints=["DL"],this.initBT=!0}raptor(){this.faction="U",this.rarity="C",this.name="Deepmoss Raptor",this.initAttack=this.lValN([2,13,16]),this.initHealth=this.initAttack,this.hints=["LV","ST"],this.tribe.push("DN")}ravager(){this.faction="U",this.rarity="C",this.name="Fangwood Ravager",this.initAttack=this.boof5917,this.initHealth=this.initAttack,this.tribe.push("BE")}rime(){this.faction="T",this.rarity="C",this.name="Rimehorn Charger",this.initAttack=this.lValN([5,8,10]),this.initHealth=this.initAttack+3,this.initMobile=1,this.hints=["DL"],this.tribe.push("RM")}scorp(){this.faction="N",this.rarity="C",this.name="Scavenger Scorpion",this.initAttack=this.lValN([6,9,11]),this.initHealth=this.initAttack,this.initRegen=this.level,this.hints=["DL"],this.tribe.push("AB")}scout(){this.faction="A",this.rarity="H",this.name="Scout Drone",this.initAttack=this.boof246,this.initHealth=this.initAttack,this.isFree=this.level>1,this.hints=[this.level===1?"LV":"DL"],this.tribe.push("RB")}scrap(){this.faction="A",this.rarity="H",this.name="Scrapforge Titan",this.initAttack=this.lValN([1,5,20]),this.initHealth=this.initAttack,this.initArmor=this.lValN([1,5,10]),this.level===1&&(this.hints=["LV","ST"],this.bonus={play:1}),this.tribe.push("RB")}sfsent(){this.faction="A",this.rarity="C",this.name="Spiritforge Sentinel",this.initAttack=this.lValN([3,6,9]),this.initHealth=this.initAttack*2,this.initArmor=this.lValN([1,2,6]),this.tribe.push("RB")}sparkbot(){this.faction="A",this.rarity="C",this.name="Spark Bot",this.initAttack=this.boof5914,this.initHealth=this.lValN([6,11,16]),this.tribe.push("RB")}sparkblade(){this.faction="A",this.rarity="C",this.name="Sparkblade Assassin",this.initAttack=this.lValN([4,12,14]),this.initHealth=this.lValN([5,13,15]),this.tribe.push("HM")}sparkass(){this.faction="T",this.rarity="C",this.name="Sparkbrand Asir",this.initAttack=this.lValN([2,7,9]),this.initHealth=this.lValN([6,11,13]),this.initAggro=!0,this.tribe.push("LT","AS")}stonefist(){this.faction="T",this.rarity="C",this.name="Stonefist Giant",this.initAttack=this.lValN([3,7,16]),this.initHealth=this.lValN([6,10,24]),this.tribe.push("ER","EL")}stormcall(){this.faction="T",this.rarity="C",this.name="Storm Caller",this.initAttack=this.lValN([8,11,14]),this.initHealth=this.initAttack-2,this.tribe.push("WN","AS")}tgnome(){this.faction="A",this.rarity="C",this.name="Technognome",this.initAttack=this.lValN([3,9,19]),this.initHealth=this.initAttack,this.level===1&&(this.hints=["LV"]),this.tribe.push("GN")}tscout(){this.faction="A",this.rarity="C",this.name="Tower Scout",this.initAttack=this.boof5915,this.initHealth=this.initAttack,this.initMobile=1,this.tribe.push("HM")}tsprout(){this.faction="U",this.rarity="C",this.name="Tanglesprout",this.initAttack=this.boof7911,this.initHealth=this.initAttack+1,this.hints=["DL"],this.tribe.push("PL")}unrelenting(){this.faction="N",this.rarity="H",this.name="Unrelenting Dead",this.initAttack=this.boof4814,this.initHealth=this.initAttack,this.initRegen=this.initAttack,this.tribe.push("ZB")}vblock(){this.faction="A",this.rarity="R",this.name="Vault Blockade",this.initAttack=0,this.initHealth=this.boof135,this.initArmor=this.boof101520,this.initDefend=!0,this.tribe.push("RB")}vtech(){this.faction="A",this.rarity="C",this.name="Vault Technician",this.initAttack=this.boof61218,this.initHealth=this.lValN([3,9,15]),this.tribe.push("HM")}warcharger(){this.faction="A",this.rarity="C",this.name="Ionic Warcharger",this.initAttack=this.boof4915,this.initHealth=this.lValN([7,12,18]),this.initMobile=1,this.tribe.push("RB")}waterwalk(){this.faction="T",this.rarity="C",this.name="Water Walker",this.initAttack=this.lValN([5,12,14]),this.initHealth=this.lValN([2,9,11]),this.tribe.push("IC","AS")}windprime(){this.faction="T",this.rarity="C",this.name="Wind Primordial",this.initHealth=this.boof4814,this.initAttack=this.initHealth+2,this.initMobile=this.level,this.tribe.push("WN","EL")}xithcrush(){this.faction="N",this.rarity="C",this.name="Xithian Crusher",this.initAttack=this.lValN([4,10,16]),this.initHealth=this.initAttack+2,this.tribe.push("AB")}yetiwar(){this.faction="T",this.rarity="C",this.name="Yeti Warcaller",this.initAttack=this.boof248,this.initHealth=this.lValN([10,15,23]),this.tribe.push("YT")}zombinf(){this.faction="N",this.rarity="C",this.name="Zombie Infantry",this.initAttack=this.boof61015,this.initHealth=this.initAttack-1,this.tribe.push("ZB")}}class kr extends J{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Varna's Pact";const r=this.lValS(["a","two","three"]),e=this.level===1?"":"s",s=this.level===1?"was":"were";this.text=`Put ${r} random creature${e} that ${s} destroyed this game into ${r} space${e}.`}playTargets(){const t=super.playTargets();return t.push(this.fieldTarget("P1",[])),t}handleAction(t){const r=a.deTil(t.param);if(r[0]==="P1")this.level===1?this.endSpell([t.lane],t.playerA):a.action.setupActions(this.getCardActions(t));else if(r[0]==="P2"){const e=[t.lane,parseInt(r[1])];this.level===2?this.endSpell(e,t.playerA):a.action.setupActions(this.getCardActions(t))}else this.endSpell([t.lane,parseInt(r[1]),parseInt(r[2])],t.playerA)}endSpell(t,r){this.logSpell();const e=Date.now();t.forEach(s=>{const c=a.death.gravedigger();c&&a.field.birthCreature(c,"R",r,s,e)}),a.turn.spellCast()}fieldTarget(t,r){const e=d.actionTarget("TF","CARD",this.code,a.enTil(t,...r));return e.player="F",e.lanes=a.field.laneIdx.filter(s=>!r.includes(s)),e}getCardActions(t,r){const e=a.deTil(t.param);let s;if(e[0]==="P1")s=this.fieldTarget("P2",[t.lane]);else{const c=[t.lane,parseInt(e[1])];s=this.fieldTarget("P3",c)}return a.target.toActions(s)}evaluateAction(t){const e=a.deTil(t.param)[0],s=d.actionEvalReplace(t,t.playerA,t.lane,`${"XHU"}1`);return s.final=this.level===1&&e==="P1"||this.level===2&&e==="P2"||this.level===3&&e==="P3",s.hints=["RE"],s}}class Tr extends x{constructor(t){super(t),this.faction="U",this.rarity="R",this.name="Wildwood Sower",this.initAttack=this.boof3612,this.initHealth=this.lValN([6,11,18]),this.tribe.push("HM"),this.hints=["EMO"];const r=N.minionBuff(this.level);this.text=`When you play a spell, you may put a ${r}/${r} ${N.minionName(this.level)} into an available space.`,this.bonus={exist:this.boardFormula(1,r*2,r,0)*.5}}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("PC",this.code);return s.interactive=!0,e}handleAction(t){a.field.birthCreature(N.minionCode(this.level),"P",t.playerA,t.lane),a.action.actionDone(!0)}getsTriggered(t){if(t.trigger.type==="PC"){const r=t.event;return r.playerA===t.ownerPlayerA&&a.cards.getCard(r.cardCode).type==="S"}return!1}resolveTrigger(t){const r=d.actionTarget("TF","CARD",this.code);r.field="E",r.player="F";const e=a.target.toActions(r);e.length===0?a.batch.triggerDone():(e.push(a.action.noneEndTrigger()),a.action.setupActions(e))}evaluateAction(t){return d.actionEvalReplace(t,t.playerA,t.lane,N.minionCode(this.level))}}class Cr extends x{constructor(t){super(t),this.faction="T",this.rarity="C",this.name="Windcaller Shaman",this.initAttack=this.boof3713,this.initHealth=this.initAttack+4,this.tribe.push("WN","AS"),this.hints=["FRO","EMA"],this.text=`Forge: You may move another friendly ${a.log.levelGateText(this.level,!0)}creature to an available space adjacent to ${this.name}.`,this.bonus={play:this.lValN([.25,.5,1])}}generateCreature(t,r){const e=super.generateCreature(t,r),s=e.addTrigger("FR",this.code);return s.interactive=!0,e}resolveTrigger(t){const r=a.field.creatById(t.creatId);if(this.emptySloots(r).length>0){const e=d.crFriendNotMeActTarg("CARD",r.id,this.code,a.enTil("P1",r.id));e.level=a.target.levelMatchTarget(this.level);const s=a.target.toActions(e);s.length>0?(s.push(a.action.noneEndTrigger()),a.action.setupActions(s)):a.batch.triggerDone()}else a.batch.triggerDone()}handleAction(t){const r=a.deTil(t.param);r[0]==="P1"?a.action.setupActions(this.getCardActions(t)):(a.field.creatById(r[1]).move(t.lane),a.action.actionDone(!0))}emptySloots(t,r=""){return a.action.emptyAdjacents(t,a.enTil("P2",r))}getCardActions(t,r){const e=a.deTil(t.param),s=a.field.creatByFSA(t),c=a.field.creatById(e[1]),u=this.emptySloots(c,s.id);return u.push(a.action.cancelAction()),u}evaluateAction(t){const r=a.deTil(t.param);if(r[0]==="P1")return d.actionEvalPassive(t);{const e=d.actionEval(t,"ST"),s=a.field.creatById(r[1]),c=d.evalVectorMod(s.owner,s.lane);return c.moveTo=t.lane,e.vectors.push(c),e}}}class Sr extends x{constructor(t){super(t),this.faction="N",this.rarity="C",this.name="Xithian Rotfiend",this.initAttack=this.lValN([7,12,20]),this.initHealth=this.initAttack+1,this.tribe.push("AB"),this.hints=["OL"];const r=-this.boof135;this.text=`When ${this.name} becomes opposed, it gets ${a.log.buffText(r,r)}.`}generateCreature(t,r){const e=super.generateCreature(t,r);return e.addTrigger("EF",this.code),e.addTrigger("MV",this.code),e}getsTriggered(t){if(t.trigger.type==="EF"||t.trigger.type==="MV"){const r=t.event;return t.trigger.creatId===r.creature.id||r.creature.owner!==t.ownerPlayerA}return!1}resolveTrigger(t){let r=!1;const e=a.field.creatById(t.creatId),s=t.event;if((e.id===s.creature.id&&e.opposed||s.creature.lane===a.field.oppositeLane(e.lane))&&(r=!0),r){const c=-this.boof135;e.buff(c,c)}a.batch.triggerDone()}}class wr extends x{constructor(t){super(t),this.faction="N",this.rarity="L",this.name="Xithian Shambler",this.initAttack=this.boof369,this.initHealth=this.initAttack+1,this.tribe.push("AB");let r="",e=1;this.level===3&&(r=" You may use this ability twice per turn.",e=2),this.text=`Activate, destroy an adjacent creature: ${this.name} moves into that creature's space, then gets +attack and +health equal to that creature's attack and health.${r}`,this.hints=["LJ"];const s=this.avgCreatureStats();this.bonus={exist:this.boardFormula(-1,s[0]+s[1],s[0],0)*e}}adjacentTarget(t){const r=d.crFriendActTarg("CARD",this.code,t.id);return r.lanes=t.adjacent,r}addExtraActivate(t){const r=d.mod("EA",!0,t.id);r.expiry="ET",t.addMod(r)}generateCreature(t,r){const e=super.generateCreature(t,r);return this.level===3&&(e.addTrigger("TS",this.code),this.addExtraActivate(e)),e}canActivate(t){return a.target.toActions(this.adjacentTarget(t)).length>0}startActivation(t){a.action.setupActions(this.getCardActions(d.fakeActivateAction(),t))}handleAction(t){const r=a.field.creatByFSA(t),e=a.field.creatById(t.param),s=r.attack,c=r.health;a.death.destroy(r,this.code),e.move(t.lane),e.buff(s,c),e.endActivation(),this.level===3&&e.hasMod(e.id)&&(e.removeMod(e.id),e.activationAvailable=!0,a.phase.whatNext())}getsTriggered(t){return t.trigger.type==="TS"}resolveTrigger(t){const r=a.field.creatById(t.creatId);this.addExtraActivate(r),a.batch.triggerDone()}getCardActions(t,r){const e=r??a.field.creatById(t.param);return a.target.toActions([this.adjacentTarget(e),a.target.buttonTarget("CANC")])}evaluateAction(t){if(t.actionKey==="ACTV")return d.actionEvalPassive(t);{const r=a.deTil(t.param),e=t,s=a.field.creatById(r[0]),c=a.field.creatByFSA(e),u=d.actionEvalBuffC(t,s,c.attack,c.health),m=d.evalVectorMod(c.owner,c.lane);m.destroy=!0;const y=d.evalVectorMod(s.owner,s.lane);return y.moveTo=e.lane,u.vectors.push(m,y),u}}}class Er{cardCache={};mapper={["AAK"]:Pe,["AGC"]:Q,["AGK"]:B,["AGP"]:Y,["ASG"]:P,["AFO"]:ne,["ATG"]:xt,["ART"]:xt,["AGM"]:Bt,["ALG"]:$t,["AHL"]:Ue,["ALS"]:$t,["AEN"]:D,["APM"]:Fe,["AQE"]:P,["AGD"]:He,["AFS"]:Ht,["ABR"]:kt,["AMY"]:kt,["ABL"]:P,["AGU"]:D,["AIV"]:pt,["BTN"]:$t,["BLH"]:xt,["BSP"]:pt,["BWK"]:Bt,["BSR"]:Q,["BMY"]:Ne,["BTM"]:P,["BOS"]:N,["BAW"]:Q,["BWG"]:D,["BWD"]:It,["BSG"]:Be,["BSS"]:B,["BTS"]:It,["BWH"]:Me,["BZD"]:B,["BFM"]:B,["BSM"]:Re,["CDT"]:Bt,["CTL"]:Y,["CHY"]:D,["CHV"]:Ge,["CTI"]:B,["CHA"]:Q,["CHH"]:B,["CHR"]:Le,["CDC"]:D,["CFB"]:kt,["CNM"]:D,["CSW"]:B,["CCT"]:Xt,["CFG"]:Ut,["CSU"]:P,["CCR"]:Q,["CSB"]:et,["CRC"]:pt,["CYC"]:xt,["CTW"]:P,["CTV"]:P,["CAG"]:P,["CBS"]:P,["CIN"]:Yt,["CSG"]:Ut,["DFR"]:B,["DHW"]:xt,["DSS"]:Vt,["DCR"]:Y,["DSK"]:et,["DBA"]:B,["DBP"]:D,["DMR"]:D,["DBR"]:D,["DCS"]:yt,["DGZ"]:Y,["DIS"]:Mt,["DSV"]:$e,["DDD"]:B,["DBT"]:P,["DFB"]:mt,["DMW"]:Ht,["DCH"]:Mt,["DSZ"]:D,["DYB"]:P,["ESK"]:pt,["EHW"]:Ie,["ETN"]:P,["EWE"]:he,["ENP"]:P,["ESU"]:Mt,["ENR"]:P,["EPD"]:Y,["ESC"]:It,["ESP"]:We,["EWT"]:B,["EHN"]:It,["EFM"]:kt,["EFP"]:Oe,["EXD"]:P,["FWB"]:D,["FWR"]:D,["FWK"]:et,["FIN"]:P,["FRR"]:Y,["FVA"]:P,["FFU"]:z,["FMS"]:D,["FSM"]:Y,["FBC"]:kt,["FBI"]:xt,["FFS"]:z,["FLN"]:P,["FSS"]:Vt,["FLS"]:xt,["FSH"]:z,["FFD"]:et,["FSP"]:gt,["FPR"]:D,["FFL"]:P,["FGA"]:D,["FGB"]:D,["FGG"]:Ht,["FGO"]:D,["FPS"]:D,["FSK"]:Ze,["FWT"]:B,["FZS"]:P,["GHS"]:Ht,["GHB"]:Xt,["GRN"]:Ut,["GTH"]:P,["GSC"]:Bt,["GMP"]:yt,["GTT"]:ze,["GCL"]:D,["GCR"]:P,["GLF"]:Q,["GRW"]:Q,["GSW"]:B,["GVS"]:et,["GSS"]:B,["GBG"]:et,["GGE"]:D,["GGH"]:D,["GRP"]:Ke,["GGD"]:mt,["GGP"]:mt,["GGS"]:D,["GRM"]:Y,["GHT"]:Q,["GMR"]:et,["HTR"]:qt,["HAR"]:P,["HFA"]:Lt,["HWM"]:Yt,["HGS"]:Ye,["HTP"]:qe,["IBF"]:Y,["ITO"]:Mt,["IWC"]:D,["IHA"]:Bt,["IMA"]:B,["JPK"]:P,["KAW"]:xt,["KOD"]:z,["KKK"]:qt,["LKP"]:Xe,["LGT"]:B,["LBR"]:P,["LSK"]:je,["LWY"]:D,["LBD"]:B,["LSS"]:Vt,["LBL"]:yt,["LSP"]:Yt,["LMV"]:B,["LHY"]:D,["MMH"]:Q,["MRF"]:D,["MOE"]:B,["MXW"]:Q,["MSP"]:Mt,["MMA"]:B,["MMX"]:et,["MMO"]:D,["MMV"]:pt,["MSC"]:P,["MTS"]:Je,["MTT"]:Qe,["MML"]:_e,["MMW"]:tr,["MBP"]:z,["MND"]:z,["NGB"]:Q,["NSL"]:P,["NCS"]:z,["NCW"]:D,["NCV"]:P,["NDR"]:er,["NEM"]:Mt,["NSH"]:Y,["NXC"]:D,["NXP"]:se,["NXT"]:$t,["NGT"]:mt,["NCL"]:Y,["NFF"]:z,["NOZ"]:et,["NSY"]:B,["ONN"]:rr,["OXA"]:ir,["OXM"]:B,["OXP"]:ar,["OOZ"]:N,["OBD"]:D,["OFM"]:B,["OJC"]:gt,["OPK"]:B,["OWW"]:Ht,["OHV"]:z,["ODC"]:sr,["OSP"]:D,["OWF"]:Y,["OXS"]:nr,["PHM"]:B,["PPM"]:z,["PSM"]:B,["PHS"]:Q,["PTB"]:Y,["PSC"]:z,["PTR"]:P,["PSG"]:P,["PMS"]:P,["PYG"]:Xt,["PYS"]:Y,["RBH"]:or,["RTS"]:kt,["RLW"]:gt,["RFL"]:hr,["RHC"]:D,["ROG"]:P,["RFA"]:Lt,["RBG"]:oe,["RGG"]:pt,["RSZ"]:et,["SAP"]:P,["SPL"]:N,["SVO"]:P,["SSE"]:yt,["SXP"]:N,["SXD"]:N,["SXT"]:N,["SCS"]:D,["SMD"]:B,["SFS"]:lr,["SCD"]:D,["SFT"]:D,["SDL"]:N,["SAD"]:cr,["SHG"]:P,["SPD"]:yt,["SPM"]:yt,["STD"]:Q,["SHS"]:Bt,["SGF"]:z,["SKG"]:se,["SSR"]:pt,["SNB"]:P,["SNP"]:Y,["SRD"]:Y,["SRH"]:mt,["SDN"]:B,["SHV"]:P,["SBA"]:D,["SKB"]:D,["SBR"]:D,["SBD"]:B,["SFM"]:et,["SSN"]:D,["SSM"]:pt,["SLH"]:dr,["SPN"]:N,["SRV"]:oe,["STR"]:P,["XYR"]:N,["SSA"]:z,["STO"]:P,["SDR"]:gt,["SWR"]:ur,["SHK"]:fr,["SFA"]:Lt,["STG"]:gr,["SSS"]:Vt,["SWM"]:z,["STN"]:P,["SGI"]:D,["SBG"]:mr,["SCL"]:D,["SGA"]:Lt,["SSG"]:pt,["SVH"]:kt,["SIN"]:P,["SYL"]:B,["SML"]:D,["SYO"]:pr,["TST"]:Y,["TBA"]:yt,["TGS"]:D,["TPT"]:P,["TDW"]:gt,["TGN"]:D,["TSM"]:ne,["TUP"]:P,["TGI"]:B,["TDS"]:yr,["TOB"]:P,["TWS"]:D,["TVG"]:Ve,["TXS"]:P,["TFK"]:N,["TFD"]:N,["TFF"]:N,["TCG"]:P,["TRN"]:Y,["TWG"]:Ut,["UGM"]:pt,["UGL"]:B,["UIC"]:br,["ULR"]:vr,["URD"]:D,["UBL"]:P,["UCM"]:z,["UHS"]:Ar,["UIM"]:z,["UWL"]:B,["UWS"]:B,["UTM"]:B,["UTR"]:gt,["URB"]:kt,["UPM"]:Ht,["VRP"]:kr,["VBK"]:D,["VTC"]:D,["VGN"]:et,["VNF"]:Q,["VNS"]:B,["VGR"]:P,["VCG"]:yt,["VES"]:kt,["VYE"]:P,["WBY"]:Q,["WBU"]:Q,["WMR"]:z,["WMM"]:P,["WTW"]:D,["WWP"]:B,["WFM"]:Ht,["WWS"]:Tr,["WBH"]:he,["WCS"]:Cr,["WPD"]:D,["WFB"]:B,["WFS"]:z,["WBG"]:yt,["XCR"]:D,["XHS"]:et,["XHU"]:D,["XRF"]:Sr,["XSH"]:wr,["XDV"]:qt,["XRW"]:P,["YWC"]:D,["YNS"]:mt,["ZPM"]:z,["ZTR"]:N,["ZTU"]:et,["ZIN"]:D,["ZBS"]:N,["ZMB"]:N,["ZSH"]:yt};makeCard(t){try{return new this.mapper[ht.extractCardCode(t)](t)}catch(r){throw console.error("Make card screwed up on code: "+t),r}}getCard(t){return this.cardCache[t]||(this.cardCache[t]=this.makeCard(t)),this.cardCache[t]}}class xr{guts="";txt(t){return this.guts+=t,this}plr(t){const r=a.player.toBool(t);return this.guts+="^p"+(r?"a":"b"),this}crd(t){return this.guts+="^c"+t,this}go(){a.log.parse(this)}}class Dr{loglist;you=!0;localPlayerKey="";oppPlayerKey="";localPlayerSpan="";oppPlayerSpan="";constructor(){this.loglist=document.getElementById("loglist")}setup(){this.you=a.state.gs.isLocalA,this.localPlayerKey=this.you?"^pa":"^pb",this.oppPlayerKey=this.you?"^pb":"^pa",this.localPlayerSpan=this.span(a.player.toPlayer(this.you).name,"green"),this.oppPlayerSpan=this.span(a.player.toPlayer(!this.you).name,"red")}addLi(t){const r=document.createElement("li");r.innerHTML=t,this.loglist.appendChild(r),r.scrollIntoView({behavior:"smooth",block:"end"})}span(t,r){return`${t}`}add(t){this.addLi(t)}clearAll(){this.loglist.innerHTML=""}new(){return new xr}factMap={["A"]:"all",["N"]:"nek",["T"]:"tem",["U"]:"ute"};parseCards(t){let r=!0;for(;r;){const e=t.indexOf("^c");if(e===-1)r=!1;else{const s=t.slice(e+2,e+6);if(s==="POIS")t=t.replaceAll("^c"+s,this.span("Poison","green"));else{const c=a.cards.getCard(s);t=t.replaceAll("^c"+s,this.span(`${c.name} ${c.level}`,this.factMap[c.faction]))}}}return t}parse(t){const e=t.guts.replaceAll(this.localPlayerKey,this.localPlayerSpan).replaceAll(this.oppPlayerKey,this.oppPlayerSpan),s=this.parseCards(e);this.add(s)}cardText(t){let r;if(t.type==="C"){const e=t,s=[];e.initRegen>0&&s.push("Regenerate "+e.initRegen),e.initArmor>0&&s.push("Armor "+e.initArmor),e.initMobile>0&&s.push("Mobility "+e.initMobile),e.initBT&&s.push("Breakthrough"),e.initDefend&&s.push("Defender"),e.initAggro&&s.push("Aggressive"),e.consistent&&s.push("Consistent"),s.length>0&&s.push(""),r=s.join(". ")+t.text}else r=t.text;return(t.isFree?"Free. ":"")+(t.overload?"Overload. ":"")+r}factionText(t){switch(t){case "A":return"Alloyin";case "N":return"Nekrium";case "T":return"Tempys";case "U":return"Uterra";case "X":return""}}cardTypeText(t){return t==="C"?"Creature":"Spell"}rarityText(t){switch(t){case "C":return"Common";case "R":return"Rare";case "H":return"Heroic";case "L":return"Legendary";case "T":return"Token"}}levelGateText(t,r=!1){const e=r?" ":"";return t===1?`level 1${e}`:t===2?`level 2 or lower${e}`:""}buffText(t,r,e=!1){return t!==0&&r!==0?`${this.bufferson(t,!0)}${e?",":" and"} ${this.bufferson(r,!1)}`:t!==0?this.bufferson(t,!0):this.bufferson(r,!1)}bufferson(t,r){return`${t>0?"+":""}${t} ${r?"attack":"health"}`}dbdtac(t=-1){return`deals battle damage to a ${t===-1?"":this.levelGateText(t,!0)}creature`}dbdtap(){return"deals battle damage to a player"}daluac(t=!1){return(t?"D":"d")+"iscard and level up a card"}forglied(t){return t==="X"?"Forge":`Allied ${this.factionText(t)}`}fastName(t){return t.length===3&&(t=`${t}1`),a.cards.getCard(t).name}actionText(t){switch(t.actionKey){case "ACTV":return"Activate";case "CARD":return`Card (${this.fastName(t.hostCard)})`;case "FITE":return"Fight";case "FORG":const r=t;return`Forge (${this.fastName(r.hostCard)}) Lane ${6-r.lane}`;case "HDSC":return`Hand Discard (${this.fastName(t.hostCard)})`;case "HPLY":const e=t;return`Hand Pick (${this.fastName(e.card)})`;case "MEND":return"Move End";case "MOVE":return"Move Start";case "NOTR":return"Pick None";case "ENDT":return"Donethanks";default:return t.actionKey}}tribeText(t){switch(t){case "AN":return"Any";case "AB":return"Abomination";case "AG":return"Angel";case "AS":return"Asir";case "BR":return"Bear";case "BE":return"Beast";case "CT":return"Cat";case "CR":return"Chrysalis";case "CY":return"Cyborg";case "DF":return"Darkforged";case "DM":return"Demon";case "DN":return"Dinosaur";case "DG":return"Dragon";case "DY":return"Dryad";case "ER":return"Earth";case "EL":return"Elemental";case "EN":return"Energeist";case "FY":return"Fairy";case "FR":return"Fire";case "FB":return"Forgeborn";case "FT":return"Frost";case "GT":return"Giant";case "GN":return"Gnome";case "GL":return"Golem";case "GG":return"Grimgaunt";case "GD":return"Guardian";case "HM":return"Human";case "HY":return"Hydra";case "IC":return"Ice";case "IN":return"Insect";case "LT":return"Lightning";case "LP":return"Lupin";case "MT":return"Manticore";case "MC":return"Mech";case "MM":return"Metamind";case "NG":return"Naga";case "OZ":return"Ooze";case "PX":return"Phoenix";case "PL":return"Plant";case "RM":return"Ram";case "RB":return"Robot";case "SY":return"Satyr";case "SE":return"Seraph";case "SH":return"Shaman";case "SS":return"Shapeshifter";case "SK":return"Skeleton";case "SN":return"Snake";case "SP":return"Spider";case "ST":return"Spirit";case "TG":return"Tigrin";case "TK":return"Tuskin";case "VP":return"Vampire";case "WD":return"Wanderer";case "WN":return"Wind";case "WF":return"Wolf";case "WR":return"Wurm";case "YT":return"Yeti";case "ZB":return"Zombie"}}}class Pr{makeTrans(t,r,e,s,c,u){}writeTrans(t,r,e,s,c,u){let m=!1;const y=a.state.getPlayer(t);if(r==="P")e==="HD"&&(u==="R"?(y.hand=s,m=!0):u==="D"&&(this.delPlayerHandI(y,s),m=!0));else if(r==="F"){if(u!=="R"){if(u==="U"){const A=a.field.creatById(c);A?e==="FT"&&(this.updFieldStateI(A,s),m=!0):console.error("Write could not find field, creature key:",c)}}}else r==="T"?e==="RP"&&(this.updRegPlaysI(s),m=!0):r==="D"&&u==="A"&&(this.addPlayerDeckI(y,e,s),m=!0);m||console.error("encountered unhandled DataDuke.write request",t,r,e,s,u)}updFieldState(t,r){this.updFieldStateI(t,r),this.makeTrans(t.owner,"F","FT",r,t.id,"U")}updRegPlays(t){this.updRegPlaysI(t),this.makeTrans(a.state.getActivePlayerB(),"T","RP",t,void 0,"U")}delPlayerHand(t,r){this.delPlayerHandI(t,r),this.makeTrans(t.isPlayerA,"P","HD",r,void 0,"D")}addPlayerDeck(t,r,e){this.addPlayerDeckI(t,r,e),this.makeTrans(t.isPlayerA,"D",r,e,void 0,"A")}updFieldStateI(t,r){t.status=r}updRegPlaysI(t){a.state.gs.turn.regularPlays=t}delPlayerHandI(t,r){t.hand.splice(r,1)}addPlayerDeckI(t,r,e){let s;if(r==="MD")s=t.deck;else if(r==="HD")s=t.hand;else if(r==="DD")s=t.discard;else{console.error("Invalid write item passed to addPlayerDeck ",r);return}s.push(e)}}class Fr{getsTriggered(t){return t.trigger.type==="FR"?this.forgeTriggerTest(t):t.trigger.type==="VN"?this.vengeanceTriggerTest(t):t.trigger.type==="FK"?this.flankTriggerTest(t):t.trigger.type==="DM"&&t.event.code==="DMG"||t.trigger.type==="EF"&&t.event.code==="ENT"||t.trigger.type==="DS"&&t.event.code==="DIE"||t.trigger.type==="PC"&&t.event.code==="PLC"||t.trigger.type==="MV"&&t.event.code==="MOV"||t.trigger.type==="LG"&&t.event.code==="PHL"||t.trigger.type==="TS"&&t.event.code==="TRS"||t.trigger.type==="TE"&&t.event.code==="TRE"||t.trigger.type==="PT"&&t.event.code==="PTN"||t.trigger.type==="RU"&&t.event.code==="RKU"?this.generalTriggerTest(t):!1}resolve(t){t.host==="C"?a.cards.getCard(t.trigger.logicCode).resolveTrigger(t):t.host==="P"?console.error("player hosted trigger encountered. No code!"):t.host==="H"?console.error("hand card hosted trigger encountered. No code!"):console.error("Encountered trigger reaction with mystery host ",t)}forgeTriggerTest(t){if(t.event.code==="ENT"){const r=t.event;if(!r.creature)throw new Error("Creature Enters Field event not provided creature payload");if(r.forged){const e=a.field.creatById(t.creatId);return e.status==="A"&&e.id===r.creature.id}}return!1}vengeanceTriggerTest(t){if(t.event.code==="DIE"){const r=t.event;if(!r.creature)throw new Error("Creature Died event not provided creature payload");const e=a.field.searchById(t.creatId);if(e)return e.status==="D"&&e.id===r.creature.id;console.warn("interesting. venegeance trigger test could not find its creature",t)}return!1}flankTriggerTest(t){if(t.event.code==="MOV"){const r=t.event;if(!r.creature)throw new Error("Creature Moved event not provided creature payload");const e=a.field.creatById(t.creatId);return e.status==="A"&&e.id===r.creature.id}return!1}generalTriggerTest(t){return t.creatId?a.cards.getCard(t.trigger.logicCode).getsTriggered(t):(console.error("player based trigger event encountered"),!1)}}class Hr{deathCheck(){const t=Date.now();a.field.qActiveCreats().forEach(s=>{s.health<1&&(a.log.new().crd(s.code).txt(" died.").go(),this.smite(s,t))});const r=a.player.toPlayer(!0),e=a.player.toPlayer(!1);(r.health<1||e.health<1)&&(r.healthe.creatId===t.id)&&(a.state.gs.deathOrder=a.state.gs.deathOrder.filter(e=>e.creatId!==t.id))}findDeathTime(t){const r=a.state.gs.deathOrder.filter(e=>e.creatId===t).map(e=>e.time);if(r.length!==0)return Math.min(...r)}destroy(t,r,e=void 0){a.log.new().crd(t.code).txt(" was destroyed by ").crd(r).txt(".").go(),this.smite(t,e)}gravedigger(t="X"){if(t==="X"){const r=a.state.gs.graveyard.length;return r===0?"":a.state.gs.graveyard[a.randInt(0,r)].cardCode}else{const r=a.player.toBool(t),e=a.state.gs.graveyard.filter(c=>c.owner===r),s=e.length;return s===0?"":e[a.randInt(0,s)].cardCode}}smite(t,r=void 0){t.status="D",a.state.gs.deathOrder.push({creatId:t.id,time:r||Date.now()}),a.state.gs.graveyard.push({cardCode:t.code,owner:t.owner}),a.batch.addEvents(d.creatureEvent("DIE",t)),a.effect.positionChange(t.owner)}}class Nr{startBatch(){this.deathCheck=!1,this.type==="C0"?this.type="C1":this.type==="C1"?this.type="C2":this.type==="C2"&&(this.type="N0");const t=this.type;let r;if(t==="N0")r=a.state.gs.batch.events.slice(),a.state.gs.batch.events=[];else{const s=a.state.gs.batch.events.filter(u=>u.code==="DIE"),c=a.state.gs.batch.events.filter(u=>u.code!=="DIE");t==="C1"?(r=c,a.state.gs.batch.events=s):(r=s,a.state.gs.batch.events=c)}const e=this.generateTriggers(r);a.state.gs.batch.triggerActions=this.sortTriggers(e),a.phase.whatNext()}generateTriggers(t){let r;const e=t.map(s=>(s.code==="TRS"&&(r=s),a.state.gs.field.map(u=>u.triggers.map(m=>{const y=d.triggerReaction(s,m,u.owner,"C");return y.creatId=u.id,y.cardCode=u.code,y}).filter(m=>a.trigger.getsTriggered(m))).flat())).flat();return r&&this.handleTurnStart(r),e}sortTriggers(t){const r=a.state.getActivePlayerB(),e=t.filter(u=>!u.trigger.interactive&&u.ownerPlayerA===r),s=t.filter(u=>!u.trigger.interactive&&u.ownerPlayerA!==r);return t.filter(u=>u.trigger.interactive&&u.ownerPlayerA===r).concat(s,e)}handleTurnStart(t){const r=a.state.getActivePlayerB();a.field.qPlayerCreats(r).filter(s=>s.sleeping).forEach(s=>{s.sleeping=!1});const e=Date.now();a.field.qActiveCreats().forEach(s=>{if(s.owner===t.playerA&&(s.activationAvailable=!0,s.mobilityAvailable=!0,s.sleeping=!1),s.armorDmg=0,s.poison>0&&s.hurtDirect(s.poison,"POIS",e),s.regen>0){const c=s.heal(s.regen);this.addEvents(d.creatStatEvent("RGN",s,c))}a.death.deathProdder(s,e)})}getNextTrigger(){const t=a.state.gs.batch.triggerActions;if(t.length!==0)return t[t.length-1]}triggerDone(){const t=a.state.gs.batch.triggerActions;t.length===0?console.error("batch.triggerDone() was called when there is no trigger actions"):t.pop(),a.phase.whatNext()}addEvents(...t){a.state.gs.batch.events.push(...t)}get deathCheck(){return a.state.gs.batch.deathCheck}set deathCheck(t){a.state.gs.batch.deathCheck=t}get type(){return a.state.gs.batch.type}set type(t){a.state.gs.batch.type=t}}class Br{chirpy=!1;chirp(t){this.chirpy&&console.log(t)}enterMainPhase(){a.state.setPhase("MN");const t=a.state.getActivePlayer(),r=this.getMainPhaseActions(t);a.action.setupActions(r)}passTheTurn(){a.state.gs.activePlayer=!a.state.gs.activePlayer,a.state.setPhase("WT"),a.state.gs.aiMode&&(a.state.gs.aiActive=!a.state.gs.aiActive,this.startTurn())}startTurn(){a.log.new().txt("------").go(),a.log.new().plr(a.state.getActivePlayerB()).txt(" starts turn.").go(),a.state.resetTurnData(),a.state.setPhase("ST"),a.batch.addEvents(d.playerEvent("TRS",a.state.getActivePlayerB())),this.expireMods(),this.whatNext()}async whatNext(){if(a.state.gs.winFlag!==0){this.chirp("NEXT! found win state"),a.action.actionHistory=[],a.state.gs.aiActive=!1,await a.drawing.drawAll();return}if(await a.drawing.drawAll(),a.action.actionHistory.length>0)this.chirp("NEXT! action restore"),a.action.setupActions();else if(a.batch.getNextTrigger())this.chirp("NEXT! next trigger"),a.trigger.resolve(a.batch.getNextTrigger());else if(!a.batch.deathCheck)this.chirp("NEXT! death check"),a.death.deathCheck(),this.whatNext();else if(a.state.gs.batch.events.length>0)this.chirp("NEXT! batch start"),a.batch.startBatch();else switch(this.chirp("NEXT! enter phase handler "+a.state.gs.phase),a.state.gs.field=a.state.gs.field.filter(t=>t.status==="A"),a.state.gs.deathOrder=[],a.state.gs.birthOrder=[],a.state.gs.phase){case "MN":this.enterMainPhase();break;case "ET":a.state.setPhase("PT"),a.batch.addEvents(d.playerEvent("PTN",a.state.getActivePlayerB())),a.phase.expireMods(),this.whatNext();break;case "PT":this.passTheTurn();break;case "WT":console.error("Hit unhandled waiting phase"),a.state.setPhase("MN"),this.whatNext();break;case "ST":a.state.setPhase("MN"),a.ai.cheater()?a.sleep(500).then(()=>this.whatNext()):this.whatNext();break}}expireMods(){const t=a.state.gs.phase,r=a.field.creatByTarget(d.crTarg());let e=[];t==="PT"?r.forEach(s=>{s.mods.forEach(c=>{c.expiry==="EN"?c.expiry="ET":c.expiry==="ET"&&e.push([s,c])})}):t==="ST"&&r.forEach(s=>{s.mods.forEach(c=>{c.expiry==="SN"?c.expiry="ST":c.expiry==="ST"&&e.push([s,c])})}),e.length>0&&(e.forEach(s=>s[0].expireMod(s[1])),a.effect.enforceAllNonPositionCreatureEffects())}getMainPhaseActions(t){const r=this.getHandActions(t),e=this.getFieldActions(t);let s=!a.state.gs.turn.mainBattle,c="M";return s||(s=a.field.qFriendCreats().some(m=>m.extraBattles>0&&m.isActive&&!m.defender),c="E"),s&&r.push({actionKey:"FITE",zone:"B",param:c,hostCard:""}),s||r.push({actionKey:"ENDT",zone:"B",param:"",hostCard:""}),[r,e].flat()}getHandActions(t){const r=[...new Set(t.hand)],e=[],s=[];r.forEach(y=>{a.cards.getCard(y).isFree?e.push(y):s.push(y)});const c=e.map(y=>[y,"FREE"]);a.state.gs.turn.freeCards.forEach(y=>{a.target.cardByTarget(s,y.condition).forEach(k=>{c.push([k[0],y.id]),s.splice(s.indexOf(k[0]),1)})}),c.push(...s.map(y=>[y,""]));const u=a.state.gs.turn.regularPlays>0;let m=t.hand.map((y,A)=>[y,A]);return u||(m=m.filter(y=>!s.includes(y[0]))),m.map(y=>{const A=c.find(k=>k[0]===y[0]);return A||console.error("No cost found for card"+y[0]),d.handSelectAction("HPLY",y[0],A[1],y[1])})}getFieldActions(t){const r=a.field.qPlayerCreats(t.isPlayerA),e=r.filter(c=>a.field.canMove(c).length>0).map(c=>d.fieldSelectAction("MOVE",c.lane,c.owner)),s=r.filter(c=>c.isActive&&c.activationAvailable?a.cards.getCard(c.code).canActivate(c):!1).map(c=>{const u=d.fieldSelectAction("ACTV",c.lane,c.owner);return u.hostCard=c.code,u.param=c.id,u});return e.forEach(c=>{const u=s.findIndex(m=>m.lane===c.lane);u>-1&&(s.splice(u,1),c.param="ACTV")}),e.concat(s)}}var Tt=(o=>(o[o.Left=0]="Left",o[o.Both=1]="Both",o[o.Right=2]="Right",o))(Tt||{});class Jt{action;hitTest(t,r,e){}enabled=!0;mouse=0;validButton(t){return this.mouse===1||this.mouse===t}static arrayHit(t,r,e,s){let c,u=0;const m=t.length;for(;c===void 0&&u=t&&this.originY<=r&&this.endY>=r?this.action:void 0}}class Ct extends Z{constructor(t,r,e,s,c=0){super({zone:"N",actionKey:"BNDL",hostCard:"",param:""},t,r,e,s,c)}childs=[];addChild(t){this.childs.push(t)}clear(){this.childs=[]}hitTest(t,r,e){if(super.hitTest(t,r,e))return Jt.arrayHit(this.childs,t,r,e)}}class Mr{registry;constructor(){this.registry=[]}find(t){const r=this.registry.find(e=>e.action===t);if(r)return r;throw console.trace(),new Error("Attempted to find non-existing clicker")}entoggle(t,r){const e=this.find(t);e.enabled=r}add(t){this.registry.push(t)}get(t){return this.find(t)}remove(t){const r=this.registry.findIndex(e=>e.action===t);r>-1&&this.registry.splice(r,1)}removeAll(){this.registry=[]}enable(t){this.entoggle(t,!0)}disable(t){this.entoggle(t,!1)}hitTest(t,r,e){return Jt.arrayHit(this.registry,t,r,e)}}class Rr{forgeCard(t,r){const e=this.cardPlayed(r),s=a.state.getActivePlayer();a.log.new().txt("Forged ").crd(e.code).txt(".").go(),a.field.birthCreature(e,"F",s.isPlayerA,t.lane),a.action.actionDone()}levelAndDiscard(t){const r=a.cards.getCard(t.card),e=a.state.getActivePlayer();return e.hand.splice(t.position,1),r.overload||e.discard.push(r.levelUpCard()),r}cardPlayed(t,r=!1){const e=this.levelAndDiscard(t),s=a.state.getActivePlayer();if(t.cost==="")a.state.gs.turn.regularPlays-=1;else if(t.cost!=="FREE"){const c=a.state.gs.turn.freeCards.findIndex(u=>u.id===t.cost);c>-1?a.state.gs.turn.freeCards.splice(c,1):console.error("Could not find free card rule!")}if(a.state.gs.turn.cardsPlayed+=1,!r){const c=d.playCardEvent(t.card,s.isPlayerA);a.batch.addEvents(c)}return e}spellCast(){this.cardPlayed(a.action.cardBeingPlayed),a.action.actionDone()}endTurn(){const t=a.state.getActivePlayer();t.discard.push(...t.hand),t.hand=[],t.turn++;const r=t.turn>4;a.batch.addEvents(d.playerEvent("TRE",t.isPlayerA)),r&&(t.turn=1,t.rank++,a.batch.addEvents(d.playerEvent("RKU",t.isPlayerA)),t.deck.push(...t.discard),t.discard=[],a.deck.shuffleDeck(t.isPlayerA)),a.field.qActiveCreats().forEach(e=>{e.extraBattles=0}),a.player.drawCard(t,5),a.state.setPhase("ET"),a.action.actionDone()}mobility(t){const r=a.field.creatById(t.param);r.mobilityAvailable=!1,r.move(t.lane),a.action.actionDone()}allied(t,r){const e=r??a.state.getActivePlayer(),s=d.target("TH");return s.player=a.player.toTarget(e),s.faction=t,a.target.deckByTarget(s).length>0}}class Gr{laneIdx=[1,2,3,4,5];creatById(t){const r=this.searchById(t);if(r)return r;throw console.error("naughty creature id",t),new Error("Could not find creature by id")}creatByLane(t,r){const e=this.searchByLane(t,r);if(e)return e;throw console.error("naughty creature lane ",t,r),new Error("Could not find creature by lane")}creatByFSA(t){const r=this.searchByFSA(t);if(r)return r;throw console.error("naughty FSA",t),new Error("Could not find creature by FSA")}searchById(t){return a.state.gs.field.find(r=>r.id===t)}searchByLane(t,r){return a.state.gs.field.find(e=>e.lane===t&&e.owner===r&&e.status==="A")}searchByFSA(t){return this.searchByLane(t.lane,t.playerA)}creatByTarget(t){let r=a.state.gs.field;if(t){if(t.player!=="X"){const e=a.player.toBool(t.player);r=r.filter(s=>s.owner===e)}if(t.creatStatus!=="A"){const e=this.creatStatusTargetToCS(t.creatStatus);r=r.filter(s=>s.status===e)}if(!a.isUn(t.lanes)){const e=a.target.lanesToArr(t.lanes);r=r.filter(s=>e.includes(s.lane))}if(a.isUn(t.maxAttack)||(r=r.filter(e=>e.attack<=t.maxAttack)),t.notMe&&(r=r.filter(e=>e.id!==t.notMe)),t.tribe!=="AN"&&(r=r.filter(e=>e.isTribe(t.tribe))),t.level!=="LA")if(t.level==="LG")r=r.filter(e=>a.cards.getCard(e.code).canLevel());else{const e=a.target.levelTargetToLevel(t.level);r=r.filter(s=>e.includes(s.level))}t.canDefender&&(r=r.filter(e=>!e.negateDefender)),t.hasDefender&&(r=r.filter(e=>e.defender)),t.canArmor&&(r=r.filter(e=>!e.negateArmor)),t.hasArmor&&(r=r.filter(e=>e.armor>0)),t.canMove&&(r=r.filter(e=>!e.negateMobility)),t.hasMobility&&(r=r.filter(e=>e.mobility>0)),t.hasPoison&&(r=r.filter(e=>e.poison>0)),t.canRegen&&(r=r.filter(e=>!e.negateRegen)),t.hasRegen&&(r=r.filter(e=>e.regen>0)),t.faction!=="X"&&(r=r.filter(e=>e.faction===t.faction))}return r}cst2cs={["A"]:()=>{throw new Error("goof passed any to field state target mapper")},["V"]:()=>"A",["D"]:()=>"D",["R"]:()=>"R"};creatStatusTargetToCS(t){return this.cst2cs[t]()}emptyLanes(t){return this.laneIdx.filter(r=>!a.state.gs.field.find(s=>s.owner===t&&s.lane===r&&s.status==="A"))}oppositeLane(t){return 6-t}adjacentPositions(t){return[[2],[1,3],[2,4],[3,5],[4]][t-1]}canMove(t){return t.mobility>0&&t.mobilityAvailable&&(!t.sleeping||t.aggressive)?this.emptyLanes(t.owner).filter(r=>Math.abs(t.lane-r)<=t.mobility):[]}birthCreature(t,r,e,s=0,c=void 0){if(r==="S"){const k=this.emptyLanes(e);if(k.length===0)return;s=k[a.randInt(0,k.length)]}else if(r==="P"&&!this.emptyLanes(e).includes(s))return;const m=(typeof t=="string"?a.cards.getCard(t):t).generateCreature(e,s),y=a.state.gs.field;if(r==="F"||r==="R"){const k=a.field.searchByLane(s,e);k&&(a.log.new().crd(k.code).txt(" was replaced.").go(),k.status="R",a.batch.addEvents(d.creatureEvent("RPL",k)))}y.push(m);const A=d.enterFieldEvent(m);return A.forged=r==="F",a.state.gs.birthOrder.push({creatId:m.id,time:c||Date.now()}),a.batch.addEvents(A),m.enforceEffects("PH"),a.effect.positionChange(e),m}findBirthTime(t){const r=a.state.gs.birthOrder.filter(e=>e.creatId===t).map(e=>e.time);if(r.length!==0)return r.length>1&&console.warn("wery curious, more than one birth record for creat "+t),r[0]}qActiveCreats(){return this.creatByTarget(d.crTarg())}qPlayerCreats(t){const r=d.crTarg();return r.player=a.player.toTarget(t),this.creatByTarget(r)}qFriendCreats(){return this.creatByTarget(d.crFriendTarg())}qEnemyCreats(){return this.creatByTarget(d.crEnemyTarg())}}class Lr{creatFightState(t,r){return t?r===1||t.defender||t.sleeping&&!t.aggressive?1:r===0?2:t.extraBattles>0?(t.extraBattles-=1,2):1:0}dukeItOut(t,r,e,s){if(t>0){let c=0;if(r>0){const u=t===2&&e.breakthrough;c=s.hurtBattle(e.attack,e,u)}else t===2&&(c=e.attack);c>0&&a.player.hurtPlayerBattle(!e.owner,c,e)}}fight(t){a.log.add("FIGHT!");let r=2,e=1;t&&(a.state.gs.turn.mainBattle=!0,r=0,e=0);const s=a.state.getActivePlayerB(),c=[],u=[];a.field.laneIdx.forEach(m=>{const y=a.field.searchByLane(m,s),A=a.field.searchByLane(6-m,!s),k=this.creatFightState(y,r),E=this.creatFightState(A,e);(k===2||E===2)&&(u.push([k,E,y,A],[E,k,A,y]),k===2&&(a.state.gs.turn.friendlyFightStarters++,c.push([m,s])),E===2&&c.push([a.field.oppositeLane(m),!s]))}),this.barking&&c.length>0&&a.dogBark(),a.drawing.drawCombat(c).then(()=>{u.forEach(m=>this.dukeItOut(...m)),a.effect.playerHealthChange(),a.death.deathCheck(),a.batch.type="C0",a.action.actionDone()})}barking=!0}class $r{positionChange(t){a.field.creatByTarget().forEach(r=>{r.enforceEffects("PS",t)})}defenderChange(t){a.field.qActiveCreats().forEach(e=>{e.effects.filter(s=>s.watch==="DF").filter(s=>s.area==="C"&&e.owner===t||s.area==="A").forEach(s=>a.cards.getCard(s.logicCode).enforceEffect(s,e))})}playerHealthChange(){a.field.qActiveCreats().forEach(t=>{t.enforceEffects("PH")})}enforceAllNonPositionCreatureEffects(){a.field.qActiveCreats().forEach(r=>{r.enforceEffects("AT"),r.enforceEffects("AR"),r.enforceEffects("CH"),r.enforceEffects("DF",r.owner)})}}class Ir{}class Vr{pt2pb={["X"]:()=>{throw new Error("goof passed any to player target boolean-o-fier")},["A"]:()=>!0,["B"]:()=>!1,["F"]:()=>a.state.getActivePlayerB(),["E"]:()=>!a.state.getActivePlayerB()};toPlayer(t){return typeof t=="boolean"?a.state.getPlayer(t):typeof t=="string"?a.state.getPlayer(this.pt2pb[t]()):t}toBool(t){return typeof t=="boolean"?t:typeof t=="string"?this.pt2pb[t]():t.isPlayerA}toTarget(t){return typeof t=="string"?t:(typeof t=="boolean"?t:t.isPlayerA)?"A":"B"}hurtPlayer(t,r){return r<1?0:(t.health-=r,r)}hurtPlayerDirect(t,r,e){const s=this.toPlayer(t),c=this.hurtPlayer(s,r);c>0&&(a.log.new().crd(e).txt(` dealt ${c} dmg to `).plr(s).txt(".").go(),a.batch.addEvents(d.damageEvent(!1,c,!1,!1,s.isPlayerA,void 0)),a.effect.playerHealthChange())}hurtPlayerBattle(t,r,e){const s=this.toPlayer(t),c=this.hurtPlayer(s,r);c>0&&(a.log.new().crd(e.code).txt(` dealt ${c} battle dmg to `).plr(s).txt(".").go(),a.batch.addEvents(d.damageEvent(!0,c,!0,!1,s.isPlayerA,e)))}healPlayer(t,r){const e=this.toPlayer(t);e.health+=r,a.log.new().plr(e).txt(` gained ${r} health.`).go(),a.batch.addEvents(d.playerHealEvent("PHL",e.isPlayerA,r)),a.effect.playerHealthChange()}drawCard(t,r){const e=this.toPlayer(t);for(let s=0;s{const s=this.actionTargGuts(e);return s.forEach(c=>{c.hostCard=e.hostCard,c.param=e.param}),s}).flat()}actionTargGuts(t){if(t.target==="TH")return this.deckByTarget(t).map(r=>d.handSelectAction(t.actionKey,r[0],"",r[1]));if(t.target==="TF"){if(t.field==="O")return a.field.creatByTarget(t).map(r=>d.fieldSelectAction(t.actionKey,r.lane,r.owner));{const r=t.player==="X"?[!0,!1]:[a.player.toBool(t.player)],e=a.isUn(t.lanes)?a.field.laneIdx:this.lanesToArr(t.lanes);if(t.field==="A")return r.map(s=>e.map(c=>d.fieldSelectAction(t.actionKey,c,s))).flat();if(t.field==="E")return r.map(s=>a.field.emptyLanes(s).filter(c=>e.includes(c)).map(c=>d.fieldSelectAction(t.actionKey,c,s))).flat()}}if(t.target==="TP")return t.player==="X"?[d.playerSelectAction(t.actionKey,!0),d.playerSelectAction(t.actionKey,!1)]:[d.playerSelectAction(t.actionKey,a.player.toBool(t.player))];if(t.target==="TB")return[{actionKey:t.actionKey,zone:"B",hostCard:t.hostCard,param:""}];if(t.target==="TR")return[{actionKey:t.actionKey,zone:"R",hostCard:t.hostCard,param:""}];if(t.target==="TD")return[];throw new Error("Target encountered that doesnt have mappings to actions: "+t.target)}cardByTarget(t,r){let e=t.map((s,c)=>[s,c]);if(r){if(a.isUn(r.deckPositionSkip)||(e=e.filter(s=>s[1]!==r.deckPositionSkip)),r.faction!=="X"&&(e=e.filter(s=>a.cards.getCard(s[0]).faction===r.faction)),r.tribe!=="AN"&&(e=e.filter(s=>{const c=a.cards.getCard(s[0]);return c.type==="C"?c.isTribe(r.tribe):!1})),r.level!=="LA")if(r.level==="LG")e=e.filter(s=>a.cards.getCard(s[0]).canLevel());else{const s=a.target.levelTargetToLevel(r.level);e=e.filter(c=>{const u=parseInt(c[0].substring(3,4));return s.includes(u)})}if(r.card!=="A"){const s=r.card==="C"?"C":"S";e=e.filter(c=>a.cards.getCard(c[0]).type===s)}}return e}deckByTarget(t){const r=a.player.toPlayer(t.player);let e;if(t.target==="TH")e=r.hand;else if(t.target==="TD")e=r.discard;else throw new Error("bad target passed to deckByTarget: "+t.target);return this.cardByTarget(e,t)}buttonTarget(t,r="",e=""){return d.actionTarget("TB",t,r,e)}boardTarget(t,r){return d.actionTarget("TR",t,r)}levelMatchTarget(t){return t===1?"L1":t===2?"LN":"LA"}lt2l={["LA"]:()=>[1,2,3,4],["LG"]:()=>{throw new Error("goof passed grow to level target mapper")},["L1"]:()=>[1],["L2"]:()=>[2],["L3"]:()=>[3],["LN"]:()=>[1,2]};levelTargetToLevel(t){return this.lt2l[t]()}levelTargetTest(t,r){return this.levelTargetToLevel(t).includes(r)}levelTestCommon(t,r){return this.levelTargetTest(this.levelMatchTarget(r),t)}lanesToArr(t){return Array.isArray(t)?t:[t]}}class Wr{handleAction(t){if(t.actionKey==="DEET"){a.state.gs.ui.detailsMode=!0,a.drawing.drawDetails(t);return}if(t.actionKey==="HPLY"){this.playCardSelect(t);return}if(t.actionKey==="FORG"){a.turn.forgeCard(t,this.cardBeingPlayed);return}if(t.actionKey==="FITE"){a.fight.fight(t.param==="M");return}if(t.actionKey==="ENDT"){a.turn.endTurn();return}if(t.actionKey==="MOVE"){this.mobilitySelect(t);return}if(t.actionKey==="MEND"){a.turn.mobility(t);return}if(t.actionKey==="HDSC"){const r=this.cardBeingPlayed;r.cost="",a.turn.cardPlayed(r,!0),this.actionDone();return}if(t.actionKey==="ACTV"){const r=a.field.creatById(t.param);a.cards.getCard(r.code).startActivation(r);return}if(t.actionKey==="NOTR"){this.actionDone(!0);return}if(t.actionKey==="CARD"){a.cards.getCard(t.hostCard).handleAction(t);return}if(t.actionKey==="CANC"){this.actionHistory.pop(),this.setupActions();return}if(t.actionKey==="SCRH"){t.param==="R"?a.state.gs.ui.handScrollLeft+=1:a.state.gs.ui.handScrollLeft-=1,a.drawing.drawAll();return}if(t.actionKey==="DRFT"){a.draft.resumeDraft(t.param);return}if(t.actionKey==="SCRD"){t.param==="U"?a.draft.paginating=!1:a.draft.paginating=!0,a.drawing.drawAll();return}if(t.actionKey==="MENU"){t.param==="D"?(a.state.setMode("D"),a.state.gs.options.wasDrafting=!0,a.draft.startDraft(!1,!1)):t.param==="C"?(a.state.setMode("C"),a.state.gs.options.wasDrafting=!1,this.setupActions(this.generateDeckPickerActions())):t.param==="I"?(a.state.setMode("I"),a.drawing.drawAll()):window.open("deckbuilder.html");return}if(t.actionKey==="MNBT"){if(t.param==="RP")if(a.log.clearAll(),a.state.gs.options.wasDrafting)a.draft.startDraft(!1,!0);else{const r=a.deck.randomStockDeck();a.state.gs.newGame(a.state.gs.options.playerDeck,r.cards)}else t.param==="MM"?(a.state.setMode("M"),a.log.clearAll(),a.drawing.drawAll()):t.param==="LK"?a.deck.loadFromFile().then(r=>{Array.isArray(r)?this.launchConstructed(r):new me().iAmError(r)}):t.param==="GP"?(a.state.gs.options.fatPacks=!a.state.gs.options.fatPacks,a.drawing.drawAll()):t.param==="LD"?(a.state.gs.options.legDraft=!a.state.gs.options.legDraft,a.drawing.drawAll()):t.param==="HH"?(a.state.gs.options.highHealth=!a.state.gs.options.highHealth,a.drawing.drawAll()):t.param==="CH"?(a.state.gs.options.cheater=!a.state.gs.options.cheater,a.drawing.drawAll()):t.param==="BB"?(a.state.gs.options.bark=!a.state.gs.options.bark,a.drawing.drawAll()):t.param==="RU"?window.open("https://github.com/grousewood-games/solforge/blob/main/docs/rules.md#rules"):t.param==="FQ"?window.open("https://github.com/grousewood-games/solforge/blob/main/docs/faq.md#info--faq"):console.error("missing handler for menu button param "+t.param);return}if(t.actionKey==="DSET"){this.setupActions(this.generateDeckPickerActions(parseInt(t.param)));return}if(t.actionKey==="DECK"){let r;if(t.param==="~random~")r=a.deck.randomStockDeck();else{const e=a.deTil(t.param);r=a.deck.stockDeckByName(e[0],e[1])}this.launchConstructed(r.cards);return}}launchConstructed(t){a.state.gs.options.playerDeck=t;const r=a.deck.randomStockDeck();a.state.setMode("G"),a.state.gs.newGame(t,r.cards)}setupActions(t){let r;if(t){const e=this.generateDetailActions();r=t.concat(e),this.actionHistory.push(r)}else r=this.actionHistory[this.actionHistory.length-1];a.state.gs.aiActive?a.ai.processAction(r):a.drawing.drawAll()}currPlayHandAction;get cardBeingPlayed(){if(this.currPlayHandAction)return this.currPlayHandAction;throw new Error("Attempted to read current card being played, nothing exists")}actionHistory=[];get activeActions(){const t=this.actionHistory.length;return t===0?[]:this.actionHistory[t-1]}actionDone(t=!1){this.currPlayHandAction=void 0,this.actionHistory=[],a.clickers.removeAll(),a.drawing.drawActions([]),t?a.batch.triggerDone():a.phase.whatNext()}playCardSelect(t){this.currPlayHandAction=t;const r=this.getPlayCardActions(t);this.setupActions(r)}getPlayCardActions(t){if(t.actionKey!=="HPLY")throw new Error("Unexpected action passed to getPlayCardActions: "+t.actionKey);const e=a.cards.getCard(t.card).playTargets();a.state.getRegularPlays()>0&&e.push(a.target.buttonTarget("HDSC",t.card));const s=a.target.toActions(e);return s.push(d.handSelectAction("CANC",t.card,"",t.position)),s}mobilitySelect(t){const r=this.getMoveCardActions(t);this.setupActions(r)}getMoveCardActions(t){if(t.actionKey!=="MOVE")throw new Error("Unexpected action passed to getMoveCardActions: "+t.actionKey);const r=a.field.creatByFSA(t);let e=[];if(t.param==="ACTV"){const s=d.actionTarget("TB","ACTV","",r.id);e=a.target.toActions(s)}return e.push(d.fieldSelectAction("CANC",t.lane,t.playerA)),a.field.canMove(r).map(s=>{const c=d.fieldSelectAction("MEND",s,t.playerA);return c.param=r.id,c}).concat(e)}noneEndTrigger(){return a.target.toActions(a.target.buttonTarget("NOTR"))[0]}cancelAction(){return a.target.toActions(a.target.buttonTarget("CANC"))[0]}emptyAdjacents(t,r=""){const e=r||t.id,s=d.actionTarget("TF","CARD",t.code,e);return s.field="E",s.lanes=t.adjacent,s.player="F",a.target.toActions(s)}generateDetailActions(){const t=a.state.gs.appMode;if(a.state.gs.aiActive||t==="M"||t==="C"||t==="I")return[];if(t==="G"){const r=a.state.getLocalPlayer().hand.map((s,c)=>{const u=d.handSelectAction("DEET",s,"",c);return u.param=s,u}),e=a.field.qActiveCreats().map(s=>{const c=d.fieldSelectAction("DEET",s.lane,s.owner);return c.param=s.code,c});return r.concat(e)}else if(t==="D"){const r=a.draft.currentPack.map((s,c)=>{const u=d.draftSelectAction("DEET",c,!0);return u.param=`${s}1`,u}),e=a.draft.picksAsDeck().map((s,c)=>{const u=d.draftSelectAction("DEET",c,!1);return u.param=`${s.card}1`,u});return r.concat(e)}return[]}generateDeckPickerActions(t=-1){const r=Nt.map((e,s)=>({actionKey:"DSET",zone:"N",hostCard:"",param:s.toString()}));if(t>-1){const e=Nt[t],s=e.decks.map(c=>({actionKey:"DECK",zone:"N",hostCard:"",param:a.enTil(e.id,c.name)}));return r.concat(s)}return r}generateInfoActions(){return Nt.map((r,e)=>({actionKey:"MNBT",zone:"N",hostCard:"",param:"MM"}))}}class Or{_state=new De;get gs(){return this._state}resetTurnData(){this.gs.turn=d.freshTurn(),this.gs.firstTurn&&(this.gs.firstTurn=!1,this.gs.turn.regularPlays=1)}clearDetails(){this.gs.ui.detailsMode=!1,a.drawing.clearDetails()}getPlayer(t){return t?this._state.playerA:this._state.playerB}getActivePlayer(){return this.getPlayer(this._state.activePlayer)}getActivePlayerB(){return this._state.activePlayer}getLocalPlayer(){return this.getPlayer(this._state.isLocalA)}setPhase(t){this.gs.phase=t}setMode(t){this.gs.appMode=t,t==="G"?(a.canvases.get("game-ui").clear(),a.drawing.setBackground("playmat")):t==="D"||t==="C"||t==="I"?(a.canvases.get("game-ui").clear(),a.drawing.setBackground("blueface")):t==="M"&&(a.drawing.clearAll(),a.drawing.setBackground("mainmenu"))}getRegularPlays(){return this.gs.turn.regularPlays}getCardsPlayed(){return this.gs.turn.cardsPlayed}}class Zr{async drawAll(){a.clickers.removeAll(),a.state.gs.appMode==="G"?(await Promise.all([this.drawHand(a.state.getLocalPlayer()),this.drawPlayers(),this.drawField(),this.drawActions(a.action.activeActions)]),a.state.gs.winFlag!==0&&await this.drawGameOver()):a.state.gs.appMode==="D"?await this.drawDraft(a.action.activeActions):a.state.gs.appMode==="C"?await this.drawDeckPick(a.action.activeActions):a.state.gs.appMode==="I"?await this.drawInfoMenu():await this.drawMenu()}async drawGameOver(){await new te().drawGameOver()}async drawHand(t){await new ge().drawCards(t)}async drawField(){await new _t().drawCards()}async drawPlayers(){await new te().drawAllPlayers()}async drawActions(t){const r=new jr;if(a.state.gs.aiActive)await r.drawActions([]);else{a.canvases.get("effects").clear();const s=new ge,c=new _t,u=new te;await Promise.all([s.drawActions(t),c.drawActions(t),r.drawActions(t),u.drawActions(t)])}}async drawCombat(t){if(t.length===0)return;a.canvases.get("effects").clear(),await new _t().drawFight(t)}async drawDraft(t){const r=new _r,e=a.canvases.get("game-ui");e.clear(),a.clickers.removeAll(),await r.drawPack(t,e),await r.drawList(t,e)}async drawMenu(){const t=new ei,r=a.canvases.get("game-ui");r.clear(),a.clickers.removeAll(),await t.drawMenu(r)}async drawInfoMenu(){const t=new ti,r=a.canvases.get("game-ui");r.clear(),a.clickers.removeAll(),await t.drawMenu(r)}async drawDeckPick(t){const r=new me,e=a.canvases.get("game-ui");e.clear(),a.clickers.removeAll(),await r.drawSets(t,e),await r.drawList(t,e)}clearDetails(){a.canvases.get("card").clear()}async drawDetails(t){a.canvases.get("card").clear(),await new Qr().drawCards(t.param)}setBackground(t){const r="hide";["playmat","blueface","mainmenu"].forEach(e=>{const s=document.getElementById(e);t===e?s.classList.remove(r):s.classList.add(r)})}clearAll(){["card","decklist","effects","field","game-ui","hand","player"].forEach(t=>{a.canvases.get(t).clear()})}}class Dt{paStats;pbStats;constructor(t,r){this.paStats=t,this.pbStats=r}allStats(){return[this.paStats,this.pbStats]}playerStats(t){return t?this.paStats:this.pbStats}deltaStats(t){const r=this.playerStats(t),e=this.playerStats(!t);return Dt.deltafier(r,e)}static deltafier(t,r){const e=Dt.blankStats(!0);return e.creatCount=t.creatCount-r.creatCount,e.creatValue=t.creatValue-r.creatValue,e.threatValue=t.threatValue-r.threatValue,e.playerHealth=t.playerHealth-r.playerHealth,e}static blankStats(t){return{side:t,creatCount:0,creatValue:0,threatValue:0,playerHealth:0}}}class St{guts;constructor(t){this.guts=t}static fromState(){const t=a.field.qActiveCreats(),r=[!0,!1],e=r.map(c=>a.field.laneIdx.map(u=>{const m=t.find(y=>y.owner===c&&y.lane===u);return m?d.evalVectorCreature(m):d.evalVectorEmpty(c,u)})).flat(),s=r.map(c=>{const u=a.player.toPlayer(c),m=d.evalVectorPlayer(c);return m.health=u.health,m});return e.push(...s),new St(e)}static boardFormula(t,r,e,s,c=0){return t/2+c+r/10+(s+e)/3}static creatValueFormula(t){return t.health+Math.max(0,t.attack)+t.bonus+t.regen+t.armor-t.poison}clone(){return new St(structuredClone(this.guts))}boardStats(){const t=[!0,!1].map(r=>this.guts.filter(e=>e.playerA===r)).map(r=>{const e=Dt.blankStats(r[0].playerA),s=r.filter(c=>c.type==="C");return e.creatCount=s.length,e.playerHealth=r[5].health,e.creatValue=this.creatSum(s,St.creatValueFormula),e.threatValue=this.creatSum(s,c=>{if(c.defender)return 0;{const u=this.guts[this.findLaneIndex(6-c.lane,!c.playerA)];let m=0;if(u.type==="E"?m=c.attack:c.breakthrough&&(m=c.attack-u.health),m<1)return 0;if(m<6)return m;{let y=!0,A=0,k=5,E=1;const I=5;for(;y;)m>k+I?(A+=E*I,k+=I,E++):(A+=E*(m-k),y=!1);return m+(c.sleeping&&!c.aggressive?A/2:A)}}}),e});return new Dt(t[0],t[1])}weighState(t,r,e){const s=this.boardStats(),c=s.playerStats(!e).playerHealth;if(c<1&&cr(e)).reduce((e,s)=>e+s,0)}findLaneIndex(t,r){return t+(r?-1:4)}findVectorIdx(t){return t.shape==="B"?this.findLaneIndex(t.lane,t.playerA):t.playerA?10:11}getBaseVector(t){return this.guts[this.findVectorIdx(t)]}replaceBaseVector(t){const r=this.findVectorIdx(t);this.guts[r]=t}applyVectors(t){t.forEach(e=>{switch(e.type){case "M":if(e.shape==="B")if(e.destroy)this.replaceBaseVector(d.evalVectorEmpty(e.playerA,e.lane));else{const c=this.getBaseVector(e);if(c.type!=="E"){if(e.moveTo){const u=d.evalVectorEmpty(e.playerA,e.lane);c.lane=e.moveTo,this.replaceBaseVector(c),this.replaceBaseVector(u)}else if(this.applyCreatVector(c,e),e.dirDmg){const u=Math.min(e.dirDmg,c.armor-c.armorDmg);c.armorDmg+=u,c.health-=e.dirDmg-u}}}else{const c=this.getBaseVector(e);c.health+=e.health,e.dirDmg&&(c.health-=e.dirDmg)}break;case "R":const s=d.evalVectorEmpty(e.playerA,e.lane);this.applyCreatVector(s,e),s.type="C",this.replaceBaseVector(s);break;case "P":break;default:console.warn("BoardEval is applying vectors, encountered unexpected vector type:",e)}}),this.guts.filter(e=>e.shape==="B"&&e.health<1).forEach(e=>this.replaceBaseVector(d.evalVectorEmpty(e.playerA,e.lane)))}battleState(t){return t.type==="E"?0:t.defender||t.sleeping&&!t.aggressive?1:2}battleVector(t,r,e,s){const c=[];if(t>0){let u=0;const m=Math.max(e.attack,0);if(r>0){const y=t===2&&e.breakthrough,A=Math.max(Math.min(m,s.armor-s.armorDmg),0);let k=m-A;if(y&&k>s.health&&(u=k-s.health,k=s.health),A>0||k>0){const E=d.evalVectorMod(s.playerA,s.lane);E.health=-k,E.armorDmg=A,c.push(E)}}else t===2&&(u=m);u>0&&c.push(d.evalVectorPlayerLife(s.playerA,-u))}return c}applyCombat(){const t=a.field.laneIdx.map(r=>{const e=this.guts[r-1],s=this.guts[10-r],c=this.battleState(e),u=this.battleState(s);return c===2||u===2?this.battleVector(c,u,e,s).concat(this.battleVector(u,c,s,e)):[]}).flat();this.applyVectors(t)}applyTurnEnd(t,r){const e=!t,s=!r,c=this.guts.filter(u=>u.shape==="B"&&(e||u.playerA===s)&&u.poison>0).map(u=>{const m=u.regen-Math.max(0,u.poison-u.armor),y=d.evalVectorMod(u.playerA,u.lane);return y.health=m,y}).filter(u=>u.health!==0);this.applyVectors(c)}applyCreatVector(t,r){t.health+=r.health,t.attack+=this.doubleOrNossing(t.attack,r.attack),t.armor+=r.armor,t.armorDmg+=r.armorDmg,t.poison+=this.doubleOrNossing(t.poison,r.poison),t.regen+=r.regen,t.aggressive=r.aggressive,t.breakthrough=r.breakthrough,t.defender=r.defender,t.negateDefender=r.negateDefender}doubleOrNossing(t,r){if(r>=Ft&&r0||e.freeCards.length>0)&&(r-=G.Horrid);break;case "NT":break;case "PS":break;case "NO":break;default:console.error("Final type with no weighting switch: "+t.type),r=-2}return r+t.bonus}weighPlacement(t){let r=0;const e=t.action,s=a.field.searchByFSA(e),c=a.field.searchByLane(a.field.oppositeLane(e.lane),!e.playerA),u=t.hints.includes("RD");if(s){const y=s.aiHints().includes("RT");y&&u?(this.logHint("Replacement Supercombo - Upgrade and Happy Replace"),r+=G.Grand):y?(this.logHint("Likes being replaced"),r+=G.Noice):u?(this.logHint("Upgrade"),r+=G.Noice):t.hints.includes("RE")||(a.state.gs.turn.mainBattle?r+=G.Bad:r+=G.Never)}else u&&(this.logHint("Upgrade ignored"),r+=G.Bad);return r+=this.weighOpposition(t,c),r+=this.weighLanePlacement(t,e.lane,e.playerA),t.hints.includes("SD")&&(r+=this.weighSacrificeDemand(t)),r}weighStatChange(t){let r=0;return t.hints.includes("SD")&&(r+=this.weighSacrificeDemand(t)),r}weighDestroy(t){let r=0;const e=t.action;return a.field.creatByFSA(e).owner===this.aiPlayer?t.hints.includes("ST")?(this.logHint("Good sacrifice"),r+=G.Noice):r+=G.Horrid:r+=G.Noice,r}weighDmg(t){return 0}weighDiscard(t){let r=0,e;t.action.actionKey==="HDSC"?(a.state.gs.turn.mainBattle||(r+=G.Horrid),e=t.action.hostCard):(r+=G.Noice,e=t.action.card);const c=a.cards.getCard(e).aiHints();return c.includes("LV")?(this.logHint("Good card to level"),r+=G.Noice):c.includes("DL")&&(this.logHint("Bad card to level"),r+=G.Horrid),r}weighMove(t){let r=0;const e=t.action,s=a.field.creatById(e.param),c=s.owner===this.aiPlayer?1:-1,u=this.weighLanePlacement(t,s.lane,s.owner),y=this.weighLanePlacement(t,e.lane,s.owner)-u,A=a.field.searchByLane(a.field.oppositeLane(s.lane),!s.owner),k=this.weighOpposition(t,A),E=a.field.searchByLane(a.field.oppositeLane(e.lane),!s.owner),V=this.weighOpposition(t,E)-k;let _=0;E&&(t.hints.includes("FH")?_=G.Noice:t.hints.includes("FK")&&a.target.levelTestCommon(E.level,s.level)&&(_=G.Grand*2));const st=(y+V+_)*c;return r+st}weighLanePlacement(t,r,e){let s=0;const c=t.hints.includes("NX"),u=t.hints.includes("SL"),m=t.hints.includes("LJ");if(c?r===3?(this.logHint("Nexus"),s+=G.Noice):(this.logHint("Nexus ignored"),s+=G.Bad):u&&(r===1||r===5?(this.logHint("Sidelane"),s+=G.Noice):(this.logHint("Sidelane ignored"),s+=G.Bad)),m){const y=d.crTarg();y.player=a.player.toTarget(e),y.lanes=a.field.adjacentPositions(r);const A=a.field.creatByTarget(y).length;s+=G.Noice*A}return s}weighOpposition(t,r){let e=0;const s=t.hints.includes("OL"),c=t.hints.includes("OP");if(r){const u=r.aiHints(),m=u.includes("OL"),y=u.includes("OP");c?m?(this.logHint("Likes opposition, enemy hates it"),e+=G.Grand):y||(this.logHint("Likes opposition"),e+=G.Noice):s&&(y?(this.logHint("Hates opposition, enemy loves it"),e+=G.Horrid):m||(this.logHint("Hates opposition"),e+=G.Bad))}else c?(this.logHint("Hates open lane"),e+=G.Bad):s&&(this.logHint("Loves open lane"),e+=G.Grand);return e}weighSacrificeDemand(t){let r=G.Never;const e=s=>{r{s.hints.includes("ST")?e(G.Grand*2):St.boardFormula(1,St.creatValueFormula(s),s.attack,0)<2?e(G.Grand):e(G.Horrid)}),r}logHint(t){this.logHints&&console.log("HINT: "+t)}logHintStarter(t,r){this.logHint(`Eval start - ${a.log.actionText(t)} / ${r}`)}}class Kr{logChains=!1;aiPlayer=!1;actEval=new zr(this.aiPlayer);whiffActions=["CANC","DEET","SCRH"];committedVectors=[];evaluateActions(t,r=""){const e=t.filter(s=>this.whiffActions.indexOf(s.actionKey)===-1);return e.forEach(s=>{switch(s.actionKey){case "ACTV":case "CARD":const c=a.cards.getCard(s.hostCard),u=c.evaluateAction(s);if(u.final)s.evals=[[u]];else{const rt=c.getCardActions(s);s.evals=this.evalSmoosh(this.evaluateActions(rt,r+"--"),u)}break;case "FORG":const m=s,y=d.actionEvalReplace(s,m.playerA,m.lane,m.hostCard,!0);s.evals=[[y]];break;case "HDSC":s.evals=[[d.actionEval(s,"DC")]];break;case "HPLY":const A=s,k=ht.extractCardCode(A.card);if(k==="MTS"||k==="MTT")s.evals=[[d.actionEval(s,"NR")]];else{const rt=a.action.getPlayCardActions(A);s.evals=this.evalSmoosh(this.evaluateActions(rt))}break;case "MEND":const E=d.actionEval(s,"MC"),I=a.field.creatById(s.param),V=s;E.hints=I.aiHints();const _=d.evalVectorMod(I.owner,I.lane);_.moveTo=V.lane,E.vectors.push(_),s.evals=[[E]];break;case "MOVE":const st=a.action.getMoveCardActions(s);s.evals=this.evalSmoosh(this.evaluateActions(st));break;case "NOTR":s.evals=[[d.actionEval(s,"NO")]];break;case "FITE":s.evals=[[d.actionEval(s,"FT")]];break;case "ENDT":s.evals=[[d.actionEval(s,"DT")]];break;default:s.evals=[],console.error("Encountered action that AI could not evaluate:",s)}}),e}evalSmoosh(t,r){const e=t.map(s=>s.evals||[]).flat();return r?e.map(s=>[r,...s]):e}processAction(t){const r=this.evaluateActions(t),e=St.fromState(),s=e.boardStats();let c=-9999;const m=r.map(A=>{let k=-9999;return A.evals?.forEach(E=>{let I=0;E.forEach(Pt=>{const Zt=this.actEval.weighEval(Pt);I+=Zt});const V=e.clone(),_=E.map(Pt=>Pt.vectors).flat();V.applyVectors(_);const st=V.boardStats(),rt=!a.state.gs.turn.mainBattle;rt&&V.applyCombat(),V.applyTurnEnd(rt,this.aiPlayer);const bt=V.weighState(s,st,this.aiPlayer);this.logChains&&(this.logChain(E),console.log(`Chain Weight: base + hints: ${I}, board total: ${bt.formula}, crt cnt: ${bt.stats.creatCount}, crt val: ${bt.stats.creatValue}, crt thr: ${bt.stats.threatValue}, pl hlt: ${bt.stats.playerHealth}`)),I=Math.round((I+bt.formula)*2)/2,I>k&&(k=I)}),k>c&&(c=k),{action:A,weight:k}}).filter(A=>A.weight===c),y=m[a.randInt(0,m.length)].action;a.sleep(500).then(()=>{a.action.handleAction(y)})}logChain(t){let r="- ";t.forEach(e=>{e.action.actionKey!=="HPLY"&&(console.log(`${r}Evaluating action ${a.log.actionText(e.action)}`),r="--"+r)})}alliedHint(t){if(t==="A")return "ALA";if(t==="N")return "ALN";if(t==="T")return "ALT";if(t==="U")return "ALU";throw new Error("non faction passed to allied hint")}cardle(t,r=3){return`${t}${r}`}cheatPlop(t,r){const e=a.randInt(0,r.length),s=r[e];return r.splice(e,1),a.field.birthCreature(t,"F",this.aiPlayer,s)}cheater(){const t=a.state.gs;if(!(t.aiMode&&t.aiActive&&t.options.cheater))return!1;const r=a.player.toPlayer(this.aiPlayer),e=a.player.toPlayer(!this.aiPlayer),s=e.health-r.health;let c=0;s>85?c=3:s>65?c=2:s>45&&(c=1);const u=a.field.emptyLanes(this.aiPlayer);if(c===0||u.length===0)return!1;a.log.new().plr(this.aiPlayer).txt(" is a cheaty cheaterton.").go();let m=0;if(c===1){if(t.turn.regularPlays-=1,m=a.randInt(0,13),m===0)this.cheatPlop(this.cardle("HTR"),u);else if(m===1)this.cheatPlop(this.cardle("AGM"),u).addRegen(8);else if(m===2){const y=this.cheatPlop(this.cardle("YNS"),u);y.buff(0,15),y.addRegen(4)}else if(m===3)this.cheatPlop(this.cardle("TBA"),u);else if(m===4)this.cheatPlop(this.cardle("DCS"),u);else if(m===5)this.cheatPlop(this.cardle("GGP"),u).addRegen(8);else if(m===6){const y=this.cheatPlop(this.cardle("WFM"),u);y.aggressive=!0}else if(m===7){const y=this.cheatPlop(this.cardle("FFU"),u);y.aggressive=!0}else if(m===8){const y=this.cheatPlop(this.cardle("URB"),u);y.aggressive=!0}else if(m===9){const y=this.cheatPlop(this.cardle("KOD"),u);y.aggressive=!0,y.addRegen(6)}else if(m===10)this.cheatPlop(this.cardle("AGK"),u).addArmor(3);else if(m===11){const y=this.cheatPlop(this.cardle("PSC"),u);y.aggressive=!0}else if(m===12){const y=this.cheatPlop(this.cardle("SAD"),u);y.aggressive=!0}}else if(c===2)if(t.turn.regularPlays-=1,m=a.randInt(0,17),m===0){const y=this.cheatPlop(this.cardle("NDR"),u);y.aggressive=!0}else if(m===1){const y=this.cheatPlop(this.cardle("CSW"),u);y.aggressive=!0}else if(m===2)this.cheatPlop(this.cardle("GGD"),u).addRegen(6);else if(m===3)this.cheatPlop(this.cardle("EFP"),u);else if(m===4)this.cheatPlop(this.cardle("ZTU"),u);else if(m===5){const y=this.cheatPlop(this.cardle("DDD"),u);y.aggressive=!0}else if(m===6)this.cheatPlop(this.cardle("RBH"),u).addRegen(8);else if(m===7)this.cheatPlop(this.cardle("SFT"),u);else if(m===8)this.cheatPlop(this.cardle("GTT"),u);else if(m===9)this.cheatPlop(this.cardle("SMD"),u);else if(u.length===5)this.cheatPlop(this.cardle("DFB"),u),[1,2,3,4].forEach(y=>this.cheatPlop(this.cardle("XHS"),u));else if(u.length===4)this.cheatPlop(this.cardle("LMV"),u);else if(u.length===3)this.cheatPlop(this.cardle("LHY"),u),this.cheatPlop(this.cardle("SVH"),u),this.cheatPlop(this.cardle("DBA"),u);else if(u.length===2)this.cheatPlop(this.cardle("UTR"),u),this.cheatPlop(this.cardle("TDS"),u);else if(r.turn===4)this.cheatPlop(this.cardle("SSR"),u);else if(r.turn===1)this.cheatPlop(this.cardle("ESK"),u);else{const y=this.cheatPlop(this.cardle("XSH"),u);y.aggressive=!0}else if(c===3)if(m=a.randInt(0,20),m===0){const y=this.cheatPlop(this.cardle("IHA",4),u);y.aggressive=!0}else if(m===1)this.cheatPlop(this.cardle("CHR"),u);else if(m===2)this.cheatPlop(this.cardle("FGO",1),u);else if(m===3)this.cheatPlop(this.cardle("CHV",4),u);else if(m===4)this.cheatPlop(this.cardle("KKK",4),u);else if(r.health<20){const y=this.cheatPlop(this.cardle("ODC",4),u);y.aggressive=!0}else if(u.length===5){const y=a.randInt(0,4);if(y===0)[1,2,3,4,5].forEach(A=>this.cheatPlop(this.cardle("UWL",2),u));else if(y===1)[1,2].forEach(A=>this.cheatPlop(this.cardle("DFB"),u)),[1,2,3].forEach(A=>this.cheatPlop(this.cardle("FFD"),u));else if(y===2)[1,2,3,4,5].forEach(A=>this.cheatPlop(this.cardle("BWK"),u));else if(y===3){this.cheatPlop(this.cardle("SBG"),u),this.cheatPlop(this.cardle("EWE"),u);const A=this.cheatPlop(this.cardle("BMY"),u);A.defender=!0,A.aggressive=!0}}else if(e.health>350)r.health<180&&a.player.healPlayer(r,180-r.health),this.cheatPlop(this.cardle("AGD"),u);else if(e.health>250)this.cheatPlop(this.cardle("FGO"),u);else if(u.length===4){const y=a.randInt(0,3);y===0?(this.cheatPlop(this.cardle("AGK"),u),[1,2,3].forEach(A=>this.cheatPlop(this.cardle("VBK"),u))):y===1?(this.cheatPlop(this.cardle("TDS"),u),this.cheatPlop(this.cardle("TDS"),u),this.cheatPlop(this.cardle("UTR"),u)):y===2&&[1,2,3,4].forEach(A=>this.cheatPlop(this.cardle("CDC"),u))}else if(u.length===3)if(a.randInt(0,2)){this.cheatPlop(this.cardle("SDR"),u),this.cheatPlop(this.cardle("SDR"),u);const y=this.cheatPlop(this.cardle("UPM"),u);y.aggressive=!0}else{this.cheatPlop(this.cardle("SDL"),u);const y=this.cheatPlop(this.cardle("NFF"),u);y.aggressive=!0}else if(u.length===2)this.cheatPlop(this.cardle("SPM"),u),this.cheatPlop(this.cardle("SPM"),u);else{const y=this.cheatPlop(this.cardle("NXC"),u);y.buff(10,0),y.aggressive=!0,y.addMobility(2),y.addRegen(5)}return r.health<30&&a.player.healPlayer(r,50-r.health),!0}}class Yr{constructor(){this.loader=document.getElementById("fileupload"),this.loader.addEventListener("change",t=>this.loadInputHandler(t))}shuffleDeck(t){const r=a.state.getPlayer(t).deck;this.shuffle(r)}shuffle(t){const r=t.length,e=(s,c)=>{const u=t[s];t[s]=t[c],t[c]=u};if(r>0){let s,c;for(let u=0;ue.decks).flat(),r=a.randInt(0,t.length);return t[r]}stockDeckByName(t,r){let e;if(Nt.some(s=>s.id===t?s.decks.some(c=>{c.name===r&&(e=c)}):!1),e)return e;throw new Error("Stock Deck not found: Set: "+t+"; Name: "+r)}ripper(t,r,e){const s=[[15,8,5],[30,15,10]],c=this.getDeckCards([],[t]),u=[],m=s[e===15?0:1][r-1];for(;u.lengthE===k)||u.push(k)}const y=u.map(A=>({card:A,num:r}));return r===2&&e===15&&(y[0].num=1),y}deckify(t){const r=t.map(e=>{const s=be.find(c=>c[0]===e);return s?s[1]:[]}).flat();return t.concat(r).map(e=>`${e}1`)}parseDeck(t){const r=t.map(e=>Array(e.num).fill(e.card)).flat();return this.deckify(r)}validDeck(t){const r={};t.forEach(A=>{r[A.card]?r[A.card]+=A.num:r[A.card]=A.num});const e=Object.entries(r).map(A=>({card:A[0],num:A[1]})),s=e.map(A=>A.num).reduce((A,k)=>A+k,0);if(s!==30)return"Deck must have 30 cards, found "+s;const c=[];let u="";if(e.some(A=>{const k=wt.findIndex(E=>E.crd===A.card);return k===-1?(u=A.card,!0):(c.push(wt[k].fct),!1)}))return`Invalid card code: '${u}'`;let m=0;if(e.some(A=>A.num>3?(u=A.card,m=A.num,!0):!1))return`${m} copies of '${u}' ${a.log.fastName(u)}`;const y=[...new Set(c)];return y.length>2?"Deck must have two or less factions, found: "+y.join():""}getDeckCards(t=[],r=[]){return t.length===0&&r.length===0?wt.map(e=>e.crd):t.length>0&&r.length>0?wt.filter(e=>t.includes(e.rty)&&r.includes(e.fct)).map(e=>e.crd):t.length>0?wt.filter(e=>t.includes(e.rty)).map(e=>e.crd):wt.filter(e=>r.includes(e.fct)).map(e=>e.crd)}getCardFaction(t){const r=wt.find(e=>e.crd===t);return r?r.fct:"X"}getCardRarity(t){const r=wt.find(e=>e.crd===t);return r?r.rty:"T"}cardStats(){re.forEach(t=>{const r=`${a.log.factionText(t)} total: ${this.getDeckCards(void 0,[t]).length}; `,e=Kt.map(s=>`${a.log.rarityText(s)}: ${this.getDeckCards([s],[t]).length}`).join("; ");console.log(r+e)})}loadPromise=new le;fileguts="";loader;async loadFromFile(){if(this.loadPromise=new le,this.loader.click(),await this.loadPromise.getPromise(),this.fileguts==="")return"";if(this.fileguts.startsWith("!")){const s=this.fileguts.substring(1);return this.fileguts="",s}const t=JSON.parse(this.fileguts);this.fileguts="";const r=t.cards,e=this.validDeck(r);return e||r}readError(t){this.fileguts="!"+t,this.loadPromise.resolveMe()}loadInputHandler(t){const r=this.loader.files;if(r&&r.length>0){const s=r[0];var e=new FileReader;e.onload=c=>{try{var u=e.result;if(u){var m=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(u)));m.cards&&Array.isArray(m.cards)&&!m.cards.some(y=>!(y&&typeof y.card=="string"&&Number.isInteger(y.num)))?(this.fileguts=JSON.stringify(m),this.loadPromise.resolveMe()):this.readError("File format is incorrect.")}else this.readError("File read was empty.")}catch(y){console.error(y),this.readError("Error occurred while reading file.")}};try{e.readAsArrayBuffer(s)}catch{this.readError("Could not read file.")}}else this.loadPromise.resolveMe()}}class le{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((t,r)=>{this.resolveMe=t,this.rejectMe=r})}}class qr{rarityCache={["L"]:[],["H"]:[],["R"]:[],["C"]:[],["T"]:[]};faction1="X";faction2="X";factionLock=!1;picks=[];currentPack=[];paginating=!1;aiPicking=!1;packOdds=[];legMode=!1;startDraft(t,r){!t&&r?this.startDraft(!0,!1):(t||(a.state.gs.options.playerDeck=[]),this.aiPicking=t,this.legMode=a.state.gs.options.legDraft,this.paginating=!1,this.packOdds=a.state.gs.options.fatPacks?[9,31,40]:[5,25,40],Kt.forEach(e=>{this.rarityCache[e]=a.deck.getDeckCards([e])}),this.faction1="X",this.faction2="X",this.factionLock=!1,this.picks=[],this.resumeDraft(""))}resumeDraft(t){if(t){if(this.picks.push(t),this.picks.length===30){let s=this.picksAsDeck();this.aiPicking?a.state.gs.options.playerDeck.length>0&&(a.state.setMode("G"),a.state.gs.newGame(a.state.gs.options.playerDeck,this.picksAsDeck())):(this.startDraft(!0,!1),a.state.gs.options.playerDeck=s,a.state.setMode("G"),a.state.gs.newGame(s,this.picksAsDeck()));return}if(!this.factionLock){const s=a.deck.getCardFaction(t);this.faction1==="X"?this.faction1=s:s!==this.faction1&&(this.faction2=s,this.factionLock=!0,Kt.forEach(c=>{this.rarityCache[c]=a.deck.getDeckCards([c],[this.faction1,this.faction2])}))}}const r=this.generatePack().slice(-1*(6-this.picks.length%5)),e=this.fillPack(r);if(this.aiPicking)this.resumeDraft(e[e.length-1]);else{this.currentPack=e;const s=e.map((c,u)=>{const m=d.draftSelectAction("DRFT",u,!0);return m.param=c,m});a.action.setupActions(s)}}picksAsDeck(){const t=[];return this.picks.forEach(r=>{const e=t.findIndex(s=>s.card===r);e===-1?t.push({card:r,num:1}):t[e].num+=1}),t.sort((r,e)=>{const s=a.cards.getCard(r.card+"1"),c=a.cards.getCard(e.card+"1");return s.name.toLowerCase(){const s=this.rarityCache[e].length;let c=!0;for(;c;){const u=this.rarityCache[e][a.randInt(0,s)];r.includes(u)||(r.push(u),c=!1)}}),r}}class ce{id;dom;context;width;height;constructor(t){if(this.id=t,this.dom=document.getElementById(t),!this.dom)throw new Error(`Could not find canvas id ${t}`);this.context=this.dom.getContext("2d"),this.width=this.dom.width,this.height=this.dom.height,this.context.textBaseline="top",this.context.shadowOffsetX=1,this.context.shadowOffsetY=1}show(){this.dom.hidden=!1}hide(){this.dom.hidden=!0}get visible(){return!this.dom.hidden}clear(){this.context.clearRect(0,0,this.width,this.height)}sprite(t,r,e){this.context.drawImage(t,r,e)}}class Xr{registry;constructor(){this.registry={}}register(t){if(this.registry[t])throw new Error(`Double registration of canvas ${t}`);this.registry[t]=new ce(t)}get(t){return this.registry[t]}}class lt{getCanv(t){return t instanceof ce?t:a.canvases.get(t)}async drawSprite(t,r,e,s,c={}){const u=this.getCanv(t).context,m=await a.getSprite(a.imgRoot+r);let y=1;c&&(y=c.alpha??1),y<1&&(u.globalAlpha=y),u.drawImage(m,e,s,m.naturalWidth,m.naturalHeight),y<1&&(u.globalAlpha=1)}async drawText(t,r,e,s,c={}){const u=this.getCanv(t).context;u.fillStyle=c.colour||"#000000",u.font=`${c.fontSize??24}px ${c.fontName||"cinzel"}`,u.shadowColor=c.shadow?"#000000":"#00000000",u.fillText(r,e,s),u.shadowColor="#00000000"}async drawHighlight(t,r,e,s,c,u="#00FF00"){const m=u.length===7?u.concat("aa"):u,y=this.getCanv(t);y.context.strokeStyle=m,y.context.beginPath(),y.context.rect(r,e,s,c),y.context.stroke()}hlColour(t){return t==="CANC"?"#FF0000":"#00FF00"}drawRarity(t,r,e,s){return this.drawSprite(t,`icons/rarity/new/${a.log.rarityText(r).toLowerCase()}.png`,e,s)}drawFaction(t,r,e,s){const c=r==="T"?2:0;return this.drawSprite(t,`icons/faction/${a.log.factionText(r).toLowerCase()}.png`,e+c,s+3)}}class Qt extends lt{async drawButton(t,r,e,s,c,u=7,m=!1){let y,A;m?(y="ui/button/menu_on.png",A="#d7fc03"):(y="ui/button/menu_off.png",A="#00DEF7");const k=this.buttonBounds(r,e);await this.drawSprite(t,y,k[0],k[1]),await this.drawText(t,c,k[0]+7+u,k[1]+24,{colour:A,fontSize:30});const E=new Z(s,...k);a.clickers.add(E)}buttonBounds(t,r){return[t-7,r-7,232,69]}}class jr extends lt{async drawActions(t){const r=a.canvases.get("effects"),e=t.filter(s=>s.zone==="B");if(e.length>1&&console.error("Two button actions encountered in one batch",e),e.length===0){const s=this.buttonBounds();await this.drawSprite(r,"ui/button/off.png",s[0],s[1])}else{const s=e[0],c=this.buttonBounds();await this.drawSprite(r,"ui/button/on.png",c[0],c[1]);const m={["HDSC"]:{s:"Discard",x:22},["ENDT"]:{s:"Done",x:41},["FITE"]:{s:"Fight",x:42},["NOTR"]:{s:"None",x:41},["ACTV"]:{s:"Activ8",x:33},["CANC"]:{s:"Cancel",x:28}}[s.actionKey]??{s:"???",x:60};await this.drawText(r,m.s,c[0]+m.x,c[1]+21,{colour:"#00ff00",fontSize:26});const y=this.highlightBounds(),A=new Z(s,...y);a.clickers.add(A)}}buttonBounds(){return[856,406,160,63]}highlightBounds(){const t=this.buttonBounds(),r=5,e=[-1,-1,2,2];return t.map((s,c)=>s+r*e[c])}}const de={colour:"#ffd865",fontSize:18,fontName:"serif"},Jr={colour:"#0f300f",fontSize:18,fontName:"serif"};class Rt extends lt{async drawCard(t,r,e,s){const c=this.getCanv(r);let u,m=!1,y=0,A=0,k=!1,E=0,I=!1,V=!1,_=!1,st=!1,rt=0,bt=0,Pt=0,Zt=!1;if(!(t instanceof ht))m=!0,y=t.attack,A=t.health,k=t.sleeping&&!t.aggressive,E=t.regen,I=t.breakthrough,V=t.defender,_=t.aggressive,rt=t.armor,bt=t.poison,Pt=t.mobility,st=t.changed,u=a.cards.getCard(t.code);else{if(t.type==="C"){m=!0;const at=t;y=at.initAttack,A=at.initHealth,E=at.initRegen,I=at.initBT,V=at.initDefend,_=at.initAggro,rt=at.initArmor,Pt=at.initMobile}Zt=t.overload,u=t}if(u.faction,await this.drawSprite(c,u.image,e+14,s+35),await this.drawSprite(c,this.frameImg(u.level,u.faction,u.type),e,s),m){const at=s+177,zt=e+15,ee=e+119,pe=this.statFormat(y);await this.drawText(c,pe[0],zt+(pe[1]?4:0),at,de);const ye=this.statFormat(A);await this.drawText(c,ye[0],ee+(ye[1]?4:0),at,de)}k&&await this.drawSprite(c,"icons/effects/defensive.png",e+5,s+40,{alpha:.7});const nt=[];if(Zt&&nt.push(["overload",0]),E>0&&nt.push(["regenerate",E]),I&&nt.push(["breakthrough",0]),V&&nt.push(["defender",0]),_&&nt.push(["aggressive",0]),rt>0&&nt.push(["armor",rt]),bt>0&&nt.push(["poison",bt]),Pt>0&&nt.push(["mobility",Pt]),st&&nt.push(["changed",0]),nt.length>0){const at=e+54-17*(nt.length-1);await Promise.all(nt.map(async(zt,ee)=>this.drawIcon(c,at+ee*35,s+140,zt[0],zt[1])))}}async drawIcon(t,r,e,s,c=0){const u=this.getCanv(t);if(await this.drawSprite(u,`icons/effects/${s}.png`,r,e),c>0){const m=this.statFormat(c);await this.drawText(u,m[0],r+(m[1]?12:7),e+8,Jr)}}async drawHilight(t,r,e,s="#00FF00"){await super.drawHighlight(t,...this.highlightBounds(r,e),s)}cardBounds(t,r){return[t,r,150,205]}highlightBounds(t,r){const e=this.cardBounds(t,r),s=5,c=[-1,-1,2,2];return e.map((u,m)=>u+s*c[m])}frameImg(t,r,e){return`frames/small/lvl${t}_${r}${e}.png`}levelImg(t){return`icons/frame/lvl${t}.png`}oldFrameImg(t){return`icons/frame/frame${t}.png`}factionImg(t){return`icons/faction/orb${t}.png`}statFormat(t){const r=t.toString();return[r,r.length===1]}}const ue=30,Ot=540,fe=5;class ge extends lt{async drawCards(t){const r=a.canvases.get("hand");r.clear();const e=new Rt,s=e.highlightBounds(0,0)[2]+fe;let c=ue;const u=this.paginatron(t);for(let m=u[0];m<=u[1];m++){const y=a.cards.getCard(t.hand[m]);await e.drawCard(y,r,c,Ot),c+=s}}async drawActions(t){const r=a.canvases.get("effects"),e=new Rt,s=e.highlightBounds(0,0)[2]+fe,c=new Ct(0,520,1e3,250),u=new Ct(0,520,1e3,250,Tt.Right),m=this.paginatron(a.state.getActivePlayer());await Promise.all(t.filter(y=>y.zone==="H").map(async y=>{const A=y;if(A.position>=m[0]&&A.position<=m[1]){const k=ue+(A.position-m[0])*s;if(y.actionKey==="DEET"){const E=new Z(y,...e.highlightBounds(k,Ot),Tt.Right);u.addChild(E)}else{const E=new Z(y,...e.highlightBounds(k,Ot));c.addChild(E),await e.drawHilight(r,k,Ot,this.hlColour(A.actionKey))}}})),a.clickers.add(c),a.clickers.add(u),m[0]>0&&await this.makeScroller(r,!1),m[1]0&&t.hand.length-r<5&&(r=Math.max(0,t.hand.length-5),a.state.gs.ui.handScrollLeft=r),[r,Math.min(r+4,t.hand.length-1),t.hand.length-1]}scrollHilightBounds(t,r){return[t-3,r-2,27,38]}async makeScroller(t,r){const e=r?948:899,s=715,c=this.scrollHilightBounds(e,s);await this.drawSprite(t,`ui/arrow/${r?"right":"left"}.png`,e,s),await this.drawHighlight(t,...c);const u={zone:"N",actionKey:"SCRH",hostCard:"",param:r?"R":"L"},m=new Z(u,...c);a.clickers.add(m)}}class _t extends lt{fieldBoundary=[17,62,821,443];async drawCards(t){const r=a.state.gs.isLocalA,e=a.canvases.get("field");e.clear();const s=new Rt,c=a.field.qActiveCreats().map(u=>{let m=0;t&&t.scrappers.some(A=>A[0]===u.lane&&A[1]===u.owner)&&(m=t.battlePhase);const y=this.coordCalc(u.lane,u.owner,r,m);return s.drawCard(u,e,...y)});await Promise.all(c)}async drawActions(t){const r=a.state.gs.isLocalA,e=a.canvases.get("effects"),s=new Rt,c=new Ct(...this.fieldBoundary),u=new Ct(...this.fieldBoundary,Tt.Right);await Promise.all(t.filter(m=>m.zone==="F"||m.zone==="R").map(async m=>{if(m.zone==="R"){const y=new Z(m,...this.fieldBoundary);a.clickers.add(y),await this.drawHighlight(e,...this.fieldBoundary)}else{const y=m,A=this.coordCalc(y.lane,y.playerA,r);if(m.actionKey==="DEET"){const k=new Z(m,...s.highlightBounds(...A),Tt.Right);u.addChild(k)}else{const k=new Z(m,...s.highlightBounds(...A));c.addChild(k),await s.drawHilight(e,...A,this.hlColour(y.actionKey))}}})),c.childs.length>0&&a.clickers.add(c),u.childs.length>0&&a.clickers.add(u)}async drawFight(t){if(t.length>0){const r={battlePhase:1,scrappers:t},e=72;await this.drawCards(r),await a.sleep(e),r.battlePhase=2,await this.drawCards(r),await a.sleep(e),r.battlePhase=3,await this.drawCards(r),await a.sleep(e),r.battlePhase=4,await this.drawCards(r),await a.sleep(e+70),r.battlePhase=3,await this.drawCards(r),await a.sleep(e),r.battlePhase=2,await this.drawCards(r),await a.sleep(e),r.battlePhase=1,await this.drawCards(r),await a.sleep(e)}}coordCalc(t,r,e,s=0){const c=e===r,u=166,m=5;let y,A,k;return[y,k,A]=c?[22,290,1]:[687,65,-1],[y+(t-1)*u*A,k+s*m*(-1*A)]}}class te extends lt{avatars=["barf","beee","behold","boof","crowley","darko","deert","eyebs","fine","furiousgeorge","ghoost","judge","kenta","nom","pupsky","skelly","stache"];async drawPlayer(t,r,e,s){const c=this.getCanv(r);await this.drawSprite(c,`avatar/${this.avatars[t.avatar]}.jpg`,e+46,s+48),await this.drawSprite(c,"ui/player_frame.png",e,s),await this.drawSprite(c,"ui/player_health.png",e+10,s+102);let u;t.health>99||t.health<-9?u=26:t.health>9||t.health<0?u=33:u=39,await this.drawText(c,t.health.toString(),e+u,s+147,{colour:"#00FF00",fontName:"serif"}),await this.drawText(c,`Turn: ${t.turn.toString()} Rank: ${t.rank.toString()}`,e+25,s+210,{colour:"#f5f242",fontSize:20}),await this.drawText(c,t.name,e+t.nameOffset,s+185,{colour:"#42a4f5",fontSize:20})}async drawAllPlayers(){const t=a.canvases.get("player");t.clear();const r=a.state.getLocalPlayer(),e=a.state.getPlayer(!r.isPlayerA);if(await this.drawPlayer(r,t,...this.playerOrigin(!0)),await this.drawPlayer(e,t,...this.playerOrigin(!1)),r.isPlayerA===a.state.getActivePlayerB()){let s=862;const c=350,u=a.state.getRegularPlays(),m=a.state.gs.turn.freeCards.length,y=Array(u).fill("blue").concat(Array(m).fill("green")),A=[];y.forEach(k=>{A.push(this.drawSprite(t,`ui/${k}card.png`,s,c)),s+=30}),await Promise.all(A)}}async drawActions(t){const r=a.canvases.get("effects"),e=a.state.gs.isLocalA;await Promise.all(t.filter(s=>s.zone==="P").map(s=>{const c=s,u=this.playerOrigin(c.playerA===e),m=this.highlightBounds(...u),y=new Z(s,...m);return a.clickers.add(y),this.drawHighlight(r,...m)}))}playerOrigin(t){return[832,t?485:0]}playerBounds(t,r){return[t+18,r+18,170,170]}highlightBounds(t,r){return this.playerBounds(t,r)}async drawGameOver(){const t=a.canvases.get("field"),r=a.state.gs.isLocalA,e=a.state.gs.winFlag,s=r&&e===1||!r&&e===-1;await this.drawSprite(t,`ui/you-${s?"win":"lose"}.png`,89,89),a.clickers.removeAll();const c=new Qt,u=a.canvases.get("effects");await c.drawButton(u,151,520,d.menuButtonAction("MM"),"Main Menu",20,!1),await c.drawButton(u,478,520,d.menuButtonAction("RP"),"Replay",55,!1)}}class Qr extends lt{async drawCards(t){const r=a.canvases.get("card");r.clear(),r.context.fillStyle="#222222cc",r.context.fillRect(0,0,a.gameWidth,a.gameHeight);const e=typeof t=="string"?a.cards.getCard(t):t;let s;if(e.rarity==="T")s=[e];else{const A=e.maxLevel,k=ht.extractCardCode(e.code);s=a.field.laneIdx.filter(E=>E<=A).map(E=>E===e.level?e:a.cards.getCard(`${k}${E}`))}const c=new Rt;let u=3;const m=s.length,y=m===4;u0;){let st;if(V.lengtha.log.tribeText(r)).join(" "):""}}class _r extends lt{async drawPack(t,r){const e=new Rt,s=[],c=new Ct(...this.packBoundary),u=new Ct(...this.packBoundary,Tt.Right);t.filter(y=>y.pack).forEach(y=>{const A=this.coordCalcPack(y.index);if(y.actionKey==="DRFT"){const k=a.cards.getCard(y.param+"1");s.push(e.drawCard(k,r,...A).then(()=>this.drawRarity(r,k.rarity,A[0]+112,A[1]+4)));const E=new Z(y,...e.highlightBounds(...A));c.addChild(E)}else{const k=new Z(y,...e.highlightBounds(...A),Tt.Right);u.addChild(k)}}),a.clickers.add(c),a.clickers.add(u),await Promise.all(s)}async drawList(t,r){let e=170;const s=570,c=[],u=a.draft.picksAsDeck(),m=new Ct(s,e,600,600,Tt.Right),y=t,A=15,k=a.draft.paginating;u.length>A&&await this.makeScroller(r,k),y.filter(E=>!E.pack).forEach(E=>{if(k===E.index>=A){const I=a.cards.getCard(E.param+"1");c.push(this.drawFaction(r,I.faction,s,e),this.drawRarity(r,I.rarity,s+28,e),this.drawText(r,`${u[E.index].num}x ${I.name}`,s+65,e+7,{colour:"#f5f242"}));const V=new Z(E,s,e-2,600,35,Tt.Right);m.addChild(V),e+=35}}),await Promise.all(c),a.clickers.add(m)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,c=Math.floor(t/3);return[22+s*176,200+c*235]}scrollHilightBounds(t,r){return[t-5,r-5,26,26]}async makeScroller(t,r){const c=this.scrollHilightBounds(530,720);await this.drawSprite(t,`ui/arrow/${r?"up":"down"}.png`,530,720);const u={zone:"N",actionKey:"SCRD",hostCard:"",param:r?"U":"D"},m=new Z(u,...c);a.clickers.add(m)}}class me extends lt{async drawSets(t,r){let e=200;const s=100,c=[],u=new Ct(s,e,400,600);t.filter(k=>k.actionKey==="DSET").forEach(k=>{const E=Nt[parseInt(k.param)];c.push(this.drawText(r,E.name,s,e,{colour:"#f5f242"}),this.drawSprite(r,"icons/chest_small.png",s-48,e-5));const I=new Z(k,s,e-2,400,35);u.addChild(I),e+=45}),c.push(this.drawText(r,"Random Deck",s,e,{colour:"#f5f242"}),this.drawSprite(r,"icons/chest_small.png",s-48,e-5));const m=new Z({actionKey:"DECK",zone:"N",param:"~random~",hostCard:""},s,e-2,400,35);u.addChild(m),a.clickers.add(u),await Promise.all(c);const y={actionKey:"MNBT",zone:"N",hostCard:"",param:"LK"};await new Qt().drawButton(r,s-48,650,y,"LOAD FILE",32)}async drawList(t,r){let e=170;const s=570,c=[],u=new Ct(s,e,600,600);t.filter(m=>m.actionKey==="DECK").forEach(m=>{const y=a.deTil(m.param),A=a.deck.stockDeckByName(y[0],y[1]);c.push(this.drawFaction(r,A.factions[0],s,e),this.drawText(r,A.name,s+65,e+7,{colour:"#f5f242"})),A.factions.length===2&&c.push(this.drawFaction(r,A.factions[1],s+28,e));const k=new Z(m,s,e-2,600,35);u.addChild(k),e+=35}),await Promise.all(c),a.clickers.add(u)}packBoundary=[17,190,537,480];coordCalcPack(t){const s=t%3,c=Math.floor(t/3);return[22+s*176,200+c*235]}iAmError(t){const r=a.canvases.get("game-ui");this.drawText(r,t,295,670,{colour:"#f5142e",fontSize:26})}}class ti extends lt{async drawMenu(t){const r=new Qt,e=80,s=45,c=240;let u=50,m=c;await this.textFun(u+28,m,"More Info",t),m+=s,await this.buttonMaker(t,r,u,m,"RU","RULES",66),m+=e,await this.buttonMaker(t,r,u,m,"FQ","INFO & FAQ",20),m+=e*2,await this.buttonMaker(t,r,u,m,"MM","MAIN MENU",20),u=404,m=c,await this.textFun(u+5,m,"Draft Modes",t),m+=s,await this.buttonMaker(t,r,u,m,"GP","GOOD PACKS",9,a.state.gs.options.fatPacks),m+=e,await this.buttonMaker(t,r,u,m,"LD","LEGENDARY",17,a.state.gs.options.legDraft),u=757,m=c,await this.textFun(u+12,m,"Game Modes",t),m+=s,await this.buttonMaker(t,r,u,m,"HH","BIG HEALTH",20,a.state.gs.options.highHealth),m+=e,await this.buttonMaker(t,r,u,m,"CH","CHEATER",37,a.state.gs.options.cheater),m+=e,await this.buttonMaker(t,r,u,m,"BB","BATTLE BARK",13,a.state.gs.options.bark)}async textFun(t,r,e,s){await this.drawText(s,e,t,r,{colour:"#f5f242",fontSize:30})}async buttonMaker(t,r,e,s,c,u,m=7,y=!1){const A={actionKey:"MNBT",zone:"N",hostCard:"",param:c};await r.drawButton(t,e,s,A,u,m,y)}}class ei extends lt{async drawMenu(t){let e=22;await this.drawSprite(t,"ui/button/constructed.png",778,e);const s={zone:"N",actionKey:"MENU",hostCard:"",param:"C"},c=new Z(s,...this.buttHilightBounds(778,e));a.clickers.add(c),e=148,await this.drawSprite(t,"ui/button/draft.png",778,e);const u={zone:"N",actionKey:"MENU",hostCard:"",param:"D"},m=new Z(u,...this.buttHilightBounds(778,e));a.clickers.add(m),e=508,await this.drawSprite(t,"ui/button/deck.png",778,e);const y={zone:"N",actionKey:"MENU",hostCard:"",param:"B"},A=new Z(y,...this.buttHilightBounds(778,e));a.clickers.add(A),e=634,await this.drawSprite(t,"ui/button/info.png",778,e);const k={zone:"N",actionKey:"MENU",hostCard:"",param:"I"},E=new Z(k,...this.buttHilightBounds(778,e));a.clickers.add(E),await this.drawSprite(t,"gwg/gwg_red.png",58,0)}buttBounds(t,r){return[t,r,242,113]}buttHilightBounds(t,r){const s=[-3,-3,6,6];return this.buttBounds(t,r).map((c,u)=>c+s[u])}textFun(t,r,e,s){this.drawText(s,e,t+89,r+40,{colour:"#1aa0e3",fontSize:20})}}class ri{gameWidth;gameHeight;spriteCache;action;ai;batch;canvases;cards;clickers;creat;data;death;deck;draft;drawing;effect;field;fight;log;phase;player;state;target;trigger;turn;dogAudio;idnum=0;imgRoot;constructor(){this.spriteCache={},this.imgRoot="./img/",this.gameWidth=1024,this.gameHeight=768,this.action=new Wr,this.ai=new Kr,this.batch=new Nr,this.canvases=new Xr,this.cards=new Er,this.clickers=new Mr,this.creat=new Ir,this.data=new Pr,this.death=new Hr,this.deck=new Yr,this.draft=new qr,this.drawing=new Zr,this.effect=new $r,this.field=new Gr,this.fight=new Lr,this.log=new Dr,this.phase=new Br,this.player=new Vr,this.state=new Or,this.target=new Ur,this.trigger=new Fr,this.turn=new Rr,this.dogAudio=document.getElementById("dogbark")}randInt(t,r){return Math.floor(Math.random()*(r-t))+t}isUn(t){return typeof t>"u"}async sleep(t){return new Promise(r=>{setTimeout(()=>{r()},t)})}async getSprite(t){return this.spriteCache[t]||(this.spriteCache[t]=this.imageLoader(t)),this.spriteCache[t]}async bulkLoadSprite(t){await Promise.all(t.map(r=>this.getSprite(`${this.imgRoot}${r}`)))}dogBark(){this.dogAudio.volume=.3,this.dogAudio.play()}genId(t){const e=t??this.state.gs.isLocalA?"@":"!";return this.idnum+=1,this.idnum.toString(36)+e}enTil(...t){return t.join("~")}deTil(t){return t.split("~")}imageLoader(t){return new Promise(r=>{const e=new Image;e.onload=()=>{r(e)},e.src=t})}}const a=new ri;window.onload=async()=>{await document.fonts.ready;let o=[];document.fonts.forEach(k=>{k.load(),o.push(k.loaded)}),await Promise.all(o),["game-ui","field","player","hand","effects","decklist","card"].forEach(k=>{a.canvases.register(k)});const r=a.canvases.get("effects");r.context.lineWidth=2;let e=!1;try{document.createEvent("TouchEvent"),e=!0}catch{e=!1}const s=(k,E,I)=>{if(a.state.gs.ui.detailsMode)a.state.clearDetails();else{const V=a.clickers.hitTest(k,E,I);V&&a.action.handleAction(V)}};let c=!1,u;const m=k=>{k.button===2?s(k.pageX,k.pageY,k.button):c?(clearTimeout(u),c=!1,s(k.pageX,k.pageY,2)):(c=!0,u=setTimeout(()=>{c=!1,s(k.pageX,k.pageY,k.button)},500))},y=k=>{s(k.pageX,k.pageY,k.button)},A=document.getElementById("solforge");e?A.addEventListener("click",m):(A.addEventListener("click",y),A.addEventListener("contextmenu",k=>(k.preventDefault(),y(k),!1))),a.drawing.drawAll()}})(); diff --git a/play/index.html b/play/index.html new file mode 100644 index 0000000..92ace0b --- /dev/null +++ b/play/index.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + Solforge - Mimicwurm Edition + + + +
+
+ + + + + + + + + + + +
+
+
    +
+
+
+ + + +