let default_decks = [{ "title": "Northern Realms Deck 1 - Spies & Bonds", "description": "Deck relying mostly on Tight Bonds units and Spies", "leader": "nr_foltest_lord", "faction": "realms", "cards": [ ["spe_horn", 1], ["spe_decoy", 2], ["spe_scorch", 1], ["spe_clear", 1], ["spe_fog", 1], ["spe_rain", 1], ["nr_ciri", 1], ["nr_geralt", 1], ["nr_natalis", 1], ["nr_vernon", 1], ["nr_stennis", 1], ["nr_keira", 1], ["nr_dijkstra", 1], ["nr_sheala", 1], ["nr_thaler", 1], ["nr_triss", 1], ["nr_olgierd", 1], ["nr_crinfrid_1", 1], ["nr_crinfrid_2", 1], ["nr_crinfrid_3", 1], ["nr_villen", 1], ["nr_blue_stripes_1", 1], ["nr_blue_stripes_2", 1], ["nr_blue_stripes_3", 1], ["nr_poor_infantry_1", 1], ["nr_poor_infantry_2", 1], ["nr_poor_infantry_3", 1], ["nr_banner_nurse", 1] ] }, { "title": "Nilfgaard Deck 1 - Spies & Bonds", "description": "Deck relying mostly on Spies, Emissaries, some Tight Bond and strong ranged units", "leader": "ne_emhyr_invader_of_the_north", "faction": "nilfgaard", "cards": [ ["spe_horn", 1], ["spe_decoy", 2], ["spe_scorch", 1], ["spe_clear", 1], ["ne_ciri", 1], ["ne_geralt", 1], ["ne_yennefer", 1], ["ne_black_archer", 1], ["ne_black_archer_1", 1], ["ne_letho", 1], ["ne_moorvran", 1], ["ne_stefan", 1], ["ne_shilard", 1], ["ne_young_emissary_1", 1], ["ne_young_emissary_2", 1], ["ne_vattier", 1], ["ne_impera_brigade_1", 1], ["ne_impera_brigade_2", 1], ["ne_impera_brigade_3", 1], ["ne_impera_brigade_4", 1], ["ne_archer_support", 1], ["ne_archer_support_1", 1], ["ne_cahir", 1], ["ne_renuald", 1], ["ne_vreemde", 1], ["ne_morteisen", 1], ["ne_albrich", 1], ] }, { "title": "Monsters Deck 1 - Massive Muster", "description": "Deck relying on a lot of muster units", "leader": "mo_eredin_commander", "faction": "monsters", "cards": [ ["spe_horn", 1], ["spe_decoy", 1], ["spe_scorch", 1], ["spe_clear", 1], ["spe_fog", 1], ["spe_rain", 1], ["mo_draug", 1], ["mo_imlerith", 1], ["mo_leshen", 1], ["mo_gaunter_odimm", 1], ["mo_kayran", 1], ["mo_witch_velen", 1], ["mo_witch_velen_1", 1], ["mo_witch_velen_2", 1], ["mo_foglet", 1], ["mo_arachas_behemoth", 1], ["mo_nekker", 1], ["mo_nekker_1", 1], ["mo_nekker_2", 1], ["mo_toad", 1], ["mo_katakan", 1], ["mo_arachas", 1], ["mo_arachas_1", 1], ["mo_arachas_2", 1], ["mo_plague_maiden", 1], ["mo_bruxa", 1], ["mo_ekkima", 1], ["mo_fleder", 1], ["mo_garkain", 1], ["mo_gaunter_odimm_darkness", 1] ] }, { "title": "Scoia'Tael Deck 1 - Agile & Muster", "description": "Deck relying on agile units and muster", "leader": "sc_francesca_pureblood", "faction": "scoiatael", "cards": [ ["spe_horn", 1], ["spe_decoy", 1], ["spe_scorch", 1], ["spe_clear", 1], ["spe_frost", 1], ["spe_rain", 1], ["sc_iorveth", 1], ["sc_isengrim", 1], ["sc_schirru", 1], ["sc_mahakam", 1], ["sc_mahakam_1", 1], ["sc_saskia", 1], ["sc_vrihedd_brigade_1", 1], ["sc_vrihedd_brigade", 1], ["sc_mysterious_elf", 1], ["sc_filavandrel", 1], ["sc_toruviel", 1], ["sc_yaevinn", 1], ["sc_dol_infantry_1", 1], ["sc_dol_infantry_2", 1], ["sc_havekar_support", 1], ["sc_havekar_support_1", 1], ["sc_havekar_support_2", 1], ["sc_elf_skirmisher", 1], ["sc_elf_skirmisher_1", 1], ["sc_elf_skirmisher_2", 1], ["sc_vrihedd_cadet", 1], ["sc_havekar_nurse", 1], ["sc_havekar_nurse_2", 1], ["sc_temptress", 1] ] }, { "title": "Skellige Deck 1 - Berserkers", "description": "Deck relying mostly on berserker units", "leader": "sk_holger", "faction": "skellige", "cards": [ ["spe_mardroeme", 2], ["spe_skellige_fleet", 2], ["spe_horn", 1], ["spe_decoy", 1], ["spe_scorch", 1], ["spe_clear", 1], ["spe_frost", 1], ["spe_rain", 1], ["sk_hjalmar", 1], ["sk_brokva_archer", 1], ["sk_cerys", 1], ["sk_ermion", 1], ["sk_yennefer", 1], ["sk_longship_1", 1], ["sk_longship_3", 1], ["sk_longship_2", 1], ["sk_berserker", 1], ["sk_shield_maiden_1", 1], ["sk_shield_maiden_2", 1], ["sk_shield_maiden_3", 1], ["sk_light_longship_1", 1], ["sk_light_longship_2", 1], ["sk_light_longship_3", 1], ["sk_vildkaarl", 1], ["sk_gremist", 1], ["sk_young_berserker_1", 1], ["sk_young_berserker_2", 1], ["sk_young_berserker_3", 1], ["sk_arnvald", 1], ["sk_kambi", 1] ] }, { "title": "Redania Deck 1 - Witch Hunt", "description": "Deck relying mostly on witch hunters", "leader": "re_radovid_mad_king", "faction": "redania", "cards": [ ["spe_horn", 1], ["spe_decoy", 2], ["spe_execution", 1], ["spe_royal_decree", 2], ["spe_clear", 1], ["spe_rain", 1], ["re_carlo_varese", 1], ["re_cyprian_wiley", 1], ["re_francis_bedlam", 1], ["re_black_cat_dog", 1], ["re_redanian_elite", 1], ["re_rico_meiersdorf", 1], ["re_caretaker", 1], ["re_redanian_knight_1", 1], ["re_redanian_knight_2", 1], ["re_eternal_fire_priest", 1], ["re_graden", 1], ["re_kurt", 1], ["re_moreelse", 1], ["re_nathaniel_pastodi", 1], ["re_shani", 1], ["re_witch_hunter", 1], ["re_olgierd", 1], ["re_vlodimir_von_everec", 1], ["re_cyrus_hemmelfart", 1], ["re_sigi_reuven", 1], ["re_caleb_menge", 1], ["re_iris_von_everec", 1] ] }, { "title": "Toussaint Deck 1 - Monsters & Knights", "description": "Deck relying mostly Toussaint monsters, spies and muster", "leader": "to_anna_henrietta_little_weasel", "faction": "toussaint", "cards": [ ["spe_horn", 1], ["spe_decoy", 2], ["spe_scorch", 1], ["spe_toussaint_wine", 2], ["spe_clear", 1], ["to_unseen_elder", 1], ["to_damien_tour", 1], ["to_roderick", 1], ["to_gregoire_gorgon", 1], ["to_witch_lynx_crag", 1], ["to_milton", 1], ["to_champion", 1], ["to_duchess_informant", 1], ["to_syanna", 1], ["to_bootblack", 1], ["to_dettlaff", 1], ["to_knight_errant_1", 1], ["to_knight_errant_2", 1], ["to_lui_alberni", 1], ["to_orianna", 1], ["to_regis", 1], ["to_prophet_lebioda", 1], ["to_toussaint_knight_1", 1], ["to_toussaint_knight_2", 1], ["to_toussaint_knight_3", 1], ["to_artorius_vigo", 1], ["to_lady_lake", 1], ["to_vivienne", 1] ] }, { "title": "Velen Deck 1 - Cursed Land", "description": "Deck relying mostly on bond, scorch and drawing cards", "leader": "ve_ghost_tree", "faction": "velen", "cards": [ ["spe_horn", 1], ["spe_curse", 3], ["spe_decoy", 2], ["spe_scorch", 1], ["spe_clear", 1], ["ve_bloody_baron", 1], ["ve_geralt", 1], ["ve_johnny", 1], ["ve_fugas", 1], ["ve_pellar", 1], ["ve_anna_strenger", 1], ["ve_fiend", 1], ["ve_chort", 1], ["ve_vesemir", 1], ["ve_thecla", 1], ["ve_deserter_1", 1], ["ve_deserter_2", 1], ["ve_ghoul_1", 1], ["ve_ghoul_2", 1], ["ve_marauder_1", 1], ["ve_marauder_2", 1], ["ve_tamara_strenger", 1], ["ve_angry_peasants", 1], ["ve_hungry_wolves_4", 1], ["ve_hungry_wolves_1", 1], ["ve_hungry_wolves_2", 1], ["ve_hungry_wolves_3", 1], ["ve_abandoned_girl", 1] ] } ]; /* * */ var premade_deck = default_decks; //premade_deck = custom_decks.concat(premade_deck); //premade_deck = custom_decks; var deckWeightConsts = { "spyBase": 20, "heroMult": 2, "musterMult": 2, "tightBondMult": 2, "medic": 7, "scorch": 5, "scorch_c": 5, "morale": 5, "agile": 2, "horn": 10, "berserker": 5, "mardroeme": 5, "avenger": 5, "decoy": 7, "clearWeatherWeight": 7, "heroSpyBase": 5, "cintra_slaughter": 5, "resilience": 5, "witcherSchoolWeight": 1, "witch_hunt": 5, "whorshipper": 2, "whorshipped": 2, "inspire": 3, "comrade": 7, "emissary": 5 }; function calcDeckWeight(deck) { var total = 0; deck.cards.forEach(entry => { let c = card_dict[entry[0]]; let cnt = parseInt(entry[1]); let abi = c["ability"].split(" "); let cStr = 0; if (!c["deck"].startsWith("special") && !c["deck"].startsWith("weather")) { if (abi.includes("spy")) { cStr = deckWeightConsts["spyBase"] - parseInt(c["strength"]); if (abi.includes("hero")) cStr += deckWeightConsts["heroSpyBase"]; if (c.row === "agile") cStr += deckWeightConsts["agile"]; } else { cStr = parseInt(c["strength"]); if (abi.includes("hero")) cStr *= deckWeightConsts["heroMult"]; if (abi.includes("bond")) cStr *= deckWeightConsts["tightBondMult"]; if (abi.includes("muster")) cStr *= deckWeightConsts["musterMult"]; abi.forEach(a => { if (a in deckWeightConsts) cStr += deckWeightConsts[a]; }); if (abi.includes("witcher_wolf_school") || abi.includes("witcher_bear_school") || abi.includes("witcher_viper_school") || abi.includes("witcher_cat_school") || abi.includes("witcher_griffin_school")) cStr += deckWeightConsts["witcherSchoolWeight"]; if (c.row === "agile") cStr += deckWeightConsts["agile"]; } } total += (cStr * cnt); }); return total; }