Programming Pokémon Showdown Damage Calculator

I think you mean "no direct effect on damage", by which I mean stuff that is either a modifier in the damage formula or a modifier to a Pokémon's Attack, Defense, Special Attack, or Special Defense; stuff like Anger Point which are not themselves modifiers to damage or stats that govern damage, but can generate modifiers to damage (like stat stages), have an indirect effect.



The damage calculator lets you freely fiddle with values like Ability, typing, and Base Stats.

Also, I have something to say that has nothing to do with other posts in this thread: I have noticed a lack of Substitute in the damage calculator, though I am not entirely sure how necessary it is. Since it takes off 25% of its user's maximum HP to create what amounts to a separate "shield" health bar with an amount of HP equal to the amount of HP used to create it, and since most attacks in competitive Pokémon take off more than 25% of their target's HP, the usual practical effect of Substitute is to cap the damage of the next hit taken to 25% of the user's max HP. There are cases where an attack would not take off 25% or more of the target's HP, such as Seismic Toss used on a Pokémon with a huge HP stat like Blissey or Wailord (I'd mention Wobbuffet, but it can't learn Substitute), in which case the Substitute survives with a reduced amount of remaining HP, but leftover damage from the hit that breaks the Substitute still isn't transferred to the Pokémon behind it, so it still imposes a cap on the effective damage from the hit that breaks it. I think this cap only applies to the damage that would be taken by the Pokémon behind the Substitute; it doesn't apply to other things that are a function of the dealt damage, like healing from moves such as Drain Punch or Giga Drain or recoil damage from moves such as Double-Edge or Wild Charge. A Substitute also prevents most status moves, like Leech Seed, Toxic, Hypnosis, Thunder Wave, etc. from connecting with the Pokémon behind the substitute, and also prevents secondary effects like status effects or stat drops from an attack that hits a Substitute, but it does not prevent indirect damage such as weather, poison, burn, Curse, Leech Seed, etc. (though a lot of these, like poison and Leech Seed, require that the indirect damage in question starts before the Substitute goes up, others, like weather, can start happening regardless of whether or not a Substitute exists), nor does a Substitute prevent the Pokémon behind it from deducting its own HP to use moves like Curse (as a Ghost), Belly Drum, or Mind Blown (though not Substitute itself, as it fails if used while a Substitute already exists), taking recoil damage from moves like Double-Edge and Wild Charge, reducing its own stats or afflicting itself with status conditions by using certain moves (such as Close Combat or Outrage), or taking damage from self-attacking by confusion (though, again, the confusion usually has to be inflicted before the Substitute goes up). These are all things that should be known by competitive Pokémon players, and they may not be relevant to the damage calculator (though it may do things like change 6HKOs to 7HKOs, I'm not sure). Where it gets interesting is when Substitute is ignored or transferred.

Pokémon with Infiltrator bypass an opponent's Substitute with any move they use, and sound-based moves bypass Substitute regardless of whether or not their user has Infiltrator. This means that the damage calculation will be the same regardless of whether or not a Substitute exists. Also, while a Substitute usually vanishes immediately when the Pokémon behind it is switched out (or when it faints), it stays in place if the Pokémon behind it was switched out by using Baton Pass. When this happens, the Substitute's HP remains the same as it was when the Pokémon behind it used Baton Pass and exited the field, but a Substitute does not have defensive stats of its own; the damage a Substitute takes from an attack is determined by the type, Defense/Special Defense, Ability, and held item of the Pokémon which is currently behind it (as well as global modifiers such as weather and terrain). This means that Baton Pass can be used to give a Pokémon a Substitute with more HP than a Substitute that Pokémon could create itself could have, and that a Pokémon can get a Substitute without sacrificing any of its own HP. While this scenario will not come up in most Smogon-based battles due to our Baton Pass clause, people will use this calculator for battles with or without that clause. So we need to be able to factor in damage based strictly on the HP the Substitute itself has, using the type, stats, Ability, and held item of the Pokémon behind it (we don't really need to worry about damage in excess of a Substitute's HP, since that isn't transferred to the Pokémon behind it). A Substitute could be broken in one hit when its original creator is attacked, but that same attack could fail to break that same Substitute if it is transferred to another Pokémon.
Long story short, you want Substitute to be added?
 
Long story short, you want Substitute to be added?
Yes, I do. Though I also want a way to account for when a Pokémon receives a Substitute from another Pokémon. Which means we need at the least the base HP stats of everything that can learn Baton Pass. (And then EVs and IVs need to be factored in...)
 
Last edited:
Yes, I do. Though I also want a way to account for when a Pokémon receives a Substitute from another Pokémon. Which means we need at the least the base HP stats of everything that can learn Baton Pass. (And then EVs and IVs need to be factored in...)
You can just manually change the defense stats of substitute receiver to match the substitute baton passer.
 
Really quick possible bug, but when I was calcing Balanced Hackmons stuff, a Diancie-Mega with Pixie Plate Pixilate ESpeed against a 252 HP/ 252 Def Giratina was doing slightly more when the Giratina was fluffy, versus fur coat. With a defense boosting nature (not the standard set), it did the same, regardless. Are there any explanations as to why this is the case? Is it a mathematical oddity or am I missing something?
 
When calculating a type Z-move, like hydro vortex, can the text specify the base move?
Really quick possible bug, but when I was calcing Balanced Hackmons stuff, a Diancie-Mega with Pixie Plate Pixilate ESpeed against a 252 HP/ 252 Def Giratina was doing slightly more when the Giratina was fluffy, versus fur coat. With a defense boosting nature (not the standard set), it did the same, regardless. Are there any explanations as to why this is the case? Is it a mathematical oddity or am I missing something?
I don't know exactly what causes this, but there are 2 possibilities, both based on the fact that fur coat doubles physical defense while fluffy halves damage. Damage isn't directly proportional to the defending Pokemon's defense stat; it's increased by 2 points after the defense stat is applied. Fur coat works directly on the physical defense stat, so it can only almost halve the damage. The other possibility is that the damage formula divides the damage by 50 and rounds down at some point. Fur coat applies before that, and fluffy applies after.
 
hey guys, I'm generally loving the calculator, but if I could say one major thing that bothers me it's definitely having to adjust level from 100 to 50 ALL THE TIME. even if a lot of players might use Lv 100 more, to the rest of us it's quite a major annoyance - I would love if there was an a button/slider which would let you set Lv 100/50 once without the need of repeating the process.

oh, and Z Moves are to me quite annoying to set as well as you have to search for their base powers all the time...

btw apologies if any of this has been addressed.
 

Pikachuun

the entire waruda machine
Give your Pokemon the Z-crystal you want to calculate and click the Z button next to the move you want to calculate.
you actually don't even need to give the z-crystal and can just click the Z button. it won't take the item into account so there's no need to change it
 
you actually don't even need to give the z-crystal and can just click the Z button. it won't take the item into account so there's no need to change it
If that's the case, how does it tell if you're using a type Z-move or a species-exclusive Z-move?
 

Pikachuun

the entire waruda machine
If that's the case, how does it tell if you're using a type Z-move or a species-exclusive Z-move?
it defaults to the type-based Z move according to a quick check, so those would be the only cases that you would need to switch item to the Z crystal (particularly the signature one)
although i don't really have any idea why you'd use a type-based Z crystal when a signature one is better in basically every case... ah well, calculator is calculator ig

EDIT: upon re-testing, if you give a signature Z crystal to a mon that normally can't use it, it will still display the signature Z move, which is probably a bug
1533054660137.png
 
Last edited:
Give your Pokemon the Z-crystal you want to calculate and click the Z button next to the move you want to calculate.
ah, thanks, I hadn't noticed the "Z" button!

so a quick option to set everything on Lv 50 is all I desire now ;-)
it would imo REALLY be helpful (I personally never play anything with Lv100 and I hardly think I am alone in that)
 
Could you add a way to check dmg dealt by at least 2 Pokemon to an opponent's done in 2 turns along with recovery options like lefties, grassy terrain, etc? (for example, heatran magma storms defensive landot with lefties, dies, and ferrothorn power whips the landot next turn, all while landot gets 2 turns of leftovers)? maybe like a drag-and-drop style addition box with 1 box having the dmg of 1 pokemon, another having the 2nd pokemon's, and a third having the recocery options added? this just makes adding up dmg easier
 
The export button stops working after I load a custom set. Is this a bug?
Also, an option called "Caterpie" sometimes appears in the dropdown menu when I'm searching for Pokemon. Is that also a bug?
 
it defaults to the type-based Z move according to a quick check, so those would be the only cases that you would need to switch item to the Z crystal (particularly the signature one)
although i don't really have any idea why you'd use a type-based Z crystal when a signature one is better in basically every case... ah well, calculator is calculator ig

EDIT: upon re-testing, if you give a signature Z crystal to a mon that normally can't use it, it will still display the signature Z move, which is probably a bug
It is not. That function is mainly there for Balanced Hackmons, and similar modded tiers that allow everybody to slap any Z-Cristal they want to anything they want.
 

Pikachuun

the entire waruda machine
It is not. That function is mainly there for Balanced Hackmons, and similar modded tiers that allow everybody to slap any Z-Cristal they want to anything they want.
false, as BH is limited to the mechanics of the base game.
unless you hack what a Z crystal binds to, you aren't going to have Zygarde-C use Let's Snuggle Forever via a Z crystal in-game. you CAN put it in a moveslot in hackmons tiers (banned in BH basically means Pure Hackmons only), which is intended, and the damage calculator does allow you to do as shown in the hide tag below, though (and also for moves like Inferno Overdrive correctly displays that it will have 1 BP):
1538404596239.png
it's a really minor bug at the end of the day so it doesn't really have to be fixed, but it's not really correct either
 
false, as BH is limited to the mechanics of the base game.
unless you hack what a Z crystal binds to, you aren't going to have Zygarde-C use Let's Snuggle Forever via a Z crystal in-game. you CAN put it in a moveslot in hackmons tiers (banned in BH basically means Pure Hackmons only), which is intended, and the damage calculator does allow you to do as shown in the hide tag below, though (and also for moves like Inferno Overdrive correctly displays that it will have 1 BP): it's a really minor bug at the end of the day so it doesn't really have to be fixed, but it's not really correct either
As far as my knowledge goes, you can easily hack tee base game to remove the restriction of all the exclusive items, so I assumed it would be included as a part of it. But that's not a section for Balanced Hackmons discussion, so I'll leave it at that.
 
When calculating damage with a damage-reducing berry (or I guess any item that gets consumed when hit by an attack), can the damage calculator take the item consuming into account when displaying the <number>HKO? Or maybe add one of those once/twice/thrice dropdown menus like the ones used for overheat and leaf storm? Right now the calculator assumes the damage-reducing berries last forever, so it might say an attack takes 5 hits to beat a Pokemon when it should only take 3 hits.
 
Last edited:
Did you try closing your browser and restarting your computer? If yes, did the problems go away?
I mention it a bit later in my post, yes I did reset my PC. I've tried a lot of things to see whether the problem was on my end but it didn't fix the issue.
 

Austin

Schismatic
is a Programmeris a Community Contributoris a Forum Moderator Alumnusis a Battle Simulator Moderator Alumnus
The calculator is of great help, but the one vs all, and all vs one functions don't work for me. I did not see any comment about it in this thread, or google, so I'd like to ask if it is currently unavailable.
As of today I've started experiencing a plethora of weird issues with the damage calculator that weren't there yesterday. I've recorded my screen to show what's going on:

1. 0:00 The Z button does nothing. It's supposed to work even if the Pokemon set doesn't have a Z-Crystal, but regardless of whether it does or doesn't the button doesn't turn the move into a Z move.

2. 0:37 The crit damage multiplier appears to be 2x in the S/M calc and possibly in the X/Y calc as well, even though it's supposed to be 1.5x as of gen 6.

3. 1:03 The RBY calc is all kinds of messed up. Moves are undefined, it says Abra is the default Pokemon when it's supposed to be Aerodactyl, etc. Says "something broke; please tell Austin" so I assume this is the right thread to post this in.

4. 1:28 The ADV calculator appears to be using the DPP Physical Special split.

I have no idea what is causing this. While attempting to figure out whether this was an issue on my end I've refreshed the page, cleared my cookies and cache, turned off all my extensions, restarted my browser and PC but nothing fixed it. I've asked around and most other people tell me the calculator works just fine for them, however I've confirmed that at least one other person is experiencing the same problems. One thing I figured out is that we were both using Chrome to access it, however the calculator worked fine on his mobile phone's browser but not on mine.

I use the calculator a lot and I appreciate the work you put into it, so I thought this would be worth bringing to your attention.
Sorry I didn’t get a notification for this today, I’ll have to fix it tomorrow :/. Z-moves not working was brought to my attention so I fixed that at least and I think it also fixed your gen 1 issues and possibly gen 3(?). Sorry there was a refactor that I guess broke a lot of things
 
Last edited:
Sorry I didn’t get a notification for this today, I’ll have to fix it tomorrow :/. Z-moves not working was brought to my attention so I fixed that at least and I think it also fixed your gen 1 issues and possibly gen 3(?). Sorry there was a refactor that I guess broke a lot of things
All the bugs I've noticed seem to be fixed now, so thank you!
 

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

Top