diff --git a/.DS_Store b/.DS_Store index e3f395a..4b77174 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/other/index.html b/other/index.html deleted file mode 100644 index 5b1e744..0000000 --- a/other/index.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - SDB Portfolio - - -

SDB_Portfolio

-

1. Poke_Coverage.py

-

In the game of Pokemon, a pokemon can be one or two of 18 unique types. This is their type combination. - - There are 306/324 possible type combinations currently in use. - - Each pokemon can attack with up to four moves. - - Each move can be any type in the attackers move pool. - - When pokemon attack using a move of the same type, they get a "Same-type attack bonus" or STAB, where (1.5)*DAMAGE is dealt. - - Attack types can: - - Be Super-effective (2.0 or 4.0*DAMAGE) - - Be Resisted or 'Not very-effective' (0.5 or 0.25*DAMAGE) - - Be an Immunity or Have 'no effect' (0*DAMAGE) - - This project suggests 4 types to help users choose moves that will do the most damage to the most type combinations not covered by stab types. - These moves are known as "coverage." - - #!/usr/bin/env python - - __author__ = 'Shamar D. Brown' - __version__ = '5.0' - - from poke_functions_wrkg import (Pkmn, import_poke_input_file, generate_type_combos, generate_pkmn_stats, - generate_combo_dicts, combo_print, type_counts, coverage_calcs, get_combo_difference, - get_coverage, join_coverage, print_coverage) - - ''' - README: - - In the game of Pokemon, a pokemon can be one or two of 18 unique types. This is known as their type combination. - - There are 306/324 type combinations currently in use. - - Each pokemon can attack with up to four moves. - - Each move can be any type in the attackers move pool. - - When pokemon attack using a move of the same type, they get a "Same-type attack bonus" or STAB - - This project suggests 4 types to help users choose moves that will do the most damage to the most type combinations. - These moves are known as "coverage." - ''' - - - ######################################################################################################################## - # C O N S T A N T S # - ######################################################################################################################## - - # list of all types of pokemon - all_types = ['normal', 'fire', 'water', 'electric', 'grass', 'ice', 'fighting', 'poison', 'ground', 'flying', 'psychic', - 'bug', 'rock', 'ghost', 'dragon', 'dark', 'steel', 'fairy'] - - # strengths = {pkmn_type: [types that pkmn_type does "super effective damage"(damage*2 or 4) to]}; offensive dictionary - all_strengths = {'normal': [], 'fire': ['grass', 'ice', 'bug', 'steel'], 'water': ['fire', 'ground', 'rock'], - 'electric': ['water', 'flying'], 'grass': ['water', 'ground', 'rock'], - 'ice': ['grass', 'ground', 'flying', 'dragon'], 'fighting': ['normal', 'ice', 'rock', 'dark', 'steel'], - 'poison': ['grass', 'fairy'], 'ground': ['fire', 'electric', 'poison', 'rock', 'steel'], - 'flying': ['grass', 'fighting', 'bug'], 'psychic': ['fighting', 'poison'], - 'bug': ['grass', 'psychic', 'dark'], 'rock': ['fire', 'ice', 'flying', 'bug'], - 'ghost': ['psychic', 'ghost'], 'dragon': ['dragon'], 'dark': ['psychic', 'ghost'], - 'steel': ['ice', 'rock', 'fairy'], 'fairy': ['fighting', 'dragon', 'dark']} - - # weaknesses = {pkmn_type: [types that do "super effective damage"(damage*2 or 4) to pkmn_type]}; defensive dictionary - all_weaknesses = {'normal': ['fighting'], 'fire': ['water', 'rock', 'ground'], 'water': ['electric', 'grass'], - 'electric': ['ground'], 'grass': ['fire', 'ice', 'poison', 'flying', 'bug'], - 'ice': ['fire', 'fighting', 'rock', 'steel'], 'fighting': ['flying', 'psychic', 'fairy'], - 'poison': ['ground', 'psychic'], 'ground': ['water', 'ice', 'grass'], - 'flying': ['electric', 'ice', 'rock'], 'psychic': ['bug', 'ghost', 'dark'], - 'bug': ['fire', 'flying', 'rock'], 'rock': ['water', 'grass', 'fighting', 'ground', 'steel'], - 'ghost': ['ghost', 'dark'], 'dragon': ['ice', 'dragon', 'fairy'], 'dark': ['fighting', 'bug', 'fairy'], - 'steel': ['fire', 'fighting', 'ground'], 'fairy': ['poison', 'steel']} - - # resistances = {pkmn_type: [types that do "resisted damage"(damage*0.5 or 0.25) to pkmn_type]}; defensive dictionary - all_resistances = {'normal': [], 'fire': ['fire', 'grass', 'ice', 'bug', 'steel', 'fairy'], - 'water': ['fire', 'water', 'ice', 'steel'], 'electric': ['electric', 'flying', 'steel'], - 'grass': ['water', 'electric', 'grass', 'ground'], 'ice': ['ice'], 'fighting': ['bug', 'rock', 'dark'], - 'poison': ['fighting', 'poison', 'bug', 'fairy'], 'ground': ['poison', 'rock'], - 'flying': ['fighting', 'bug', 'grass'], 'psychic': ['fighting', 'psychic'], - 'bug': ['fighting', 'ground', 'grass'], 'rock': ['normal', 'fire', 'poison', 'flying'], - 'ghost': ['poison', 'bug'], 'dragon': ['fire', 'water', 'electric', 'grass'], 'dark': ['ghost', 'dark'], - 'steel': ['normal', 'grass', 'ice', 'psychic', 'flying', 'bug', 'rock', 'dragon', 'steel', 'fairy'], - 'fairy': ['fighting', 'bug', 'dark']} - - # immunities = {pkmn_type: types with an "immunity"(damage*0) to pkmn_type}; defensive dictionary - all_immunities = {'normal': ['ghost'], 'ground': ['electric'], 'flying': ['ground'], 'ghost': ['normal', 'fighting'], - 'dark': ['psychic'], 'steel': ['poison'], 'fairy': ['dragon']} - - # list of static dictionaries - all_swri = [all_strengths, all_weaknesses, all_resistances, all_immunities] - - # Unused type combinations (for canon Pokémon) - unused_combos = [['normal', 'ice'], ['normal', 'bug'], ['normal', 'rock'], ['normal', 'steel'], ['fire', 'fairy'], - ['ice', 'poison'], ['ground', 'fairy'], ['bug', 'dragon'], ['rock', 'ghost'], ['ice', 'normal'], - ['bug', 'normal'], ['rock', 'normal'], ['steel', 'normal'], ['fairy', 'fire'], ['poison', 'ice'], - ['fairy', 'ground'], ['dragon', 'bug'], ['ghost', 'rock']] - - # initialize count - all_count = 1 - - - ######################################################################################################################## - # S E T U P # - ######################################################################################################################## - - - # INTRO - print('\n** Starting Program!\n** Ensure input file is current.\n') - print('\n** print better intro **\n') - - - # import the input file - pkmn_team = import_poke_input_file(r'poke_input.txt') - print(f'pkmn_team:\tgenerated\t||\t{pkmn_team}\n') - - - # Generate a list of all usable type combos - all_combos = generate_type_combos(all_types, unused_combos) - print(f'all_combos:\tgenerated\t||\t{len(all_combos)}\n') - - # Generate Dictionaries using Static Dictionaries {type combo: [static dictionary calc]} - all_combo_swri = generate_combo_dicts(all_types, all_combos, all_swri) - '''combo_print(all_combo_swri)''' - - # generate type counts; {'atk_type': {'combo count': int(count), - # ('type_combo',): [(type_combos,) that 'atk_type' does damage to]}} - all_type_counts = type_counts(all_types, all_combo_swri) - all_weak_counts, all_resist_counts, all_immune_counts = all_type_counts - - # [print(k, v) for k, v in all_weak_counts.items()] - - # used for tracking combos not covered by your team's stab types - team_nonstab_damage = all_types.copy() - - ######################################################################################################################## - # START WORK # - ######################################################################################################################## - - - if __name__ == '__main__': - - for pokemon in pkmn_team: - - # setup current pkmn - this_pkmn = Pkmn(all_types, pokemon, all_swri) - - # print 'this_pkmn' stats - all_count = this_pkmn.print_pkmn(all_count) - - # make list [these_combos]; change from list to tuples to compare to dictionary keys - these_combos = [tuple(combo) for combo in all_combos] - - # result = [(type_combos,) that 'this_pkmn' does not (2*damage) to] - last_bit_of_combos = get_combo_difference(this_pkmn.strength, these_combos, all_weak_counts) - - # generate stab coverage data for this_pkmn; [[stab types_header],[stab_coverage data]] - stab_coverage = get_coverage(this_pkmn.types, all_type_counts) - - # get type counts for coverage recommendation - last_bit_of_combo_swri = generate_combo_dicts(all_types, last_bit_of_combos, all_swri) - last_bit_of_counts = type_counts(all_types, last_bit_of_combo_swri) - - # generate coverage options for this_pkmn - last_bit_of_coverage = get_coverage([t for t in all_types if t not in this_pkmn.types], last_bit_of_counts) - - # concatenate coverage data - new_coverage = join_coverage(stab_coverage, last_bit_of_coverage) - - # print 'this_pkmn' coverage table - print_coverage(new_coverage) - - # track the non stab types for your pokemon team - team_nonstab_damage = [t for t in team_nonstab_damage if t not in this_pkmn.types] - - - # print uncoverable combos as a dictionary - print(f"\n\n\t** Your team doesn't do stab damage to {len(team_nonstab_damage)} types || {team_nonstab_damage} **\n") - - ######################################################################################################################## - # END WORK # - ######################################################################################################################## - -

- - \ No newline at end of file