• The moderator of this forum is Austin.
  • Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.

Programming Pokémon Showdown Damage Calculator

Austin

Schismatic
is a Programmeris a Forum Moderatoris a Community Contributoris a Battle Simulator Moderator Alumnus
Moderator
Some unintended behavior I found with Tera + Adaptability.

Since Adaptability and Terastal both increase STAB to 2x, GameFreak made it so that these two have a significantly diminished effect when combined, instead increasing power to 2.25x, which only raises the STAB modifier by 1.125x versus a second 1.33x. This aspect is reflected accurately on the calculator.

However, if your Tera Type does not match one (or both) of your original Types, you are supposed to lose the Adaptability boost entirely (per Bulbapedia, Serebii said nothing but I assume it's just not been addressed yet). This is implemented properly on Showdown after some quick testing, but the calculator does something else.

(1)Adaptability, No Tera
252+ SpA Choice Specs Adaptability Dragalge Draco Meteor vs. 0 HP / 0 SpD Mew: 382-450 (112 - 131.9%) -- guaranteed OHKO

(2)No Adaptability or Tera
252+ SpA Choice Specs Dragalge Draco Meteor vs. 0 HP / 0 SpD Mew: 286-337 (83.8 - 98.8%) -- 75% chance to OHKO after Stealth Rock

(3)Adaptability with related Tera Type
252+ SpA Choice Specs Adaptability Tera Dragon Dragalge Draco Meteor vs. 0 HP / 0 SpD Mew: 430-506 (126 - 148.3%) -- guaranteed OHKO

(4)Adaptability with unrelated Tera Type
252+ SpA Choice Specs Adaptability Tera Poison Dragalge Draco Meteor vs. 0 HP / 0 SpD Mew: 334-394 (97.9 - 115.5%) -- guaranteed OHKO after Stealth Rock

(5)Adaptability with Dragon Tera Type on a non-Dragon Dragalge
252+ SpA Choice Specs Adaptability Tera Dragon Dragalge Draco Meteor vs. 0 HP / 0 SpD Mew: 334-394 (97.9 - 115.5%) -- guaranteed OHKO after Stealth Rock

Some quick math with the damage rolls of 2 and 4 reveals that the 1.125x modifier to bring 2x to 2.25x is being incorrectly applied to unrelated Tera Types. I have almost no programming experience, but it appears the issue might have something to do with Adaptability's 1.33x Damage modifier being set to 1.125x for both original Types, instead of just being applied to the Tera one while being negated for the other. The situation with 5 seems to be related but I am struggling to wrap my head around the exact issue. Again, did testing and Showdown works fine.
Should be fixed
 
Zoroark and Zoroark-Hisui have their levels set to 0 in the Random Battles S/V Calculator, making calculations as if they were level 100 display.
This is because Zoroark and Zoroark-Hisui do not have a fixed level in Random Battles. Their levels are automatically set equal to the level of the 6th Pokemon in your party, so that the Illusion is not given away. You can just change it manually to whatever level you get.
 
Idea: X of Ruin as buttons (power spot, etc.) instead of ability with button being pressed automatically when having a pokemon (this is for doubles)
Wait actually, we've been struggling implementing the latest Ruin ability update with Showdex (same Ruin abilities cancelling each other out), and this part really confused us. If we turn on the Ruin ability toggles, it applies to both Pokemon (even the one with the Ruin ability, which it shouldn't affect). We were also confused on why the toggles are there if the Ruin abilities are applied automatically when set as an ability, but we assumed it was for doubles right? Since you might want to calc the damage for the two other non-Ruin pokemon on the field, while still needing the Ruin effect to apply to them. Idk it's very confusing to explain even haha.

Sorry if this is coming out of nowhere, I just wanted to piggyback off your suggestion since we've been struggling with it as well and would love some insight into the implementation.
 

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

Top