From 3c4a3c1364bca5a09cff2085c808c47b30136406 Mon Sep 17 00:00:00 2001 From: pifopi Date: Sat, 16 Jan 2021 14:18:53 +0100 Subject: [PATCH] various fixes --- AutoMaxLair.py | 9 +++++++-- Package_Pokemon.py | 4 ++-- Pokemon_Data/All_Pokemon_raw.txt | 22 +++++++++++----------- Pokemon_Data/Rental_Pokemon.txt | 2 +- Pokemon_Data/matchup_scoring.py | 8 +++++--- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/AutoMaxLair.py b/AutoMaxLair.py index e8d1311f..7b21ed9a 100644 --- a/AutoMaxLair.py +++ b/AutoMaxLair.py @@ -192,6 +192,11 @@ def battle(inst) -> str: inst.push_buttons((b'y', 1), (b'a', 1), (b'l', 3)) inst.opponent = inst.read_selectable_pokemon('battle', language)[0] inst.push_buttons((b'0', 1), (b'b', 1.5), (b'b', 2)) + + # When we fight a Ditto, he will always copy your pokemon + if inst.opponent.name == 'Ditto': + inst.opponent = copy(inst.pokemon) + # If our Pokemon is Ditto, transform it into the boss. # TODO: Ditto's HP does not change when transformed which is not @@ -380,9 +385,9 @@ def select_pokemon(inst) -> str: inst.log('''****************************** \n\nShiny found!\n\n******************************''' ) - inst.log('Shiny ' + inst.caught_pokemon[i] + ' will be kept') + inst.log('Shiny ' + inst.caught_pokemon[inst.num_caught - 1 - i] + ' will be kept') inst.shinies_found += 1 - inst.caught_shinies.append(inst.caught_pokemon[i]) + inst.caught_shinies.append(inst.caught_pokemon[inst.num_caught - 1 - i]) inst.display_results(screenshot=True) inst.push_buttons((b'p', 1), (b'b', 3), (b'p', 1)) if inst.num_caught == 4 and i == 0: diff --git a/Package_Pokemon.py b/Package_Pokemon.py index 6d6b3f73..59785c7e 100644 --- a/Package_Pokemon.py +++ b/Package_Pokemon.py @@ -51,7 +51,7 @@ if ('twice in one turn' in Effect) or ('twice in a row' in Effect): multiplier *= 2 elif 'Hits 2-5 times' in Effect: - multiplier *= 2.2575 + multiplier *= 3.167 elif 'Attacks thrice with more power each time.' in Effect: multiplier *= 94.14/20/Accuracy elif '2 turns later' in Effect: @@ -117,7 +117,7 @@ move = copy(move_list[dump[i][0]]) moves.append(move) if ability == 'Skill Link' and 'Hits 2-5 times' in move.effect: - move.power *= 5/2.1575 + move.power *= 5/3.167 if move.base_power > 0: max_move = copy(max_move_list[move.type]) max_move.power = matchup_scoring.get_max_move_power(move) diff --git a/Pokemon_Data/All_Pokemon_raw.txt b/Pokemon_Data/All_Pokemon_raw.txt index 2ce375e7..ed46b91b 100644 --- a/Pokemon_Data/All_Pokemon_raw.txt +++ b/Pokemon_Data/All_Pokemon_raw.txt @@ -43,7 +43,7 @@ Run Away 45 30 35 20 20 45 Metapod Shed Skin 50 20 55 25 25 30 #012 -Butterfree Compoundeyes +Butterfree Compound Eyes Tinted Lens 60 45 50 90 80 70 #013 @@ -205,7 +205,7 @@ Dry Skin Damp 60 95 80 60 80 30 #048 -Venonat Compoundeyes +Venonat Compound Eyes Tinted Lens Run Away 60 55 50 40 55 45 #049 @@ -888,7 +888,7 @@ Early Bird 75 75 55 105 85 30 #193 Yanma Speed Boost -Compoundeyes +Compound Eyes Frisk 65 65 45 75 45 95 #194 @@ -1229,7 +1229,7 @@ Cascoon Shed Skin 50 35 55 25 25 15 #269 Dustox Shield Dust -Compoundeyes 60 50 70 50 90 65 +Compound Eyes 60 50 70 50 90 65 #270 Lotad Swift Swim @@ -1322,7 +1322,7 @@ Vigoroth Vital Spirit 80 80 80 55 55 90 Slaking Truant 150 160 100 95 65 100 #290 -Nincada Compoundeyes +Nincada Compound Eyes Run Away 31 45 90 30 30 40 #291 @@ -2666,12 +2666,12 @@ Hydration Regenerator 165 75 80 40 45 65 #595 -Joltik Compoundeyes +Joltik Compound Eyes Unnerve Swarm 50 47 50 57 50 65 #596 -Galvantula Compoundeyes +Galvantula Compound Eyes Unnerve Swarm 70 77 60 97 60 108 #597 @@ -2960,7 +2960,7 @@ Gale Wings 78 81 71 74 69 126 #664 Scatterbug Shield Dust -Compoundeyes +Compound Eyes Friend Guard 38 35 40 27 25 35 #665 @@ -2969,7 +2969,7 @@ Friend Guard 45 22 60 27 30 29 #666 Vivillon Shield Dust -Compoundeyes +Compound Eyes Friend Guard 80 52 50 90 50 89 #667 @@ -3615,12 +3615,12 @@ Mirror Armor 98 87 105 53 85 67 #824 Blipbug Swarm -Compoundeyes +Compound Eyes Telepathy 25 20 20 25 45 45 #825 Dottler Swarm -Compoundeyes +Compound Eyes Telepathy 50 35 80 50 90 30 #826 diff --git a/Pokemon_Data/Rental_Pokemon.txt b/Pokemon_Data/Rental_Pokemon.txt index a73512af..e3419693 100644 --- a/Pokemon_Data/Rental_Pokemon.txt +++ b/Pokemon_Data/Rental_Pokemon.txt @@ -1460,7 +1460,7 @@ Icy Wind Galvantula -Compoundeyes +Compound Eyes Level 65 Attacks: Thunder diff --git a/Pokemon_Data/matchup_scoring.py b/Pokemon_Data/matchup_scoring.py index f3b23753..0b53109a 100644 --- a/Pokemon_Data/matchup_scoring.py +++ b/Pokemon_Data/matchup_scoring.py @@ -129,10 +129,12 @@ def calculate_damage(attacker: Pokemon, move_index: int, defender: Pokemon, mult modifier *= ability_damage_multiplier(attacker, move_index, defender) # Apply attacker and defender stats if move.category == 'Physical': - if move.name != 'Body Press': - numerator = attacker.stats[1] - else: + if move.name == 'Body Press': numerator = attacker.stats[2] + elif move.name == 'Foul Play': + numerator = defender.stats[1] + else: + numerator = attacker.stats[1] denominator = defender.stats[2] else: numerator = attacker.stats[3]