mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 16:26:25 +00:00
[Bug] Ignored strong winds for stealth rock and anticipation (#1682)
This commit is contained in:
parent
d592187f2c
commit
c177f3c1fb
@ -2214,7 +2214,7 @@ function getAnticipationCondition(): AbAttrCondition {
|
||||
for (const opponent of pokemon.getOpponents()) {
|
||||
for (const move of opponent.moveset) {
|
||||
// move is super effective
|
||||
if (move.getMove() instanceof AttackMove && pokemon.getAttackTypeEffectiveness(move.getMove().type, opponent) >= 2) {
|
||||
if (move.getMove() instanceof AttackMove && pokemon.getAttackTypeEffectiveness(move.getMove().type, opponent, true) >= 2) {
|
||||
return true;
|
||||
}
|
||||
// move is a OHKO
|
||||
|
@ -518,7 +518,7 @@ class StealthRockTag extends ArenaTrapTag {
|
||||
}
|
||||
|
||||
getDamageHpRatio(pokemon: Pokemon): number {
|
||||
const effectiveness = pokemon.getAttackTypeEffectiveness(Type.ROCK);
|
||||
const effectiveness = pokemon.getAttackTypeEffectiveness(Type.ROCK, undefined, true);
|
||||
|
||||
let damageHpRatio: number;
|
||||
|
||||
|
@ -1070,7 +1070,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
return (!cancelled.value ? typeMultiplier.value : 0) as TypeDamageMultiplier;
|
||||
}
|
||||
|
||||
getAttackTypeEffectiveness(moveType: Type, source?: Pokemon): TypeDamageMultiplier {
|
||||
getAttackTypeEffectiveness(moveType: Type, source?: Pokemon, ignoreStrongWinds: boolean = false): TypeDamageMultiplier {
|
||||
if (moveType === Type.STELLAR) {
|
||||
return this.isTerastallized() ? 2 : 1;
|
||||
}
|
||||
@ -1089,7 +1089,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier;
|
||||
|
||||
// Handle strong winds lowering effectiveness of types super effective against pure flying
|
||||
if (this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && multiplier >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(moveType, Type.FLYING) === 2) {
|
||||
if (!ignoreStrongWinds && this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && multiplier >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(moveType, Type.FLYING) === 2) {
|
||||
multiplier /= 2;
|
||||
}
|
||||
return multiplier;
|
||||
|
Loading…
Reference in New Issue
Block a user