Programming 1v6 calculator for quick damage calculations on your whole team

Hi all,

This is version one of my damage calculator that I've written with Python, and the code (with instructions on running it) is at:
https://github.com/Greg-from-work/vgccalctest

The calculator is specifically meant for quickly running a calculation accross your whole team, while needing to spend the shortest amount of time on actual data entry. This is an example of me calculating how much damage a specs Gholdengo shadow ball is expected to do to my whole VGC team (though you could change the level for singles calculations):
1679147235923.png


I created this calculator for my own use since I found that calculating things like specs Gholdengo using make it rain is something that took too long to calculate across my whole team.

The program gets your team's data by reading from a text file that you paste a showdown export into. This means that you don't need to input what your Pokémon are, and it also grabs and incorporates their EVs and natures.

The mults field is a place in which you can enter any number of multipliers to the damage, instead of needing to take the time to seek out and click individual buttons such as "sun" or "helping hand". Keep in mind that since the order of multiplication technically matters for Pokémon, the damage numbers you get will potentially be a little bit off if you use the mults field when compared to directly clicking buttons on the Showdown calculator. The numbers for this calculator should still be quite close to the actual damage numbers (unless you're playing little cup), and it's meant to very quickly give a strong idea as to what the damage is rather than being perfectly accurate. That being said, if you need to confirm for instance that a move dealing 99.5% damage is in fact one that has a 0% chance of fainting your mon, then you'd want to double check that specific calculation with the Showdown calculator.

While the above is all a core part of the calculator, there are some things that I plan to add in in the future. Currently the calculator uses the EVs and natures of your team, but in the future I will likely make it also automatically incorporate your team's items and abilities as well. Movewise, the calculator is only grabbing a move's power and typing currently, and does not take into account things like knock off getting a boost if it hits an item, or spread moves decreasing in damage. Currently the mults field will need to be used to manually incorporate such boosts and/or drops.

The calculator also has some other modes, such as an attacking mode (a) which shows you how much damage one of your Pokémon does to each of the opponent's 6 pokemon. It displays 5 different potential damage ranges for each enemy Pokémon depending on whether they have no bulk, max defensive EVs, max HP, etc. You input the enemy team by pasting in the string that showdown gives you (Example: Lunala / Groudon / Tapu Fini / Tsareena / Incineroar / Stakataka)

Last off is the speed mode, which looks like this:
1679148533588.png


Please let me know if there are things that have not been mentioned which would improve either the user experience or the way that I approached the code. Thanks for PokeAPI, which I fetch data from as part of the calculator operation. I store information about the most frequent run in text files so that data does not have to be re-fetched from PokeAPI for multiple consecutive similar calculations.
 

Attachments

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

Top