Git Product home page Git Product logo

damage-calc's Introduction

Smogon

@pkmn's unofficial APIs for Smogon's analysis, moveset, sample teams, and usage statistics data.

Smogon does not officially provide any API for third party developers, and is at liberty to make breaking changes to its internal data representations at any point - this project attempts to provide a stable way of accessing the data Smogon exposes on its site. Two packages are provided:

  • smogon: A low-level wrapper around Smogon's analysis and statistics endpoints used to ergonomically fetch raw data via point queries from the source.
  • @pkmn/smogon: A rich client for the processed and aggregated Smogon analysis and moveset information available at data.pkmn.cc.

data.pkmn.cc contains several curated datasets pulled from Smogon and Pokémon Showdown which have been processed to allow for efficient batch access of analysis, sets, teams, and statistics data by format or generation. Analysis and set data is refreshed automatically every 24 hours as are sample teams, the best stats data for each generation is converted each month into @pkmn/stats's optimized output format, and information about Pokémon Showdown’s standard Random Battle formats from pkmn/randbats is updated hourly.

The API for these endpoints is documented though subject to change - developers relying on these endpoints should join the Discord to keep abreast of updates and/or rely on the latest version of the @pkmn/smogon package to simplify the data handling.

While this project's code is distributed under the terms of the MIT License and the aggregated stats information is freely available in the public domain, the set and analysis data is copyrighted by Smogon and its contributors.

damage-calc's People

Contributors

ajhyndman avatar annikacodes avatar asgdf avatar augmt avatar austinxii avatar awildnoob avatar dawoblefet avatar dependabot[bot] avatar elaverack avatar fsibapt avatar gamut-was-taken avatar honko avatar kamilaborowska avatar karthik99999 avatar krisxv avatar legofigure11 avatar magiasn avatar marty-d avatar mk360 avatar monsanto avatar ntonio36 avatar scheibo avatar shivad173 avatar shrianshchari avatar sobolews avatar sparktrain avatar thejetou avatar wartab avatar zarel avatar zrp200 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

damage-calc's Issues

Metal Claw is missing

Currently battling a Registeel in Gen3, and I noticed that Metal Claw is missing from the move list.

problem looking up the Tapus

Hey
Lately there appears a new little handling inconvenience when typing in the Tapus in the damage calculator.
The calculator seems to not perceive the space between 'Tapu' and Bulu/Lele/Koko/Fini ofcourse you can type Tapu in the search mask and look up the one you need manually but I remember a (maybe?) similar bug during ORAS when it appears to say 'Blank Set' for every Pokémon with a hyphen in its name which you could fix quite fast therefore I hope this is only a little issue too :)

Good job Man!

Improve accessibility for screen readers

Similar to the corresponding issue for the Showdown client. Unfortunately, this will be much harder than the client, as that only needed usability improvements.

  • The generation radio buttons are not recognized as such, they just read as plain text. There is no indication which is selected, or that they are a logical group. Might be because elements need to always be inside a <form>, or associated with one using an attribute, so this looks like invalid html5. Similarly for the notation and mode radio buttons on the top, the move selection, single/doubles, terrain selection, weather selection, and spike layers radios.
  • What's this used for? <span id="damageValues">(211, 214, 216, 218, 220, 224, 226, 227, 231, 234, 235, 238, 242, 243, 246, 250)</span>
  • When the page loads, below pokemon1, I hear "Abomasnow (ORAS NU Mixed Attacker)" being announced as a link. Only by pressing enter do I hear my focus moving into an edit field. I can edit the text, but it doesn't read suggestions when pressing up/down, or announce the presence of suggestions. When I press escape to stop editing, I hear 2 edit boxes now, one of them is probably not meant for editing, so should be aria-hidden.
  • The crit and z checkboxes are not recognized as such, but read as plain text, with no indication of being checked/unchecked. Similarly, the gravity, stealth rocks, reflect, light screen, protect, leech seed, Foresight, Helping Hand, Friend Guard and Aurora Veil checkboxes.
  • For controls that can affect either side of the field (e.g, hazards), should be labeled so it differentiates between yours and opponent's side.

Function isGrounded is missing

Function isGrounded is called in getTerrainEffects (defined in calc_ab.js), but I can't find its definition.
When I check Electric Terrain and Misty Terrain, a script error occurred and their effects are not applied. Grassy Terrain and Psychic Terrain work fine.
Please have a look at this.

To Do list

I figured putting a todo list on the GitHub repo itself might be beneficial as it's much easier for developers to see what still needs to be done.
1: Fix Mega's/alolan Pokémon search currently the calculator doesn't support searching for the Pokémons Mega or Alola forms. If you wanted to search for mega metagross for example, you'd have to type "metagross-mega". Changing the getSetOptions function in ap_calc.js should be the solution here
2: Fix best move auto selection currently when you change a pokemons EVs after already doing a calc it will redirect you off of the move that was previously the strongest. This is annoying people so adding a lock-move option might be a good thing to have, the best being if you double click on a move it stays highlighted.
3: Add forme-change option a dropdown option that changes the Pokémons forme but not the set. This would require adding hasAltForm in pokedex_js
4: Imported sets only mode an option where only your imported sets show up on the left side of the calc, while the other showing sets from setdex_**.js
5: Fix stat dropping moves KO-Chance auto calculate ko chance with moves that drop a users stats. Pretty straight forward, add dropsStats to any relevant move in moves.js then change any relevant code in ko_chance.js
6: Show percent recovered from moves that drain health There's probably a lot of ways this could be implemented, we could put it right next to the damage output, we could put it under the damage rolls, or just make a new section. The move data part is already done with givesHealth.
7: take into account defense drops after pokemon with Weak Armor or Stamina get hit by a multi hit move when generating the ko chance.
8:Add a “clear” button for custom sets. Create a button that erases all imported custom sets

Evasion and accuracy

Should be able to set stat changes in evasion and accuracy for the purpose of correctly calculating stored power's base power. Also having accuracy of moves being considered in the % to OHKO would be nice

Dragon Dance Missing

I know it is a status move but I imported a set with D-Dance and it is not coming up. Just figured someone would like to know

Beat Up is not on the calc?

Hey there, just noticed that Beat Up isn't among the listed moves for a Pokemon to use. I wanted to do Beat Up calcs from a Whimsicott on a Focus Sash Gengar, but it seems that I can't do that because Beat Up isn't a listed move.

Automatic move highlighting picks lowest damaging move

Picking Passimian when Abomasnow is already loaded defaults to Passimian's Earthquake
Picking Ferroseed when Passimian is already loaded defaults to Passimian's Rock Slide
Picking Magmortar when Ferroseed is already loaded defaults to Magmortar's Thunderbolt
If (No Move) is available it chooses that.

Sometimes it picks the status moves (Recover for Mareanie vs Ferroseed) sometimes it doesn't (Ferroseed vs Passimian)

Suggestion: Add Costum set for base forms

Hey
I want to suggest an addition too,
thinking it would be a nice feature if you could choose 'Costum Set' with Ash-Greninja in regular Greninja form or when you using a mega but you arent mega evolved yet.
I don't know a single thing about scripting therefore I want to apologize if this is a insanely complicated to implement idea.

Again, keeping up the great work!

RBY/GSC mix up stat order when determining HP IV

Nowadays, the canonical ordering of stats is HP-AT-DF-SA-SD-SP, but it was originally ordered as HP-AT-DF-SP-SC, and that's the order that's reflected in the G1 and G2 data structure. If you go into one of those modes and set the Special IV to 14, HP is also supposed to drop to 14 because the low bit there is also the low bit for HP, but the calculator actually sets HP to 13 there, as though it thinks Special controls the 2 bit of HP. That bit is really supposed to be intermeshed with Speed, and setting a 14 there should drop HP to 13 in the absence of anything else, but instead the calc goes to 14 HP--a straight relabeling of the stat order.

Hyper Fang is missing

I wanted to see how ridiculous Hyper Fang on Gumshoos with Strong Jaw and Adaptability would be, but the calculator doesn't have that move in the system.

All vs One for VGC 17 broken

When clicking the 'Honkalculate' button for All vs One VGC 17, no damage calculations are produced. I did a bit of investigating and it seems to be a problem with Vanilluxe using Sheer Cold which gives an undefined 'move.type' value. After I used Chrome's inbuilt debugger to create an IF statement that sets 'move.type' to Ice when Sheer Cold is used, the problem went away. I don't know why the problem only happens for VGC 17, however.

Improve z-move input

It seems power of z-moves can only be assigned manually now. I think it would be better if we just type the original move, then check a checkbox or something, and got the corresponding z-move used for calc.
Is anyone working on this? I can have a try if not :)

Importing Sets does not work

Currently when you take the sets directly from teambuilder the moves will not appear. Edit: Marty has confirmed this is from the extra space Teambuilder adds to support reddit

Ring Target has no effect

This one's easy; just set up a scenario where one of the attacker's moves is blocked by an immunity. Then change the defender's item to Ring Target. It should override the immunity and allow it to show some actual damage, but doesn't.

Add option for not automatically assuming max EVs in RBY/GSC sections

Obviously in a competitive battle under those two rulesets, it's possible to max out all the stats so for almost all practical purposes you might as well. However, there are some cases (the most prominent one on my mind is setting up in-game scenarios) where more flexibility in the gamut of player/opponent stats is helpful.

A lot of the time, it's possible to construct the equivalent setup in ADV mode and run the numbers from there, but there are some details that don't quite sync across the generation gap (in particular, the damage variation roll dropping from a d39 to a d16) for cases where the slight changes might tangibly affect the odds.

Having the EV text boxes be hidden by default, and only revealing them on the deselection of a toggle switch like the one used for critical hits, would be fine.

Abilities on imported sets occasionally reverting to base abilities.

Rayquaza-Mega @ Choice Specs  
Ability: Aerilate  
Shiny: Yes  
EVs: 252 HP / 252 Atk / 252 Def / 252 SpA / 252 SpD / 252 Spe  
Modest Nature  
IVs: 0 Atk  
- Boomburst  
- Secret Sword  
- Magma Storm  
- Draco Meteor

This set for example, when I import it, the ability sometimes changes to Delta Stream. Do you guys have this same issue? This is particularly annoying when dealing with Balanced Hackmons calcs.

If Spectral Thief in moveset, all other moves steal offensive boosts, and defending Pokémon steal defensive boosts

  1. Pick Marhsdow's Uber Life Orb Attacker set on both sides
  2. Make Attack at +1 on left Marshadow
  3. Now any calc from right sides's Marshadow (not at +1) show up at +1, see pic attached https://imgur.com/a/GPQt1de

It's like it applies Spectral Thief's effect to any of Marshadow's moves, even Shadow Sneak or Rock Tomb as seen on the pic, which should not happen. It also works for any +X Att, or +X SpA, or +X Def, +X SpD. Actually it goes even further (and is probably the same bug), if you do +1Def on the LEFT, and select a calc on the LEFT side, it will take it into account for the right side :
252 Atk Life Orb Technician Marshadow Rock Tomb vs. +1 0 HP / 4 Def Marshadow: 49-58 (15.2 - 18%) -- possible 6HKO

Honkalculate doesn't work

Pressing Honkalculate with any tier checked prints the following error in console:

Uncaught TypeError: pokeInfo.find is not a function
at new Pokemon (shared_controls.js:408)
at calculate (honkalculate_controls.js:76)
at HTMLButtonElement. (honkalculate_controls.js:231)
at HTMLButtonElement.dispatch (jquery-1.9.1.min.js:3)
at HTMLButtonElement.v.handle (jquery-1.9.1.min.js:3)

When loading a custom set on the right side, Abomasnow form remains, messing up calc

I followed the following steps:
Load this set:

Necrozma-Dusk-Mane @ Solganium Z  
Ability: Prism Armor  
EVs: 252 Atk / 4 Def / 252 Spe  
Adamant Nature  
- Sunsteel Strike  
- Photon Geyser  
- Prismatic Laser  
- Brick Break  

then load this set:

Gengar  
Ability: Cursed Body  
IVs: 0 Atk  
- Will-O-Wisp 

Both imported with success.
Then on the left side, I select 'Only show imported sets', then select my Necrozma-Dusk-Mane set.
Then on the right I select my Gengar manually from the list (since there is no 'Only show imported sets ' option on the right).
Then the calc shows this:
252+ Atk Necrozma-Dusk-Mane Photon Geyser vs. 0 HP / 0 Def Abomasnow: 584-690 (181.9 - 214.9%) -- guaranteed OHKO
Yes, Abomasnow, and in the right field, everything has Gengar's stuff, except the 'Forme' field, that still has Abomasnow, so the error night come from here. After that if you try to change the Pokémon on the right to like Abra or some other, and then reselect my Gengar set, a lot of weird stuff happens, sometimes it will work, sometimes the previous Pokémon will still show up...
So I'm not sure what's happening exactly but it is not right. And yeah, would be nice to have the 'Only show imported sets' option on the right side too.

Solar Power Electric Terrain issue

I got this bug report from Twitter:

damagecalc

bug:
when pokemon ability is solar power used thunder in Electric Terrain in sun。
Similar to the situation,
+2 252+ SpA Solar Power Abomasnow Thunder vs. +6 0 HP / 0+ SpD Abomasnow: 61-72 (19 - 22.4%) -- guaranteed 4HKO after Stealth Rock, Solar Power damage, Leech Seed recovery, and burn damage

"in sun" and "in Electric Terrain" It will not be displayed.

All vs One and One vs All Sort Incorrect

https://pokemonshowdown.com/damagecalc/calc_bc.html?mode=all-vs-one
https://pokemonshowdown.com/damagecalc/calc_bc.html?mode=one-vs-all
Damage (%) and KO Chance column sort
When clicking the column headers to sort by damage, it looks like it's incorrectly sorting alphabetically rather than a number value sort.
e.g.
0
101.5
11
122
13.2
whereas it should be
0
11
13.2
101.5
122
I believe the last time I used this functionality was 2016-07-XX. It was working at that time.
Please take a look.
Thanks!

Choice items are not taken into account in multi-hit moves after the first move

Following a discussion on Smogon's Forums bug report thread for the calc here, the issue is the following:
Choice items (I tested both) are not taken into account in multi-hit moves (I tested Draco Meteor and Superpower for instance) after the first move.
Here is the proof:
252+ SpA Choice Specs Kingdra Draco Meteor vs. 248 HP / 208+ SpD Mantine: 165-195 (44.2 - 52.2%)
so the min damage of one hit is 165.
Now, the min damage of one hit starting at -2 SpA (to mimick what should be the second hit) is 84:
-2 252+ SpA Choice Specs Kingdra Draco Meteor vs. 248 HP / 208+ SpD Mantine: 84-99 (22.5 - 26.5%)
So the total min damage of 'Twice' Draco Meteor should be 249.
But currently we have a min of 220:
252+ SpA Choice Specs Kingdra Draco Meteor over 2 turns vs. 248 HP / 208+ SpD Mantine: 220-261 (58.9 - 69.9%)
But actually 220-165=55 which is the result of no choice Specs for the second hit:
-2 252+ SpA Kingdra Draco Meteor vs. 248 HP / 208+ SpD Mantine: 55-66 (14.7 - 17.6%)
demonstrating that indeed after the first hit, the Choice Specs is not taken into account anymore.

Missing moves: Disarming Voice and Water Gun

Don't know if it's intended, but you can't have Water Gun nor Disarming Voice in the calculator.
We use this calculator a lot to calculate damage ranges for speedruns and since the Gen 7 speedruns use Popplio, it's tedious to always replace values of other moves.

I'd make a pull request, but my repo contains other changes on the master branch that are related to speedruns, so I cannot just make a pull request of that. Nevertheless this commit should suffice: https://github.com/wartab/honko-damagecalc/commit/a7f8142aa8dcd73f9c0c509fd92dcad7ebb00e3c

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.