Programming Pokémon Showdown Damage Calculator

Earthworm

is a Site Content Manageris a Forum Moderatoris a Community Contributoris a Top Contributoris a Tournament Director Alumnusis a Super Moderator Alumnusis a Tiering Contributor Alumnusis a Smogon Media Contributor Alumnusis the Smogon Tour Season 6 Championis a Past SPL and WCoP Championis the defending GSC Circuit Champion
Moderator
Oops, I cleverly accounted for the expected HP DV if you selected a set with Hidden Power, but didn't have it update (properly) if you selected Hidden Power as a move after the fact. Fixed, thanks!
Unfortunately the HP DV still isn't updating correctly. It seems to change to the correct value if you modify the DVs directly, but if you are on a 15 DV set and choose certain Hidden Powers it isn't updating correctly. Examples of the incorrect values include: Hidden Power Dragon should give a HP DV of 11 because it makes the Defense DV even, but it is staying at 15. HP Grass requires an even Attack and Defense DV meaning the maximum DV should be 3 but it is staying 15 in the calc currently.
 
Water Shuriken (4 hits) vs 79 hp Dragapult : KO chance = 77.73% (calc says 87.5) (I don't know how you got your ~63.65% here)
I made a mistake with my code. I used >79 over >=79.

Water Shuriken (4 hits) vs 81 hp Dragapult : KO chance = 47.15% (calc says 37.5)
Water Shuriken (4 hits) vs 82 hp Dragapult : KO chance = 30.52% (calc says 37.5)
(I don't understand why you think that 37.5% to KO doesn't make sense in these 2 cases, it's not very accurate but still in the good range of values)
Water Shuriken (4 hits) vs 317 hp Dragapult but weak to Water instead : KO chance = 82.97% (calc says 87.5)
I said it didn't make sense because the values resemble a normal distribution, and the mean damage output is 80.25
 
Not a bug, but a suggestion.

Suggest giving knock off the over "x" turns effect, such as stat lowering moves like Leaf Storm and Overheat.
This would be used to calculate if the move 2hkos or 3hkos with the difference in power after the opponent losing their item.
 
So I had this weird moment in an gen 7 Ag match where my lvl 1 magnemite got hit by a critical hit precipice blades from primal groundon and sturdy did not get triggered. It did not go to 1 hp instead it took 72%. I tried replicating it in a friendly but without succes. I am assuming it was a bug, but I have heard similar things happen in the real games. So I am really sorry if this is not relevant. I saved the battle so the link wil be below this, thanks for checking it out.
https://replay.pokemonshowdown.com/gen7anythinggoes-1166391156-o6i7hayqnf4wa1ip2ne31zec043hoabpw
 
So I had this weird moment in an gen 7 Ag match where my lvl 1 magnemite got hit by a critical hit precipice blades from primal groundon and sturdy did not get triggered. It did not go to 1 hp instead it took 72%. I tried replicating it in a friendly but without succes. I am assuming it was a bug, but I have heard similar things happen in the real games. So I am really sorry if this is not relevant. I saved the battle so the link wil be below this, thanks for checking it out.
https://replay.pokemonshowdown.com/gen7anythinggoes-1166391156-o6i7hayqnf4wa1ip2ne31zec043hoabpw
Sorry forgot to mention the battle is very long, skip to turn 169
 
So I had this weird moment in an gen 7 Ag match where my lvl 1 magnemite got hit by a critical hit precipice blades from primal groundon and sturdy did not get triggered. It did not go to 1 hp instead it took 72%. I tried replicating it in a friendly but without succes. I am assuming it was a bug, but I have heard similar things happen in the real games. So I am really sorry if this is not relevant. I saved the battle so the link wil be below this, thanks for checking it out.
https://replay.pokemonshowdown.com/gen7anythinggoes-1166391156-o6i7hayqnf4wa1ip2ne31zec043hoabpw
I did a damage calc

252+ Atk Groudon-Primal Precipice Blades vs. Lvl 1 0 HP / 36 Def Magnemite on a critical hit: 8-64780 (72.7 - 588909%) -- guaranteed OHKO
Possible damage amounts: (64780, 8, 768, 1532, 2292, 3056, 3816, 4580, 5340, 6104, 6864, 7628, 8388, 9152, 9912, 10680)

Because of the modulo 65536, damage can become very small if it becomes a bit too large (for instance if you get 66000 damage, it becomes 464 (66000 - 65536) instead).
In this case, it can indeed do 8 damage and not ohko Magnemite (I don't know if these were the precise spreads of the involved Pokémon but it shows it is possible)

Also this calc shows something else : it shows guaranteed OHKO because the first value of the damage range is high enough to KO Magnemite but the minimum value isn't in first place because of the modulo 65536.
 
Last edited:

Ropalme1914

Ace Poker Player
is a Site Content Manageris a Forum Moderatoris a Tiering Contributoris a Contributor to Smogonis a Smogon Media Contributor
Moderator
The G-Max effects that deal damage per turn (Wildfire, Vine Lash, Cannonade, and Volcalith) are not working: when the move has no chance to OHKO, they appear on the calc description, but don't do anything even when the base move could deal 99%:
Wildfire.png
In addition to this, if the move has a chance to OHKO, they simply don't appear on the calc at all (and still don't change anything on the damage itself
Wildfire 2.png

On another note, would it be possible to add trap damage such as from Fire Spin and Infestation? This would be useful mainly due to Binding Band changing its damage and the possibility of it being knocked off, so we would need to keep switching between Leech Seed and Volcalith as substitutes for them
 

MAMP

mamp
is a Pre-Contributor
I think Unburden is not implemented correctly on the calculator. If a Pokemon is holding no item, their speed will not be doubled, as shown below:
View attachment 268536
This is the set for Hawlucha. Normally it would be about 670 Speed after an Unburden boost. Of course, it's only 335 speed with an item, so I think this deserves a refix.
unburden doesn't give you a speed boost for not having an item, it boosts your speed when you lose your item until you switch out. there's a check box next to the ability that applies the speed boost for unburden
 

pre

pkmn.cc
Unfortunately the HP DV still isn't updating correctly. It seems to change to the correct value if you modify the DVs directly, but if you are on a 15 DV set and choose certain Hidden Powers it isn't updating correctly. Examples of the incorrect values include: Hidden Power Dragon should give a HP DV of 11 because it makes the Defense DV even, but it is staying at 15. HP Grass requires an even Attack and Defense DV meaning the maximum DV should be 3 but it is staying 15 in the calc currently.
This was a bug (was relying on the past sets DVs instead of the updated one), thanks for pointing it out.

Kind of annoying that [Zarude] that appears in random battles isn't in the random battle calculator
Random calc sets have been updated.

Struggle does not affect ghost type pokemon, even though it should.
Fixed, thanks (though Gen 1 still correctly has it not affecting Ghosts).
 
Zamazenta's ability (Dauntless Shield) does not reflect stat boost on Damage Calculator (basically no effect).

With Dauntless Shield:

252 Atk Choice Band Urshifu Close Combat vs. +1 0 HP / 4 Def Zamazenta: 261-307 (80.3 - 94.4%) -- guaranteed 2HKO (notice the +1)

With Dauntless Shied.JPG


Without Dauntless Shield (using Drizzle as Zamazenta's ability):

252 Atk Choice Band Urshifu Close Combat vs. 0 HP / 4 Def Zamazenta: 261-307 (80.3 - 94.4%) -- guaranteed 2HKO (Same damage as above)

Without Dauntless Shied.JPG


What it should actually show:

252 Atk Choice Band Urshifu Close Combat vs. +1 0 HP / 4 Def Zamazenta: 174-205 (53.5 - 63%) -- guaranteed 2HKO

Dauntless Shield is being counted as +1 despite not showing the effect
 
BUG : i can't calculate anymore...refresh, clean the cookies, try others gens, others pokemons...it's always locked on Abomasnow's mooves
1597927748414.png
 
Could you add trick or treat/forest curse to the effects?
Edit: The calculator also lacks the difference between physical and contact (example: eq is physical but doesn't make contact, even though the calculator treats it as a contact move.
Another Edit: It calculates correctly for moves that normally don't make contact, it's just for the sake of testing (mainly because of Fluffy, that only affect contact moves, not physical moves in general).
 
Last edited:
Rising Voltage's power appears to be increased against airborne targets like Rotom. This should not be the case as the move checks against the target, not the user, unlike Expanding Force and Grassy Glide.
4 SpA Pincurchin Rising Voltage (140 BP) vs. 248 HP / 0 SpD Rotom-Heat in Electric Terrain: 85-101 (28 - 33.3%) -- 0% chance to 3HKO
 
Hello. There seems to be an error with the damage calculation for the move Nature Power. I can attach a screenshot. It is supposed to become the exact move it replicates, but the calculator shows it doing way less. I was mainly trying it for terrains, but even misty terrain nature power does less than Moonblast so the terrains aren't affecting the core damage in the Calc. please fix
 

Attachments

Hello. There seems to be an error with the damage calculation for the move Nature Power. I can attach a screenshot. It is supposed to become the exact move it replicates, but the calculator shows it doing way less. I was mainly trying it for terrains, but even misty terrain nature power does less than Moonblast so the terrains aren't affecting the core damage in the Calc. please fix
I think I know what the issue is.
Nature Power is considered as a variable power physical move by default.
The power is correctly updated on various terrains but not the category of the move.
So for instance in Misty Terrain, the calculator essentially computes the damage from a physical Moonblast, hence the difference in the results.
 
Last edited:
I think I know what the issue is.
Nature Power is considered as a variable power physical move by default.
The power is correctly updated on various terrains but not the category of the move.
So for instance in Misty Terrain, the calculator essentially computes the damage from a physical Moonblast, hence the difference in the results.
Oh that makes sense! I could just input the morphed moves for my calcs in that case. Would it be alright on showdown though? Damage-wise I mean. I have not tested it, but I've always been unsure if the two were directly linked.
 

steelskitty

you wanna sink so i'm gonna let you
is a Tutoris a Site Content Manageris a Forum Moderatoris a Community Contributoris a Tiering Contributoris a Past WCoP Champion
Moderator
weather ball doesn't seem to output the correct damage in dpp:

252+ SpA Life Orb Victreebel Weather Ball (100 BP Fire) vs. 252 HP / 116 SpD Dialga in Sun: 85-101 (21 - 25%) -- possible 5HKO after Leftovers recovery
252+ SpA Life Orb Victreebel Flamethrower vs. 252 HP / 116 SpD Dialga in Sun: 164-193 (40.5 - 47.7%) -- guaranteed 3HKO after Leftovers recovery

it looks like the calc should be displaying twice the amount of damage that it currently does for dpp weather ball.

edit: the lovely and talented SparksBlade has an example of weather ball vs flamethrower damage on ps! https://replay.pokemonshowdown.com/gen4customgame-1183478326
 
Last edited:
To add onto the message above, when changing the power of Weather Ball to a custom value, the calculator uses this value to compute the damage and displays "Weather Ball ([twice the custom value] BP Fire)".
So the display part understands that the bp is doubled when a weather like sun is active but the calc part doesn't acquire the correct base power for the move and always uses the custom / default value instead (without doubling it when appropriate).
In recent generations, it always uses 50 (no boost from weather) or 100 (boosted by weather) base power regardless of the custom input base power.
 

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

Top