Fixed when roost removes flying type (#148)

* Initial push with roost fix

* Roost fix

* Added GROUNDED to Levitate

* Cleaned up GROUNDED code
This commit is contained in:
Ishan Patel authored and GitHub committed 2024-04-16 14:31:30 -04:00
1 parent 7bc147166e
commit 1f9834d1f6
6 files changed
+12 -8

No files matched your search

+3 -3
View File
@@ -28,7 +28,7 @@ import { Biome } from "../data/enums/biome";
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs } from '../data/ability';
import { Abilities } from "#app/data/enums/abilities";
import PokemonData from '../system/pokemon-data';
import { BattlerIndex } from '../battle';
import Battle, { BattlerIndex } from '../battle';
import { BattleSpec } from "../enums/battle-spec";
import { Mode } from '../ui/ui';
import PartyUiHandler, { PartyOption, PartyUiMode } from '../ui/party-ui-handler';
@@ -694,7 +694,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
}
if (forDefend && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY))) {
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);
@@ -730,7 +730,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
while (pokemonPrevolutions.hasOwnProperty(starterSpeciesId))
starterSpeciesId = pokemonPrevolutions[starterSpeciesId];
return allAbilities[starterPassiveAbilities[starterSpeciesId]];
}
}
hasPassive(): boolean {
return this.passive || this.isBoss();