Skip to content

Commit

Permalink
Merge pull request #6 from pifopi/main
Browse files Browse the repository at this point in the history
various fixes
  • Loading branch information
ercdndrs authored Jan 17, 2021
2 parents c2f23e2 + 3c4a3c1 commit 054b815
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
9 changes: 7 additions & 2 deletions AutoMaxLair.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Package_Pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions Pokemon_Data/All_Pokemon_raw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Pokemon_Data/Rental_Pokemon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ Icy Wind

Galvantula

Compoundeyes
Compound Eyes
Level 65
Attacks:
Thunder
Expand Down
8 changes: 5 additions & 3 deletions Pokemon_Data/matchup_scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 054b815

Please sign in to comment.