Programming Pokémon Showdown Damage Calculator

1708610958616.png


Well... this is a decieving calc... because shadow ball act does

+1 252 SpA Iron Valiant Shadow Ball vs. 0 HP / 4 SpD Gholdengo: 266-314 (84.4 - 99.6%) -- guaranteed 2HKO

And can never kill a gholdengo from full hp but since quark drive is defaulted to "auto-select" it def is trying to confuse some people. Witnessed it first hand in tour games and on ladder several times. What should prob happen is it should default to having no boosts... as very few pokemon benefit from smth like fiery dance moth -> elec terrain happens and now you havq quark drive special attack.

If it defaulted to the stats at +0 this allows you to calc quickly and make sure that you have the right thing as in tense moments like tours this may be something you overlook and something that can prob cost you the game since its telling you are doing more dmg than you can.

If you want to auto check it then you can just set it to +special attack like in doubles where an electric terrain teammate may come in after while you are on the field boosted...
 
I have a question that may be weird. I was looking through the github trying to find where the calculator decides to go for a 4HKO, 3HKO, 2HKO odds, etc.

I'm very new to coding and was curious to see a simple way of doing this type of thing. Can someone point to me where it is in the github?
 
I have a question that may be weird. I was looking through the github trying to find where the calculator decides to go for a 4HKO, 3HKO, 2HKO odds, etc.

I'm very new to coding and was curious to see a simple way of doing this type of thing. Can someone point to me where it is in the github?
should be here
 
These two parts specifically aren't properly integrated into the calc extension for Gen 1: " RBY features only a single move that raises Speed in Agility, which is found on many Pokémon, particularly the legendary birds. Thanks to the way the game handles boosting stats, Agility completely cures the Speed drop inflicted by paralysis upon use". This does not show in the Calcdex, which was very confusing because I would be going against a paralyzed Zapdos with agility and be told I was faster even when I wasn't. There's also this: "Paralysis, along with burn, is subject to the stat reapplication glitch. This means that, if the opposing Pokémon uses a stat-raising move like Swords Dance, the stat drop of your Pokémon's status is reapplied. For example, if a Starmie with 328 Speed were to be paralyzed, it would first drop to 82 as normal. If an opposing Kabutops were to use Swords Dance, though, it would drop further to a mere 20 Speed". Once again there would be times where I made choices based on what Calcdex said that were misleading. You can read more here: https://www.smogon.com/rb/articles/rby_speed
 
Grassy seed (presumably other seeds) give boosts in the terrain but do not reduce knock off damage
252 Atk Choice Band Weavile Knock Off (97.5 BP) vs. +1 252 HP / 0 Def Grassy Seed Prism Armor Necrozma: 222-262 (55.7 - 65.8%) -- guaranteed 2HKO after Grassy Terrain recovery (note the base power listed)
 
Want to remention that Neutralizing Gas doesn't seem to be affecting certain Abilities. Was mentioned in some earlier posts but didn't see a mention of it in reply.

Kingambit against NG
252+ Atk Supreme Overlord 3 allies fainted Kingambit Iron Head vs. 252 HP / 80+ Def Weezing-Galar: 278-330 (83.2 - 98.8%) -- guaranteed 2HKO
1710460909410.png

Kingambit against Levitate
252+ Atk Supreme Overlord 3 allies fainted Kingambit Iron Head vs. 252 HP / 80+ Def Weezing-Galar: 278-330 (83.2 - 98.8%) -- guaranteed 2HKO
1710460955175.png
 
These two parts specifically aren't properly integrated into the calc extension for Gen 1: " RBY features only a single move that raises Speed in Agility, which is found on many Pokémon, particularly the legendary birds. Thanks to the way the game handles boosting stats, Agility completely cures the Speed drop inflicted by paralysis upon use". This does not show in the Calcdex, which was very confusing because I would be going against a paralyzed Zapdos with agility and be told I was faster even when I wasn't. There's also this: "Paralysis, along with burn, is subject to the stat reapplication glitch. This means that, if the opposing Pokémon uses a stat-raising move like Swords Dance, the stat drop of your Pokémon's status is reapplied. For example, if a Starmie with 328 Speed were to be paralyzed, it would first drop to 82 as normal. If an opposing Kabutops were to use Swords Dance, though, it would drop further to a mere 20 Speed". Once again there would be times where I made choices based on what Calcdex said that were misleading. You can read more here: https://www.smogon.com/rb/articles/rby_speed
Showdex dev here, this is actually a bug on our end lol since we copied Showdown's code and modified it to calculate the final stats ourselves. We weren't aware of that mechanic and all the unique caveats. That is way more complicated than I ever could have imagined, wow! I tried testing it out myself and I was surprised that the tooltip actually reports the incorrect speed as well if you Agility before getting paralyzed. I used Agility then got paralyzed, and it reported my speed stat as 452 in the tooltip. But the next turn, my opponent moved first, which means my speed actually wasn't 452, it was probably 112 (cause the paralysis debuff was still being applied).

We'll have to consult with someone who understands RBY a lot better than we do and see how we could potentially fix it. The stat reapplication glitch makes it more complicated too, so we're hoping there's a simpler fix we can implement. Thanks for the heads-up, we'll be looking into it!
 
Grassy seed (presumably other seeds) give boosts in the terrain but do not reduce knock off damage
252 Atk Choice Band Weavile Knock Off (97.5 BP) vs. +1 252 HP / 0 Def Grassy Seed Prism Armor Necrozma: 222-262 (55.7 - 65.8%) -- guaranteed 2HKO after Grassy Terrain recovery (note the base power listed)
Fixed.
 
Hey new to the forums so I don't know if anyone else is having these issues but my showdown calculator is showing the second mon on the right as vertically under the first for some reason. It doesnt have this issue with the randbats calculator for some reason, just the usual 1v1. I use OperaGx browser
 

Attachments

Nashrock

nothing to say and nothing to lose
is a Social Media Contributoris a Forum Moderatoris a Community Contributoris a Tiering Contributoris a Top Contributor
1710813359315.png

we just did a test to confirm that grassy glide is buffed to 60bp by tera without terrain, but for now the calc doesn't automatically update it from 55 to 60 when you de-select terrain
 

jetou

is a Programmeris a Forum Moderatoris a Battle Simulator Moderatoris a Community Contributor Alumnus
Moderator
View attachment 616877
we just did a test to confirm that grassy glide is buffed to 60bp by tera without terrain, but for now the calc doesn't automatically update it from 55 to 60 when you de-select terrain
It does seem to get buffed to 60 BP when I deselect Grassy Terrain: '252+ Atk Choice Band Tera Grass Rillaboom Grassy Glide (60 BP) vs. 0 HP / 0 Def Mew: 210-248 (61.5 - 72.7%) -- guaranteed 2HKO'. You can see that yours has the 'after Grassy Terrain recovery' so the terrain must be active if that's the case.
 

1LDK

Vengeance
is a Top Team Rater
Hey, this is just a minor thing, and maybe I'm dumb in case im putting it wrong, but the calc does not automatically count wind raider boost under tailwind

Qur2xUaj2u.png

csZnNqwr2j.png
 
I noticed about 12 hours ago that the SwSh calculator isn't functionally properly. The Dynamax button is changing the Pokemon's HP value, but it's not updating the Pokemon's moves to their dynamax equivalents.
 
What type of bug are you reporting? Mechanics

What is the bug?
The damage calculator doesn't change Tera Starstorm to the Stellar type when Terapagos terastalizes. Due to this, it does not deal double damage to opposing terastalized pokemon.

Are you able to replicate it? If so, how?
Yes, set up Stellar Terapagos in the calculator. Toggle the opposing pokemon's tera, and change the type of Tera Starstorm
 
Fairly minor qol suggestion:
Can Knock Off gen 6 and onwards be programmed like the offensive stat dropping moves, with an option to see its chance to KO over two turns selectable with a drop down menu. The menu would only need a "once " and "twice" option, since those are the only possible changes to its power from the move alone. With this you can more conveniently calc the overall chance to ko factoring in the changing bp. Rn, since they're different outputs, you have to take the calc with an item, then unequip the item to get the 2nd calc, then manually combine them (unless im missing smth, and I honestly might be). This is very inconvenient. There is of course special cases like sticky hold and unremovable items, but if the enemy is one of those things, just program the "how many times" drop down menu to not show.
 
Hey guys,
I would like to know how the chances are calculated to the 2HKO.
I mean, how can you explain this (in bold):
-1 252+ Atk Rayquaza Dragon Ascent vs. 244 HP / 156 Def Tera-Water Ogerpon-Wellspring: 82-97 (44 - 52.1%) -- 14.5% chance to 2HKO
However, if it was at 50% of health:
-1 252+ Atk Rayquaza Dragon Ascent vs. 244 HP / 156 Def Tera-Water Ogerpon-Wellspring: 82-97 (44 - 52.1%) -- 31.3% chance to OHKO
It is just an example, if you can explain or just share the formula.
Thanks
 
What type of bug are you reporting? Mechanics

What is the bug?
The damage calculator doesn't change Tera Starstorm to the Stellar type when Terapagos terastalizes. Due to this, it does not deal double damage to opposing terastalized pokemon.

Are you able to replicate it? If so, how?
Yes, set up Stellar Terapagos in the calculator. Toggle the opposing pokemon's tera, and change the type of Tera Starstorm
The damage calculator checks if it is specifically by Terapagos-Stellar instead of whether the Pokemon's Tera type is Stellar type, and then the damage calculator will then automatically update the type of Tera Starstorm. If you change the forme to "Terapagos-Stellar", then the damage associated with Tera Starstorm will automatically update.

1712179428748.png


I personally think that clicking Tera Stellar should update the forme in the same way it happens with Ogerpon, so I will look into it and come back to you on that.
 
Mold Breaker, Turboblaze etc are incorrectly removing the effects of Tablets of Ruin/Vessel of Ruin from calcs. Example from Randbats:
+2 Lvl 76 84 Atk Turboblaze Tera Dragon Reshiram Outrage vs. Lvl 83 84 HP / 84 Def Wo-Chien: 278-328 (100.3 - 118.4%) -- guaranteed OHKO
Ended up doing only 88% because of Tablets of Ruin. Changing Reshiram's ability in the calc to something irrelevant like Triage returns the correct value.
Fixed.
 
Heyo. A Pokemon holding Punching Glove and using a punching move will ignore Fluffy's damage reduction (because the glove turns them into non-contact moves). This doesn't apply to Protective Pads, just Punching Glove.

1712269995007.png


This has been tested on cart as well: https://www.smogon.com/forums/threa...chanics-research.3709545/page-23#post-9434178

The calculator, though, outputs damage for a mon holding Punching Glove and using a punching move as if Fluffy still applied (i.e. the calculator shows half the damage that will actually be done).
 

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

Top