Programming Pokémon Showdown Damage Calculator

Minor complaint: When I change the weather and then change something else (such as a Pokemon's move or ability), the weather automatically reverts to none. This makes doing calculations in a certain weather condition annoying. Can it please not happen anymore?
 
Bug concerning Eviolite (as far as I can tell):
1. Calculate Muk (Blank set) vs. Mew (Blank set) Body Slam.
2. Calculate Bronzor (Blank set) vs. Mew (Blank set) Body Slam.
3. Calculate Bronzor with Eviolite (Blank set) vs. Mew (Blank set) Body Slam.
4. Calculate Muk (Blank set) vs. Mew (Blank set) Body Slam again.
5. Compare Muk results.

-> Damage changes (because Muks HP changes)

Edit: doesn´t seem to be about Eviolite. Muk seems to copy the HP of whatever you calculated before (only happens with the blank Muk set). + Altaria seems to have a similar issue.
 
Last edited:
That might not be a bug. I know someone tested in BW and found that they can, since Reflect and other final modifiers get applied after ensuring 1 damage. Someone should probably test if that's still the case in ORAS and SM though.
 
Minor accuracy thing: Moves cannot deal 0 damage (source: bulbapedia. Someone might need to factcheck this)

-6 0- Atk Happiny Tackle vs. +6 252 HP / 252+ Def Aggron through Reflect: 0-0 (0 - 0%) -- aim for the horn next time
I can't replicate this issue, at least for Gen 7. It always shows at least 1 damage being dealt.

-6 0- Atk Defeatist burned Happiny Return vs. +6 252 HP / 252+ Def Eviolite Fur Coat Lairon with an ally's Friend Guard with an ally's Aurora Veil: 1-1 (0.3 - 0.3%) -- possibly the worst move ever
 
That makes sense though. Pretty much everything there isn't a final modifier except for Friend Guard. So it applies everything except friend guard, gets zero damage, then forces it to be 1. And then it multiplies by 3072/4096 if we base it off of the BW base damage formula, which isn't enough to make it round down.

Test with something that reduces damage by 0.5x or more either on its own or in combination (like reflect).

For reference, this is what all the damage formulas for BW and later are assumed to be based on.
 
No, BW and onward it has different methods of rounding applied to certain scenarios. Applying and chaining modifiers rounds "half-to-zero", e.g.:
round(0.5)=0
round(0.6)=1
round(-0.5)=0

I believe there are other scenarios that just do integer division though, it really depends.

It might apply to HGSS too, but nobody ever looked at a disassembly like they did for BW. It might not apply to current gens, but again, nobody has looked at the disassembly for ORAS and SM as far as I know, so we just assume it's the same and say "good enough".

edit: tl;dr rby, gsc, adv (maybe), and bw are the only gens we actually know exactly how damage is calculated
 
yea its broken because someone refactored without unit tests a year ago. :(

the person that posted here must have a really old cached version, i remember it had issues with the cache before too.
 

Paperblade

Puzzle Hunt Champion
bug concerning Metronome

Rather than doing damage at intervals of 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, it's doing 1.0, 1.1, 1.1*1.2 (1.32), 1.1*1.2*1.3 (1.716), 1.1*1.2*1.3*1.4 (2.4024).

For example, blank set Blaziken using Blaze Kick vs. blank set Mew, at 2/3/4/5 consecutive uses, with an unboosted hit for reference:

0 Atk Blaziken Blaze Kick vs. 0 HP / 0 Def Mew: 108-127 (31.6 - 37.2%) -- 83.8% chance to 3HKO


Capping at 5 consecutive hits also means we can't calc a 2.0 hit
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top