Closed doshidak closed 2 years ago
Hopefully fixed.
Only hazards that deal damage, i.e., Spikes and Stealth Rock, are ignored if the selected Pokémon in the Calcdex is also active on the field. Otherwise, they will be provided to the damage calculator, which should correctly account for the gen's specific mechanics, such as the Pokémon's typings (e.g., Flying), abilities (e.g., Levitate), and items (e.g., Air Balloon).
(Side note: Stealth Rock places levitating stones, according to its entry on Bulbapedia, which affects Flying types, Levitate & Air Balloon [unlike Spikes]. When the Calcdex reports hazards, the damage calculator will apply Stealth Rock damage for these affected Pokémon.)
Consider the following Gen 8 OU battle with Stealth Rock and 2 layers of Spikes on both sides:
When the selected Pokémon are also active on the field, hazard damages are not applied:
When switching P2's selected Pokémon, hazard damages are applied only to the P2 Pokémon since it's not active:
After switching both player's selected Pokémon, hazard damages are applied since they're both not active:
Actually found that the damage calculator does not apply hazard damages to the move's damage range (as the range refers to damage output from the move itself), but rather, only changes the NHKO value (including the probability, if applicable).
Will close this via reference on the next PR.
Hazards are always included in the damage calculations, even if the Pokémon is already switched-in, resulting in inaccurate damage ranges.