Fixed flying type being removed in type effectiveness calculation under gravity

pull/693/head
Tristan D Gant 2024-05-09 16:27:12 -05:00
parent 08067d9937
commit 1564cc4616
1 changed files with 6 additions and 6 deletions

View File

@ -772,12 +772,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
}
if (forDefend && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY) || this.getTag(BattlerTagType.GROUNDED))) {
const flyingIndex = types.indexOf(Type.FLYING);
if (flyingIndex > -1)
types.splice(flyingIndex, 1);
}
if (!types.length) // become UNKNOWN if no types are present
types.push(Type.UNKNOWN);
@ -908,6 +902,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this.isTerastallized() ? 2 : 1;
const types = this.getTypes(true, true);
if (moveType === Type.GROUND && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY) || this.getTag(BattlerTagType.GROUNDED))) {
const flyingIndex = types.indexOf(Type.FLYING);
if (flyingIndex > -1)
types.splice(flyingIndex, 1);
}
const ignorableImmunities = source?.getAbility()?.getAttrs(IgnoreTypeImmunityAbAttr) || [];
const cancelled = new Utils.BooleanHolder(false);