Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toxic fix #596

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Toxic fix #596

wants to merge 3 commits into from

Conversation

noobscrub27
Copy link

@noobscrub27 noobscrub27 commented Jan 11, 2024

Fixed several bugs:

  • End of turn damage is now considered on the first turn.
  • A pokemon that was KO'd by a move but would have healed above 0HP at the end of the turn is now considered KO'd.
  • Toxic damage works now.
  • Neutralizing Gas now negates end of turn healing and damage caused by abilities.

I also changed the way OHKOs are displayed when end of turn damage comes into play. For example, if a move isn't a guaranteed OHKO before end of turn damage, but has a higher chance to OHKO after end of turn damage, the chance to OHKO after end of turn damage is displayed separately. This is for cases where someone's pokemon outspeeds their opponent's pokemon, but their opponent can OHKO and the player wants to see how likely it is for them to KO their opponent before they get attacked. Here's an example: 0 SpA Ivysaur Weather Ball (100 BP Fire) vs. 0 HP / 252 SpD Abomasnow in Sun: 316-376 (98.4 - 117.1%) -- 87.5% chance to OHKO (guaranteed OHKO after poison damage)

Copy link
Collaborator

@thejetou thejetou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, these changes are appreciated but a few requests:

  • Remove the .vs/ files
  • Please write tests for this. EOT code is hard to work with so it would be great for sanity's sake

Also, can you elaborate on what 'End of turn damage is now considered on the first turn' means?

@noobscrub27
Copy link
Author

Hi, thanks for the response!
In hindsight I could have done more to explain myself. By end of turn damage being considered on the first turn, I mean that when calculating damage, if the defender would lose health at the end the turn due to a status condition, it currently only starts counting this on the second turn.
As an example, this Mew is poisoned and seeded. It's level 30 with no HP IVs or EVs so it has exactly 100 HP. A level 99 Chansey's Seismic Toss should OHKO after hazards are accounted for, but the calculator thinks its a 2HKO.
image
And for toxic damage, not only is damage not applied on the first turn, the counter doesn't increase either.
Here's an example with a level 82 Chansey using Seismic Toss against a Pokemon with 200 Max HP:
image
This is listed as a 3HKO, but it's actually a 2HKO. This is how it should play out:

  1. Seismic Toss: 200 - 82 = 118
  2. Toxic damage (toxic count 1): 118 - 12 = 106
  3. Seismic Toss: 106 - 82 = 24
  4. Toxic damage (toxic count 2): 24 - 25 = -1 (2HKO)

This is how it the calculator does it currently:

  1. Seismic Toss: 200 - 82 = 118
  2. (EOT damage is skipped and the toxic count does not increase)
  3. Seismic Toss: 118 - 82 = 36
  4. Toxic damage (toxic count 1): 36 - 12 = 24
  5. Seismic Toss: 24 - 82 = -58 (3HKO)

This is my first pull request so please be patient if I make any mistakes. Things are pretty busy in my life right now, but I'm going to do my best to fix this soon.

@thejetou
Copy link
Collaborator

thejetou commented Mar 6, 2024

Thanks, your explanation clears it up.

This is my first pull request so please be patient if I make any mistakes. Things are pretty busy in my life right now, but I'm going to do my best to fix this soon.

Don't worry, get to it whenever you can. If you have any questions feel free to ask in #calc-dev in the Dev Discord Server and I'll help you out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants