Programming Pokémon Showdown Damage Calculator

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
for some reason, mimic and hypnosis seem to not exist in gen 1, at least for me.
they did work like 1 hour ago, but now they just don't exist edit: mega kick too
View attachment 214205
Weird, I’ll re-add these
Gorilla Tactics does not factor in the attack boost
Was Fixed
I noticed Body Press isn't calculating properly. Its using the attack stat rather than your defense stat to calculate damage. I know you guys are still very much updating for gen 8 but I thought I'd leave a notice just in case it was overlooked.
was fixed
For the Sword/Shield Smogon Analysis link, the URL comes out to 'https://smogon.com/dex/undefined/pokemon/abomasnow/', which should probably be SS (it works for SM analyses).
Tried this on Edge & Firefox.

Edit: gonna made a branch on github to see if I can try & fix this
Edit: lack permission to push up to a branch (and also getting errors when I try and run it locally) so whoever can should just have to change smogonAnalysis() function in shared_analysis.js to:
JavaScript:
function smogonAnalysis(pokemonName) {
    var generation = ["rb", "gs", "rs", "dp", "bw", "xy", "sm", "ss"][gen - 1];
    return "https://smogon.com/dex/" + generation + "/pokemon/" + pokemonName.toLowerCase() + "/";
}
sorry I’ve had this done on an unpushed branch for a while, pushed


on a side note. Sorry everyone I stopped reviewing notifications on this thread for some reason. I’ll get to doing/starting all the requests probably next week. I’ve also changed my notifications so I receive email notifications as well to prevent this from happening again
 
Last edited:
Also minor suggestion but make Intrepid Sword/Dauntless Shield like Flash Fire, so with a button to activate/desactiavte the ability (With activate by defaut, because it is most useful I think). I feel, since the calc don't have always put IS/DS boost in the past, it would make more clear.
I think it would be better if intimidate, intrepid sword, and dauntless shield change a Pokemon's stat stages when you select the ability in the calculator. That way they're consistent with other stat stage changes, and you can deactivate those abilities just by clicking the "---" in the stat stages.
 
Last edited:
A minor suggestion, but having played in multiple Aegislash-allowed formats, Lego's calc having an "Aegislash-Both" forme in the calc was very convenient for me to calculate damage vs Aegislash. I think this feature is useful enough that it should be incorporated to the main site calc, especially with Aegislash looking to stay in OU for some time now.

edit: for clarification, "Aegislash-Both" forme refers to Aegislash that has both offense of Blade forme and Defense of Shield forme. The advantage of this is as following: If you know you're going to be hitting Aegislash in Blade forme you the Blade forme calc shows you all the calcs in the matchup. However, this is not the case for calculating vs Aegislash Shield forme, as you are forced to swap formes for your calc and is not able to have everything visible in a single screen.

Aegislash will almost never get to attack in Shield forme - unless Ditto or Transform is in play. Being forced to look at meaningless offensive calcs from Shield forme Aegislash makes it a huge hassle to calc vs it as you need to keep changing formes to calc 1 matchup. I understand it's a bit hacky, though, but I wanted to make this suggestion regardless.

Cheers,
Can we get the option to change the Pokemon species to any other species without changing the other parts of the moveset? That would fix the Aegislash problem and also let me more easily see the differences between similar Pokemon species, like Magneton and Magnezone.
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
for some reason, mimic and hypnosis seem to not exist in gen 1, at least for me.
they did work like 1 hour ago, but now they just don't exist edit: mega kick too
View attachment 214205
Re-added
A minor suggestion, but having played in multiple Aegislash-allowed formats, Lego's calc having an "Aegislash-Both" forme in the calc was very convenient for me to calculate damage vs Aegislash. I think this feature is useful enough that it should be incorporated to the main site calc, especially with Aegislash looking to stay in OU for some time now.

edit: for clarification, "Aegislash-Both" forme refers to Aegislash that has both offense of Blade forme and Defense of Shield forme. The advantage of this is as following: If you know you're going to be hitting Aegislash in Blade forme you the Blade forme calc shows you all the calcs in the matchup. However, this is not the case for calculating vs Aegislash Shield forme, as you are forced to swap formes for your calc and is not able to have everything visible in a single screen.

Aegislash will almost never get to attack in Shield forme - unless Ditto or Transform is in play. Being forced to look at meaningless offensive calcs from Shield forme Aegislash makes it a huge hassle to calc vs it as you need to keep changing formes to calc 1 matchup. I understand it's a bit hacky, though, but I wanted to make this suggestion regardless.

Cheers,
Done
requesting to add eternamax to the calc for PH / CG
done
Selecting Aegislash-Shield as either Pokemon will cause it to use the name of the previously selected pokemon in the calc description.
weird, the calcs seem to be correct though, at least. I’ll have to investigate more
for some reason, mimic and hypnosis seem to not exist in gen 1, at least for me.
they did work like 1 hour ago, but now they just don't exist edit: mega kick too
View attachment 214205
Done
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
Today, I have tried to import a Darmanitan-Galar-Zen set for hackmons purpose, and it a initially falled, due to name difference between PS and the Calc.
Indeed, calculator only accepts "Darmanitan-Zen-Galar" while the PS! teambuilder export as "Darmanitan-Galar-Zen"
Thank to KennedyLFC I was able to find my mistake, but I think it would be great to change the name to reflet the PS! name.

Also minor suggestion but make Intrepid Sword/Dauntless Shield like Flash Fire, so with a button to activate/desactiavte the ability (With activate by defaut, because it is most useful I think). I feel, since the calc don't have always put IS/DS boost in the past, it would make more clear.
Done
Calculator does not seem to be including Punk Rock boosts for Toxtricity.
It works fine with my testing? What exactly were your calc conditions
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
hey austin, i discovered an issue with the way stat boots and drops are measured in gsc. in gens 1 and 2 when you drop your speed stat by one stage it's dropped to 66/100 and not 67/100 like in gen 3 and above. the damage calc however implements 67/100 for gen 2, which causes the following, for example:



in reality, a machamp after two curses and a snorlax after one curse speed tie at 104 speed, as seen here when machamp moves first:



i'm not sure what you guys can do with this, but i figured it was worth reporting. :psyglad:
Was fixed
 
step 1 -> look at a fully evolved pokemon
step 2 -> then switch to mr. mime-galar
step 3 -> give mr. mime-galar eviolite
-> doesn't have an effect on mr. mime. this not only applies to blank sets, but also to saved mr. mime-galar sets.
 
In gen 3, Pidgeot, Clefable, Parasect, Persian, Machamp, Cloyster, Hitmonlee, Hitmonchan, Hitmontop, Kangaskhan, Mr. Mime, Scizor, Jynx, Pinsir, Porygon2, Shuckle, Piloswine, Octillery, Smeargle, Linoone, Breloom, Illumise, Camerupt, Whiscash, and Glalie's blank sets have no default ability even though they have only one possible ability in that generation. I can fix this if someone shows me which part of the Github thing stores the blank sets' default abilities.
A minor suggestion, but having played in multiple Aegislash-allowed formats, Lego's calc having an "Aegislash-Both" forme in the calc was very convenient for me to calculate damage vs Aegislash. I think this feature is useful enough that it should be incorporated to the main site calc, especially with Aegislash looking to stay in OU for some time now.

edit: for clarification, "Aegislash-Both" forme refers to Aegislash that has both offense of Blade forme and Defense of Shield forme. The advantage of this is as following: If you know you're going to be hitting Aegislash in Blade forme you the Blade forme calc shows you all the calcs in the matchup. However, this is not the case for calculating vs Aegislash Shield forme, as you are forced to swap formes for your calc and is not able to have everything visible in a single screen.

Aegislash will almost never get to attack in Shield forme - unless Ditto or Transform is in play. Being forced to look at meaningless offensive calcs from Shield forme Aegislash makes it a huge hassle to calc vs it as you need to keep changing formes to calc 1 matchup. I understand it's a bit hacky, though, but I wanted to make this suggestion regardless.

Cheers,
Are you sure this is done? I see no "Aegislash-both" form on my calculator, and Aegislash-shield continues using its 50 base attack stats when I make it attack.
Why is the "Aegislash-both" suggestion better than this one?
Can we get the option to change the Pokemon species to any other species without changing the other parts of the moveset? That would fix the Aegislash problem and also let me more easily see the differences between similar Pokemon species, like Magneton and Magnezone.
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
you sure this is done? I see no "Aegislash-both" form on my calculator, and Aegislash-shield continues using its 50 base attack stats when I make it attack.
Yes it’s done check the change log :). Sorry I don’t have access to make the GitHub changes live that’s pre
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
In gen 3, Pidgeot, Clefable, Parasect, Persian, Machamp, Cloyster, Hitmonlee, Hitmonchan, Hitmontop, Kangaskhan, Mr. Mime, Scizor, Jynx, Pinsir, Porygon2, Shuckle, Piloswine, Octillery, Smeargle, Linoone, Breloom, Illumise, Camerupt, Whiscash, and Glalie's blank sets have no default ability even though they have only one possible ability in that generation. I can fix this if someone shows me which part of the Github thing stores the blank sets' default abilities. Are you sure this is done? I see no "Aegislash-both" form on my calculator, and Aegislash-shield continues using its 50 base attack stats when I make it attack.
Why is the "Aegislash-both" suggestion better than this one?
I did the aegi-both because it’s significantly easier and a good temp fix. Also see: https://github.com/smogon/damage-calc/pull/314
 
Hi there. I decided to make Pokemon Showdown as my project for Software testing in my Uni.

Here are my findings, to be honest there is only one but without solving it many more occure
You are able to set values not to be integers from range 0-999 if you paste the text you wish to insert into the "value" of the attack and press "Honkanculate" at the exact same frame.

Here is a link to my google drive presentation with examples and error replication:

https://drive.google.com/open?id=1X_o43dpzX7qSJxB-ezgVarfK5hMkH-R_FNyXphdAr0k
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
Hey, not sure if this is the right place, but there's a bug with the damage calculator when finding Struggle damage in GSC.

https://replay.pokemonshowdown.com/smogtours-gen2ou-373028

( ( ( ( ( ( (2 x 100)/5) + 2 ) * 50 * (999/999) ) / 50 ) + 2 ) / 50 ) = 44
44 * .85 = 37 (rounds down)
Damage roll for +6 Skarmory's Struggle vs +6 Skarmory = 11.1% - 13.2%

In the above replay you can see that Struggle is doing around 12% damage when both Skarmorys are at max stats, so 999 Atk/Def (GSC caps stats at this) with the 50 BP effectively-typeless move. This is correct if you do the damage calculation by hand. In GSC Struggle isn't affected by STAB/resistances/etc. which is why I call it typeless, but when you select the default option in the calculator for Struggle, which is "None", you get this damage:

Skarmory Struggle vs. Skarmory: 28-33 (8.4 - 9.9%)

This is obviously wrong, which is why it surprised me. Note that this is only when Struggle's type is "None" - when I changed the type of Struggle to a type that's neutral vs Skarmory, such as Fighting, it displayed the proper damage roll:

+6 Skarmory Struggle vs. +6 Skarmory: 37-44 (11.1 - 13.2%)

Seems to only be an issue with the type "None" option in the damage calculator. Haven't tested it for other gens. Thanks!
this was fixed a while ago i just never got back to you
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
There seems to be a problem with recoil calculation when the damage done by a recoil move exceeds the targets maximum HP, causing it to become something close to 0. Please either fix or implement this on PS.




same with this one
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
While using the calculator I noticed that Rocky Helmet wasn't available as an item and it seems like it should be given that it affects damage output and ranges. I asked in Help if this was something intentional or if I was just missing something and was asked to post about it here so here I am.

View attachment 115791
This is currently what is listed for items beginning with 'R.'
sorry what's the point in displaying rocky helmet damage when its given to the attacker?
 
A certain bug with SpA drop moves and the "x times" button has resurfaced.
Sample problem calcs:
+2 20 SpA Rotom-Heat Overheat vs. 72 HP / 0 SpD Seismitoad: 188-222 (50.9 - 60.1%) -- 87.5% chance to 2HKO after Leftovers recovery
20 SpA Rotom-Heat Overheat vs. 72 HP / 0 SpD Seismitoad: 94-111 (25.4 - 30%) -- 0.3% chance to 4HKO after Leftovers recovery
-2 20 SpA Rotom-Heat Overheat vs. 72 HP / 0 SpD Seismitoad: 47-56 (12.7 - 15.1%) -- possibly the worst move ever
+2 20 SpA Rotom-Heat Overheat over 2 turns vs. 72 HP / 0 SpD Seismitoad: 376-444 (101.8 - 120.3%) -- possible KO in 2 turns after Leftovers recovery
+2 20 SpA Rotom-Heat Overheat over 3 turns vs. 72 HP / 0 SpD Seismitoad: 282-333 (76.4 - 90.2%) -- not a KO (weirdly this calc is the exact same without Leftovers as with)
Another example without Lefties:
+2 20 SpA Rotom-Heat Overheat vs. 240 HP / 0 SpD Arceus: 255-300 (57.8 - 68%) -- guaranteed 2HKO
20 SpA Rotom-Heat Overheat vs. 240 HP / 0 SpD Arceus: 127-151 (28.7 - 34.2%) -- 1.9% chance to 3HKO
-2 20 SpA Rotom-Heat Overheat vs. 240 HP / 0 SpD Arceus: 64-76 (14.5 - 17.2%) -- possible 6HKO
+2 20 SpA Rotom-Heat Overheat over 2 turns vs. 240 HP / 0 SpD Arceus: 510-600 (115.6 - 136%) -- guaranteed KO in 2 turns
+2 20 SpA Rotom-Heat Overheat over 3 turns vs. 240 HP / 0 SpD Arceus: 382-451 (86.6 - 102.2%) -- 81.3% chance to 3HKO
+2 20 SpA Rotom-Heat Overheat over 5 turns vs. 240 HP / 0 SpD Arceus: 319-376 (72.3 - 85.2%) -- not a KO (??? No healing!)
To show it's not the +2 doing it:
20 SpA Rotom-Heat Overheat over 2 turns vs. 240 HP / 0 SpD Arceus: 191-227 (43.3 - 51.4%) -- not a KO (this is right I think)
20 SpA Rotom-Heat Overheat over 3 turns vs. 240 HP / 0 SpD Arceus: 169-202 (38.3 - 45.8%) -- not a KO (This is 100% wrong)
This is 100% wrong:
+6 20 SpA Rotom-Heat Overheat vs. 252 HP / 4 SpD Mantine: 220-260 (58.8 - 69.5%) -- guaranteed 2HKO after Leftovers recovery
+6 20 SpA Rotom-Heat Overheat over 2 turns vs. 252 HP / 4 SpD Mantine: 882-1039 (235.8 - 277.8%) -- guaranteed KO in 2 turns after Leftovers recovery (???)
+6 20 SpA Rotom-Heat Overheat over 2 turns vs. 252 HP / 4 SpD Mantine: 882-1039 (235.8 - 277.8%) -- guaranteed KO in 2 turns
Hope you can get to the bottom of this.
On another note, the "All vs One " mode flat-out does not return anything for S/S Ubers, PU and LC. All other tiers are happy to show last Gen's mons, and work as far as I can tell on a quick glance.
sorry what's the point in displaying rocky helmet damage when its given to the attacker?
Same reason as to display recoil damage I guess. Though it being a fixed value means you can manually account for it.
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
A certain bug with SpA drop moves and the "x times" button has resurfaced.
Sample problem calcs:
+2 20 SpA Rotom-Heat Overheat vs. 72 HP / 0 SpD Seismitoad: 188-222 (50.9 - 60.1%) -- 87.5% chance to 2HKO after Leftovers recovery
20 SpA Rotom-Heat Overheat vs. 72 HP / 0 SpD Seismitoad: 94-111 (25.4 - 30%) -- 0.3% chance to 4HKO after Leftovers recovery
-2 20 SpA Rotom-Heat Overheat vs. 72 HP / 0 SpD Seismitoad: 47-56 (12.7 - 15.1%) -- possibly the worst move ever
+2 20 SpA Rotom-Heat Overheat over 2 turns vs. 72 HP / 0 SpD Seismitoad: 376-444 (101.8 - 120.3%) -- possible KO in 2 turns after Leftovers recovery
+2 20 SpA Rotom-Heat Overheat over 3 turns vs. 72 HP / 0 SpD Seismitoad: 282-333 (76.4 - 90.2%) -- not a KO (weirdly this calc is the exact same without Leftovers as with)
Another example without Lefties:
+2 20 SpA Rotom-Heat Overheat vs. 240 HP / 0 SpD Arceus: 255-300 (57.8 - 68%) -- guaranteed 2HKO
20 SpA Rotom-Heat Overheat vs. 240 HP / 0 SpD Arceus: 127-151 (28.7 - 34.2%) -- 1.9% chance to 3HKO
-2 20 SpA Rotom-Heat Overheat vs. 240 HP / 0 SpD Arceus: 64-76 (14.5 - 17.2%) -- possible 6HKO
+2 20 SpA Rotom-Heat Overheat over 2 turns vs. 240 HP / 0 SpD Arceus: 510-600 (115.6 - 136%) -- guaranteed KO in 2 turns
+2 20 SpA Rotom-Heat Overheat over 3 turns vs. 240 HP / 0 SpD Arceus: 382-451 (86.6 - 102.2%) -- 81.3% chance to 3HKO
+2 20 SpA Rotom-Heat Overheat over 5 turns vs. 240 HP / 0 SpD Arceus: 319-376 (72.3 - 85.2%) -- not a KO (??? No healing!)
To show it's not the +2 doing it:
20 SpA Rotom-Heat Overheat over 2 turns vs. 240 HP / 0 SpD Arceus: 191-227 (43.3 - 51.4%) -- not a KO (this is right I think)
20 SpA Rotom-Heat Overheat over 3 turns vs. 240 HP / 0 SpD Arceus: 169-202 (38.3 - 45.8%) -- not a KO (This is 100% wrong)
This is 100% wrong:
+6 20 SpA Rotom-Heat Overheat vs. 252 HP / 4 SpD Mantine: 220-260 (58.8 - 69.5%) -- guaranteed 2HKO after Leftovers recovery
+6 20 SpA Rotom-Heat Overheat over 2 turns vs. 252 HP / 4 SpD Mantine: 882-1039 (235.8 - 277.8%) -- guaranteed KO in 2 turns after Leftovers recovery (???)
+6 20 SpA Rotom-Heat Overheat over 2 turns vs. 252 HP / 4 SpD Mantine: 882-1039 (235.8 - 277.8%) -- guaranteed KO in 2 turns
Hope you can get to the bottom of this.
On another note, the "All vs One " mode flat-out does not return anything for S/S Ubers, PU and LC. All other tiers are happy to show last Gen's mons, and work as far as I can tell on a quick glance.

Same reason as to display recoil damage I guess. Though it being a fixed value means you can manually account for it.
yeah im fixing the reversed KO chance description when dealing with moves that are using more than one hit right now. I would assume the All vs One mode is missing those tiers because they don't have gen8 sets in the calc right now since they aren't released
 
yeah im fixing the reversed KO chance description when dealing with moves that are using more than one hit right now. I would assume the All vs One mode is missing those tiers because they don't have gen8 sets in the calc right now since they aren't released
all other tiers use last gen's sets (including NU which doesn't exist yet this gen), and those tiers work fine in one vs all. Plus a G-Darm Ubers set exists already.
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
View attachment 119056View attachment 119057

When Arcanine uses Overheat multiple times, the calc inverts the % chance to KO with respect to additional EVs.

0 SpA Life Orb Arcanine Overheat over 3 turns vs. 252 HP / 4 SpD Clefable: 364-431 (92.3 - 109.3%) -- 43.8% chance to 3HKO after Leftovers recovery
28 SpA Life Orb Arcanine Overheat over 3 turns vs. 252 HP / 4 SpD Clefable: 373-445 (94.6 - 112.9%) -- 31.3% chance to 3HKO after Leftovers recovery

This pattern is repeated with other mons using reducing SpA attacks

252 SpA Life Orb Hydreigon Draco Meteor over 3 turns vs. 248 HP / 156+ SpD Venusaur-Mega: 338-401 (93.1 - 110.4%) -- 43.8% chance to 3HKO
156 SpA Life Orb Hydreigon Draco Meteor over 3 turns vs. 248 HP / 156+ SpD Venusaur-Mega: 317-376 (87.3 - 103.5%) -- 81.3% chance to 3HKO
etc
Fixed
 
Hi, I have a request regarding the damage calculator (RBY). Would it be possible to add 'Low Kick' to the list of moves? I use a lot UU pokemon so it would be really useful!
 
Hey Austin, Low Kick is missing in gen 1. Is it possible to add stat modifiers like swords dance? Congratulations for the tool!
 

Clementine

one for the money, two for the show
is a Top Artistis a Forum Moderatoris a Community Contributoris a Top Tiering Contributoris a Battle Simulator Moderatoris a Community Leader Alumnusis a defending SCL Champion
UUPL Champion
There seems to be a mistake with the Low Kick calc on Diggersby.

252+ Atk Choice Band Hustle Dracozolt Low Kick (40 BP) vs. 0 HP / 4 Def Diggersby: 222-262 (71.3 - 84.2%) -- guaranteed 2HKO after poison damage

According to Diggersby's Bulbapedia page, it weights 93.5 lbs / 42.4 kg, and according to the Low Kick Bulbapedia page, Low Kick's base power should be 60BP.

I don't know yet if this problem exists for other mons, but I tried with many low kick users and the calc still says 40 BP for Diggersby.
Also, this problem isn't limited to Low Kick since Grass Knot also has 40 BP against Diggesrby in the calc.
 
Hi! im losing my mind trying to figure out the damage formula in Gen 1, when there is a Attack Stat boosted. I do the formula when all stats are in 0, and i get the same results as the Damage Calculator, but when I do the manual calculator of those damages, when I have, for example, Special +1, im not getting the same results (The Damage Calculator shows a bigger damage, than the one im getting, with the 0.85 RANDOM number, and with 1.00 RANDOM NUMER.) So, anybody can explain me the order of the damage formula, used in the Damage Calculator? (GEN 1) PLEEAASE
 

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

Top