var STANDARD_SETS = ["Basic", "Classic", "Whispers of the Old Gods", "One Night in Karazhan", "Mean Streets of Gadgetzan", "Journey to Un'goro", "Knights of the Frozen Throne"]; var BUILDER_MODE = "Standard"; var BEASTS_TO_USE_COMPLICATED = []; var BEASTS_TO_USE_SIMPLE = []; // dump-beasts.py complicated var BEASTS_COMPLICATED = [ {'name': "King Mukla", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/814/373.png', 'cost': 3, 'atk': 5, 'health': 5, 'text': "Battlecry: Give your opponent 2 Bananas.", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Legendary', 'cardId': '373' }, {'name': "Captain's Parrot", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/149/490/559.png', 'cost': 2, 'atk': 1, 'health': 1, 'text': "Battlecry: Draw a Pirate from your deck.", 'expansion': "Rewards", 'hsclass': 'Neutral', 'rarity': 'Epic', 'cardId': '559' }, {'name': "Desert Camel", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/272/340/27251.png', 'cost': 3, 'atk': 2, 'health': 4, 'text': "Battlecry: Put a 1-Cost minion from each deck into the battlefield.", 'expansion': "The League of Explorers", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '27251' }, {'name': "Tundra Rhino", 'cardImg': 'https://media-Hearth.cursecdn.com/avatars/320/450/162.png', 'cost': 5, 'atk': 2, 'health': 5, 'text': "Your Beasts have Charge.", 'expansion': "Basic", 'hsclass': 'Hunter', 'rarity': 'Free', 'cardId': '162' }, {'name': "Hungry Crab", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/149/495/660.png', 'cost': 1, 'atk': 1, 'health': 2, 'text': "Battlecry: Destroy a Murloc and gain +2/+2.", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Epic', 'cardId': '660' }, {'name': "Gentle Megasaur", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/991/52595.png', 'cost': 4, 'atk': 5, 'health': 4, 'text': "Battlecry: Adapt your Murlocs.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Epic', 'cardId': '52595' }, {'name': "Ironbeak Owl", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/289/30/500.png', 'cost': 3, 'atk': 2, 'health': 1, 'text': "Battlecry: Silence a minion.", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '500' }, {'name': "Dire Wolf Alpha", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/148/60/305.png', 'cost': 2, 'atk': 2, 'health': 2, 'text': "Adjacent minions have +1 Attack.", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '305' }, {'name': "Scavenging Hyena", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/148/388/279.png', 'cost': 2, 'atk': 2, 'health': 2, 'text': "Whenever a friendly Beast dies, gain +2/+1.", 'expansion': "Classic", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '279' }, {'name': "Starving Buzzard", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/438/101.png', 'cost': 5, 'atk': 3, 'health': 2, 'text': "Whenever you summon a Beast, draw a card.", 'expansion': "Basic", 'hsclass': 'Hunter', 'rarity': 'Free', 'cardId': '101' }, {'name': "Haunted Creeper", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/148/626/7756.png', 'cost': 2, 'atk': 1, 'health': 2, 'text': "Deathrattle: Summon two 1/1 Spectral Spiders.", 'expansion': "Curse of Naxxramas", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '7756' }, {'name': "Webspinner", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/148/660/7741.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Deathrattle: Add a random Beast card to your hand.", 'expansion': "Curse of Naxxramas", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '7741' }, {'name': "King of Beasts", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/148/906/12285.png', 'cost': 5, 'atk': 2, 'health': 6, 'text': "Taunt. Battlecry: Gain +1 Attack for each other Beast you have.", 'expansion': "Goblins vs Gnomes", 'hsclass': 'Hunter', 'rarity': 'Rare', 'cardId': '12285' }, {'name': "Core Rager", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/197/984/14444.png', 'cost': 4, 'atk': 4, 'health': 4, 'text': "Battlecry: If your hand is empty, gain +3/+3.", 'expansion': "Blackrock Mountain", 'hsclass': 'Hunter', 'rarity': 'Rare', 'cardId': '14444' }, {'name': "Armored Warhorse", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/252/262/22312.png', 'cost': 4, 'atk': 5, 'health': 3, 'text': "Battlecry: Reveal a minion in each deck. If yours costs more, gain Charge.", 'expansion': "The Grand Tournament", 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '22312' }, {'name': "Mukla's Champion", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/252/226/22318.png', 'cost': 5, 'atk': 4, 'health': 3, 'text': "Inspire: Give your other minions +1/+1.", 'expansion': "The Grand Tournament", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '22318' }, {'name': "Dreadscale", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/252/396/22389.png', 'cost': 3, 'atk': 4, 'health': 2, 'text': "At the end of your turn, deal 1 damage to all other minions.", 'expansion': "The Grand Tournament", 'hsclass': 'Hunter', 'rarity': 'Legendary', 'cardId': '22389' }, {'name': "King's Elekk", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/252/384/22370.png', 'cost': 2, 'atk': 3, 'health': 2, 'text': "Battlecry: Reveal a minion in each deck. If yours costs more, draw it.", 'expansion': "The Grand Tournament", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '22370' }, {'name': "Tomb Spider", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/272/370/27226.png', 'cost': 4, 'atk': 3, 'health': 3, 'text': "Battlecry: Discover a Beast.", 'expansion': "The League of Explorers", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '27226' }, {'name': "Fiery Bat", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/289/283/35214.png', 'cost': 1, 'atk': 2, 'health': 1, 'text': "Deathrattle: Deal 1 damage to a random enemy.", 'expansion': "Whispers of the Old Gods", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '35214' }, {'name': "Huge Toad", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/285/249/635951427946440115.png', 'cost': 2, 'atk': 3, 'health': 2, 'text': "Deathrattle: Deal 1 damage to a random enemy.", 'expansion': "The League of Explorers", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '27219' }, {'name': "Jeweled Scarab", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/310/390/27211.png', 'cost': 2, 'atk': 1, 'health': 1, 'text': "Battlecry: Discover a 3-Cost card.", 'expansion': "The League of Explorers", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '27211' }, {'name': "Princess Huhuran", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/289/461/35188.png', 'cost': 5, 'atk': 6, 'health': 5, 'text': "Battlecry: Trigger a friendly minion's Deathrattle effect.", 'expansion': "Whispers of the Old Gods", 'hsclass': 'Hunter', 'rarity': 'Legendary', 'cardId': '35188' }, {'name': "Infested Wolf", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/289/331/35215.png', 'cost': 4, 'atk': 3, 'health': 3, 'text': "Deathrattle: Summon two 1/1 Spiders.", 'expansion': "Whispers of the Old Gods", 'hsclass': 'Hunter', 'rarity': 'Rare', 'cardId': '35215' }, {'name': "Golakka Crawler", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/90/55453.png', 'cost': 2, 'atk': 2, 'health': 3, 'text': "Battlecry: Destroy a Pirate and gain +1/+1.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '55453' }, {'name': "Pantry Spider", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/310/610/42053.png', 'cost': 3, 'atk': 1, 'health': 3, 'text': "Battlecry: Summon a 1/3 Spider.", 'expansion': "One Night in Karazhan", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '42053' }, {'name': "Dispatch Kodo", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/309/86/49674.png', 'cost': 4, 'atk': 2, 'health': 4, 'text': "Battlecry: Deal damage equal to this minion's Attack.", 'expansion': "Mean Streets of Gadgetzan", 'hsclass': 'Hunter', 'rarity': 'Rare', 'cardId': '49674' }, {'name': "Knuckles", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/309/83/49682.png', 'cost': 5, 'atk': 3, 'health': 7, 'text': "After this attacks a minion, it also hits the enemy hero.", 'expansion': "Mean Streets of Gadgetzan", 'hsclass': 'Hunter', 'rarity': 'Legendary', 'cardId': '49682' }, {'name': "Rat Pack", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/309/62/49681.png', 'cost': 3, 'atk': 2, 'health': 2, 'text': "Deathrattle: Summon a number of 1/1 Rats equal to this minion's Attack.", 'expansion': "Mean Streets of Gadgetzan", 'hsclass': 'Hunter', 'rarity': 'Epic', 'cardId': '49681' }, {'name': "Alleycat", 'cardImg': 'https://media-Hearth.cursecdn.com/avatars/309/56/49745.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Battlecry: Summon a 1/1 Cat.", 'expansion': "Mean Streets of Gadgetzan", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '49745' }, {'name': "Crackling Razormaw", 'cardImg': 'https://media-Hearth.cursecdn.com/avatars/320/222/55500.png', 'cost': 2, 'atk': 3, 'health': 2, 'text': "Battlecry: Adapt a friendly Beast.", 'expansion': "Journey to Un'goro", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '55500' }, {'name': "Emerald Reaver", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/84/55568.png', 'cost': 1, 'atk': 2, 'health': 1, 'text': "Battlecry: Deal 1 damage to each hero.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55568' }, {'name': "Vicious Fledgling", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/952/55584.png', 'cost': 3, 'atk': 3, 'health': 3, 'text': "After this minion attacks a hero, Adapt.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '55584' }, {'name': "Ravasaur Runt", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/834/55521.png', 'cost': 2, 'atk': 2, 'health': 2, 'text': "Battlecry: If you control at least 2 other minions, Adapt.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55521' }, {'name': "Nesting Roc", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/81/55573.png', 'cost': 5, 'atk': 4, 'health': 7, 'text': "Battlecry: If you control at least 2 other minions, gain Taunt.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55573' }, {'name': "Jeweled Macaw", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/210/55528.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Battlecry: Add a random Beast to your hand.", 'expansion': "Journey to Un'goro", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '55528' }, {'name': "Emerald Hive Queen", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/979/55575.png', 'cost': 1, 'atk': 2, 'health': 3, 'text': "Your minions cost (2) more.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Epic', 'cardId': '55575' }, {'name': "Stampeding Kodo", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/149/566/389.png', 'cost': 5, 'atk': 3, 'health': 5, 'text': "Battlecry: Destroy a random enemy minion with 2 or less Attack.", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '389' }, {'name': "Kindly Grandmother", 'cardImg': 'https://media-Hearth.cursecdn.com/avatars/304/612/42020.png', 'cost': 2, 'atk': 1, 'health': 1, 'text': "Deathrattle: Summon a 3/2 Big Bad Wolf.", 'expansion': "One Night in Karazhan", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '42020' }, {'name': "Weasel Tunneler", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/715/49758.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Deathrattle: Shuffle this minion into your opponent's deck.", 'expansion': "Mean Streets of Gadgetzan", 'hsclass': 'Neutral', 'rarity': 'Epic', 'cardId': '49758' }, {'name': "Bittertide Hydra", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/985/55570.png', 'cost': 5, 'atk': 8, 'health': 8, 'text': "Whenever this minion takes damage, deal 3 damage to your hero.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Epic', 'cardId': '55570' }, {'name': "Thunder Lizard", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/967/55506.png', 'cost': 3, 'atk': 3, 'health': 3, 'text': "Battlecry: If you played an Elemental last turn, Adapt.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55506' }, {'name': "Raptor Hatchling", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/216/55502.png', 'cost': 1, 'atk': 2, 'health': 1, 'text': "Deathrattle: Shuffle a 4/3 Raptor into your deck.", 'expansion': "Journey to Un'goro", 'hsclass': 'Hunter', 'rarity': 'Rare', 'cardId': '55502' }, {'name': "Pterrordax Hatchling", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/319/825/55591.png', 'cost': 3, 'atk': 2, 'health': 2, 'text': "Battlecry: Adapt.", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55591' }, {'name': "Angry Chicken", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/801/57.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Enrage: +5 Attack.", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '57' }, {'name': "Bearshark", 'cardImg': 'http://media-hearth.cursecdn.com/avatars/336/250/636367040553987117.png', 'cost': 3, 'atk': 4, 'health': 3, 'text': "Can't be targeted by spells or Hero Powers", 'expansion': 'Knights of the Frozen Throne', 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '61827'}, {'name': "Corpse Widow", 'cardImg': 'http://media-hearth.cursecdn.com/avatars/336/906/636371706452688781.png', 'cost': 5, 'atk': 4, 'health': 6, 'text': "Your Deathrattle cards cost (2) less.", 'expansion': 'Knights of the Frozen Throne', 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '62867'}, {'name': "Exploding Bloatbat", 'cardImg': 'http://media-hearth.cursecdn.com/avatars/338/883/636377122460740861.png', 'cost': 4, 'atk': 2, 'health': 1, 'text': "Deathrattle: Deal 2 damage to all enemy minions.", 'expansion': 'Knights of the Frozen Throne', 'hsclass': 'Hunter', 'rarity': 'Rare', 'cardId': '62942'}, {'name': "Arfus", 'cardImg': 'http://media-hearth.cursecdn.com/avatars/338/864/636377086585345525.png', 'cost': 4, 'atk': 2, 'health': 2, 'text': "Deathrattle: Add a random Death Knight card to your hand.", 'expansion': 'Knights of the Frozen Throne', 'hsclass': 'Neutral', 'rarity': 'Legendary', 'cardId': '62923'}, ]; // dump-beasts.py simple var BEASTS_SIMPLE = [ {'name': "Jungle Panther", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/826/392.png', 'cost': 3, 'atk': 4, 'health': 2, 'text': "Stealth", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '392' }, {'name': "Oasis Snapjaw", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/577/15.png', 'cost': 4, 'atk': 2, 'health': 7, 'text': "", 'expansion': "Basic", 'hsclass': 'Neutral', 'rarity': 'Free', 'cardId': '15' }, {'name': "Stonetusk Boar", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/637/76.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Charge", 'expansion': "Basic", 'hsclass': 'Neutral', 'rarity': 'Free', 'cardId': '76' }, {'name': "Stranglethorn Tiger", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/848/338.png', 'cost': 5, 'atk': 5, 'health': 5, 'text': "Stealth", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '338' }, {'name': "Young Dragonhawk", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/634/629.png', 'cost': 1, 'atk': 1, 'health': 1, 'text': "Windfury", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '629' }, {'name': "Ironfur Grizzly", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/592/519.png', 'cost': 3, 'atk': 3, 'health': 3, 'text': "Taunt", 'expansion': "Basic", 'hsclass': 'Neutral', 'rarity': 'Free', 'cardId': '519' }, {'name': "Silverback Patriarch", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/625/611.png', 'cost': 3, 'atk': 1, 'health': 4, 'text': "Taunt", 'expansion': "Basic", 'hsclass': 'Neutral', 'rarity': 'Free', 'cardId': '611' }, {'name': "Bloodfen Raptor", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/640/576.png', 'cost': 2, 'atk': 3, 'health': 2, 'text': "", 'expansion': "Basic", 'hsclass': 'Neutral', 'rarity': 'Free', 'cardId': '576' }, {'name': "River Crocolisk", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/147/580/535.png', 'cost': 2, 'atk': 2, 'health': 3, 'text': "", 'expansion': "Basic", 'hsclass': 'Neutral', 'rarity': 'Free', 'cardId': '535' }, {'name': "Carrion Grub", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/289/513/35218.png', 'cost': 3, 'atk': 2, 'health': 5, 'text': "", 'expansion': "Whispers of the Old Gods", 'hsclass': 'Hunter', 'rarity': 'Common', 'cardId': '35218' }, {'name': "Duskboar", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/289/516/35251.png', 'cost': 2, 'atk': 4, 'health': 1, 'text': "", 'expansion': "Whispers of the Old Gods", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '35251' }, {'name': "Stegodon", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/102/55519.png', 'cost': 4, 'atk': 2, 'health': 6, 'text': "Taunt", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55519' }, {'name': "Stubborn Gastropod", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/93/55532.png', 'cost': 2, 'atk': 1, 'health': 2, 'text': "Taunt Poisonous", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55532' }, {'name': "Giant Wasp", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/320/111/55525.png', 'cost': 3, 'atk': 2, 'health': 2, 'text': "Stealth Poisonous", 'expansion': "Journey to Un'goro", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '55525' }, {'name': "Emperor Cobra", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/317/602/625.png', 'cost': 3, 'atk': 2, 'health': 3, 'text': "Poisonous", 'expansion': "Classic", 'hsclass': 'Neutral', 'rarity': 'Rare', 'cardId': '625' }, {'name': "Lost Tallstrider", 'cardImg': 'http://media-Hearth.cursecdn.com/avatars/148/984/12284.png', 'cost': 4, 'atk': 5, 'health': 4, 'text': "", 'expansion': "Goblins vs Gnomes", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '12284' }, {'name': "Snowflipper Penguin", 'cardImg': 'http://media-hearth.cursecdn.com/avatars/336/442/636368450976115667.png', 'cost': 0, 'atk': 1, 'health': 1, 'text': "", 'expansion': "Knights of the Frozen Throne", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '62839' }, {'name': "Bloodworm", 'cardImg': 'http://media-hearth.cursecdn.com/avatars/338/874/636377105609053407.png', 'cost': 5, 'atk': 4, 'health': 4, 'text': "Lifesteal", 'expansion': "Knights of the Frozen Throne", 'hsclass': 'Neutral', 'rarity': 'Common', 'cardId': '62933' }, ]; function getRandomInt(low, high) { return Math.floor(Math.random() * (high - low + 1)) + low; } function getDiscoverChoices(cards) { var discoverChoices = []; var discoverPicks = []; while (discoverPicks.length < 3) { var num = getRandomInt(0, cards.length - 1); console.log(num); if (discoverPicks.indexOf(num) > -1) continue; console.log("Discover Picks Len " + discoverPicks.length); discoverChoices[discoverPicks.length] = cards[num]; discoverChoices[discoverPicks.length].num = num; discoverPicks[discoverPicks.length] = num; } return discoverChoices; } function buildZombeastChoices(cards, stageID) { var picks = getDiscoverChoices(cards); picks.forEach(function(card, i, a) { var selector = '#zombeast-stage-' + stageID + ' .zombeast-choices li:eq(' + i + ')'; $(selector + ' img').attr('src', card.cardImg); $(selector).data('beastIndex', card.num); update_hscard(selector + ' .mobile-hscard', card); }); } function getStandardBeasts(cards) { var standard_cards = []; cards.forEach(function(card, i, a) { if (STANDARD_SETS.indexOf(card.expansion) > -1) { standard_cards.push(card); } }); return standard_cards; } function setupZombeasts() { // is set to standard, need a diff set. if (BUILDER_MODE == "Standard") { BEASTS_TO_USE_COMPLICATED = getStandardBeasts(BEASTS_COMPLICATED); BEASTS_TO_USE_SIMPLE = getStandardBeasts(BEASTS_SIMPLE); } else { BEASTS_TO_USE_COMPLICATED = BEASTS_COMPLICATED; BEASTS_TO_USE_SIMPLE = BEASTS_SIMPLE; } buildZombeastChoices(BEASTS_TO_USE_COMPLICATED, 2); buildZombeastChoices(BEASTS_TO_USE_SIMPLE, 3); } function barnes(oldStageID, newStageID) { $('#zombeast-stage-' + oldStageID).fadeOut(function(){ $('#zombeast-stage-' + newStageID).fadeIn(); }); } function calculateZombeast(beasts) { var card = {'cost': 0, 'atk': 0, 'health': 0, 'text': '', 'name': 'Zombeast'}; beasts.forEach(function(beast, i, a) { card.cost += beast.cost; card.atk += beast.atk; card.health += beast.health; card.text += beast.text; if (card.text !== '' && i === 0) { card.text += '
'; } }); update_hscard('#card-result.mobile-hscard', card); } function update_hscard(selector, card) { $(selector + ' .card-name').text(card.name); $(selector + ' .card-mana').text(card.cost); $(selector + ' .card-atk').text(card.atk); $(selector + ' .card-health').text(card.health); $(selector + ' .card-text').html(card.text); } $(document).ready(function() { setupZombeasts(); var selectedBeasts = []; $('.switch-zombs-mode').on('click', function() { if (BUILDER_MODE == "Standard") { BUILDER_MODE = "Wild"; $('.switch-zombs-mode').text("Switch to Standard"); $('.switch-zombs-mode').attr('title', "Build a Zombeast using Standard cards instead!"); } else { BUILDER_MODE = "Standard"; $('.switch-zombs-mode').text("Switch to Wild"); $('.switch-zombs-mode').attr('title', "Build a Zombeast using Wild cards instead!"); } setupZombeasts(); }); // When you click button 1, go to stage 2 $('#build-your-beast').on('click', function() { barnes(1, 2); }); // When you select a card from stage 2, go to stage 3 $('#zombeast-stage-2 .zombeast-choices li').on('click', function() { selectedBeasts[1] = BEASTS_TO_USE_COMPLICATED[$(this).data('beastIndex')]; barnes(2, 3); }); // When you select a card from stage 3, go to stage 4 $('#zombeast-stage-3 .zombeast-choices li').on('click', function() { selectedBeasts[0] = BEASTS_TO_USE_SIMPLE[$(this).data('beastIndex')]; calculateZombeast(selectedBeasts); barnes(3, 4); }); // If you want to build a new beast, reset everything, go to stage 2. $('#build-new-beast').on('click', function() { setupZombeasts(); selectedBeasts = []; barnes(4, 2); }); });