Skip to content

Commit

Permalink
Fix more multihit bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
thejetou committed Sep 25, 2023
1 parent 1f7aa05 commit 69c5854
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions calc/src/mechanics/gen789.ts
Expand Up @@ -645,6 +645,25 @@ export function calculateSMSSSV(
if (isCritical) {
newBaseDamage = Math.floor(OF32(newBaseDamage * 1.5));
}
// TODO probably move these to a common function
const isSpread = field.gameType !== 'Singles' &&
['allAdjacent', 'allAdjacentFoes'].includes(move.target);
if (isSpread) {
newBaseDamage = pokeRound(OF32(newBaseDamage * 3072) / 4096);
}
if (!defender.hasItem('Utility Umbrella')) {
if (
(field.hasWeather('Sun', 'Harsh Sunshine') && move.hasType('Fire')) ||
(field.hasWeather('Rain', 'Heavy Rain') && move.hasType('Water'))
) {
newBaseDamage = pokeRound(OF32(newBaseDamage * 6144) / 4096);
} else if (
(field.hasWeather('Sun') && move.hasType('Water')) ||
(field.hasWeather('Rain') && move.hasType('Fire'))
) {
newBaseDamage = pokeRound(OF32(newBaseDamage * 2048) / 4096);
}
}
const newFinalDamage = getFinalDamage(
newBaseDamage,
damageMultiplier,
Expand Down

0 comments on commit 69c5854

Please sign in to comment.