def test_deoxys_d(): try: create_table("deoxys defense") calc_stat_product("deoxys defense") except: pass PVP_stats = get_stat_product("deoxys defense", [0, 15, 15]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 2305927 assert round(PVP_stats[2]) == 100
def test_bronzong(): try: create_table("bronzong") calc_stat_product("bronzong") except Exception as e: print("table exists") PVP_stats = get_stat_product("bronzong", [1, 15, 14]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 2050565 assert round(PVP_stats[2]) == 100
def test_altaria(): try: create_table("altaria") calc_stat_product("altaria") except Exception as e: print("table exists") PVP_stats = get_stat_product("altaria", [0, 14, 15]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 2212160 assert round(PVP_stats[2]) == 100
def test_lanturn(): try: create_table("lanturn") calc_stat_product("lanturn") except Exception as e: print("table exists") PVP_stats = get_stat_product("lanturn", [0, 13, 14]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 2177678 assert round(PVP_stats[2]) == 100
def test_azumarill(): try: create_table("azumarill") calc_stat_product("azumarill") except Exception as e: print(e) PVP_stats = get_stat_product("azumarill", [8, 15, 15]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 2365612 assert round(PVP_stats[2]) == 100
def test_medicham(): try: create_table("medicham") calc_stat_product("medicham") except Exception as e: print(e) PVP_stats = get_stat_product("medicham", [15, 15, 15]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 1900834 assert round(PVP_stats[2]) == 100
def test_skarmory(): try: create_table("skarmory") calc_stat_product("skarmory") except Exception as e: print("table exists") PVP_stats = get_stat_product("skarmory", [0, 15, 14]) assert PVP_stats[0] == 1 assert round(PVP_stats[1]) == 2153020 assert round(PVP_stats[2]) == 100
def single_poke_analysis(single_entry): from stat_product import get_stat_product, create_table, calc_stat_product stats = read_stats(filename=None, single_entry=single_entry) evo_pokemon = search_chosen.get() # read cp multiplier and level data from text file dic_cp_mult = read_cp_mult() # read stardust and level data from csv file dic_stardust = read_stardust() dic_power_up = read_power_up_costs() for entry in stats: pokemon = entry[1] t_IV = entry[3:] # order: atk, def, stam # choose correct base stat for pokemon being analyzed t_base_stats = read_base_stats(pokemon) # guess by inputing IVs and possible cp_mult into cp equation # narrow down levels & cp multipliers based on stardust t_cp_mult, t_level = narrow_cp_mult(dic_cp_mult, dic_stardust, entry, t_base_stats) # calc evolution stats evolve_stats = calc_evolve_cp(evo_pokemon, t_IV, t_level, t_cp_mult, dic_cp_mult, dic_power_up) # get PVP stat product try: create_table(evo_pokemon) calc_stat_product(evo_pokemon) except Exception as e: pass #print(e) PVP_stats = get_stat_product(evo_pokemon, t_IV) # display tables for great league and perhaps ultra league display_great_league(PVP_stats, entry, t_level, t_IV, evolve_stats, evo_pokemon) if show_ultra_league.get() is True: display_ultra_league(PVP_stats, entry, t_level, t_IV, evolve_stats) if show_master_league.get() is True: display_master_league(PVP_stats, entry, t_level, t_IV, evolve_stats)
def main(): from stat_product import get_stat_product, create_table, calc_stat_product # set poke_file as global so that files can be fed in # see read_many_files.py for usage global poke_file global evo_pokemon global single_entry global show_ultra_state # read pokemon data from text file try: # poke_file has been defined in read_many_files.py as global var stats = read_stats(poke_file) except: # poke_file hasn't been defined poke_file = file_input() stats = read_stats(poke_file) # ask for evolution pokemon (assumes only one pokemon species in file) if len(argv) == 2 and "csv" not in argv[1]: # evolution input from command line, and input not mistaken for csv file evo_pokemon = argv[1].lower() print("Using target pokemon: {}".format(evo_pokemon)) elif len(argv) >= 3 and "csv" not in argv[1]: # argv has [useless string, evo pokemon, poke file] evo_pokemon = argv[1].lower() elif len(argv) >= 2 and "csv" in argv[1]: # no evo pokemon specified from command line, only files evo_pokemon = input("Evolution pokemon?\n").lower() print('Evolution pokemon chosen: ', evo_pokemon) else: try: print('Evolution pokemon chosen: ', evo_pokemon) except: evo_pokemon = input("Evolution pokemon?\n").lower() # read cp multiplier and level data from text file dic_cp_mult = read_cp_mult() #print(dic_cp_mult) # read stardust and level data from csv file dic_stardust = read_stardust() #print(dic_stardust[1300]) dic_power_up = read_power_up_costs() for entry in stats: pokemon = entry[1] t_IV = entry[3:] # order: atk, def, stam # choose correct base stat for pokemon being analyzed t_base_stats = read_base_stats(pokemon) # guess by inputing IVs and possible cp_mult into cp equation # narrow down levels & cp multipliers based on stardust t_cp_mult, t_level = narrow_cp_mult(dic_cp_mult, dic_stardust, entry, t_base_stats) #print("t_list_levels", t_list_levels) # calc evolution stats dic_evolve_stats = calc_evolve_cp(evo_pokemon, t_IV, t_level, t_cp_mult, dic_cp_mult, dic_power_up) #print(evolve_stats) # get PVP stat product try: #print("creating table for: {}".format(evo_pokemon)) create_table(evo_pokemon) calc_stat_product(evo_pokemon) except Exception as e: #print(e) pass #print(e) PVP_stats = get_stat_product(evo_pokemon, t_IV) # display Great League analysis display_great_league(PVP_stats, entry, t_level, t_IV, dic_evolve_stats, evo_pokemon) # optionally display Ultra League analysis based on checkbox in GUI try: if show_ultra_state: display_ultra_league(PVP_stats, entry, t_level, t_IV, dic_evolve_stats) if show_master_state: display_master_league(PVP_stats, entry, t_level, t_IV, dic_evolve_stats) except Exception as e: print(e)