Programming Pokémon Showdown Damage Calculator

Okay, first of all, sry for double posting, but I'd rather be sure mY post is seen.

This time I've found an issue, still related to teravolt/mold breaker (and this time, I've tested sunsteel strike and photon geyser too). So the current situation is : against a pokemon having multiscale (I just tested with lugia but I assume it's coded the same way for dragonite), multiscale does get ignored on the sims by the move/abilities stated above, but not in the calc.

first the replay with the test : http://replay.pokemonshowdown.com/gen7anythinggoes-849776798 (I've been carefull to use the spread of the calc)

For LO KB (dealt 45% to full health Lugia and 49% with multiscale broke):
4 Atk Life Orb Teravolt Kyurem-Black Fusion Bolt vs. 252 HP / 160+ Def Multiscale Lugia: 95-113 (22.8 - 27.1%) -- Theorical damage against a full health lugia according to the calc
4 Atk Life Orb Teravolt Kyurem-Black Fusion Bolt vs. 252 HP / 160+ Def Lugia: 190-226 (45.6 - 54.3%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

For excadrill scarf (dealt 30% to full lugia and 29%with multiscale broke):
252 Atk Mold Breaker Excadrill Rock Slide vs. 252 HP / 160+ Def Multiscale Lugia: 55-65 (13.2 - 15.6%) -- Theorical damage against a full health lugia according to the calc
252 Atk Mold Breaker Excadrill Rock Slide vs. 252 HP / 160+ Def Lugia: 110-130 (26.4 - 31.2%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

For Necro-DM's Sunsteel Strike ( dealt 30% to full health Lugia and 30% with multiscale broke):
252 Atk Necrozma-Dusk-Mane Sunsteel Strike vs. 252 HP / 160+ Def Multiscale Lugia: 60-72 (14.4 - 17.3%) -- Theorical damage against a full health lugia according to the calc
252 Atk Necrozma-Dusk-Mane Sunsteel Strike vs. 252 HP / 160+ Def Lugia: 121-144 (29 - 34.6%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

For Necro-DM's Photon Geyser (dealt 15% to full health Lugia and 16% with multiscale broke):
252 Atk Necrozma-Dusk-Mane Photon Geyser vs. 252 HP / 160+ Def Multiscale Lugia: 30-36 (7.2 - 8.6%) -- Theorical damage against a full health lugia according to the calc
252 Atk Necrozma-Dusk-Mane Photon Geyser vs. 252 HP / 160+ Def Lugia: 60-72 (14.4 - 17.3%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

Once Again it might very well be the sims that does things wrong, but once again the sims doing what I expected I posted here.
(However if needed, I'm gonna try to test those things on cartridge asap)
 
I tried to import:
Nidoking @ Life Orb
Timid Nature
Ability: Sheer Force
EVs: 4 HP / 252 SpA / 252 Spe
- Ice Beam
- Flamethrower
- Sludge Wave
- Earth Power

But the Damage Calculator seems can't remember the ability
Every time I click its custom set
The ability is "other"
How can I force the Damage Calculator to remember the ability?
you can't force it to remember it, but it is probably just a small bug
 

Lego

Formally LegoFigure11
is a Top Smogon Social Media Contributoris a Community Contributor
I tried to import:
Nidoking @ Life Orb
Timid Nature
Ability: Sheer Force
EVs: 4 HP / 252 SpA / 252 Spe
- Ice Beam
- Flamethrower
- Sludge Wave
- Earth Power

But the Damage Calculator seems can't remember the ability
Every time I click its custom set
The ability is "other"
How can I force the Damage Calculator to remember the ability?
Code:
Nidoking @ Life Orb
Ability: Sheer Force
Timid Nature
EVs: 4 HP / 252 SpA / 252 Spe
- Ice Beam
- Flamethrower
- Sludge Wave
- Earth Power
Using the actual export format from PS with Ability listed second works fine. I'll see if I can make it find the ability regardless of where it is but for now doing this should fix your problem.
 
Using the actual export format from PS with Ability listed second works fine. I'll see if I can make it find the ability regardless of where it is but for now doing this should fix your problem.
unfortunately it don't work for me
I import again with your way and checked it right away, the ability Sheer Force was there
however after I pressed F5 to refresh the page, the ability was back to "other"
 
Last edited:
Feature request: add a column to the right of where you apply stat buffs/debuffs that displays the final calculated value of that stat (taking items and weather into account as well). Example: what is the final speed stat of a +2 Heracross with a choice scarf? What is the sp.def of Tyranitar in sand? (I know you can just calculate it manually, but it would be convenient)
 
Last edited:

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
I tried to import:
Nidoking @ Life Orb
Timid Nature
Ability: Sheer Force
EVs: 4 HP / 252 SpA / 252 Spe
- Ice Beam
- Flamethrower
- Sludge Wave
- Earth Power

But the Damage Calculator seems can't remember the ability
Every time I click its custom set
The ability is "other"
How can I force the Damage Calculator to remember the ability?
It should be fixed now
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
Okay, first of all, sry for double posting, but I'd rather be sure mY post is seen.

This time I've found an issue, still related to teravolt/mold breaker (and this time, I've tested sunsteel strike and photon geyser too). So the current situation is : against a pokemon having multiscale (I just tested with lugia but I assume it's coded the same way for dragonite), multiscale does get ignored on the sims by the move/abilities stated above, but not in the calc.

first the replay with the test : http://replay.pokemonshowdown.com/gen7anythinggoes-849776798 (I've been carefull to use the spread of the calc)

For LO KB (dealt 45% to full health Lugia and 49% with multiscale broke):
4 Atk Life Orb Teravolt Kyurem-Black Fusion Bolt vs. 252 HP / 160+ Def Multiscale Lugia: 95-113 (22.8 - 27.1%) -- Theorical damage against a full health lugia according to the calc
4 Atk Life Orb Teravolt Kyurem-Black Fusion Bolt vs. 252 HP / 160+ Def Lugia: 190-226 (45.6 - 54.3%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

For excadrill scarf (dealt 30% to full lugia and 29%with multiscale broke):
252 Atk Mold Breaker Excadrill Rock Slide vs. 252 HP / 160+ Def Multiscale Lugia: 55-65 (13.2 - 15.6%) -- Theorical damage against a full health lugia according to the calc
252 Atk Mold Breaker Excadrill Rock Slide vs. 252 HP / 160+ Def Lugia: 110-130 (26.4 - 31.2%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

For Necro-DM's Sunsteel Strike ( dealt 30% to full health Lugia and 30% with multiscale broke):
252 Atk Necrozma-Dusk-Mane Sunsteel Strike vs. 252 HP / 160+ Def Multiscale Lugia: 60-72 (14.4 - 17.3%) -- Theorical damage against a full health lugia according to the calc
252 Atk Necrozma-Dusk-Mane Sunsteel Strike vs. 252 HP / 160+ Def Lugia: 121-144 (29 - 34.6%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

For Necro-DM's Photon Geyser (dealt 15% to full health Lugia and 16% with multiscale broke):
252 Atk Necrozma-Dusk-Mane Photon Geyser vs. 252 HP / 160+ Def Multiscale Lugia: 30-36 (7.2 - 8.6%) -- Theorical damage against a full health lugia according to the calc
252 Atk Necrozma-Dusk-Mane Photon Geyser vs. 252 HP / 160+ Def Lugia: 60-72 (14.4 - 17.3%) -- Theorical damage against a lugia that is either not at full else or if multiscale does get ignored

Once Again it might very well be the sims that does things wrong, but once again the sims doing what I expected I posted here.
(However if needed, I'm gonna try to test those things on cartridge asap)
This should have been fixed idk if the calc was updated yet
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
It looks like the damage coding for Electro Ball doesn't match Bulbapedia (some in-game research may be needed.

Calc Code:
JavaScript:
    case "Electro Ball":
        var r = Math.floor(attacker.stats[SP] / defender.stats[SP]);
        basePower = r >= 4 ? 150 : r >= 3 ? 120 : r >= 2 ? 80 : 60;
        description.moveBP = basePower;
        break;

Mainly it says that the attack power bottoms out at 40, not 60. Also Electro Ball takes stat boosts into account and it seems that the calc code does not.

The damage from other speed based moves (Gyro Ball) may also need to be researched.
Fixed
 
Some fixes/features:
  • toggle option for partners with Battery ability
  • toggle for ally with plus/minus (right now the calc acts like plus/minus is always active)
  • toggles for the effects of Power Split, Power Trick, and Guard Split
 
Moves that lower one of the user's attack stats come with a dropdown that lets people calculate the total damage after using it multiple times, right? Clicking things in the dropdown doesn't seem to do anything in generations before BW.
164947
Edit: I was instructed to tell Austin.
165474
 
Last edited:

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
it still don't work for me on both Chrome and Firefox :psycry:

importing when the ability on 3rd line:
ability shows "other" before F5
ability shows "other" after F5

importing when the ability on 2nd line:
ability shows "Sheer Force " before F5
ability shows "other" after F5
Was fixed
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
A quick potential suggestion for the damage calculator: for DPP only (excluding RBY and GSC), when Tyranitar is clicked on, the "Sand" option is not automatically turned on to provide more realistic damage calculations vs Tyranitar. As someone who's used the calculator extensively, I think it would benefit all DPP players to have sand automatically selected when Tyranitar is selected. Thanks!
I made a PR for smogon to fix this, I’m not site staff so it may take a bit + honko will need to update the sets but this should be fixed soon. I have no idea why it was never listed in its analysis
E: actually I just fixed it rn
 
I don't know if the same happens with other mons/sets but when I try to importy the following set:


Garchomp-Mega @ Garchompite
Ability: Rough Skin
EVs: 4 Atk / 252 SpA / 252 Spe
Mild Nature
- Earthquake
- Fire Blast
- Draco Meteor
- Stealth Rock

and then try to calc with the custom set, the set got no move.
I've asked friend to try and import that same set in the calculator to see and they obtain the same result.
it's because of the space at the end of first three moves, remove that and import
 

Ktütverde

Ban haxx, but only from the opponent
is a Tiering Contributoris the defending PU Circuit Champion
Hi! Is it possible to have stamina's effect be implemented in the damage calc?

I know only mudsdale has it, but as a PU player, it would help me a lot since I always have to calc in my head how low will mudsdale be after two hits, the second hit being physical: first calc the first hit, then put +1 in defense and calc a second hit.

For example, mudsdale's official spread lets it tank 2 returns from stoutland after stealth rock (and then heal with a iapapa berry), but the calc shows:

252+ Atk Choice Band Stoutland Return vs. 252 HP / 128 Def Mudsdale: 214-253 (52.9 - 62.6%) -- guaranteed 2HKO after Stealth Rock

Thanks in advance!
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
Normalize doesn't appear to be boosting Normal-type moves. Quickly checked by manually setting Double-Edge to Electric-type and got a different result than Normal-typed Double Edge.

236 Atk Life Orb Normalize Skitty Double-Edge vs. 212 HP / 196+ Def Eviolite Spritzee: 12-16 (44.4 - 59.2%) -- guaranteed 2HKO after Stealth Rock
236 Atk Life Orb Skitty Double-Edge vs. 212 HP / 196+ Def Eviolite Spritzee: 9-13 (33.3 - 48.1%) -- 87.9% chance to 2HKO after Stealth Rock

Normalize should boost all damaging moves bar moves that can change type like Judgment or Weather Ball, even if they remain Normal.
Fixed
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
Hey. I've noticed that the calc isn't calculating Pokemons' HP properly and instead calculates Pokemons' HP stat as if it was any other stat. e.g The Kartana in the screenshot attached has a much lower HP stat than in reality, leading to a very wrong calc.
Fixed sorry I fixed alt formes not getting their needed HP when switching and didn’t even realize that. I’m bad and don’t play Pokémon
 
  • Like
Reactions: gum
I made a post November 2018, but it seems the issue hasn´t been adressed. So in case you overlooked it:
Certain Blank Sets take over the HP from the Pokemon you looked up earlier. Example: If I open the calc, it shows me Abomasnow with 321 HP. Now I search for Muk (Blank Set) and Muk appears with 321 HP (at full HP). This is also true for Altaria (and I assume other Pokemon too).
 

Austin

Schismatic
is a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
I made a post November 2018, but it seems the issue hasn´t been adressed. So in case you overlooked it:
Certain Blank Sets take over the HP from the Pokemon you looked up earlier. Example: If I open the calc, it shows me Abomasnow with 321 HP. Now I search for Muk (Blank Set) and Muk appears with 321 HP (at full HP). This is also true for Altaria (and I assume other Pokemon too).
I actually don’t know what causes this so I’ll have to investigate, sorry about the delay but I promise this will get fixed.
 

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

Top