Skip to content

Commit

Permalink
Fix for Hackmons
Browse files Browse the repository at this point in the history
Relevant if Terapagos-Terastal transforms and terastallizes, keeping Tera Shell
  • Loading branch information
andrebastosdias committed Jan 21, 2025
1 parent 16ec2c7 commit 7f3d543
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sim/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2105,12 +2105,15 @@ export class Pokemon {
}

runEffectiveness(move: ActiveMove) {
if (this.terastallized && move.type === 'Stellar') return 1;
let totalTypeMod = 0;
for (const type of this.getTypes()) {
let typeMod = this.battle.dex.getEffectiveness(move, type);
typeMod = this.battle.singleEvent('Effectiveness', move, null, this, type, move, typeMod);
totalTypeMod += this.battle.runEvent('Effectiveness', this, type, move, typeMod);
if (this.terastallized && move.type === 'Stellar') {
totalTypeMod = 1;
} else {
for (const type of this.getTypes()) {
let typeMod = this.battle.dex.getEffectiveness(move, type);
typeMod = this.battle.singleEvent('Effectiveness', move, null, this, type, move, typeMod);
totalTypeMod += this.battle.runEvent('Effectiveness', this, type, move, typeMod);
}
}
if (this.species.name === 'Terapagos-Terastal' && this.hasAbility('Tera Shell') &&
!this.battle.suppressingAbility(this)) {
Expand Down

0 comments on commit 7f3d543

Please sign in to comment.