Rename Abilities to AbilityId

This commit is contained in:
NightKev 2025-06-04 13:41:14 -07:00
parent dd2f475ded
commit 3c0febe232
335 changed files with 4857 additions and 4858 deletions

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import type { AbAttrCondition } from "#app/@types/ability-types"; import type { AbAttrCondition } from "#app/@types/ability-types";
import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr"; import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
import i18next from "i18next"; import i18next from "i18next";
@ -6,7 +6,7 @@ import type { Localizable } from "#app/interfaces/locales";
import type { Constructor } from "#app/utils/common"; import type { Constructor } from "#app/utils/common";
export class Ability implements Localizable { export class Ability implements Localizable {
public id: Abilities; public id: AbilityId;
private nameAppend: string; private nameAppend: string;
public name: string; public name: string;
@ -20,7 +20,7 @@ export class Ability implements Localizable {
public attrs: AbAttr[]; public attrs: AbAttr[];
public conditions: AbAttrCondition[]; public conditions: AbAttrCondition[];
constructor(id: Abilities, generation: number) { constructor(id: AbilityId, generation: number) {
this.id = id; this.id = id;
this.nameAppend = ""; this.nameAppend = "";
@ -39,7 +39,7 @@ export class Ability implements Localizable {
return this.isCopiable && this.isReplaceable; return this.isCopiable && this.isReplaceable;
} }
localize(): void { localize(): void {
const i18nKey = Abilities[this.id] const i18nKey = AbilityId[this.id]
.split("_") .split("_")
.filter(f => f) .filter(f => f)
.map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase())) .map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()))

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ import {
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims"; import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims";
import i18next from "i18next"; import i18next from "i18next";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -1090,7 +1090,7 @@ export class TrickRoomTag extends ArenaTag {
/** /**
* Arena Tag class for {@link https://bulbapedia.bulbagarden.net/wiki/Gravity_(move) Gravity}. * Arena Tag class for {@link https://bulbapedia.bulbagarden.net/wiki/Gravity_(move) Gravity}.
* Grounds all Pokémon on the field, including Flying-types and those with * Grounds all Pokémon on the field, including Flying-types and those with
* {@linkcode Abilities.LEVITATE} for the duration of the arena tag, usually 5 turns. * {@linkcode AbilityId.LEVITATE} for the duration of the arena tag, usually 5 turns.
*/ */
export class GravityTag extends ArenaTag { export class GravityTag extends ArenaTag {
constructor(turnCount: number) { constructor(turnCount: number) {
@ -1139,7 +1139,7 @@ class TailwindTag extends ArenaTag {
for (const pokemon of party) { for (const pokemon of party) {
// Apply the CHARGED tag to party members with the WIND_POWER ability // Apply the CHARGED tag to party members with the WIND_POWER ability
if (pokemon.hasAbility(Abilities.WIND_POWER) && !pokemon.getTag(BattlerTagType.CHARGED)) { if (pokemon.hasAbility(AbilityId.WIND_POWER) && !pokemon.getTag(BattlerTagType.CHARGED)) {
pokemon.addTag(BattlerTagType.CHARGED); pokemon.addTag(BattlerTagType.CHARGED);
globalScene.queueMessage( globalScene.queueMessage(
i18next.t("abilityTriggers:windPowerCharged", { i18next.t("abilityTriggers:windPowerCharged", {
@ -1150,7 +1150,7 @@ class TailwindTag extends ArenaTag {
} }
// Raise attack by one stage if party member has WIND_RIDER ability // Raise attack by one stage if party member has WIND_RIDER ability
// TODO: Ability displays should be handled by the ability // TODO: Ability displays should be handled by the ability
if (pokemon.hasAbility(Abilities.WIND_RIDER)) { if (pokemon.hasAbility(AbilityId.WIND_RIDER)) {
globalScene.queueAbilityDisplay(pokemon, false, true); globalScene.queueAbilityDisplay(pokemon, false, true);
globalScene.unshiftPhase(new StatStageChangePhase(pokemon.getBattlerIndex(), true, [Stat.ATK], 1, true)); globalScene.unshiftPhase(new StatStageChangePhase(pokemon.getBattlerIndex(), true, [Stat.ATK], 1, true));
globalScene.queueAbilityDisplay(pokemon, false, false); globalScene.queueAbilityDisplay(pokemon, false, false);

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ import type { StatStageChangeCallback } from "#app/phases/stat-stage-change-phas
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
import i18next from "#app/plugins/i18n"; import i18next from "#app/plugins/i18n";
import { BooleanHolder, getFrameMs, NumberHolder, toDmgValue } from "#app/utils/common"; import { BooleanHolder, getFrameMs, NumberHolder, toDmgValue } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { PokemonAnimType } from "#enums/pokemon-anim-type"; import { PokemonAnimType } from "#enums/pokemon-anim-type";
@ -277,7 +277,7 @@ export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
} }
/** /**
* Tag representing the "disabling" effect performed by {@linkcode Moves.DISABLE} and {@linkcode Abilities.CURSED_BODY}. * Tag representing the "disabling" effect performed by {@linkcode Moves.DISABLE} and {@linkcode AbilityId.CURSED_BODY}.
* When the tag is added, the last-used move of the tag holder is set as the disabled move. * When the tag is added, the last-used move of the tag holder is set as the disabled move.
*/ */
export class DisabledTag extends MoveRestrictionBattlerTag { export class DisabledTag extends MoveRestrictionBattlerTag {
@ -1868,9 +1868,9 @@ export class CenterOfAttentionTag extends BattlerTag {
} }
export class AbilityBattlerTag extends BattlerTag { export class AbilityBattlerTag extends BattlerTag {
public ability: Abilities; public ability: AbilityId;
constructor(tagType: BattlerTagType, ability: Abilities, lapseType: BattlerTagLapseType, turnCount: number) { constructor(tagType: BattlerTagType, ability: AbilityId, lapseType: BattlerTagLapseType, turnCount: number) {
super(tagType, lapseType, turnCount); super(tagType, lapseType, turnCount);
this.ability = ability; this.ability = ability;
@ -1882,7 +1882,7 @@ export class AbilityBattlerTag extends BattlerTag {
*/ */
loadTag(source: BattlerTag | any): void { loadTag(source: BattlerTag | any): void {
super.loadTag(source); super.loadTag(source);
this.ability = source.ability as Abilities; this.ability = source.ability as AbilityId;
} }
} }
@ -1892,7 +1892,7 @@ export class AbilityBattlerTag extends BattlerTag {
*/ */
export class UnburdenTag extends AbilityBattlerTag { export class UnburdenTag extends AbilityBattlerTag {
constructor() { constructor() {
super(BattlerTagType.UNBURDEN, Abilities.UNBURDEN, BattlerTagLapseType.CUSTOM, 1); super(BattlerTagType.UNBURDEN, AbilityId.UNBURDEN, BattlerTagLapseType.CUSTOM, 1);
} }
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
@ -1904,14 +1904,14 @@ export class UnburdenTag extends AbilityBattlerTag {
export class TruantTag extends AbilityBattlerTag { export class TruantTag extends AbilityBattlerTag {
constructor() { constructor() {
super(BattlerTagType.TRUANT, Abilities.TRUANT, BattlerTagLapseType.MOVE, 1); super(BattlerTagType.TRUANT, AbilityId.TRUANT, BattlerTagLapseType.MOVE, 1);
} }
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
if (!pokemon.hasAbility(Abilities.TRUANT)) { if (!pokemon.hasAbility(AbilityId.TRUANT)) {
return super.lapse(pokemon, lapseType); return super.lapse(pokemon, lapseType);
} }
const passive = pokemon.getAbility().id !== Abilities.TRUANT; const passive = pokemon.getAbility().id !== AbilityId.TRUANT;
const lastMove = pokemon.getLastXMoves().find(() => true); const lastMove = pokemon.getLastXMoves().find(() => true);
@ -1933,7 +1933,7 @@ export class TruantTag extends AbilityBattlerTag {
export class SlowStartTag extends AbilityBattlerTag { export class SlowStartTag extends AbilityBattlerTag {
constructor() { constructor() {
super(BattlerTagType.SLOW_START, Abilities.SLOW_START, BattlerTagLapseType.TURN_END, 5); super(BattlerTagType.SLOW_START, AbilityId.SLOW_START, BattlerTagLapseType.TURN_END, 5);
} }
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
@ -1972,7 +1972,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
public stat: Stat; public stat: Stat;
public multiplier: number; public multiplier: number;
constructor(tagType: BattlerTagType, ability: Abilities) { constructor(tagType: BattlerTagType, ability: AbilityId) {
super(tagType, ability, BattlerTagLapseType.CUSTOM, 1); super(tagType, ability, BattlerTagLapseType.CUSTOM, 1);
} }
@ -2031,7 +2031,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
export class WeatherHighestStatBoostTag extends HighestStatBoostTag implements WeatherBattlerTag { export class WeatherHighestStatBoostTag extends HighestStatBoostTag implements WeatherBattlerTag {
public weatherTypes: WeatherType[]; public weatherTypes: WeatherType[];
constructor(tagType: BattlerTagType, ability: Abilities, ...weatherTypes: WeatherType[]) { constructor(tagType: BattlerTagType, ability: AbilityId, ...weatherTypes: WeatherType[]) {
super(tagType, ability); super(tagType, ability);
this.weatherTypes = weatherTypes; this.weatherTypes = weatherTypes;
} }
@ -2049,7 +2049,7 @@ export class WeatherHighestStatBoostTag extends HighestStatBoostTag implements W
export class TerrainHighestStatBoostTag extends HighestStatBoostTag implements TerrainBattlerTag { export class TerrainHighestStatBoostTag extends HighestStatBoostTag implements TerrainBattlerTag {
public terrainTypes: TerrainType[]; public terrainTypes: TerrainType[];
constructor(tagType: BattlerTagType, ability: Abilities, ...terrainTypes: TerrainType[]) { constructor(tagType: BattlerTagType, ability: AbilityId, ...terrainTypes: TerrainType[]) {
super(tagType, ability); super(tagType, ability);
this.terrainTypes = terrainTypes; this.terrainTypes = terrainTypes;
} }
@ -3555,12 +3555,12 @@ export function getBattlerTag(
case BattlerTagType.PROTOSYNTHESIS: case BattlerTagType.PROTOSYNTHESIS:
return new WeatherHighestStatBoostTag( return new WeatherHighestStatBoostTag(
tagType, tagType,
Abilities.PROTOSYNTHESIS, AbilityId.PROTOSYNTHESIS,
WeatherType.SUNNY, WeatherType.SUNNY,
WeatherType.HARSH_SUN, WeatherType.HARSH_SUN,
); );
case BattlerTagType.QUARK_DRIVE: case BattlerTagType.QUARK_DRIVE:
return new TerrainHighestStatBoostTag(tagType, Abilities.QUARK_DRIVE, TerrainType.ELECTRIC); return new TerrainHighestStatBoostTag(tagType, AbilityId.QUARK_DRIVE, TerrainType.ELECTRIC);
case BattlerTagType.FLYING: case BattlerTagType.FLYING:
case BattlerTagType.UNDERGROUND: case BattlerTagType.UNDERGROUND:
case BattlerTagType.UNDERWATER: case BattlerTagType.UNDERWATER:

View File

@ -1,4 +1,4 @@
import type { Abilities } from "#enums/abilities"; import type { AbilityId } from "#enums/abilities";
import type { PokemonType } from "#enums/pokemon-type"; import type { PokemonType } from "#enums/pokemon-type";
import type { Nature } from "#enums/nature"; import type { Nature } from "#enums/nature";
@ -12,8 +12,8 @@ export class CustomPokemonData {
* The scale at which to render this Pokemon's sprite. * The scale at which to render this Pokemon's sprite.
*/ */
public spriteScale = -1; public spriteScale = -1;
public ability: Abilities | -1; public ability: AbilityId | -1;
public passive: Abilities | -1; public passive: AbilityId | -1;
public nature: Nature | -1; public nature: Nature | -1;
public types: PokemonType[]; public types: PokemonType[];
/** Deprecated but needed for session save migration */ /** Deprecated but needed for session save migration */

View File

@ -83,7 +83,7 @@ import { Command } from "../../ui/command-ui-handler";
import i18next from "i18next"; import i18next from "i18next";
import type { Localizable } from "#app/interfaces/locales"; import type { Localizable } from "#app/interfaces/locales";
import { getBerryEffectFunc } from "../berry"; import { getBerryEffectFunc } from "../berry";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome"; import { Biome } from "#enums/biome";
@ -332,7 +332,7 @@ export default class Move implements Localizable {
} }
break; break;
case PokemonType.DARK: case PokemonType.DARK:
if (user.hasAbility(Abilities.PRANKSTER) && this.category === MoveCategory.STATUS && (user.isPlayer() !== target.isPlayer())) { if (user.hasAbility(AbilityId.PRANKSTER) && this.category === MoveCategory.STATUS && (user.isPlayer() !== target.isPlayer())) {
return true; return true;
} }
break; break;
@ -418,7 +418,7 @@ export default class Move implements Localizable {
/** /**
* Sets the {@linkcode MoveFlags.MAKES_CONTACT} flag for the calling Move * Sets the {@linkcode MoveFlags.MAKES_CONTACT} flag for the calling Move
* @param setFlag Default `true`, set to `false` if the move doesn't make contact * @param setFlag Default `true`, set to `false` if the move doesn't make contact
* @see {@linkcode Abilities.STATIC} * @see {@linkcode AbilityId.STATIC}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
makesContact(setFlag: boolean = true): this { makesContact(setFlag: boolean = true): this {
@ -508,7 +508,7 @@ export default class Move implements Localizable {
/** /**
* Sets the {@linkcode MoveFlags.RECKLESS_MOVE} flag for the calling Move * Sets the {@linkcode MoveFlags.RECKLESS_MOVE} flag for the calling Move
* @see {@linkcode Abilities.RECKLESS} * @see {@linkcode AbilityId.RECKLESS}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
recklessMove(): this { recklessMove(): this {
@ -621,12 +621,12 @@ export default class Move implements Localizable {
* *
* This method will take the `user`'s ability into account when reporting flags, e.g. * This method will take the `user`'s ability into account when reporting flags, e.g.
* calling this method for {@linkcode MoveFlags.MAKES_CONTACT | MAKES_CONTACT} * calling this method for {@linkcode MoveFlags.MAKES_CONTACT | MAKES_CONTACT}
* will return `false` if the user has a {@linkcode Abilities.LONG_REACH} that is not being suppressed. * will return `false` if the user has a {@linkcode AbilityId.LONG_REACH} that is not being suppressed.
* *
* **Note:** This method only checks if the move should have effectively have the flag applied to its use. * **Note:** This method only checks if the move should have effectively have the flag applied to its use.
* It does *not* check whether the flag will trigger related effects. * It does *not* check whether the flag will trigger related effects.
* For example using this method to check {@linkcode MoveFlags.WIND_MOVE} * For example using this method to check {@linkcode MoveFlags.WIND_MOVE}
* will not consider {@linkcode Abilities.WIND_RIDER | Wind Rider }. * will not consider {@linkcode AbilityId.WIND_RIDER | Wind Rider }.
* *
* To simply check whether the move has a flag, use {@linkcode hasFlag}. * To simply check whether the move has a flag, use {@linkcode hasFlag}.
* @param flag {@linkcode MoveFlags} MoveFlag to check on user and/or target * @param flag {@linkcode MoveFlags} MoveFlag to check on user and/or target
@ -1909,9 +1909,9 @@ export class PartyStatusCureAttr extends MoveEffectAttr {
/** Message to display after using move */ /** Message to display after using move */
private message: string | null; private message: string | null;
/** Skips mons with this ability, ie. Soundproof */ /** Skips mons with this ability, ie. Soundproof */
private abilityCondition: Abilities; private abilityCondition: AbilityId;
constructor(message: string | null, abilityCondition: Abilities) { constructor(message: string | null, abilityCondition: AbilityId) {
super(); super();
this.message = message; this.message = message;
@ -2386,8 +2386,8 @@ export class MultiHitAttr extends MoveAttr {
* *
* @param move - The move that this attribtue is applied to * @param move - The move that this attribtue is applied to
* @param partySize - The size of the user's party, used for {@linkcode Moves.BEAT_UP | Beat Up} (default: `1`) * @param partySize - The size of the user's party, used for {@linkcode Moves.BEAT_UP | Beat Up} (default: `1`)
* @param maxMultiHit - Whether the move should always hit the maximum number of times, e.g. due to {@linkcode Abilities.SKILL_LINK | Skill Link} (default: `false`) * @param maxMultiHit - Whether the move should always hit the maximum number of times, e.g. due to {@linkcode AbilityId.SKILL_LINK | Skill Link} (default: `false`)
* @param ignoreAcc - `true` if the move should ignore accuracy checks, e.g. due to {@linkcode Abilities.NO_GUARD | No Guard} (default: `false`) * @param ignoreAcc - `true` if the move should ignore accuracy checks, e.g. due to {@linkcode AbilityId.NO_GUARD | No Guard} (default: `false`)
*/ */
calculateExpectedHitCount(move: Move, { ignoreAcc = false, maxMultiHit = false, partySize = 1 }: {ignoreAcc?: boolean, maxMultiHit?: boolean, partySize?: number} = {}): number { calculateExpectedHitCount(move: Move, { ignoreAcc = false, maxMultiHit = false, partySize = 1 }: {ignoreAcc?: boolean, maxMultiHit?: boolean, partySize?: number} = {}): number {
let expectedHits: number; let expectedHits: number;
@ -2430,7 +2430,7 @@ export class ChangeMultiHitTypeAttr extends MoveAttr {
export class WaterShurikenMultiHitTypeAttr extends ChangeMultiHitTypeAttr { export class WaterShurikenMultiHitTypeAttr extends ChangeMultiHitTypeAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.species.speciesId === Species.GRENINJA && user.hasAbility(Abilities.BATTLE_BOND) && user.formIndex === 2) { if (user.species.speciesId === Species.GRENINJA && user.hasAbility(AbilityId.BATTLE_BOND) && user.formIndex === 2) {
(args[0] as NumberHolder).value = MultiHitType._3; (args[0] as NumberHolder).value = MultiHitType._3;
return true; return true;
} }
@ -2512,7 +2512,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr {
* @returns `true` if Psycho Shift's effect is able to be applied to the target * @returns `true` if Psycho Shift's effect is able to be applied to the target
*/ */
apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean { apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean {
const statusToApply: StatusEffect | undefined = user.status?.effect ?? (user.hasAbility(Abilities.COMATOSE) ? StatusEffect.SLEEP : undefined); const statusToApply: StatusEffect | undefined = user.status?.effect ?? (user.hasAbility(AbilityId.COMATOSE) ? StatusEffect.SLEEP : undefined);
if (target.status) { if (target.status) {
return false; return false;
@ -4237,7 +4237,7 @@ export class PresentPowerAttr extends VariablePowerAttr {
export class WaterShurikenPowerAttr extends VariablePowerAttr { export class WaterShurikenPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.species.speciesId === Species.GRENINJA && user.hasAbility(Abilities.BATTLE_BOND) && user.formIndex === 2) { if (user.species.speciesId === Species.GRENINJA && user.hasAbility(AbilityId.BATTLE_BOND) && user.formIndex === 2) {
(args[0] as NumberHolder).value = 20; (args[0] as NumberHolder).value = 20;
return true; return true;
} }
@ -5616,7 +5616,7 @@ export class GulpMissileTagAttr extends MoveEffectAttr {
return false; return false;
} }
if (user.hasAbility(Abilities.GULP_MISSILE) && user.species.speciesId === Species.CRAMORANT) { if (user.hasAbility(AbilityId.GULP_MISSILE) && user.species.speciesId === Species.CRAMORANT) {
if (user.getHpRatio() >= .5) { if (user.getHpRatio() >= .5) {
user.addTag(BattlerTagType.GULP_MISSILE_ARROKUDA, 0, move.id); user.addTag(BattlerTagType.GULP_MISSILE_ARROKUDA, 0, move.id);
} else { } else {
@ -5629,7 +5629,7 @@ export class GulpMissileTagAttr extends MoveEffectAttr {
} }
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number { getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
const isCramorant = user.hasAbility(Abilities.GULP_MISSILE) && user.species.speciesId === Species.CRAMORANT; const isCramorant = user.hasAbility(AbilityId.GULP_MISSILE) && user.species.speciesId === Species.CRAMORANT;
return isCramorant && !user.getTag(GulpMissileTag) ? 10 : 0; return isCramorant && !user.getTag(GulpMissileTag) ? 10 : 0;
} }
} }
@ -6676,7 +6676,7 @@ export class ChangeTypeAttr extends MoveEffectAttr {
} }
getCondition(): MoveConditionFunc { getCondition(): MoveConditionFunc {
return (user, target, move) => !target.isTerastallized && !target.hasAbility(Abilities.MULTITYPE) && !target.hasAbility(Abilities.RKS_SYSTEM) && !(target.getTypes().length === 1 && target.getTypes()[0] === this.type); return (user, target, move) => !target.isTerastallized && !target.hasAbility(AbilityId.MULTITYPE) && !target.hasAbility(AbilityId.RKS_SYSTEM) && !(target.getTypes().length === 1 && target.getTypes()[0] === this.type);
} }
} }
@ -7377,9 +7377,9 @@ export class SketchAttr extends MoveEffectAttr {
} }
export class AbilityChangeAttr extends MoveEffectAttr { export class AbilityChangeAttr extends MoveEffectAttr {
public ability: Abilities; public ability: AbilityId;
constructor(ability: Abilities, selfTarget?: boolean) { constructor(ability: AbilityId, selfTarget?: boolean) {
super(selfTarget); super(selfTarget);
this.ability = ability; this.ability = ability;
@ -7938,9 +7938,9 @@ const failIfDampCondition: MoveConditionFunc = (user, target, move) => {
return !cancelled.value; return !cancelled.value;
}; };
const userSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => user.status?.effect === StatusEffect.SLEEP || user.hasAbility(Abilities.COMATOSE); const userSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => user.status?.effect === StatusEffect.SLEEP || user.hasAbility(AbilityId.COMATOSE);
const targetSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.status?.effect === StatusEffect.SLEEP || target.hasAbility(Abilities.COMATOSE); const targetSleptOrComatoseCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.status?.effect === StatusEffect.SLEEP || target.hasAbility(AbilityId.COMATOSE);
const failIfLastCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => globalScene.phaseQueue.find(phase => phase instanceof MovePhase) !== undefined; const failIfLastCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => globalScene.phaseQueue.find(phase => phase instanceof MovePhase) !== undefined;
@ -8917,7 +8917,7 @@ export function initMoves() {
.condition(userSleptOrComatoseCondition) .condition(userSleptOrComatoseCondition)
.target(MoveTarget.NEAR_ENEMY), .target(MoveTarget.NEAR_ENEMY),
new StatusMove(Moves.HEAL_BELL, PokemonType.NORMAL, -1, 5, -1, 0, 2) new StatusMove(Moves.HEAL_BELL, PokemonType.NORMAL, -1, 5, -1, 0, 2)
.attr(PartyStatusCureAttr, i18next.t("moveTriggers:bellChimed"), Abilities.SOUNDPROOF) .attr(PartyStatusCureAttr, i18next.t("moveTriggers:bellChimed"), AbilityId.SOUNDPROOF)
.soundBased() .soundBased()
.target(MoveTarget.PARTY), .target(MoveTarget.PARTY),
new AttackMove(Moves.RETURN, PokemonType.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, 0, 2) new AttackMove(Moves.RETURN, PokemonType.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, 0, 2)
@ -9241,7 +9241,7 @@ export function initMoves() {
}) })
.ballBombMove(), .ballBombMove(),
new StatusMove(Moves.AROMATHERAPY, PokemonType.GRASS, -1, 5, -1, 0, 3) new StatusMove(Moves.AROMATHERAPY, PokemonType.GRASS, -1, 5, -1, 0, 3)
.attr(PartyStatusCureAttr, i18next.t("moveTriggers:soothingAromaWaftedThroughArea"), Abilities.SAP_SIPPER) .attr(PartyStatusCureAttr, i18next.t("moveTriggers:soothingAromaWaftedThroughArea"), AbilityId.SAP_SIPPER)
.target(MoveTarget.PARTY), .target(MoveTarget.PARTY),
new StatusMove(Moves.FAKE_TEARS, PokemonType.DARK, 100, 20, -1, 0, 3) new StatusMove(Moves.FAKE_TEARS, PokemonType.DARK, 100, 20, -1, 0, 3)
.attr(StatStageChangeAttr, [ Stat.SPDEF ], -2) .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2)
@ -9440,7 +9440,7 @@ export function initMoves() {
new StatusMove(Moves.PSYCHO_SHIFT, PokemonType.PSYCHIC, 100, 10, -1, 0, 4) new StatusMove(Moves.PSYCHO_SHIFT, PokemonType.PSYCHIC, 100, 10, -1, 0, 4)
.attr(PsychoShiftEffectAttr) .attr(PsychoShiftEffectAttr)
.condition((user, target, move) => { .condition((user, target, move) => {
let statusToApply = user.hasAbility(Abilities.COMATOSE) ? StatusEffect.SLEEP : undefined; let statusToApply = user.hasAbility(AbilityId.COMATOSE) ? StatusEffect.SLEEP : undefined;
if (user.status?.effect && isNonVolatileStatusEffect(user.status.effect)) { if (user.status?.effect && isNonVolatileStatusEffect(user.status.effect)) {
statusToApply = user.status.effect; statusToApply = user.status.effect;
} }
@ -9484,7 +9484,7 @@ export function initMoves() {
.attr(LastResortAttr) .attr(LastResortAttr)
.edgeCase(), // May or may not need to ignore remotely called moves depending on how it works .edgeCase(), // May or may not need to ignore remotely called moves depending on how it works
new StatusMove(Moves.WORRY_SEED, PokemonType.GRASS, 100, 10, -1, 0, 4) new StatusMove(Moves.WORRY_SEED, PokemonType.GRASS, 100, 10, -1, 0, 4)
.attr(AbilityChangeAttr, Abilities.INSOMNIA) .attr(AbilityChangeAttr, AbilityId.INSOMNIA)
.reflectable(), .reflectable(),
new AttackMove(Moves.SUCKER_PUNCH, PokemonType.DARK, MoveCategory.PHYSICAL, 70, 100, 5, -1, 1, 4) new AttackMove(Moves.SUCKER_PUNCH, PokemonType.DARK, MoveCategory.PHYSICAL, 70, 100, 5, -1, 1, 4)
.condition((user, target, move) => { .condition((user, target, move) => {
@ -9787,7 +9787,7 @@ export function initMoves() {
new AttackMove(Moves.FOUL_PLAY, PokemonType.DARK, MoveCategory.PHYSICAL, 95, 100, 15, -1, 0, 5) new AttackMove(Moves.FOUL_PLAY, PokemonType.DARK, MoveCategory.PHYSICAL, 95, 100, 15, -1, 0, 5)
.attr(TargetAtkUserAtkAttr), .attr(TargetAtkUserAtkAttr),
new StatusMove(Moves.SIMPLE_BEAM, PokemonType.NORMAL, 100, 15, -1, 0, 5) new StatusMove(Moves.SIMPLE_BEAM, PokemonType.NORMAL, 100, 15, -1, 0, 5)
.attr(AbilityChangeAttr, Abilities.SIMPLE) .attr(AbilityChangeAttr, AbilityId.SIMPLE)
.reflectable(), .reflectable(),
new StatusMove(Moves.ENTRAINMENT, PokemonType.NORMAL, 100, 15, -1, 0, 5) new StatusMove(Moves.ENTRAINMENT, PokemonType.NORMAL, 100, 15, -1, 0, 5)
.attr(AbilityGiveAttr) .attr(AbilityGiveAttr)
@ -9834,7 +9834,7 @@ export function initMoves() {
new AttackMove(Moves.HEX, PokemonType.GHOST, MoveCategory.SPECIAL, 65, 100, 10, -1, 0, 5) new AttackMove(Moves.HEX, PokemonType.GHOST, MoveCategory.SPECIAL, 65, 100, 10, -1, 0, 5)
.attr( .attr(
MovePowerMultiplierAttr, MovePowerMultiplierAttr,
(user, target, move) => target.status || target.hasAbility(Abilities.COMATOSE) ? 2 : 1), (user, target, move) => target.status || target.hasAbility(AbilityId.COMATOSE) ? 2 : 1),
new ChargingAttackMove(Moves.SKY_DROP, PokemonType.FLYING, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 5) new ChargingAttackMove(Moves.SKY_DROP, PokemonType.FLYING, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 5)
.chargeText(i18next.t("moveTriggers:tookTargetIntoSky", { pokemonName: "{USER}", targetName: "{TARGET}" })) .chargeText(i18next.t("moveTriggers:tookTargetIntoSky", { pokemonName: "{USER}", targetName: "{TARGET}" }))
.chargeAttr(SemiInvulnerableAttr, BattlerTagType.FLYING) .chargeAttr(SemiInvulnerableAttr, BattlerTagType.FLYING)
@ -10164,10 +10164,10 @@ export function initMoves() {
.chargeText(i18next.t("moveTriggers:isChargingPower", { pokemonName: "{USER}" })) .chargeText(i18next.t("moveTriggers:isChargingPower", { pokemonName: "{USER}" }))
.attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF, Stat.SPD ], 2, true), .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF, Stat.SPD ], 2, true),
new StatusMove(Moves.MAGNETIC_FLUX, PokemonType.ELECTRIC, -1, 20, -1, 0, 6) new StatusMove(Moves.MAGNETIC_FLUX, PokemonType.ELECTRIC, -1, 20, -1, 0, 6)
.attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], 1, false, { condition: (user, target, move) => !![ Abilities.PLUS, Abilities.MINUS ].find(a => target.hasAbility(a, false)) }) .attr(StatStageChangeAttr, [ Stat.DEF, Stat.SPDEF ], 1, false, { condition: (user, target, move) => !![ AbilityId.PLUS, AbilityId.MINUS ].find(a => target.hasAbility(a, false)) })
.ignoresSubstitute() .ignoresSubstitute()
.target(MoveTarget.USER_AND_ALLIES) .target(MoveTarget.USER_AND_ALLIES)
.condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ Abilities.PLUS, Abilities.MINUS ].find(a => p?.hasAbility(a, false)))), .condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ AbilityId.PLUS, AbilityId.MINUS ].find(a => p?.hasAbility(a, false)))),
new StatusMove(Moves.HAPPY_HOUR, PokemonType.NORMAL, -1, 30, -1, 0, 6) // No animation new StatusMove(Moves.HAPPY_HOUR, PokemonType.NORMAL, -1, 30, -1, 0, 6) // No animation
.attr(AddArenaTagAttr, ArenaTagType.HAPPY_HOUR, null, true) .attr(AddArenaTagAttr, ArenaTagType.HAPPY_HOUR, null, true)
.target(MoveTarget.USER_SIDE), .target(MoveTarget.USER_SIDE),
@ -10354,10 +10354,10 @@ export function initMoves() {
new SelfStatusMove(Moves.LASER_FOCUS, PokemonType.NORMAL, -1, 30, -1, 0, 7) new SelfStatusMove(Moves.LASER_FOCUS, PokemonType.NORMAL, -1, 30, -1, 0, 7)
.attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_CRIT, true, false), .attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_CRIT, true, false),
new StatusMove(Moves.GEAR_UP, PokemonType.STEEL, -1, 20, -1, 0, 7) new StatusMove(Moves.GEAR_UP, PokemonType.STEEL, -1, 20, -1, 0, 7)
.attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], 1, false, { condition: (user, target, move) => !![ Abilities.PLUS, Abilities.MINUS ].find(a => target.hasAbility(a, false)) }) .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], 1, false, { condition: (user, target, move) => !![ AbilityId.PLUS, AbilityId.MINUS ].find(a => target.hasAbility(a, false)) })
.ignoresSubstitute() .ignoresSubstitute()
.target(MoveTarget.USER_AND_ALLIES) .target(MoveTarget.USER_AND_ALLIES)
.condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ Abilities.PLUS, Abilities.MINUS ].find(a => p?.hasAbility(a, false)))), .condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ AbilityId.PLUS, AbilityId.MINUS ].find(a => p?.hasAbility(a, false)))),
new AttackMove(Moves.THROAT_CHOP, PokemonType.DARK, MoveCategory.PHYSICAL, 80, 100, 15, 100, 0, 7) new AttackMove(Moves.THROAT_CHOP, PokemonType.DARK, MoveCategory.PHYSICAL, 80, 100, 15, 100, 0, 7)
.attr(AddBattlerTagAttr, BattlerTagType.THROAT_CHOPPED), .attr(AddBattlerTagAttr, BattlerTagType.THROAT_CHOPPED),
new AttackMove(Moves.POLLEN_PUFF, PokemonType.BUG, MoveCategory.SPECIAL, 90, 100, 15, -1, 0, 7) new AttackMove(Moves.POLLEN_PUFF, PokemonType.BUG, MoveCategory.SPECIAL, 90, 100, 15, -1, 0, 7)
@ -10562,7 +10562,7 @@ export function initMoves() {
new AttackMove(Moves.FREEZY_FROST, PokemonType.ICE, MoveCategory.SPECIAL, 100, 90, 10, -1, 0, 7) new AttackMove(Moves.FREEZY_FROST, PokemonType.ICE, MoveCategory.SPECIAL, 100, 90, 10, -1, 0, 7)
.attr(ResetStatsAttr, true), .attr(ResetStatsAttr, true),
new AttackMove(Moves.SPARKLY_SWIRL, PokemonType.FAIRY, MoveCategory.SPECIAL, 120, 85, 5, -1, 0, 7) new AttackMove(Moves.SPARKLY_SWIRL, PokemonType.FAIRY, MoveCategory.SPECIAL, 120, 85, 5, -1, 0, 7)
.attr(PartyStatusCureAttr, null, Abilities.NONE), .attr(PartyStatusCureAttr, null, AbilityId.NONE),
new AttackMove(Moves.VEEVEE_VOLLEY, PokemonType.NORMAL, MoveCategory.PHYSICAL, -1, -1, 20, -1, 0, 7) new AttackMove(Moves.VEEVEE_VOLLEY, PokemonType.NORMAL, MoveCategory.PHYSICAL, -1, -1, 20, -1, 0, 7)
.attr(FriendshipPowerAttr), .attr(FriendshipPowerAttr),
new AttackMove(Moves.DOUBLE_IRON_BASH, PokemonType.STEEL, MoveCategory.PHYSICAL, 60, 100, 5, 30, 0, 7) new AttackMove(Moves.DOUBLE_IRON_BASH, PokemonType.STEEL, MoveCategory.PHYSICAL, 60, 100, 5, 30, 0, 7)

View File

@ -23,7 +23,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import { getPokemonSpecies } from "#app/data/pokemon-species"; import { getPokemonSpecies } from "#app/data/pokemon-species";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { import {
applyAbilityOverrideToPokemon, applyAbilityOverrideToPokemon,
applyModifierTypeToPlayerPokemon, applyModifierTypeToPlayerPokemon,
@ -54,21 +54,21 @@ import { Challenges } from "#enums/challenges";
const namespace = "mysteryEncounters/clowningAround"; const namespace = "mysteryEncounters/clowningAround";
const RANDOM_ABILITY_POOL = [ const RANDOM_ABILITY_POOL = [
Abilities.STURDY, AbilityId.STURDY,
Abilities.PICKUP, AbilityId.PICKUP,
Abilities.INTIMIDATE, AbilityId.INTIMIDATE,
Abilities.GUTS, AbilityId.GUTS,
Abilities.DROUGHT, AbilityId.DROUGHT,
Abilities.DRIZZLE, AbilityId.DRIZZLE,
Abilities.SNOW_WARNING, AbilityId.SNOW_WARNING,
Abilities.SAND_STREAM, AbilityId.SAND_STREAM,
Abilities.ELECTRIC_SURGE, AbilityId.ELECTRIC_SURGE,
Abilities.PSYCHIC_SURGE, AbilityId.PSYCHIC_SURGE,
Abilities.GRASSY_SURGE, AbilityId.GRASSY_SURGE,
Abilities.MISTY_SURGE, AbilityId.MISTY_SURGE,
Abilities.MAGICIAN, AbilityId.MAGICIAN,
Abilities.SHEER_FORCE, AbilityId.SHEER_FORCE,
Abilities.PRANKSTER, AbilityId.PRANKSTER,
]; ];
/** /**

View File

@ -42,7 +42,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
import { EncounterAnim } from "#enums/encounter-anims"; import { EncounterAnim } from "#enums/encounter-anims";
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
@ -239,11 +239,11 @@ export const FieryFalloutEncounter: MysteryEncounter = MysteryEncounterBuilder.w
if (chosenPokemon.trySetStatus(StatusEffect.BURN)) { if (chosenPokemon.trySetStatus(StatusEffect.BURN)) {
// Burn applied // Burn applied
encounter.setDialogueToken("burnedPokemon", chosenPokemon.getNameToRender()); encounter.setDialogueToken("burnedPokemon", chosenPokemon.getNameToRender());
encounter.setDialogueToken("abilityName", new Ability(Abilities.HEATPROOF, 3).name); encounter.setDialogueToken("abilityName", new Ability(AbilityId.HEATPROOF, 3).name);
queueEncounterMessage(`${namespace}:option.2.target_burned`); queueEncounterMessage(`${namespace}:option.2.target_burned`);
// Also permanently change the burned Pokemon's ability to Heatproof // Also permanently change the burned Pokemon's ability to Heatproof
applyAbilityOverrideToPokemon(chosenPokemon, Abilities.HEATPROOF); applyAbilityOverrideToPokemon(chosenPokemon, AbilityId.HEATPROOF);
} }
} }

View File

@ -27,7 +27,7 @@ import PokemonData from "#app/system/pokemon-data";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { NON_LEGEND_PARADOX_POKEMON, NON_LEGEND_ULTRA_BEASTS } from "#app/data/balance/special-species-groups"; import { NON_LEGEND_PARADOX_POKEMON, NON_LEGEND_ULTRA_BEASTS } from "#app/data/balance/special-species-groups";
import { timedEventManager } from "#app/global-event-manager"; import { timedEventManager } from "#app/global-event-manager";
@ -81,7 +81,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
let tries = 0; let tries = 0;
// Reroll any species that don't have HAs // Reroll any species that don't have HAs
while ((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) && tries < 5) { while ((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === AbilityId.NONE) && tries < 5) {
species = getSalesmanSpeciesOffer(); species = getSalesmanSpeciesOffer();
tries++; tries++;
} }
@ -110,7 +110,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
*/ */
if ( if (
r === 0 || r === 0 ||
((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) && ((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === AbilityId.NONE) &&
validEventEncounters.length === 0) validEventEncounters.length === 0)
) { ) {
// If you roll 1%, give shiny Magikarp with random variant // If you roll 1%, give shiny Magikarp with random variant
@ -118,7 +118,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
pokemon = new PlayerPokemon(species, 5, 2, undefined, undefined, true); pokemon = new PlayerPokemon(species, 5, 2, undefined, undefined, true);
} else if ( } else if (
validEventEncounters.length > 0 && validEventEncounters.length > 0 &&
(r <= EVENT_THRESHOLD || isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) (r <= EVENT_THRESHOLD || isNullOrUndefined(species.abilityHidden) || species.abilityHidden === AbilityId.NONE)
) { ) {
tries = 0; tries = 0;
do { do {
@ -128,7 +128,7 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
pokemon = new PlayerPokemon( pokemon = new PlayerPokemon(
species, species,
5, 5,
species.abilityHidden === Abilities.NONE ? undefined : 2, species.abilityHidden === AbilityId.NONE ? undefined : 2,
enc.formIndex, enc.formIndex,
); );
pokemon.trySetShinySeed(); pokemon.trySetShinySeed();

View File

@ -16,7 +16,7 @@ import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-en
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { getPokemonSpecies } from "#app/data/pokemon-species"; import { getPokemonSpecies } from "#app/data/pokemon-species";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Nature } from "#enums/nature"; import { Nature } from "#enums/nature";
@ -216,7 +216,7 @@ function endTrainerBattleAndShowDialogue(): Promise<void> {
// Hardcoded Eiscue for now in case it is fused with another pokemon // Hardcoded Eiscue for now in case it is fused with another pokemon
if ( if (
pokemon.species.speciesId === Species.EISCUE && pokemon.species.speciesId === Species.EISCUE &&
pokemon.hasAbility(Abilities.ICE_FACE) && pokemon.hasAbility(AbilityId.ICE_FACE) &&
pokemon.formIndex === 1 pokemon.formIndex === 1
) { ) {
globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeAbilityTrigger); globalScene.triggerPokemonFormChange(pokemon, SpeciesFormChangeAbilityTrigger);

View File

@ -10,7 +10,7 @@ import type { PlayerPokemon } from "#app/field/pokemon";
import { AttackTypeBoosterModifier } from "#app/modifier/modifier"; import { AttackTypeBoosterModifier } from "#app/modifier/modifier";
import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type"; import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type";
import { isNullOrUndefined } from "#app/utils/common"; import { isNullOrUndefined } from "#app/utils/common";
import type { Abilities } from "#enums/abilities"; import type { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -651,13 +651,13 @@ export class CompatibleMoveRequirement extends EncounterPokemonRequirement {
} }
export class AbilityRequirement extends EncounterPokemonRequirement { export class AbilityRequirement extends EncounterPokemonRequirement {
requiredAbilities: Abilities[]; requiredAbilities: AbilityId[];
minNumberOfPokemon: number; minNumberOfPokemon: number;
invertQuery: boolean; invertQuery: boolean;
excludeDisallowedPokemon: boolean; excludeDisallowedPokemon: boolean;
constructor( constructor(
abilities: Abilities | Abilities[], abilities: AbilityId | AbilityId[],
excludeDisallowedPokemon: boolean, excludeDisallowedPokemon: boolean,
minNumberOfPokemon = 1, minNumberOfPokemon = 1,
invertQuery = false, invertQuery = false,

View File

@ -1,5 +1,5 @@
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
/** /**
* Moves that "steal" things * Moves that "steal" things
@ -105,26 +105,26 @@ export const EXTORTION_MOVES = [
* Abilities that (loosely) can be used to trap/rob someone * Abilities that (loosely) can be used to trap/rob someone
*/ */
export const EXTORTION_ABILITIES = [ export const EXTORTION_ABILITIES = [
Abilities.INTIMIDATE, AbilityId.INTIMIDATE,
Abilities.ARENA_TRAP, AbilityId.ARENA_TRAP,
Abilities.SHADOW_TAG, AbilityId.SHADOW_TAG,
Abilities.SUCTION_CUPS, AbilityId.SUCTION_CUPS,
Abilities.STICKY_HOLD, AbilityId.STICKY_HOLD,
]; ];
/** /**
* Abilities that signify resistance to fire * Abilities that signify resistance to fire
*/ */
export const FIRE_RESISTANT_ABILITIES = [ export const FIRE_RESISTANT_ABILITIES = [
Abilities.FLAME_BODY, AbilityId.FLAME_BODY,
Abilities.FLASH_FIRE, AbilityId.FLASH_FIRE,
Abilities.WELL_BAKED_BODY, AbilityId.WELL_BAKED_BODY,
Abilities.HEATPROOF, AbilityId.HEATPROOF,
Abilities.THERMAL_EXCHANGE, AbilityId.THERMAL_EXCHANGE,
Abilities.THICK_FAT, AbilityId.THICK_FAT,
Abilities.WATER_BUBBLE, AbilityId.WATER_BUBBLE,
Abilities.MAGMA_ARMOR, AbilityId.MAGMA_ARMOR,
Abilities.WATER_VEIL, AbilityId.WATER_VEIL,
Abilities.STEAM_ENGINE, AbilityId.STEAM_ENGINE,
Abilities.PRIMORDIAL_SEA, AbilityId.PRIMORDIAL_SEA,
]; ];

View File

@ -35,7 +35,7 @@ import type { PermanentStat } from "#enums/stat";
import { VictoryPhase } from "#app/phases/victory-phase"; import { VictoryPhase } from "#app/phases/victory-phase";
import { SummaryUiMode } from "#app/ui/summary-ui-handler"; import { SummaryUiMode } from "#app/ui/summary-ui-handler";
import { CustomPokemonData } from "#app/data/custom-pokemon-data"; import { CustomPokemonData } from "#app/data/custom-pokemon-data";
import type { Abilities } from "#enums/abilities"; import type { AbilityId } from "#enums/abilities";
import type { PokeballType } from "#enums/pokeball"; import type { PokeballType } from "#enums/pokeball";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -1024,7 +1024,7 @@ export function isPokemonValidForEncounterOptionSelection(
* Permanently overrides the ability (not passive) of a pokemon. * Permanently overrides the ability (not passive) of a pokemon.
* If the pokemon is a fusion, instead overrides the fused pokemon's ability. * If the pokemon is a fusion, instead overrides the fused pokemon's ability.
*/ */
export function applyAbilityOverrideToPokemon(pokemon: Pokemon, ability: Abilities) { export function applyAbilityOverrideToPokemon(pokemon: Pokemon, ability: AbilityId) {
if (pokemon.isFusion()) { if (pokemon.isFusion()) {
if (!pokemon.fusionCustomPokemonData) { if (!pokemon.fusionCustomPokemonData) {
pokemon.fusionCustomPokemonData = new CustomPokemonData(); pokemon.fusionCustomPokemonData = new CustomPokemonData();

View File

@ -4,7 +4,7 @@ import { StatusEffect } from "#enums/status-effect";
import { allMoves } from "./data-lists"; import { allMoves } from "./data-lists";
import { MoveCategory } from "#enums/MoveCategory"; import { MoveCategory } from "#enums/MoveCategory";
import type { Constructor, nil } from "#app/utils/common"; import type { Constructor, nil } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import type { TimeOfDay } from "#enums/time-of-day"; import type { TimeOfDay } from "#enums/time-of-day";
@ -403,7 +403,7 @@ export class MeloettaFormChangePostMoveTrigger extends SpeciesFormChangePostMove
return false; return false;
} }
// Meloetta will not transform if it has the ability Sheer Force when using Relic Song // Meloetta will not transform if it has the ability Sheer Force when using Relic Song
if (pokemon.hasAbility(Abilities.SHEER_FORCE)) { if (pokemon.hasAbility(AbilityId.SHEER_FORCE)) {
return false; return false;
} }
return super.canChange(pokemon); return super.canChange(pokemon);
@ -453,11 +453,11 @@ export class SpeciesFormChangeLapseTeraTrigger extends SpeciesFormChangeTrigger
*/ */
export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger { export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger {
/** The ability that triggers the form change */ /** The ability that triggers the form change */
public ability: Abilities; public ability: AbilityId;
/** The list of weathers that trigger the form change */ /** The list of weathers that trigger the form change */
public weathers: WeatherType[]; public weathers: WeatherType[];
constructor(ability: Abilities, weathers: WeatherType[]) { constructor(ability: AbilityId, weathers: WeatherType[]) {
super(); super();
this.ability = ability; this.ability = ability;
this.weathers = weathers; this.weathers = weathers;
@ -492,11 +492,11 @@ export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger {
*/ */
export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChangeTrigger { export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChangeTrigger {
/** The ability that triggers the form change*/ /** The ability that triggers the form change*/
public ability: Abilities; public ability: AbilityId;
/** The list of weathers that will also trigger a form change to original form */ /** The list of weathers that will also trigger a form change to original form */
public weathers: WeatherType[]; public weathers: WeatherType[];
constructor(ability: Abilities, weathers: WeatherType[]) { constructor(ability: AbilityId, weathers: WeatherType[]) {
super(); super();
this.ability = ability; this.ability = ability;
this.weathers = weathers; this.weathers = weathers;
@ -515,7 +515,7 @@ export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChange
const isWeatherSuppressed = globalScene.arena.weather?.isEffectSuppressed(); const isWeatherSuppressed = globalScene.arena.weather?.isEffectSuppressed();
const isAbilitySuppressed = pokemon.summonData.abilitySuppressed; const isAbilitySuppressed = pokemon.summonData.abilitySuppressed;
const summonDataAbility = pokemon.summonData.ability; const summonDataAbility = pokemon.summonData.ability;
const isAbilityChanged = summonDataAbility !== this.ability && summonDataAbility !== Abilities.NONE; const isAbilityChanged = summonDataAbility !== this.ability && summonDataAbility !== AbilityId.NONE;
if (this.weathers.includes(currentWeather) || isWeatherSuppressed || isAbilitySuppressed || isAbilityChanged) { if (this.weathers.includes(currentWeather) || isWeatherSuppressed || isAbilitySuppressed || isAbilityChanged) {
return true; return true;
@ -553,7 +553,7 @@ export function getSpeciesFormChangeMessage(pokemon: Pokemon, formChange: Specie
pokemonName: getPokemonNameWithAffix(pokemon), pokemonName: getPokemonNameWithAffix(pokemon),
}); });
} }
if (pokemon.getAbility().id === Abilities.DISGUISE) { if (pokemon.getAbility().id === AbilityId.DISGUISE) {
return i18next.t("battlePokemonForm:disguiseChange"); return i18next.t("battlePokemonForm:disguiseChange");
} }
return i18next.t("battlePokemonForm:formChange", { preName }); return i18next.t("battlePokemonForm:formChange", { preName });
@ -701,18 +701,18 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.ALTARIA, "", SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.ALTARIANITE)) new SpeciesFormChange(Species.ALTARIA, "", SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.ALTARIANITE))
], ],
[Species.CASTFORM]: [ [Species.CASTFORM]: [
new SpeciesFormChange(Species.CASTFORM, "", "sunny", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true), new SpeciesFormChange(Species.CASTFORM, "", "sunny", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true),
new SpeciesFormChange(Species.CASTFORM, "rainy", "sunny", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true), new SpeciesFormChange(Species.CASTFORM, "rainy", "sunny", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true),
new SpeciesFormChange(Species.CASTFORM, "snowy", "sunny", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true), new SpeciesFormChange(Species.CASTFORM, "snowy", "sunny", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true),
new SpeciesFormChange(Species.CASTFORM, "", "rainy", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]), true), new SpeciesFormChange(Species.CASTFORM, "", "rainy", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]), true),
new SpeciesFormChange(Species.CASTFORM, "sunny", "rainy", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]), true), new SpeciesFormChange(Species.CASTFORM, "sunny", "rainy", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]), true),
new SpeciesFormChange(Species.CASTFORM, "snowy", "rainy", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]), true), new SpeciesFormChange(Species.CASTFORM, "snowy", "rainy", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]), true),
new SpeciesFormChange(Species.CASTFORM, "", "snowy", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.HAIL, WeatherType.SNOW ]), true), new SpeciesFormChange(Species.CASTFORM, "", "snowy", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.HAIL, WeatherType.SNOW ]), true),
new SpeciesFormChange(Species.CASTFORM, "sunny", "snowy", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.HAIL, WeatherType.SNOW ]), true), new SpeciesFormChange(Species.CASTFORM, "sunny", "snowy", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.HAIL, WeatherType.SNOW ]), true),
new SpeciesFormChange(Species.CASTFORM, "rainy", "snowy", new SpeciesFormChangeWeatherTrigger(Abilities.FORECAST, [ WeatherType.HAIL, WeatherType.SNOW ]), true), new SpeciesFormChange(Species.CASTFORM, "rainy", "snowy", new SpeciesFormChangeWeatherTrigger(AbilityId.FORECAST, [ WeatherType.HAIL, WeatherType.SNOW ]), true),
new SpeciesFormChange(Species.CASTFORM, "sunny", "", new SpeciesFormChangeRevertWeatherFormTrigger(Abilities.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), true), new SpeciesFormChange(Species.CASTFORM, "sunny", "", new SpeciesFormChangeRevertWeatherFormTrigger(AbilityId.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), true),
new SpeciesFormChange(Species.CASTFORM, "rainy", "", new SpeciesFormChangeRevertWeatherFormTrigger(Abilities.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), true), new SpeciesFormChange(Species.CASTFORM, "rainy", "", new SpeciesFormChangeRevertWeatherFormTrigger(AbilityId.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), true),
new SpeciesFormChange(Species.CASTFORM, "snowy", "", new SpeciesFormChangeRevertWeatherFormTrigger(Abilities.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), true), new SpeciesFormChange(Species.CASTFORM, "snowy", "", new SpeciesFormChangeRevertWeatherFormTrigger(AbilityId.FORECAST, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG ]), true),
new SpeciesFormChange(Species.CASTFORM, "sunny", "", new SpeciesFormChangeActiveTrigger(), true), new SpeciesFormChange(Species.CASTFORM, "sunny", "", new SpeciesFormChangeActiveTrigger(), true),
new SpeciesFormChange(Species.CASTFORM, "rainy", "", new SpeciesFormChangeActiveTrigger(), true), new SpeciesFormChange(Species.CASTFORM, "rainy", "", new SpeciesFormChangeActiveTrigger(), true),
new SpeciesFormChange(Species.CASTFORM, "snowy", "", new SpeciesFormChangeActiveTrigger(), true) new SpeciesFormChange(Species.CASTFORM, "snowy", "", new SpeciesFormChangeActiveTrigger(), true)
@ -753,8 +753,8 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.DEOXYS, "normal", "speed", new SpeciesFormChangeItemTrigger(FormChangeItem.SMOOTH_METEORITE)) new SpeciesFormChange(Species.DEOXYS, "normal", "speed", new SpeciesFormChangeItemTrigger(FormChangeItem.SMOOTH_METEORITE))
], ],
[Species.CHERRIM]: [ [Species.CHERRIM]: [
new SpeciesFormChange(Species.CHERRIM, "overcast", "sunshine", new SpeciesFormChangeWeatherTrigger(Abilities.FLOWER_GIFT, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true), new SpeciesFormChange(Species.CHERRIM, "overcast", "sunshine", new SpeciesFormChangeWeatherTrigger(AbilityId.FLOWER_GIFT, [ WeatherType.SUNNY, WeatherType.HARSH_SUN ]), true),
new SpeciesFormChange(Species.CHERRIM, "sunshine", "overcast", new SpeciesFormChangeRevertWeatherFormTrigger(Abilities.FLOWER_GIFT, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG, WeatherType.HAIL, WeatherType.HEAVY_RAIN, WeatherType.SNOW, WeatherType.RAIN ]), true), new SpeciesFormChange(Species.CHERRIM, "sunshine", "overcast", new SpeciesFormChangeRevertWeatherFormTrigger(AbilityId.FLOWER_GIFT, [ WeatherType.NONE, WeatherType.SANDSTORM, WeatherType.STRONG_WINDS, WeatherType.FOG, WeatherType.HAIL, WeatherType.HEAVY_RAIN, WeatherType.SNOW, WeatherType.RAIN ]), true),
new SpeciesFormChange(Species.CHERRIM, "sunshine", "overcast", new SpeciesFormChangeActiveTrigger(), true) new SpeciesFormChange(Species.CHERRIM, "sunshine", "overcast", new SpeciesFormChangeActiveTrigger(), true)
], ],
[Species.LOPUNNY]: [ [Species.LOPUNNY]: [
@ -788,23 +788,23 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.SHAYMIN, "land", "sky", new SpeciesFormChangeItemTrigger(FormChangeItem.GRACIDEA)), new SpeciesFormChange(Species.SHAYMIN, "land", "sky", new SpeciesFormChangeItemTrigger(FormChangeItem.GRACIDEA)),
], ],
[Species.ARCEUS]: [ [Species.ARCEUS]: [
new SpeciesFormChange(Species.ARCEUS, "normal", "fighting", new SpeciesFormChangeItemTrigger(FormChangeItem.FIST_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "fighting", new SpeciesFormChangeItemTrigger(FormChangeItem.FIST_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "flying", new SpeciesFormChangeItemTrigger(FormChangeItem.SKY_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "flying", new SpeciesFormChangeItemTrigger(FormChangeItem.SKY_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "poison", new SpeciesFormChangeItemTrigger(FormChangeItem.TOXIC_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "poison", new SpeciesFormChangeItemTrigger(FormChangeItem.TOXIC_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "ground", new SpeciesFormChangeItemTrigger(FormChangeItem.EARTH_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "ground", new SpeciesFormChangeItemTrigger(FormChangeItem.EARTH_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "rock", new SpeciesFormChangeItemTrigger(FormChangeItem.STONE_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "rock", new SpeciesFormChangeItemTrigger(FormChangeItem.STONE_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "bug", new SpeciesFormChangeItemTrigger(FormChangeItem.INSECT_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "bug", new SpeciesFormChangeItemTrigger(FormChangeItem.INSECT_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "ghost", new SpeciesFormChangeItemTrigger(FormChangeItem.SPOOKY_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "ghost", new SpeciesFormChangeItemTrigger(FormChangeItem.SPOOKY_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "steel", new SpeciesFormChangeItemTrigger(FormChangeItem.IRON_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "steel", new SpeciesFormChangeItemTrigger(FormChangeItem.IRON_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "fire", new SpeciesFormChangeItemTrigger(FormChangeItem.FLAME_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "fire", new SpeciesFormChangeItemTrigger(FormChangeItem.FLAME_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "water", new SpeciesFormChangeItemTrigger(FormChangeItem.SPLASH_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "water", new SpeciesFormChangeItemTrigger(FormChangeItem.SPLASH_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "grass", new SpeciesFormChangeItemTrigger(FormChangeItem.MEADOW_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "grass", new SpeciesFormChangeItemTrigger(FormChangeItem.MEADOW_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "electric", new SpeciesFormChangeItemTrigger(FormChangeItem.ZAP_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "electric", new SpeciesFormChangeItemTrigger(FormChangeItem.ZAP_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "psychic", new SpeciesFormChangeItemTrigger(FormChangeItem.MIND_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "psychic", new SpeciesFormChangeItemTrigger(FormChangeItem.MIND_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "ice", new SpeciesFormChangeItemTrigger(FormChangeItem.ICICLE_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "ice", new SpeciesFormChangeItemTrigger(FormChangeItem.ICICLE_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "dragon", new SpeciesFormChangeItemTrigger(FormChangeItem.DRACO_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "dragon", new SpeciesFormChangeItemTrigger(FormChangeItem.DRACO_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "dark", new SpeciesFormChangeItemTrigger(FormChangeItem.DREAD_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "dark", new SpeciesFormChangeItemTrigger(FormChangeItem.DREAD_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
new SpeciesFormChange(Species.ARCEUS, "normal", "fairy", new SpeciesFormChangeItemTrigger(FormChangeItem.PIXIE_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.MULTITYPE))), new SpeciesFormChange(Species.ARCEUS, "normal", "fairy", new SpeciesFormChangeItemTrigger(FormChangeItem.PIXIE_PLATE), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.MULTITYPE))),
], ],
[Species.DARMANITAN]: [ [Species.DARMANITAN]: [
new SpeciesFormChange(Species.DARMANITAN, "", "zen", new SpeciesFormChangeAbilityTrigger(), true), new SpeciesFormChange(Species.DARMANITAN, "", "zen", new SpeciesFormChangeAbilityTrigger(), true),
@ -849,8 +849,8 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.PALAFIN, "hero", "zero", new SpeciesFormChangeAbilityTrigger(), true) new SpeciesFormChange(Species.PALAFIN, "hero", "zero", new SpeciesFormChangeAbilityTrigger(), true)
], ],
[Species.AEGISLASH]: [ [Species.AEGISLASH]: [
new SpeciesFormChange(Species.AEGISLASH, "blade", "shield", new SpeciesFormChangePreMoveTrigger(Moves.KINGS_SHIELD), true, new SpeciesFormChangeCondition(p => p.hasAbility(Abilities.STANCE_CHANGE))), new SpeciesFormChange(Species.AEGISLASH, "blade", "shield", new SpeciesFormChangePreMoveTrigger(Moves.KINGS_SHIELD), true, new SpeciesFormChangeCondition(p => p.hasAbility(AbilityId.STANCE_CHANGE))),
new SpeciesFormChange(Species.AEGISLASH, "shield", "blade", new SpeciesFormChangePreMoveTrigger(m => allMoves[m].category !== MoveCategory.STATUS), true, new SpeciesFormChangeCondition(p => p.hasAbility(Abilities.STANCE_CHANGE))), new SpeciesFormChange(Species.AEGISLASH, "shield", "blade", new SpeciesFormChangePreMoveTrigger(m => allMoves[m].category !== MoveCategory.STATUS), true, new SpeciesFormChangeCondition(p => p.hasAbility(AbilityId.STANCE_CHANGE))),
new SpeciesFormChange(Species.AEGISLASH, "blade", "shield", new SpeciesFormChangeActiveTrigger(false), true) new SpeciesFormChange(Species.AEGISLASH, "blade", "shield", new SpeciesFormChangeActiveTrigger(false), true)
], ],
[Species.XERNEAS]: [ [Species.XERNEAS]: [
@ -874,23 +874,23 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.WISHIWASHI, "school", "", new SpeciesFormChangeAbilityTrigger(), true) new SpeciesFormChange(Species.WISHIWASHI, "school", "", new SpeciesFormChangeAbilityTrigger(), true)
], ],
[Species.SILVALLY]: [ [Species.SILVALLY]: [
new SpeciesFormChange(Species.SILVALLY, "normal", "fighting", new SpeciesFormChangeItemTrigger(FormChangeItem.FIGHTING_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "fighting", new SpeciesFormChangeItemTrigger(FormChangeItem.FIGHTING_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "flying", new SpeciesFormChangeItemTrigger(FormChangeItem.FLYING_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "flying", new SpeciesFormChangeItemTrigger(FormChangeItem.FLYING_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "poison", new SpeciesFormChangeItemTrigger(FormChangeItem.POISON_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "poison", new SpeciesFormChangeItemTrigger(FormChangeItem.POISON_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "ground", new SpeciesFormChangeItemTrigger(FormChangeItem.GROUND_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "ground", new SpeciesFormChangeItemTrigger(FormChangeItem.GROUND_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "rock", new SpeciesFormChangeItemTrigger(FormChangeItem.ROCK_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "rock", new SpeciesFormChangeItemTrigger(FormChangeItem.ROCK_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "bug", new SpeciesFormChangeItemTrigger(FormChangeItem.BUG_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "bug", new SpeciesFormChangeItemTrigger(FormChangeItem.BUG_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "ghost", new SpeciesFormChangeItemTrigger(FormChangeItem.GHOST_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "ghost", new SpeciesFormChangeItemTrigger(FormChangeItem.GHOST_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "steel", new SpeciesFormChangeItemTrigger(FormChangeItem.STEEL_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "steel", new SpeciesFormChangeItemTrigger(FormChangeItem.STEEL_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "fire", new SpeciesFormChangeItemTrigger(FormChangeItem.FIRE_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "fire", new SpeciesFormChangeItemTrigger(FormChangeItem.FIRE_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "water", new SpeciesFormChangeItemTrigger(FormChangeItem.WATER_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "water", new SpeciesFormChangeItemTrigger(FormChangeItem.WATER_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "grass", new SpeciesFormChangeItemTrigger(FormChangeItem.GRASS_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "grass", new SpeciesFormChangeItemTrigger(FormChangeItem.GRASS_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "electric", new SpeciesFormChangeItemTrigger(FormChangeItem.ELECTRIC_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "electric", new SpeciesFormChangeItemTrigger(FormChangeItem.ELECTRIC_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "psychic", new SpeciesFormChangeItemTrigger(FormChangeItem.PSYCHIC_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "psychic", new SpeciesFormChangeItemTrigger(FormChangeItem.PSYCHIC_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "ice", new SpeciesFormChangeItemTrigger(FormChangeItem.ICE_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "ice", new SpeciesFormChangeItemTrigger(FormChangeItem.ICE_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "dragon", new SpeciesFormChangeItemTrigger(FormChangeItem.DRAGON_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "dragon", new SpeciesFormChangeItemTrigger(FormChangeItem.DRAGON_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "dark", new SpeciesFormChangeItemTrigger(FormChangeItem.DARK_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))), new SpeciesFormChange(Species.SILVALLY, "normal", "dark", new SpeciesFormChangeItemTrigger(FormChangeItem.DARK_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM))),
new SpeciesFormChange(Species.SILVALLY, "normal", "fairy", new SpeciesFormChangeItemTrigger(FormChangeItem.FAIRY_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(Abilities.RKS_SYSTEM))) new SpeciesFormChange(Species.SILVALLY, "normal", "fairy", new SpeciesFormChangeItemTrigger(FormChangeItem.FAIRY_MEMORY), true, new SpeciesFormChangeCondition((p) => p.hasAbility(AbilityId.RKS_SYSTEM)))
], ],
[Species.MINIOR]: [ [Species.MINIOR]: [
new SpeciesFormChange(Species.MINIOR, "red-meteor", "red", new SpeciesFormChangeAbilityTrigger(), true), new SpeciesFormChange(Species.MINIOR, "red-meteor", "red", new SpeciesFormChangeAbilityTrigger(), true),

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ import { Species } from "#enums/species";
import { PokeballType } from "#enums/pokeball"; import { PokeballType } from "#enums/pokeball";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { TeraAIMode } from "#enums/tera-ai-mode"; import { TeraAIMode } from "#enums/tera-ai-mode";
import { TrainerPoolTier } from "#enums/trainer-pool-tier"; import { TrainerPoolTier } from "#enums/trainer-pool-tier";
import { TrainerSlot } from "#enums/trainer-slot"; import { TrainerSlot } from "#enums/trainer-slot";
@ -1111,17 +1111,17 @@ export const trainerConfigs: TrainerConfigs = {
a => a =>
!!a && !!a &&
[ [
Abilities.WHITE_SMOKE, AbilityId.WHITE_SMOKE,
Abilities.GLUTTONY, AbilityId.GLUTTONY,
Abilities.HONEY_GATHER, AbilityId.HONEY_GATHER,
Abilities.HARVEST, AbilityId.HARVEST,
Abilities.CHEEK_POUCH, AbilityId.CHEEK_POUCH,
Abilities.SWEET_VEIL, AbilityId.SWEET_VEIL,
Abilities.RIPEN, AbilityId.RIPEN,
Abilities.PURIFYING_SALT, AbilityId.PURIFYING_SALT,
Abilities.WELL_BAKED_BODY, AbilityId.WELL_BAKED_BODY,
Abilities.SUPERSWEET_SYRUP, AbilityId.SUPERSWEET_SYRUP,
Abilities.HOSPITALITY, AbilityId.HOSPITALITY,
].includes(a), ].includes(a),
) || ) ||
s s
@ -1520,12 +1520,12 @@ export const trainerConfigs: TrainerConfigs = {
a => a =>
!!a && !!a &&
[ [
Abilities.DRIZZLE, AbilityId.DRIZZLE,
Abilities.SWIFT_SWIM, AbilityId.SWIFT_SWIM,
Abilities.HYDRATION, AbilityId.HYDRATION,
Abilities.RAIN_DISH, AbilityId.RAIN_DISH,
Abilities.DRY_SKIN, AbilityId.DRY_SKIN,
Abilities.WIND_POWER, AbilityId.WIND_POWER,
].includes(a), ].includes(a),
) || s.getLevelMoves().some(plm => plm[1] === Moves.RAIN_DANCE), ) || s.getLevelMoves().some(plm => plm[1] === Moves.RAIN_DANCE),
), // Mons with rain abilities or who learn Rain Dance by level ), // Mons with rain abilities or who learn Rain Dance by level

View File

@ -1,4 +1,4 @@
export enum Abilities { export enum AbilityId {
/**{@link https://bulbapedia.bulbagarden.net/wiki/None_(ability) | Source} */ /**{@link https://bulbapedia.bulbagarden.net/wiki/None_(ability) | Source} */
NONE, NONE,
/**{@link https://bulbapedia.bulbagarden.net/wiki/Stench_(ability) | Source} */ /**{@link https://bulbapedia.bulbagarden.net/wiki/Stench_(ability) | Source} */

View File

@ -36,7 +36,7 @@ import type { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { TimeOfDay } from "#enums/time-of-day"; import { TimeOfDay } from "#enums/time-of-day";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "#app/data/pokemon-forms"; import { SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "#app/data/pokemon-forms";
import { CommonAnimPhase } from "#app/phases/common-anim-phase"; import { CommonAnimPhase } from "#app/phases/common-anim-phase";
import { WeatherType } from "#enums/weather-type"; import { WeatherType } from "#enums/weather-type";
@ -372,8 +372,8 @@ export class Arena {
*/ */
triggerWeatherBasedFormChanges(): void { triggerWeatherBasedFormChanges(): void {
globalScene.getField(true).forEach(p => { globalScene.getField(true).forEach(p => {
const isCastformWithForecast = p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM; const isCastformWithForecast = p.hasAbility(AbilityId.FORECAST) && p.species.speciesId === Species.CASTFORM;
const isCherrimWithFlowerGift = p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM; const isCherrimWithFlowerGift = p.hasAbility(AbilityId.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM;
if (isCastformWithForecast || isCherrimWithFlowerGift) { if (isCastformWithForecast || isCherrimWithFlowerGift) {
globalScene.triggerPokemonFormChange(p, SpeciesFormChangeWeatherTrigger); globalScene.triggerPokemonFormChange(p, SpeciesFormChangeWeatherTrigger);
@ -387,9 +387,9 @@ export class Arena {
triggerWeatherBasedFormChangesToNormal(): void { triggerWeatherBasedFormChangesToNormal(): void {
globalScene.getField(true).forEach(p => { globalScene.getField(true).forEach(p => {
const isCastformWithForecast = const isCastformWithForecast =
p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM; p.hasAbility(AbilityId.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM;
const isCherrimWithFlowerGift = const isCherrimWithFlowerGift =
p.hasAbility(Abilities.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM; p.hasAbility(AbilityId.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM;
if (isCastformWithForecast || isCherrimWithFlowerGift) { if (isCastformWithForecast || isCherrimWithFlowerGift) {
return globalScene.triggerPokemonFormChange(p, SpeciesFormChangeRevertWeatherFormTrigger); return globalScene.triggerPokemonFormChange(p, SpeciesFormChangeRevertWeatherFormTrigger);

View File

@ -220,7 +220,7 @@ import i18next from "i18next";
import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { speciesEggMoves } from "#app/data/balance/egg-moves";
import { ModifierTier } from "#app/modifier/modifier-tier"; import { ModifierTier } from "#app/modifier/modifier-tier";
import { applyChallenges, ChallengeType } from "#app/data/challenge"; import { applyChallenges, ChallengeType } from "#app/data/challenge";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattleSpec } from "#enums/battle-spec"; import { BattleSpec } from "#enums/battle-spec";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
@ -1571,7 +1571,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.status && this.status.effect === StatusEffect.PARALYSIS) { if (this.status && this.status.effect === StatusEffect.PARALYSIS) {
ret >>= 1; ret >>= 1;
} }
if (this.getTag(BattlerTagType.UNBURDEN) && this.hasAbility(Abilities.UNBURDEN)) { if (this.getTag(BattlerTagType.UNBURDEN) && this.hasAbility(AbilityId.UNBURDEN)) {
ret *= 2; ret *= 2;
} }
break; break;
@ -1601,7 +1601,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (s === Stat.HP) { if (s === Stat.HP) {
statHolder.value = statHolder.value + this.level + 10; statHolder.value = statHolder.value + this.level + 10;
globalScene.applyModifier(PokemonIncrementingStatModifier, this.isPlayer(), this, s, statHolder); globalScene.applyModifier(PokemonIncrementingStatModifier, this.isPlayer(), this, s, statHolder);
if (this.hasAbility(Abilities.WONDER_GUARD, false, true)) { if (this.hasAbility(AbilityId.WONDER_GUARD, false, true)) {
statHolder.value = 1; statHolder.value = 1;
} }
if (this.hp > statHolder.value || this.hp === undefined) { if (this.hp > statHolder.value || this.hp === undefined) {
@ -2071,7 +2071,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return allAbilities[this.customPokemonData.ability]; return allAbilities[this.customPokemonData.ability];
} }
let abilityId = this.getSpeciesForm(ignoreOverride).getAbility(this.abilityIndex); let abilityId = this.getSpeciesForm(ignoreOverride).getAbility(this.abilityIndex);
if (abilityId === Abilities.NONE) { if (abilityId === AbilityId.NONE) {
abilityId = this.species.ability1; abilityId = this.species.ability1;
} }
return allAbilities[abilityId]; return allAbilities[abilityId];
@ -2165,9 +2165,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return false; return false;
} }
if ( if (
((Overrides.PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE || Overrides.HAS_PASSIVE_ABILITY_OVERRIDE) && ((Overrides.PASSIVE_ABILITY_OVERRIDE !== AbilityId.NONE || Overrides.HAS_PASSIVE_ABILITY_OVERRIDE) &&
this.isPlayer()) || this.isPlayer()) ||
((Overrides.OPP_PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE || Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE) && ((Overrides.OPP_PASSIVE_ABILITY_OVERRIDE !== AbilityId.NONE || Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE) &&
!this.isPlayer()) !this.isPlayer())
) { ) {
return true; return true;
@ -2238,7 +2238,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
* @param ignoreOverride Whether to ignore ability changing effects; default `false` * @param ignoreOverride Whether to ignore ability changing effects; default `false`
* @returns `true` if the ability is present and active * @returns `true` if the ability is present and active
*/ */
public hasAbility(ability: Abilities, canApply = true, ignoreOverride = false): boolean { public hasAbility(ability: AbilityId, canApply = true, ignoreOverride = false): boolean {
if (this.getAbility(ignoreOverride).id === ability && (!canApply || this.canApplyAbility())) { if (this.getAbility(ignoreOverride).id === ability && (!canApply || this.canApplyAbility())) {
return true; return true;
} }
@ -2321,7 +2321,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return ( return (
!!this.getTag(GroundedTag) || !!this.getTag(GroundedTag) ||
(!this.isOfType(PokemonType.FLYING, true, true) && (!this.isOfType(PokemonType.FLYING, true, true) &&
!this.hasAbility(Abilities.LEVITATE) && !this.hasAbility(AbilityId.LEVITATE) &&
!this.getTag(BattlerTagType.FLOATING) && !this.getTag(BattlerTagType.FLOATING) &&
!this.getTag(SemiInvulnerableTag)) !this.getTag(SemiInvulnerableTag))
); );
@ -6702,7 +6702,6 @@ export class EnemyPokemon extends Pokemon {
return ret; return ret;
} }
/** /**
* Show or hide the type effectiveness multiplier window * Show or hide the type effectiveness multiplier window
* Passing undefined will hide the window * Passing undefined will hide the window
@ -6785,8 +6784,8 @@ export class PokemonSummonData {
// TODO: Move these into a separate class & add rage fist hit count // TODO: Move these into a separate class & add rage fist hit count
public speciesForm: PokemonSpeciesForm | null = null; public speciesForm: PokemonSpeciesForm | null = null;
public fusionSpeciesForm: PokemonSpeciesForm | null = null; public fusionSpeciesForm: PokemonSpeciesForm | null = null;
public ability: Abilities | undefined; public ability: AbilityId | undefined;
public passiveAbility: Abilities | undefined; public passiveAbility: AbilityId | undefined;
public gender: Gender | undefined; public gender: Gender | undefined;
public fusionGender: Gender | undefined; public fusionGender: Gender | undefined;
public stats: number[] = [0, 0, 0, 0, 0, 0]; public stats: number[] = [0, 0, 0, 0, 0, 0];
@ -6800,7 +6799,7 @@ export class PokemonSummonData {
public illusion: IllusionData | null = null; public illusion: IllusionData | null = null;
public illusionBroken = false; public illusionBroken = false;
/** Array containing all berries eaten in the last turn; used by {@linkcode Abilities.CUD_CHEW} */ /** Array containing all berries eaten in the last turn; used by {@linkcode AbilityId.CUD_CHEW} */
public berriesEatenLast: BerryType[] = []; public berriesEatenLast: BerryType[] = [];
/** /**
@ -6863,7 +6862,7 @@ export class PokemonBattleData {
public hitCount = 0; public hitCount = 0;
/** Whether this Pokemon has eaten a berry this battle; used for {@linkcode Moves.BELCH} */ /** Whether this Pokemon has eaten a berry this battle; used for {@linkcode Moves.BELCH} */
public hasEatenBerry = false; public hasEatenBerry = false;
/** Array containing all berries eaten and not yet recovered during this current battle; used by {@linkcode Abilities.HARVEST} */ /** Array containing all berries eaten and not yet recovered during this current battle; used by {@linkcode AbilityId.HARVEST} */
public berriesEaten: BerryType[] = []; public berriesEaten: BerryType[] = [];
constructor(source?: PokemonBattleData | Partial<PokemonBattleData>) { constructor(source?: PokemonBattleData | Partial<PokemonBattleData>) {
@ -6886,7 +6885,7 @@ export class PokemonWaveData {
* A set of all the abilities this {@linkcode Pokemon} has used in this wave. * A set of all the abilities this {@linkcode Pokemon} has used in this wave.
* Used to track once per battle conditions, as well as (hopefully) by the updated AI for move effectiveness. * Used to track once per battle conditions, as well as (hopefully) by the updated AI for move effectiveness.
*/ */
public abilitiesApplied: Set<Abilities> = new Set<Abilities>(); public abilitiesApplied: Set<AbilityId> = new Set<AbilityId>();
/** Whether the pokemon's ability has been revealed or not */ /** Whether the pokemon's ability has been revealed or not */
public abilityRevealed = false; public abilityRevealed = false;
} }
@ -6924,7 +6923,7 @@ export class PokemonTurnData {
public extraTurns = 0; public extraTurns = 0;
/** /**
* All berries eaten by this pokemon in this turn. * All berries eaten by this pokemon in this turn.
* Saved into {@linkcode PokemonSummonData | SummonData} by {@linkcode Abilities.CUD_CHEW} on turn end. * Saved into {@linkcode PokemonSummonData | SummonData} by {@linkcode AbilityId.CUD_CHEW} on turn end.
* @see {@linkcode PokemonSummonData.berriesEatenLast} * @see {@linkcode PokemonSummonData.berriesEatenLast}
*/ */
public berriesEaten: BerryType[] = []; public berriesEaten: BerryType[] = [];

View File

@ -116,7 +116,7 @@ import {
padInt, padInt,
randSeedInt, randSeedInt,
} from "#app/utils/common"; } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -2781,15 +2781,15 @@ const modifierPool: ModifierPool = {
if (canSetStatus) { if (canSetStatus) {
// Abilities that take advantage of obtaining the actual status effect, separated based on specificity to the orb // Abilities that take advantage of obtaining the actual status effect, separated based on specificity to the orb
const hasGeneralAbility = [ const hasGeneralAbility = [
Abilities.QUICK_FEET, AbilityId.QUICK_FEET,
Abilities.GUTS, AbilityId.GUTS,
Abilities.MARVEL_SCALE, AbilityId.MARVEL_SCALE,
Abilities.MAGIC_GUARD, AbilityId.MAGIC_GUARD,
].some(a => p.hasAbility(a, false, true)); ].some(a => p.hasAbility(a, false, true));
const hasSpecificAbility = [Abilities.TOXIC_BOOST, Abilities.POISON_HEAL].some(a => const hasSpecificAbility = [AbilityId.TOXIC_BOOST, AbilityId.POISON_HEAL].some(a =>
p.hasAbility(a, false, true), p.hasAbility(a, false, true),
); );
const hasOppositeAbility = [Abilities.FLARE_BOOST].some(a => p.hasAbility(a, false, true)); const hasOppositeAbility = [AbilityId.FLARE_BOOST].some(a => p.hasAbility(a, false, true));
return hasSpecificAbility || (hasGeneralAbility && !hasOppositeAbility) || hasStatusMoves; return hasSpecificAbility || (hasGeneralAbility && !hasOppositeAbility) || hasStatusMoves;
} }
@ -2827,13 +2827,13 @@ const modifierPool: ModifierPool = {
if (canSetStatus) { if (canSetStatus) {
// Abilities that take advantage of obtaining the actual status effect, separated based on specificity to the orb // Abilities that take advantage of obtaining the actual status effect, separated based on specificity to the orb
const hasGeneralAbility = [ const hasGeneralAbility = [
Abilities.QUICK_FEET, AbilityId.QUICK_FEET,
Abilities.GUTS, AbilityId.GUTS,
Abilities.MARVEL_SCALE, AbilityId.MARVEL_SCALE,
Abilities.MAGIC_GUARD, AbilityId.MAGIC_GUARD,
].some(a => p.hasAbility(a, false, true)); ].some(a => p.hasAbility(a, false, true));
const hasSpecificAbility = [Abilities.FLARE_BOOST].some(a => p.hasAbility(a, false, true)); const hasSpecificAbility = [AbilityId.FLARE_BOOST].some(a => p.hasAbility(a, false, true));
const hasOppositeAbility = [Abilities.TOXIC_BOOST, Abilities.POISON_HEAL].some(a => const hasOppositeAbility = [AbilityId.TOXIC_BOOST, AbilityId.POISON_HEAL].some(a =>
p.hasAbility(a, false, true), p.hasAbility(a, false, true),
); );
@ -2865,18 +2865,18 @@ const modifierPool: ModifierPool = {
const moveset = p.getMoveset(true).map(m => m.moveId); const moveset = p.getMoveset(true).map(m => m.moveId);
const hasAbility = [ const hasAbility = [
Abilities.DROUGHT, AbilityId.DROUGHT,
Abilities.ORICHALCUM_PULSE, AbilityId.ORICHALCUM_PULSE,
Abilities.DRIZZLE, AbilityId.DRIZZLE,
Abilities.SAND_STREAM, AbilityId.SAND_STREAM,
Abilities.SAND_SPIT, AbilityId.SAND_SPIT,
Abilities.SNOW_WARNING, AbilityId.SNOW_WARNING,
Abilities.ELECTRIC_SURGE, AbilityId.ELECTRIC_SURGE,
Abilities.HADRON_ENGINE, AbilityId.HADRON_ENGINE,
Abilities.PSYCHIC_SURGE, AbilityId.PSYCHIC_SURGE,
Abilities.GRASSY_SURGE, AbilityId.GRASSY_SURGE,
Abilities.SEED_SOWER, AbilityId.SEED_SOWER,
Abilities.MISTY_SURGE, AbilityId.MISTY_SURGE,
].some(a => p.hasAbility(a, false, true)); ].some(a => p.hasAbility(a, false, true));
const hasMoves = [ const hasMoves = [

View File

@ -5,7 +5,7 @@ import { FormChangeItem } from "#app/data/pokemon-forms";
import { type ModifierOverride } from "#app/modifier/modifier-type"; import { type ModifierOverride } from "#app/modifier/modifier-type";
import { Variant } from "#app/sprites/variant"; import { Variant } from "#app/sprites/variant";
import { Unlockables } from "#app/system/unlockables"; import { Unlockables } from "#app/system/unlockables";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattleType } from "#enums/battle-type"; import { BattleType } from "#enums/battle-type";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { Biome } from "#enums/biome"; import { Biome } from "#enums/biome";
@ -147,8 +147,8 @@ class DefaultOverrides {
* This will override the species of the fusion * This will override the species of the fusion
*/ */
readonly STARTER_FUSION_SPECIES_OVERRIDE: Species | number = 0; readonly STARTER_FUSION_SPECIES_OVERRIDE: Species | number = 0;
readonly ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly PASSIVE_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
readonly HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null; readonly HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null;
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
readonly GENDER_OVERRIDE: Gender | null = null; readonly GENDER_OVERRIDE: Gender | null = null;
@ -169,8 +169,8 @@ class DefaultOverrides {
*/ */
readonly OPP_FUSION_SPECIES_OVERRIDE: Species | number = 0; readonly OPP_FUSION_SPECIES_OVERRIDE: Species | number = 0;
readonly OPP_LEVEL_OVERRIDE: number = 0; readonly OPP_LEVEL_OVERRIDE: number = 0;
readonly OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly OPP_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly OPP_PASSIVE_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
readonly OPP_HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null; readonly OPP_HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null;
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
readonly OPP_GENDER_OVERRIDE: Gender | null = null; readonly OPP_GENDER_OVERRIDE: Gender | null = null;

View File

@ -6,7 +6,7 @@ import { TrappedTag } from "#app/data/battler-tags";
import type { MoveTargetSet } from "#app/data/moves/move"; import type { MoveTargetSet } from "#app/data/moves/move";
import { getMoveTargets } from "#app/data/moves/move"; import { getMoveTargets } from "#app/data/moves/move";
import { speciesStarterCosts } from "#app/data/balance/starters"; import { speciesStarterCosts } from "#app/data/balance/starters";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { BattlerTagType } from "#app/enums/battler-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Biome } from "#app/enums/biome"; import { Biome } from "#app/enums/biome";
import { Moves } from "#app/enums/moves"; import { Moves } from "#app/enums/moves";
@ -308,7 +308,7 @@ export class CommandPhase extends FieldPhase {
if ( if (
targetPokemon?.isBoss() && targetPokemon?.isBoss() &&
targetPokemon?.bossSegmentIndex >= 1 && targetPokemon?.bossSegmentIndex >= 1 &&
!targetPokemon?.hasAbility(Abilities.WONDER_GUARD, false, true) && !targetPokemon?.hasAbility(AbilityId.WONDER_GUARD, false, true) &&
cursor < PokeballType.MASTER_BALL cursor < PokeballType.MASTER_BALL
) { ) {
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex); globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);

View File

@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
/** /**
@ -38,7 +38,7 @@ export class EnemyCommandPhase extends FieldPhase {
if ( if (
battle.double && battle.double &&
enemyPokemon.hasAbility(Abilities.COMMANDER) && enemyPokemon.hasAbility(AbilityId.COMMANDER) &&
enemyPokemon.getAlly()?.getTag(BattlerTagType.COMMANDED) enemyPokemon.getAlly()?.getTag(BattlerTagType.COMMANDED)
) { ) {
this.skipTurn = true; this.skipTurn = true;

View File

@ -44,7 +44,7 @@ import { MoveChargePhase } from "#app/phases/move-charge-phase";
import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase";
import { MoveEndPhase } from "#app/phases/move-end-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase";
import { NumberHolder } from "#app/utils/common"; import { NumberHolder } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -486,7 +486,7 @@ export class MovePhase extends BattlePhase {
} }
/** /**
* Applies PP increasing abilities (currently only {@link Abilities.PRESSURE Pressure}) if they exist on the target pokemon. * Applies PP increasing abilities (currently only {@link AbilityId.PRESSURE Pressure}) if they exist on the target pokemon.
* Note that targets must include only active pokemon. * Note that targets must include only active pokemon.
* *
* TODO: This hardcodes the PP increase at 1 per opponent, rather than deferring to the ability. * TODO: This hardcodes the PP increase at 1 per opponent, rather than deferring to the ability.
@ -526,7 +526,7 @@ export class MovePhase extends BattlePhase {
if ( if (
redirectTag && redirectTag &&
(!redirectTag.powder || (!redirectTag.powder ||
(!this.pokemon.isOfType(PokemonType.GRASS) && !this.pokemon.hasAbility(Abilities.OVERCOAT))) (!this.pokemon.isOfType(PokemonType.GRASS) && !this.pokemon.hasAbility(AbilityId.OVERCOAT)))
) { ) {
redirectTarget.value = p.getBattlerIndex(); redirectTarget.value = p.getBattlerIndex();
redirectedByAbility = false; redirectedByAbility = false;
@ -594,8 +594,8 @@ export class MovePhase extends BattlePhase {
/** /**
* Handles the case where the move was cancelled or failed: * Handles the case where the move was cancelled or failed:
* - Uses PP if the move failed (not cancelled) and should use PP (failed moves are not affected by {@link Abilities.PRESSURE Pressure}) * - Uses PP if the move failed (not cancelled) and should use PP (failed moves are not affected by {@link AbilityId.PRESSURE Pressure})
* - Records a cancelled OR failed move in move history, so abilities like {@link Abilities.TRUANT Truant} don't trigger on the * - Records a cancelled OR failed move in move history, so abilities like {@link AbilityId.TRUANT Truant} don't trigger on the
* next turn and soft-lock. * next turn and soft-lock.
* - Lapses `MOVE_EFFECT` tags: * - Lapses `MOVE_EFFECT` tags:
* - Semi-invulnerable battler tags (Fly/Dive/etc.) are intended to lapse on move effects, but also need * - Semi-invulnerable battler tags (Fly/Dive/etc.) are intended to lapse on move effects, but also need

View File

@ -1,7 +1,7 @@
import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/abilities/ability"; import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/abilities/ability";
import { MoveHeaderAttr } from "#app/data/moves/move"; import { MoveHeaderAttr } from "#app/data/moves/move";
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { PokemonMove } from "#app/field/pokemon"; import { PokemonMove } from "#app/field/pokemon";
@ -228,7 +228,7 @@ export class TurnStartPhase extends FieldPhase {
? playerActivePokemon[0] ? playerActivePokemon[0]
: playerActivePokemon[1]; : playerActivePokemon[1];
// check if either active pokemon has the ability "Run Away" // check if either active pokemon has the ability "Run Away"
const hasRunAway = playerActivePokemon.find(p => p.hasAbility(Abilities.RUN_AWAY)); const hasRunAway = playerActivePokemon.find(p => p.hasAbility(AbilityId.RUN_AWAY));
runningPokemon = hasRunAway !== undefined ? hasRunAway : fasterPokemon; runningPokemon = hasRunAway !== undefined ? hasRunAway : fasterPokemon;
} }
} }

View File

@ -60,7 +60,7 @@ import type { BiomeTierTod } from "#app/data/balance/biomes";
import { BiomePoolTier, catchableSpecies } from "#app/data/balance/biomes"; import { BiomePoolTier, catchableSpecies } from "#app/data/balance/biomes";
import { Biome } from "#app/enums/biome"; import { Biome } from "#app/enums/biome";
import { TimeOfDay } from "#app/enums/time-of-day"; import { TimeOfDay } from "#app/enums/time-of-day";
import type { Abilities } from "#app/enums/abilities"; import type { AbilityId } from "#app/enums/abilities";
import { BaseStatsOverlay } from "#app/ui/base-stats-overlay"; import { BaseStatsOverlay } from "#app/ui/base-stats-overlay";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText";
@ -208,10 +208,10 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
private eggMoves: Moves[] = []; private eggMoves: Moves[] = [];
private hasEggMoves: boolean[] = []; private hasEggMoves: boolean[] = [];
private tmMoves: Moves[] = []; private tmMoves: Moves[] = [];
private ability1: Abilities; private ability1: AbilityId;
private ability2: Abilities | undefined; private ability2: AbilityId | undefined;
private abilityHidden: Abilities | undefined; private abilityHidden: AbilityId | undefined;
private passive: Abilities; private passive: AbilityId;
private hasPassive: boolean; private hasPassive: boolean;
private hasAbilities: number[]; private hasAbilities: number[];
private biomes: BiomeTierTod[]; private biomes: BiomeTierTod[];

View File

@ -26,7 +26,7 @@ import { PokedexMonContainer } from "#app/ui/pokedex-mon-container";
import { FilterBar } from "#app/ui/filter-bar"; import { FilterBar } from "#app/ui/filter-bar";
import { DropDownColumn } from "#enums/drop-down-column"; import { DropDownColumn } from "#enums/drop-down-column";
import { ScrollBar } from "#app/ui/scroll-bar"; import { ScrollBar } from "#app/ui/scroll-bar";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { import {
getPassiveCandyCount, getPassiveCandyCount,
getValueReductionCandyCounts, getValueReductionCandyCounts,
@ -1590,7 +1590,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
// HA Filter // HA Filter
const speciesHasHiddenAbility = const speciesHasHiddenAbility =
species.abilityHidden !== species.ability1 && species.abilityHidden !== Abilities.NONE; species.abilityHidden !== species.ability1 && species.abilityHidden !== AbilityId.NONE;
const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN; const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN;
const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => { const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) { if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) {

View File

@ -59,7 +59,7 @@ import { ScrollBar } from "#app/ui/scroll-bar";
import { SelectChallengePhase } from "#app/phases/select-challenge-phase"; import { SelectChallengePhase } from "#app/phases/select-challenge-phase";
import { EncounterPhase } from "#app/phases/encounter-phase"; import { EncounterPhase } from "#app/phases/encounter-phase";
import { TitlePhase } from "#app/phases/title-phase"; import { TitlePhase } from "#app/phases/title-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { import {
getPassiveCandyCount, getPassiveCandyCount,
getValueReductionCandyCounts, getValueReductionCandyCounts,
@ -3171,7 +3171,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
// HA Filter // HA Filter
const speciesHasHiddenAbility = const speciesHasHiddenAbility =
container.species.abilityHidden !== container.species.ability1 && container.species.abilityHidden !== container.species.ability1 &&
container.species.abilityHidden !== Abilities.NONE; container.species.abilityHidden !== AbilityId.NONE;
const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN; const hasHA = starterData.abilityAttr & AbilityAttr.ABILITY_HIDDEN;
const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => { const fitsHA = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) { if (misc.val === "HIDDEN_ABILITY" && misc.state === DropDownState.ON) {

View File

@ -1,5 +1,5 @@
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -25,13 +25,13 @@ describe("Ability Duplication", () => {
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.battleStyle("single") .battleStyle("single")
.ability(Abilities.HUGE_POWER) .ability(AbilityId.HUGE_POWER)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("huge power should only be applied once if both normal and passive", async () => { it("huge power should only be applied once if both normal and passive", async () => {
game.override.passiveAbility(Abilities.HUGE_POWER); game.override.passiveAbility(AbilityId.HUGE_POWER);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -44,7 +44,7 @@ describe("Ability Duplication", () => {
}); });
it("huge power should stack with pure power", async () => { it("huge power should stack with pure power", async () => {
game.override.passiveAbility(Abilities.PURE_POWER); game.override.passiveAbility(AbilityId.PURE_POWER);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);

View File

@ -3,7 +3,7 @@ import { CommandPhase } from "#app/phases/command-phase";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import i18next from "#app/plugins/i18n"; import i18next from "#app/plugins/i18n";
import { UiMode } from "#enums/ui-mode"; import { UiMode } from "#enums/ui-mode";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
@ -29,8 +29,8 @@ describe("Ability Timing", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.INTIMIDATE) .enemyAbility(AbilityId.INTIMIDATE)
.ability(Abilities.BALL_FETCH); .ability(AbilityId.BALL_FETCH);
vi.spyOn(i18next, "t"); vi.spyOn(i18next, "t");
}); });

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { isBetween, toDmgValue } from "#app/utils/common"; import { isBetween, toDmgValue } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -25,13 +25,13 @@ describe("Abilities - Analytic", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH, Moves.TACKLE]) .moveset([Moves.SPLASH, Moves.TACKLE])
.ability(Abilities.ANALYTIC) .ability(AbilityId.ANALYTIC)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.startingLevel(200) .startingLevel(200)
.enemyLevel(200) .enemyLevel(200)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -1,5 +1,5 @@
import { allAbilities } from "#app/data/data-lists"; import { allAbilities } from "#app/data/data-lists";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -24,9 +24,9 @@ describe("Abilities - Arena Trap", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset(Moves.SPLASH) .moveset(Moves.SPLASH)
.ability(Abilities.ARENA_TRAP) .ability(AbilityId.ARENA_TRAP)
.enemySpecies(Species.RALTS) .enemySpecies(Species.RALTS)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.TELEPORT); .enemyMoveset(Moves.TELEPORT);
}); });
@ -54,7 +54,7 @@ describe("Abilities - Arena Trap", () => {
}); });
/** /**
* This checks if the Player Pokemon is able to switch out/run away after the Enemy Pokemon with {@linkcode Abilities.ARENA_TRAP} * This checks if the Player Pokemon is able to switch out/run away after the Enemy Pokemon with {@linkcode AbilityId.ARENA_TRAP}
* is forcefully moved out of the field from moves such as Roar {@linkcode Moves.ROAR} * is forcefully moved out of the field from moves such as Roar {@linkcode Moves.ROAR}
* *
* Note: It should be able to switch out/run away * Note: It should be able to switch out/run away
@ -64,13 +64,13 @@ describe("Abilities - Arena Trap", () => {
.battleStyle("double") .battleStyle("double")
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.moveset([Moves.ROAR, Moves.SPLASH]) .moveset([Moves.ROAR, Moves.SPLASH])
.ability(Abilities.BALL_FETCH); .ability(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([Species.MAGIKARP, Species.SUDOWOODO, Species.LUNATONE]); await game.classicMode.startBattle([Species.MAGIKARP, Species.SUDOWOODO, Species.LUNATONE]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
const [player1, player2] = game.scene.getPlayerField(); const [player1, player2] = game.scene.getPlayerField();
vi.spyOn(enemy1, "getAbility").mockReturnValue(allAbilities[Abilities.ARENA_TRAP]); vi.spyOn(enemy1, "getAbility").mockReturnValue(allAbilities[AbilityId.ARENA_TRAP]);
game.move.select(Moves.ROAR); game.move.select(Moves.ROAR);
game.move.select(Moves.SPLASH, 1); game.move.select(Moves.SPLASH, 1);

View File

@ -1,6 +1,6 @@
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -26,10 +26,10 @@ describe("Moves - Aroma Veil", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("double") .battleStyle("double")
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.HEAL_BLOCK, Moves.IMPRISON, Moves.SPLASH]) .enemyMoveset([Moves.HEAL_BLOCK, Moves.IMPRISON, Moves.SPLASH])
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.ability(Abilities.AROMA_VEIL) .ability(AbilityId.AROMA_VEIL)
.moveset([Moves.GROWL]); .moveset([Moves.GROWL]);
}); });

View File

@ -1,5 +1,5 @@
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -28,7 +28,7 @@ describe("Abilities - Aura Break", () => {
.battleStyle("single") .battleStyle("single")
.moveset([Moves.MOONBLAST, Moves.DARK_PULSE]) .moveset([Moves.MOONBLAST, Moves.DARK_PULSE])
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemyAbility(Abilities.AURA_BREAK) .enemyAbility(AbilityId.AURA_BREAK)
.enemySpecies(Species.SHUCKLE); .enemySpecies(Species.SHUCKLE);
}); });
@ -36,7 +36,7 @@ describe("Abilities - Aura Break", () => {
const moveToCheck = allMoves[Moves.MOONBLAST]; const moveToCheck = allMoves[Moves.MOONBLAST];
const basePower = moveToCheck.power; const basePower = moveToCheck.power;
game.override.ability(Abilities.FAIRY_AURA); game.override.ability(AbilityId.FAIRY_AURA);
vi.spyOn(moveToCheck, "calculateBattlePower"); vi.spyOn(moveToCheck, "calculateBattlePower");
await game.classicMode.startBattle([Species.PIKACHU]); await game.classicMode.startBattle([Species.PIKACHU]);
@ -50,7 +50,7 @@ describe("Abilities - Aura Break", () => {
const moveToCheck = allMoves[Moves.DARK_PULSE]; const moveToCheck = allMoves[Moves.DARK_PULSE];
const basePower = moveToCheck.power; const basePower = moveToCheck.power;
game.override.ability(Abilities.DARK_AURA); game.override.ability(AbilityId.DARK_AURA);
vi.spyOn(moveToCheck, "calculateBattlePower"); vi.spyOn(moveToCheck, "calculateBattlePower");
await game.classicMode.startBattle([Species.PIKACHU]); await game.classicMode.startBattle([Species.PIKACHU]);
@ -64,7 +64,7 @@ describe("Abilities - Aura Break", () => {
const moveToCheck = allMoves[Moves.MOONBLAST]; const moveToCheck = allMoves[Moves.MOONBLAST];
const basePower = moveToCheck.power; const basePower = moveToCheck.power;
game.override.ability(Abilities.BALL_FETCH); game.override.ability(AbilityId.BALL_FETCH);
vi.spyOn(moveToCheck, "calculateBattlePower"); vi.spyOn(moveToCheck, "calculateBattlePower");
await game.classicMode.startBattle([Species.PIKACHU]); await game.classicMode.startBattle([Species.PIKACHU]);

View File

@ -1,5 +1,5 @@
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -28,7 +28,7 @@ describe("Abilities - Battery", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH);
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
game.override.enemyMoveset(Moves.SPLASH); game.override.enemyMoveset(Moves.SPLASH);
}); });

View File

@ -2,7 +2,7 @@ import { MultiHitAttr } from "#app/data/moves/move";
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { MultiHitType } from "#enums/MultiHitType"; import { MultiHitType } from "#enums/MultiHitType";
import { Status } from "#app/data/status-effect"; import { Status } from "#app/data/status-effect";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -31,7 +31,7 @@ describe("Abilities - BATTLE BOND", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.startingWave(4) // Leads to arena reset on Wave 5 trainer battle .startingWave(4) // Leads to arena reset on Wave 5 trainer battle
.ability(Abilities.BATTLE_BOND) .ability(AbilityId.BATTLE_BOND)
.starterForms({ [Species.GRENINJA]: ashForm }) .starterForms({ [Species.GRENINJA]: ashForm })
.moveset([Moves.SPLASH, Moves.WATER_SHURIKEN]) .moveset([Moves.SPLASH, Moves.WATER_SHURIKEN])
.enemySpecies(Species.BULBASAUR) .enemySpecies(Species.BULBASAUR)

View File

@ -1,5 +1,5 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
@ -26,8 +26,8 @@ describe("Abilities - Beast Boost", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.BULBASAUR) .enemySpecies(Species.BULBASAUR)
.enemyAbility(Abilities.BEAST_BOOST) .enemyAbility(AbilityId.BEAST_BOOST)
.ability(Abilities.BEAST_BOOST) .ability(AbilityId.BEAST_BOOST)
.startingLevel(2000) .startingLevel(2000)
.moveset([Moves.FLAMETHROWER]) .moveset([Moves.FLAMETHROWER])
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);

View File

@ -6,7 +6,7 @@ import { Stat } from "#enums/stat";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import { WeatherType } from "#enums/weather-type"; import { WeatherType } from "#enums/weather-type";
import { MoveResult } from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -33,11 +33,11 @@ describe("Abilities - Commander", () => {
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.LIQUIDATION, Moves.MEMENTO, Moves.SPLASH, Moves.FLIP_TURN]) .moveset([Moves.LIQUIDATION, Moves.MEMENTO, Moves.SPLASH, Moves.FLIP_TURN])
.ability(Abilities.COMMANDER) .ability(AbilityId.COMMANDER)
.battleStyle("double") .battleStyle("double")
.disableCrits() .disableCrits()
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.TACKLE); .enemyMoveset(Moves.TACKLE);
vi.spyOn(game.scene, "triggerPokemonBattleAnim").mockReturnValue(true); vi.spyOn(game.scene, "triggerPokemonBattleAnim").mockReturnValue(true);

View File

@ -1,6 +1,6 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -30,7 +30,7 @@ describe("Abilities - Competitive", () => {
.enemyMoveset(Moves.TICKLE) .enemyMoveset(Moves.TICKLE)
.startingLevel(1) .startingLevel(1)
.moveset([Moves.SPLASH, Moves.CLOSE_COMBAT]) .moveset([Moves.SPLASH, Moves.CLOSE_COMBAT])
.ability(Abilities.COMPETITIVE); .ability(AbilityId.COMPETITIVE);
}); });
it("lower atk and def by 1 via tickle, then increase spatk by 4 via competitive", async () => { it("lower atk and def by 1 via tickle, then increase spatk by 4 via competitive", async () => {

View File

@ -1,5 +1,5 @@
import { Moves } from "#app/enums/moves"; import { Moves } from "#app/enums/moves";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -25,8 +25,8 @@ describe("Abilities - Contrary", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.BULBASAUR) .enemySpecies(Species.BULBASAUR)
.enemyAbility(Abilities.CONTRARY) .enemyAbility(AbilityId.CONTRARY)
.ability(Abilities.INTIMIDATE) .ability(AbilityId.INTIMIDATE)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -40,7 +40,7 @@ describe("Abilities - Contrary", () => {
describe("With Clear Body", () => { describe("With Clear Body", () => {
it("should apply positive effects", async () => { it("should apply positive effects", async () => {
game.override.enemyPassiveAbility(Abilities.CLEAR_BODY).moveset([Moves.TAIL_WHIP]); game.override.enemyPassiveAbility(AbilityId.CLEAR_BODY).moveset([Moves.TAIL_WHIP]);
await game.classicMode.startBattle([Species.SLOWBRO]); await game.classicMode.startBattle([Species.SLOWBRO]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -54,7 +54,7 @@ describe("Abilities - Contrary", () => {
}); });
it("should block negative effects", async () => { it("should block negative effects", async () => {
game.override.enemyPassiveAbility(Abilities.CLEAR_BODY).enemyMoveset(Moves.HOWL).moveset([Moves.SPLASH]); game.override.enemyPassiveAbility(AbilityId.CLEAR_BODY).enemyMoveset(Moves.HOWL).moveset([Moves.SPLASH]);
await game.classicMode.startBattle([Species.SLOWBRO]); await game.classicMode.startBattle([Species.SLOWBRO]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -26,12 +26,12 @@ describe("Abilities - Corrosion", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.GRIMER) .enemySpecies(Species.GRIMER)
.enemyAbility(Abilities.CORROSION) .enemyAbility(AbilityId.CORROSION)
.enemyMoveset(Moves.TOXIC); .enemyMoveset(Moves.TOXIC);
}); });
it("If a Poison- or Steel-type Pokémon with this Ability poisons a target with Synchronize, Synchronize does not gain the ability to poison Poison- or Steel-type Pokémon.", async () => { it("If a Poison- or Steel-type Pokémon with this Ability poisons a target with Synchronize, Synchronize does not gain the ability to poison Poison- or Steel-type Pokémon.", async () => {
game.override.ability(Abilities.SYNCHRONIZE); game.override.ability(AbilityId.SYNCHRONIZE);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
const playerPokemon = game.scene.getPlayerPokemon(); const playerPokemon = game.scene.getPlayerPokemon();

View File

@ -1,5 +1,5 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { Moves } from "#app/enums/moves"; import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species"; import { Species } from "#app/enums/species";
import { CommandPhase } from "#app/phases/command-phase"; import { CommandPhase } from "#app/phases/command-phase";
@ -25,13 +25,13 @@ describe("Abilities - COSTAR", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.ability(Abilities.COSTAR); game.override.ability(AbilityId.COSTAR);
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]); game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
game.override.enemyMoveset(Moves.SPLASH); game.override.enemyMoveset(Moves.SPLASH);
}); });
test("ability copies positive stat stages", async () => { test("ability copies positive stat stages", async () => {
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
@ -56,7 +56,7 @@ describe("Abilities - COSTAR", () => {
}); });
test("ability copies negative stat stages", async () => { test("ability copies negative stat stages", async () => {
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);

View File

@ -2,7 +2,7 @@ import { RepeatBerryNextTurnAbAttr } from "#app/data/abilities/ability";
import Pokemon from "#app/field/pokemon"; import Pokemon from "#app/field/pokemon";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -31,11 +31,11 @@ describe("Abilities - Cud Chew", () => {
game.override game.override
.moveset([Moves.BUG_BITE, Moves.SPLASH, Moves.HYPER_VOICE, Moves.STUFF_CHEEKS]) .moveset([Moves.BUG_BITE, Moves.SPLASH, Moves.HYPER_VOICE, Moves.STUFF_CHEEKS])
.startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS, count: 1 }]) .startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS, count: 1 }])
.ability(Abilities.CUD_CHEW) .ability(AbilityId.CUD_CHEW)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -174,7 +174,7 @@ describe("Abilities - Cud Chew", () => {
}); });
it("clears array if disabled", async () => { it("clears array if disabled", async () => {
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS); game.override.enemyAbility(AbilityId.NEUTRALIZING_GAS);
await game.classicMode.startBattle([Species.FARIGIRAF]); await game.classicMode.startBattle([Species.FARIGIRAF]);
const farigiraf = game.scene.getPlayerPokemon()!; const farigiraf = game.scene.getPlayerPokemon()!;
@ -222,7 +222,7 @@ describe("Abilities - Cud Chew", () => {
}); });
it("bypasses unnerve", async () => { it("bypasses unnerve", async () => {
game.override.enemyAbility(Abilities.UNNERVE); game.override.enemyAbility(AbilityId.UNNERVE);
await game.classicMode.startBattle([Species.FARIGIRAF]); await game.classicMode.startBattle([Species.FARIGIRAF]);
const farigiraf = game.scene.getPlayerPokemon()!; const farigiraf = game.scene.getPlayerPokemon()!;
@ -275,7 +275,7 @@ describe("Abilities - Cud Chew", () => {
}); });
it("works with Ripen", async () => { it("works with Ripen", async () => {
game.override.passiveAbility(Abilities.RIPEN); game.override.passiveAbility(AbilityId.RIPEN);
await game.classicMode.startBattle([Species.FARIGIRAF]); await game.classicMode.startBattle([Species.FARIGIRAF]);
const farigiraf = game.scene.getPlayerPokemon()!; const farigiraf = game.scene.getPlayerPokemon()!;

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import type { MovePhase } from "#app/phases/move-phase"; import type { MovePhase } from "#app/phases/move-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -29,7 +29,7 @@ describe("Abilities - Dancer", () => {
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability) // Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability)
it("triggers when dance moves are used, doesn't consume extra PP", async () => { it("triggers when dance moves are used, doesn't consume extra PP", async () => {
game.override.enemyAbility(Abilities.DANCER).enemySpecies(Species.MAGIKARP).enemyMoveset(Moves.VICTORY_DANCE); game.override.enemyAbility(AbilityId.DANCER).enemySpecies(Species.MAGIKARP).enemyMoveset(Moves.VICTORY_DANCE);
await game.classicMode.startBattle([Species.ORICORIO, Species.FEEBAS]); await game.classicMode.startBattle([Species.ORICORIO, Species.FEEBAS]);
const [oricorio, feebas] = game.scene.getPlayerField(); const [oricorio, feebas] = game.scene.getPlayerField();

View File

@ -1,6 +1,6 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -30,7 +30,7 @@ describe("Abilities - Defiant", () => {
.enemyMoveset(Moves.TICKLE) .enemyMoveset(Moves.TICKLE)
.startingLevel(1) .startingLevel(1)
.moveset([Moves.SPLASH, Moves.CLOSE_COMBAT]) .moveset([Moves.SPLASH, Moves.CLOSE_COMBAT])
.ability(Abilities.DEFIANT); .ability(AbilityId.DEFIANT);
}); });
it("lower atk and def by 1 via tickle, then increase atk by 4 via defiant", async () => { it("lower atk and def by 1 via tickle, then increase atk by 4 via defiant", async () => {

View File

@ -2,7 +2,7 @@ import { PokeballType } from "#app/enums/pokeball";
import { WeatherType } from "#app/enums/weather-type"; import { WeatherType } from "#app/enums/weather-type";
import type { CommandPhase } from "#app/phases/command-phase"; import type { CommandPhase } from "#app/phases/command-phase";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -29,12 +29,12 @@ describe("Abilities - Desolate Land", () => {
.moveset(Moves.SPLASH) .moveset(Moves.SPLASH)
.hasPassiveAbility(true) .hasPassiveAbility(true)
.enemySpecies(Species.RALTS) .enemySpecies(Species.RALTS)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
/** /**
* This checks that the weather has changed after the Enemy Pokemon with {@linkcode Abilities.DESOLATE_LAND} * This checks that the weather has changed after the Enemy Pokemon with {@linkcode AbilityId.DESOLATE_LAND}
* is forcefully moved out of the field from moves such as Roar {@linkcode Moves.ROAR} * is forcefully moved out of the field from moves such as Roar {@linkcode Moves.ROAR}
*/ */
it("should lift only when all pokemon with this ability leave the field", async () => { it("should lift only when all pokemon with this ability leave the field", async () => {
@ -78,7 +78,7 @@ describe("Abilities - Desolate Land", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.moveset([Moves.SHEER_COLD]) .moveset([Moves.SHEER_COLD])
.ability(Abilities.NO_GUARD) .ability(AbilityId.NO_GUARD)
.startingLevel(100) .startingLevel(100)
.enemyLevel(1) .enemyLevel(1)
.enemyMoveset([Moves.SPLASH]) .enemyMoveset([Moves.SPLASH])
@ -135,7 +135,7 @@ describe("Abilities - Desolate Land", () => {
}); });
it("should lift after fleeing from a wild pokemon", async () => { it("should lift after fleeing from a wild pokemon", async () => {
game.override.enemyAbility(Abilities.DESOLATE_LAND).ability(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.DESOLATE_LAND).ability(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN); expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
@ -206,7 +206,7 @@ describe("Abilities - Disguise", () => {
}); });
it("activates when Aerilate circumvents immunity to the move's base type", async () => { it("activates when Aerilate circumvents immunity to the move's base type", async () => {
game.override.ability(Abilities.AERILATE); game.override.ability(AbilityId.AERILATE);
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -1,5 +1,5 @@
import { Species } from "#app/enums/species"; import { Species } from "#app/enums/species";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
@ -24,10 +24,10 @@ describe("Abilities - Dry Skin", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemyAbility(Abilities.DRY_SKIN) .enemyAbility(AbilityId.DRY_SKIN)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemySpecies(Species.CHARMANDER) .enemySpecies(Species.CHARMANDER)
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.moveset([Moves.SUNNY_DAY, Moves.RAIN_DANCE, Moves.SPLASH, Moves.WATER_GUN]) .moveset([Moves.SUNNY_DAY, Moves.RAIN_DANCE, Moves.SPLASH, Moves.WATER_GUN])
.starterSpecies(Species.CHANDELURE); .starterSpecies(Species.CHANDELURE);
}); });
@ -82,7 +82,7 @@ describe("Abilities - Dry Skin", () => {
const fireDamageTakenWithDrySkin = initialHP - enemy.hp; const fireDamageTakenWithDrySkin = initialHP - enemy.hp;
enemy.hp = initialHP; enemy.hp = initialHP;
game.override.enemyAbility(Abilities.NONE); game.override.enemyAbility(AbilityId.NONE);
// second turn // second turn
game.move.select(Moves.FLAMETHROWER); game.move.select(Moves.FLAMETHROWER);

View File

@ -1,6 +1,6 @@
import { Status } from "#app/data/status-effect"; import { Status } from "#app/data/status-effect";
import { MoveResult } from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -26,11 +26,11 @@ describe("Abilities - Early Bird", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.REST, Moves.BELLY_DRUM, Moves.SPLASH]) .moveset([Moves.REST, Moves.BELLY_DRUM, Moves.SPLASH])
.ability(Abilities.EARLY_BIRD) .ability(AbilityId.EARLY_BIRD)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -3,7 +3,7 @@ import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Species } from "#app/enums/species"; import { Species } from "#app/enums/species";
import { MovePhase } from "#app/phases/move-phase"; import { MovePhase } from "#app/phases/move-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -28,8 +28,8 @@ describe("Abilities - Flash Fire", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.ability(Abilities.FLASH_FIRE) .ability(AbilityId.FLASH_FIRE)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(20) .startingLevel(20)
.enemyLevel(20) .enemyLevel(20)
.disableCrits(); .disableCrits();
@ -103,7 +103,7 @@ describe("Abilities - Flash Fire", () => {
it("boosts Fire-type move when the ability is activated", async () => { it("boosts Fire-type move when the ability is activated", async () => {
game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]); game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]);
game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE); game.override.enemyAbility(AbilityId.FLASH_FIRE).ability(AbilityId.NONE);
await game.classicMode.startBattle([Species.BLISSEY]); await game.classicMode.startBattle([Species.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!; const blissey = game.scene.getPlayerPokemon()!;
const initialHP = 1000; const initialHP = 1000;
@ -128,7 +128,7 @@ describe("Abilities - Flash Fire", () => {
it("still activates regardless of accuracy check", async () => { it("still activates regardless of accuracy check", async () => {
game.override.moveset(Moves.FIRE_PLEDGE).enemyMoveset(Moves.EMBER); game.override.moveset(Moves.FIRE_PLEDGE).enemyMoveset(Moves.EMBER);
game.override.enemyAbility(Abilities.NONE).ability(Abilities.FLASH_FIRE); game.override.enemyAbility(AbilityId.NONE).ability(AbilityId.FLASH_FIRE);
game.override.enemySpecies(Species.BLISSEY); game.override.enemySpecies(Species.BLISSEY);
await game.classicMode.startBattle([Species.RATTATA]); await game.classicMode.startBattle([Species.RATTATA]);

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { allAbilities } from "#app/data/data-lists"; import { allAbilities } from "#app/data/data-lists";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { WeatherType } from "#app/enums/weather-type"; import { WeatherType } from "#app/enums/weather-type";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
@ -19,9 +19,9 @@ describe("Abilities - Flower Gift", () => {
/** /**
* Tests reverting to normal form when Cloud Nine/Air Lock is active on the field * Tests reverting to normal form when Cloud Nine/Air Lock is active on the field
* @param {GameManager} game The game manager instance * @param {GameManager} game The game manager instance
* @param {Abilities} ability The ability that is active on the field * @param {AbilityId} ability The ability that is active on the field
*/ */
const testRevertFormAgainstAbility = async (game: GameManager, ability: Abilities) => { const testRevertFormAgainstAbility = async (game: GameManager, ability: AbilityId) => {
game.override.starterForms({ [Species.CASTFORM]: SUNSHINE_FORM }).enemyAbility(ability); game.override.starterForms({ [Species.CASTFORM]: SUNSHINE_FORM }).enemyAbility(ability);
await game.classicMode.startBattle([Species.CASTFORM]); await game.classicMode.startBattle([Species.CASTFORM]);
@ -44,8 +44,8 @@ describe("Abilities - Flower Gift", () => {
game: GameManager, game: GameManager,
move: Moves, move: Moves,
allyAttacker: boolean, allyAttacker: boolean,
allyAbility = Abilities.BALL_FETCH, allyAbility = AbilityId.BALL_FETCH,
enemyAbility = Abilities.BALL_FETCH, enemyAbility = AbilityId.BALL_FETCH,
): Promise<[number, number]> => { ): Promise<[number, number]> => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]); game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]);
@ -104,7 +104,7 @@ describe("Abilities - Flower Gift", () => {
.moveset([Moves.SPLASH, Moves.SUNSTEEL_STRIKE, Moves.SUNNY_DAY, Moves.MUD_SLAP]) .moveset([Moves.SPLASH, Moves.SUNSTEEL_STRIKE, Moves.SUNNY_DAY, Moves.MUD_SLAP])
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyLevel(100) .enemyLevel(100)
.startingLevel(100); .startingLevel(100);
}); });
@ -139,7 +139,7 @@ describe("Abilities - Flower Gift", () => {
}); });
it("should not increase the damage of a mold breaker ally", async () => { it("should not increase the damage of a mold breaker ally", async () => {
const [damageWithGift, damageWithoutGift] = await testDamageDealt(game, Moves.TACKLE, true, Abilities.MOLD_BREAKER); const [damageWithGift, damageWithoutGift] = await testDamageDealt(game, Moves.TACKLE, true, AbilityId.MOLD_BREAKER);
expect(damageWithGift).toBe(damageWithoutGift); expect(damageWithGift).toBe(damageWithoutGift);
}); });
@ -153,8 +153,8 @@ describe("Abilities - Flower Gift", () => {
game, game,
Moves.MUD_SLAP, Moves.MUD_SLAP,
false, false,
Abilities.BALL_FETCH, AbilityId.BALL_FETCH,
Abilities.MOLD_BREAKER, AbilityId.MOLD_BREAKER,
); );
expect(damageWithGift).toBe(damageWithoutGift); expect(damageWithGift).toBe(damageWithoutGift);
}); });
@ -170,11 +170,11 @@ describe("Abilities - Flower Gift", () => {
}); });
it("reverts to Overcast Form if a Pokémon on the field has Air Lock", async () => { it("reverts to Overcast Form if a Pokémon on the field has Air Lock", async () => {
await testRevertFormAgainstAbility(game, Abilities.AIR_LOCK); await testRevertFormAgainstAbility(game, AbilityId.AIR_LOCK);
}); });
it("reverts to Overcast Form if a Pokémon on the field has Cloud Nine", async () => { it("reverts to Overcast Form if a Pokémon on the field has Cloud Nine", async () => {
await testRevertFormAgainstAbility(game, Abilities.CLOUD_NINE); await testRevertFormAgainstAbility(game, AbilityId.CLOUD_NINE);
}); });
it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => { it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => {

View File

@ -1,5 +1,5 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
@ -30,11 +30,11 @@ describe("Abilities - Flower Veil", () => {
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.enemySpecies(Species.BULBASAUR) .enemySpecies(Species.BULBASAUR)
.ability(Abilities.FLOWER_VEIL) .ability(AbilityId.FLOWER_VEIL)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -68,7 +68,7 @@ describe("Abilities - Flower Veil", () => {
// Clear the ability of the ally to isolate the test // Clear the ability of the ally to isolate the test
const ally = game.scene.getPlayerField()[1]!; const ally = game.scene.getPlayerField()[1]!;
vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]); vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[AbilityId.BALL_FETCH]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.move.selectEnemyMove(Moves.YAWN, BattlerIndex.PLAYER); await game.move.selectEnemyMove(Moves.YAWN, BattlerIndex.PLAYER);
@ -98,7 +98,7 @@ describe("Abilities - Flower Veil", () => {
const [user, ally] = game.scene.getPlayerField(); const [user, ally] = game.scene.getPlayerField();
vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
// Clear the ally ability to isolate the test // Clear the ally ability to isolate the test
vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]); vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[AbilityId.BALL_FETCH]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.move.selectEnemyMove(Moves.THUNDER_WAVE, BattlerIndex.PLAYER); await game.move.selectEnemyMove(Moves.THUNDER_WAVE, BattlerIndex.PLAYER);
@ -117,7 +117,7 @@ describe("Abilities - Flower Veil", () => {
await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]);
const [user, ally] = game.scene.getPlayerField(); const [user, ally] = game.scene.getPlayerField();
// Clear the ally ability to isolate the test // Clear the ally ability to isolate the test
vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]); vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[AbilityId.BALL_FETCH]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -130,7 +130,7 @@ describe("Abilities - Flower Veil", () => {
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
const [user, ally] = game.scene.getPlayerField(); const [user, ally] = game.scene.getPlayerField();
// Clear the ally ability to isolate the test // Clear the ally ability to isolate the test
vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]); vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[AbilityId.BALL_FETCH]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -143,7 +143,7 @@ describe("Abilities - Flower Veil", () => {
await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]);
const [user, ally] = game.scene.getPlayerField(); const [user, ally] = game.scene.getPlayerField();
// Clear the ally ability to isolate the test // Clear the ally ability to isolate the test
vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]); vi.spyOn(ally, "getAbility").mockReturnValue(allAbilities[AbilityId.BALL_FETCH]);
game.move.select(Moves.CLOSE_COMBAT, 0, BattlerIndex.ENEMY); game.move.select(Moves.CLOSE_COMBAT, 0, BattlerIndex.ENEMY);
game.move.select(Moves.CLOSE_COMBAT, 1, BattlerIndex.ENEMY_2); game.move.select(Moves.CLOSE_COMBAT, 1, BattlerIndex.ENEMY_2);

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { allAbilities } from "#app/data/data-lists"; import { allAbilities } from "#app/data/data-lists";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { WeatherType } from "#app/enums/weather-type"; import { WeatherType } from "#app/enums/weather-type";
import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase";
import { MovePhase } from "#app/phases/move-phase"; import { MovePhase } from "#app/phases/move-phase";
@ -40,9 +40,9 @@ describe("Abilities - Forecast", () => {
/** /**
* Tests reverting to normal form when Cloud Nine/Air Lock is active on the field * Tests reverting to normal form when Cloud Nine/Air Lock is active on the field
* @param {GameManager} game The game manager instance * @param {GameManager} game The game manager instance
* @param {Abilities} ability The ability that is active on the field * @param {AbilityId} ability The ability that is active on the field
*/ */
const testRevertFormAgainstAbility = async (game: GameManager, ability: Abilities) => { const testRevertFormAgainstAbility = async (game: GameManager, ability: AbilityId) => {
game.override.starterForms({ [Species.CASTFORM]: SUNNY_FORM }).enemyAbility(ability); game.override.starterForms({ [Species.CASTFORM]: SUNNY_FORM }).enemyAbility(ability);
await game.classicMode.startBattle([Species.CASTFORM]); await game.classicMode.startBattle([Species.CASTFORM]);
@ -67,7 +67,7 @@ describe("Abilities - Forecast", () => {
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE]) .moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE])
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemyAbility(Abilities.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH);
}); });
it( it(
@ -90,7 +90,7 @@ describe("Abilities - Forecast", () => {
Species.ALTARIA, Species.ALTARIA,
]); ]);
vi.spyOn(game.scene.getPlayerParty()[5], "getAbility").mockReturnValue(allAbilities[Abilities.CLOUD_NINE]); vi.spyOn(game.scene.getPlayerParty()[5], "getAbility").mockReturnValue(allAbilities[AbilityId.CLOUD_NINE]);
const castform = game.scene.getPlayerField()[0]; const castform = game.scene.getPlayerField()[0];
expect(castform.formIndex).toBe(NORMAL_FORM); expect(castform.formIndex).toBe(NORMAL_FORM);
@ -196,11 +196,11 @@ describe("Abilities - Forecast", () => {
}); });
it("reverts to Normal Form if a Pokémon on the field has Air Lock", async () => { it("reverts to Normal Form if a Pokémon on the field has Air Lock", async () => {
await testRevertFormAgainstAbility(game, Abilities.AIR_LOCK); await testRevertFormAgainstAbility(game, AbilityId.AIR_LOCK);
}); });
it("has no effect on Pokémon other than Castform", async () => { it("has no effect on Pokémon other than Castform", async () => {
game.override.enemyAbility(Abilities.FORECAST).enemySpecies(Species.SHUCKLE); game.override.enemyAbility(AbilityId.FORECAST).enemySpecies(Species.SHUCKLE);
await game.classicMode.startBattle([Species.CASTFORM]); await game.classicMode.startBattle([Species.CASTFORM]);
game.move.select(Moves.RAIN_DANCE); game.move.select(Moves.RAIN_DANCE);

View File

@ -1,6 +1,6 @@
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
@ -27,7 +27,7 @@ describe("Moves - Friend Guard", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("double") .battleStyle("double")
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.TACKLE, Moves.SPLASH, Moves.DRAGON_RAGE]) .enemyMoveset([Moves.TACKLE, Moves.SPLASH, Moves.DRAGON_RAGE])
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
@ -56,7 +56,7 @@ describe("Moves - Friend Guard", () => {
), ),
); );
vi.spyOn(player2, "getAbility").mockReturnValue(allAbilities[Abilities.FRIEND_GUARD]); vi.spyOn(player2, "getAbility").mockReturnValue(allAbilities[AbilityId.FRIEND_GUARD]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH, 1); game.move.select(Moves.SPLASH, 1);
@ -89,7 +89,7 @@ describe("Moves - Friend Guard", () => {
const turn1Damage = spy.mock.results[spy.mock.results.length - 1].value.damage; const turn1Damage = spy.mock.results[spy.mock.results.length - 1].value.damage;
vi.spyOn(player2, "getAbility").mockReturnValue(allAbilities[Abilities.FRIEND_GUARD]); vi.spyOn(player2, "getAbility").mockReturnValue(allAbilities[AbilityId.FRIEND_GUARD]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH, 1); game.move.select(Moves.SPLASH, 1);
@ -116,7 +116,7 @@ describe("Moves - Friend Guard", () => {
const turn1Damage = spy.mock.results[spy.mock.results.length - 1].value.damage; const turn1Damage = spy.mock.results[spy.mock.results.length - 1].value.damage;
expect(turn1Damage).toBe(40); expect(turn1Damage).toBe(40);
vi.spyOn(player2, "getAbility").mockReturnValue(allAbilities[Abilities.FRIEND_GUARD]); vi.spyOn(player2, "getAbility").mockReturnValue(allAbilities[AbilityId.FRIEND_GUARD]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH, 1); game.move.select(Moves.SPLASH, 1);

View File

@ -6,7 +6,7 @@ import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { StatusEffect } from "#app/enums/status-effect"; import { StatusEffect } from "#app/enums/status-effect";
import { WeatherType } from "#app/enums/weather-type"; import { WeatherType } from "#app/enums/weather-type";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -31,11 +31,11 @@ describe("Abilities - Good As Gold", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.GOOD_AS_GOLD) .ability(AbilityId.GOOD_AS_GOLD)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -49,7 +49,7 @@ describe("Abilities - Good As Gold", () => {
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(player.waveData.abilitiesApplied).toContain(Abilities.GOOD_AS_GOLD); expect(player.waveData.abilitiesApplied).toContain(AbilityId.GOOD_AS_GOLD);
expect(player.getStatStage(Stat.ATK)).toBe(0); expect(player.getStatStage(Stat.ATK)).toBe(0);
}); });
@ -70,7 +70,7 @@ describe("Abilities - Good As Gold", () => {
const [good_as_gold, ball_fetch] = game.scene.getPlayerField(); const [good_as_gold, ball_fetch] = game.scene.getPlayerField();
// Force second pokemon to have ball fetch to isolate to a single mon. // Force second pokemon to have ball fetch to isolate to a single mon.
vi.spyOn(ball_fetch, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]); vi.spyOn(ball_fetch, "getAbility").mockReturnValue(allAbilities[AbilityId.BALL_FETCH]);
game.move.select(Moves.SWORDS_DANCE, 0); game.move.select(Moves.SWORDS_DANCE, 0);
game.move.select(Moves.SAFEGUARD, 1); game.move.select(Moves.SAFEGUARD, 1);
@ -78,7 +78,7 @@ describe("Abilities - Good As Gold", () => {
await game.move.selectEnemyMove(Moves.HAZE); await game.move.selectEnemyMove(Moves.HAZE);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(good_as_gold.getAbility().id).toBe(Abilities.GOOD_AS_GOLD); expect(good_as_gold.getAbility().id).toBe(AbilityId.GOOD_AS_GOLD);
expect(good_as_gold.getStatStage(Stat.ATK)).toBe(0); expect(good_as_gold.getStatStage(Stat.ATK)).toBe(0);
expect(game.scene.arena.getTagOnSide(ArenaTagType.STEALTH_ROCK, ArenaTagSide.PLAYER)).toBeDefined(); expect(game.scene.arena.getTagOnSide(ArenaTagType.STEALTH_ROCK, ArenaTagSide.PLAYER)).toBeDefined();
expect(game.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, ArenaTagSide.PLAYER)).toBeDefined(); expect(game.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, ArenaTagSide.PLAYER)).toBeDefined();
@ -112,9 +112,9 @@ describe("Abilities - Good As Gold", () => {
game.override.battleStyle("double").statusEffect(StatusEffect.BURN); game.override.battleStyle("double").statusEffect(StatusEffect.BURN);
await game.classicMode.startBattle([Species.MILOTIC, Species.FEEBAS, Species.ABRA]); await game.classicMode.startBattle([Species.MILOTIC, Species.FEEBAS, Species.ABRA]);
const [milotic, feebas, abra] = game.scene.getPlayerParty(); const [milotic, feebas, abra] = game.scene.getPlayerParty();
game.field.mockAbility(milotic, Abilities.GOOD_AS_GOLD); game.field.mockAbility(milotic, AbilityId.GOOD_AS_GOLD);
game.field.mockAbility(feebas, Abilities.BALL_FETCH); game.field.mockAbility(feebas, AbilityId.BALL_FETCH);
game.field.mockAbility(abra, Abilities.BALL_FETCH); game.field.mockAbility(abra, AbilityId.BALL_FETCH);
// turn 1 // turn 1
game.move.use(Moves.SPLASH, 0); game.move.use(Moves.SPLASH, 0);

View File

@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle";
import { Moves } from "#app/enums/moves"; import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species"; import { Species } from "#app/enums/species";
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -24,12 +24,12 @@ describe("Abilities - Gorilla Tactics", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.SPLASH, Moves.DISABLE]) .enemyMoveset([Moves.SPLASH, Moves.DISABLE])
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyLevel(30) .enemyLevel(30)
.moveset([Moves.SPLASH, Moves.TACKLE, Moves.GROWL]) .moveset([Moves.SPLASH, Moves.TACKLE, Moves.GROWL])
.ability(Abilities.GORILLA_TACTICS); .ability(AbilityId.GORILLA_TACTICS);
}); });
it("boosts the Pokémon's Attack by 50%, but limits the Pokémon to using only one move", async () => { it("boosts the Pokémon's Attack by 50%, but limits the Pokémon to using only one move", async () => {

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -45,7 +45,7 @@ describe("Abilities - Gulp Missile", () => {
.battleStyle("single") .battleStyle("single")
.moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH, Moves.SUBSTITUTE]) .moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH, Moves.SUBSTITUTE])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemyLevel(5); .enemyLevel(5);
}); });
@ -198,7 +198,7 @@ describe("Abilities - Gulp Missile", () => {
}); });
it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => { it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => {
game.override.enemyMoveset(Moves.TACKLE).enemyAbility(Abilities.MAGIC_GUARD); game.override.enemyMoveset(Moves.TACKLE).enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([Species.CRAMORANT]); await game.classicMode.startBattle([Species.CRAMORANT]);
const cramorant = game.scene.getPlayerPokemon()!; const cramorant = game.scene.getPlayerPokemon()!;
@ -237,7 +237,7 @@ describe("Abilities - Gulp Missile", () => {
}); });
it("doesn't trigger if user is behind a substitute", async () => { it("doesn't trigger if user is behind a substitute", async () => {
game.override.enemyAbility(Abilities.STURDY).enemyMoveset([Moves.SPLASH, Moves.POWER_TRIP]); game.override.enemyAbility(AbilityId.STURDY).enemyMoveset([Moves.SPLASH, Moves.POWER_TRIP]);
await game.classicMode.startBattle([Species.CRAMORANT]); await game.classicMode.startBattle([Species.CRAMORANT]);
game.move.select(Moves.SURF); game.move.select(Moves.SURF);
@ -269,7 +269,7 @@ describe("Abilities - Gulp Missile", () => {
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
expect(cramorant.hasAbility(Abilities.GULP_MISSILE)).toBe(true); expect(cramorant.hasAbility(AbilityId.GULP_MISSILE)).toBe(true);
expect(cramorant.getTag(BattlerTagType.GULP_MISSILE_ARROKUDA)).toBeDefined(); expect(cramorant.getTag(BattlerTagType.GULP_MISSILE_ARROKUDA)).toBeDefined();
expect(cramorant.formIndex).toBe(GULPING_FORM); expect(cramorant.formIndex).toBe(GULPING_FORM);
}); });
@ -289,18 +289,18 @@ describe("Abilities - Gulp Missile", () => {
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
expect(cramorant.hasAbility(Abilities.GULP_MISSILE)).toBe(true); expect(cramorant.hasAbility(AbilityId.GULP_MISSILE)).toBe(true);
expect(cramorant.getTag(BattlerTagType.GULP_MISSILE_ARROKUDA)).toBeDefined(); expect(cramorant.getTag(BattlerTagType.GULP_MISSILE_ARROKUDA)).toBeDefined();
expect(cramorant.formIndex).toBe(GULPING_FORM); expect(cramorant.formIndex).toBe(GULPING_FORM);
}); });
it("cannot be copied", async () => { it("cannot be copied", async () => {
game.override.enemyAbility(Abilities.TRACE); game.override.enemyAbility(AbilityId.TRACE);
await game.classicMode.startBattle([Species.CRAMORANT]); await game.classicMode.startBattle([Species.CRAMORANT]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("TurnStartPhase"); await game.phaseInterceptor.to("TurnStartPhase");
expect(game.scene.getEnemyPokemon()?.hasAbility(Abilities.GULP_MISSILE)).toBe(false); expect(game.scene.getEnemyPokemon()?.hasAbility(AbilityId.GULP_MISSILE)).toBe(false);
}); });
}); });

View File

@ -4,7 +4,7 @@ import type Pokemon from "#app/field/pokemon";
import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier"; import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier";
import type { ModifierOverride } from "#app/modifier/modifier-type"; import type { ModifierOverride } from "#app/modifier/modifier-type";
import type { BooleanHolder } from "#app/utils/common"; import type { BooleanHolder } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -44,7 +44,7 @@ describe("Abilities - Harvest", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH, Moves.NATURAL_GIFT, Moves.FALSE_SWIPE, Moves.GASTRO_ACID]) .moveset([Moves.SPLASH, Moves.NATURAL_GIFT, Moves.FALSE_SWIPE, Moves.GASTRO_ACID])
.ability(Abilities.HARVEST) .ability(AbilityId.HARVEST)
.startingLevel(100) .startingLevel(100)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
@ -52,7 +52,7 @@ describe("Abilities - Harvest", () => {
.weather(WeatherType.SUNNY) // guaranteed recovery .weather(WeatherType.SUNNY) // guaranteed recovery
.enemyLevel(1) .enemyLevel(1)
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.SPLASH, Moves.NUZZLE, Moves.KNOCK_OFF, Moves.INCINERATE]); .enemyMoveset([Moves.SPLASH, Moves.NUZZLE, Moves.KNOCK_OFF, Moves.INCINERATE]);
}); });
@ -79,7 +79,7 @@ describe("Abilities - Harvest", () => {
{ name: "BERRY", type: BerryType.ENIGMA, count: 2 }, { name: "BERRY", type: BerryType.ENIGMA, count: 2 },
{ name: "BERRY", type: BerryType.LUM, count: 2 }, { name: "BERRY", type: BerryType.LUM, count: 2 },
]) ])
.enemyAbility(Abilities.NEUTRALIZING_GAS); .enemyAbility(AbilityId.NEUTRALIZING_GAS);
await game.classicMode.startBattle([Species.MILOTIC]); await game.classicMode.startBattle([Species.MILOTIC]);
const milotic = game.scene.getPlayerPokemon()!; const milotic = game.scene.getPlayerPokemon()!;
@ -96,7 +96,7 @@ describe("Abilities - Harvest", () => {
// Give ourselves harvest and disable enemy neut gas, // Give ourselves harvest and disable enemy neut gas,
// but force our roll to fail so we don't accidentally recover anything // but force our roll to fail so we don't accidentally recover anything
vi.spyOn(PostTurnRestoreBerryAbAttr.prototype, "canApplyPostTurn").mockReturnValueOnce(false); vi.spyOn(PostTurnRestoreBerryAbAttr.prototype, "canApplyPostTurn").mockReturnValueOnce(false);
game.override.ability(Abilities.HARVEST); game.override.ability(AbilityId.HARVEST);
game.move.select(Moves.GASTRO_ACID); game.move.select(Moves.GASTRO_ACID);
await game.move.selectEnemyMove(Moves.NUZZLE); await game.move.selectEnemyMove(Moves.NUZZLE);
@ -119,7 +119,7 @@ describe("Abilities - Harvest", () => {
it("remembers berries eaten array across waves", async () => { it("remembers berries eaten array across waves", async () => {
game.override game.override
.startingHeldItems([{ name: "BERRY", type: BerryType.PETAYA, count: 2 }]) .startingHeldItems([{ name: "BERRY", type: BerryType.PETAYA, count: 2 }])
.ability(Abilities.BALL_FETCH); // don't actually need harvest for this test .ability(AbilityId.BALL_FETCH); // don't actually need harvest for this test
await game.classicMode.startBattle([Species.REGIELEKI]); await game.classicMode.startBattle([Species.REGIELEKI]);
const regieleki = game.scene.getPlayerPokemon()!; const regieleki = game.scene.getPlayerPokemon()!;
@ -147,7 +147,7 @@ describe("Abilities - Harvest", () => {
.startingHeldItems([{ name: "BERRY", type: BerryType.PETAYA, count: 1 }]) .startingHeldItems([{ name: "BERRY", type: BerryType.PETAYA, count: 1 }])
.moveset([Moves.SPLASH, Moves.EARTHQUAKE]) .moveset([Moves.SPLASH, Moves.EARTHQUAKE])
.enemyMoveset([Moves.SUPER_FANG, Moves.HEAL_PULSE]) .enemyMoveset([Moves.SUPER_FANG, Moves.HEAL_PULSE])
.enemyAbility(Abilities.COMPOUND_EYES); .enemyAbility(AbilityId.COMPOUND_EYES);
await game.classicMode.startBattle([Species.REGIELEKI]); await game.classicMode.startBattle([Species.REGIELEKI]);
const regieleki = game.scene.getPlayerPokemon()!; const regieleki = game.scene.getPlayerPokemon()!;
@ -263,7 +263,7 @@ describe("Abilities - Harvest", () => {
it("cannot restore Plucked berries for either side", async () => { it("cannot restore Plucked berries for either side", async () => {
const initBerries: ModifierOverride[] = [{ name: "BERRY", type: BerryType.PETAYA, count: 1 }]; const initBerries: ModifierOverride[] = [{ name: "BERRY", type: BerryType.PETAYA, count: 1 }];
game.override.startingHeldItems(initBerries).enemyAbility(Abilities.HARVEST).enemyMoveset(Moves.PLUCK); game.override.startingHeldItems(initBerries).enemyAbility(AbilityId.HARVEST).enemyMoveset(Moves.PLUCK);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
// gobble gobble gobble // gobble gobble gobble
@ -299,7 +299,7 @@ describe("Abilities - Harvest", () => {
it("can restore stolen berries", async () => { it("can restore stolen berries", async () => {
const initBerries: ModifierOverride[] = [{ name: "BERRY", type: BerryType.SITRUS, count: 1 }]; const initBerries: ModifierOverride[] = [{ name: "BERRY", type: BerryType.SITRUS, count: 1 }];
game.override.enemyHeldItems(initBerries).passiveAbility(Abilities.MAGICIAN).hasPassiveAbility(true); game.override.enemyHeldItems(initBerries).passiveAbility(AbilityId.MAGICIAN).hasPassiveAbility(true);
await game.classicMode.startBattle([Species.MEOWSCARADA]); await game.classicMode.startBattle([Species.MEOWSCARADA]);
// pre damage // pre damage

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -31,14 +31,14 @@ describe("Abilities - Healer", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("double") .battleStyle("double")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
healerAttr = allAbilities[Abilities.HEALER].getAttrs(PostTurnResetStatusAbAttr)[0]; healerAttr = allAbilities[AbilityId.HEALER].getAttrs(PostTurnResetStatusAbAttr)[0];
healerAttrSpy = vi healerAttrSpy = vi
.spyOn(healerAttr, "getCondition") .spyOn(healerAttr, "getCondition")
.mockReturnValue((pokemon: Pokemon) => !isNullOrUndefined(pokemon.getAlly())); .mockReturnValue((pokemon: Pokemon) => !isNullOrUndefined(pokemon.getAlly()));
@ -49,7 +49,7 @@ describe("Abilities - Healer", () => {
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
const user = game.scene.getPlayerPokemon()!; const user = game.scene.getPlayerPokemon()!;
// Only want one magikarp to have the ability. // Only want one magikarp to have the ability.
vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[Abilities.HEALER]); vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[AbilityId.HEALER]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
// faint the ally // faint the ally
game.move.select(Moves.LUNAR_DANCE, 1); game.move.select(Moves.LUNAR_DANCE, 1);
@ -68,7 +68,7 @@ describe("Abilities - Healer", () => {
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
const [user, ally] = game.scene.getPlayerField(); const [user, ally] = game.scene.getPlayerField();
// Only want one magikarp to have the ability. // Only want one magikarp to have the ability.
vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[Abilities.HEALER]); vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[AbilityId.HEALER]);
expect(ally.trySetStatus(StatusEffect.BURN)).toBe(true); expect(ally.trySetStatus(StatusEffect.BURN)).toBe(true);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH, 1); game.move.select(Moves.SPLASH, 1);
@ -84,7 +84,7 @@ describe("Abilities - Healer", () => {
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
const [user, ally] = game.scene.getPlayerField(); const [user, ally] = game.scene.getPlayerField();
// Only want one magikarp to have the ability. // Only want one magikarp to have the ability.
vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[Abilities.HEALER]); vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[AbilityId.HEALER]);
expect(ally.trySetStatus(StatusEffect.BURN)).toBe(true); expect(ally.trySetStatus(StatusEffect.BURN)).toBe(true);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.SPLASH, 1); game.move.select(Moves.SPLASH, 1);

View File

@ -2,7 +2,7 @@ import { Species } from "#app/enums/species";
import { StatusEffect } from "#app/enums/status-effect"; import { StatusEffect } from "#app/enums/status-effect";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
@ -28,11 +28,11 @@ describe("Abilities - Heatproof", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.CHARMANDER) .enemySpecies(Species.CHARMANDER)
.enemyAbility(Abilities.HEATPROOF) .enemyAbility(AbilityId.HEATPROOF)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemyLevel(100) .enemyLevel(100)
.starterSpecies(Species.CHANDELURE) .starterSpecies(Species.CHANDELURE)
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.moveset([Moves.FLAMETHROWER, Moves.SPLASH]) .moveset([Moves.FLAMETHROWER, Moves.SPLASH])
.startingLevel(100); .startingLevel(100);
}); });
@ -49,7 +49,7 @@ describe("Abilities - Heatproof", () => {
const heatproofDamage = initialHP - enemy.hp; const heatproofDamage = initialHP - enemy.hp;
enemy.hp = initialHP; enemy.hp = initialHP;
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH);
game.move.select(Moves.FLAMETHROWER); game.move.select(Moves.FLAMETHROWER);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);

View File

@ -1,6 +1,6 @@
import type { CommandPhase } from "#app/phases/command-phase"; import type { CommandPhase } from "#app/phases/command-phase";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -26,12 +26,12 @@ describe("Abilities - Honey Gather", () => {
game.override game.override
.moveset([Moves.SPLASH, Moves.ROAR, Moves.THUNDERBOLT]) .moveset([Moves.SPLASH, Moves.ROAR, Moves.THUNDERBOLT])
.startingLevel(100) .startingLevel(100)
.ability(Abilities.HONEY_GATHER) .ability(AbilityId.HONEY_GATHER)
.passiveAbility(Abilities.RUN_AWAY) .passiveAbility(AbilityId.RUN_AWAY)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -1,5 +1,5 @@
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -24,13 +24,13 @@ describe("Abilities - Hustle", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.ability(Abilities.HUSTLE) .ability(AbilityId.HUSTLE)
.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE]) .moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE])
.disableCrits() .disableCrits()
.battleStyle("single") .battleStyle("single")
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH);
}); });
it("increases the user's Attack stat by 50%", async () => { it("increases the user's Attack stat by 50%", async () => {

View File

@ -1,5 +1,5 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -25,9 +25,9 @@ describe("Abilities - Hyper Cutter", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.moveset([Moves.SAND_ATTACK, Moves.NOBLE_ROAR, Moves.DEFOG, Moves.OCTOLOCK]) .moveset([Moves.SAND_ATTACK, Moves.NOBLE_ROAR, Moves.DEFOG, Moves.OCTOLOCK])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.HYPER_CUTTER) .enemyAbility(AbilityId.HYPER_CUTTER)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -4,7 +4,7 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -32,7 +32,7 @@ describe("Abilities - Ice Face", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override.battleStyle("single");
game.override.enemySpecies(Species.EISCUE); game.override.enemySpecies(Species.EISCUE);
game.override.enemyAbility(Abilities.ICE_FACE); game.override.enemyAbility(AbilityId.ICE_FACE);
game.override.moveset([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]); game.override.moveset([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]);
}); });
@ -260,11 +260,11 @@ describe("Abilities - Ice Face", () => {
expect(eiscue.getTag(BattlerTagType.ICE_FACE)).not.toBe(undefined); expect(eiscue.getTag(BattlerTagType.ICE_FACE)).not.toBe(undefined);
expect(eiscue.formIndex).toBe(icefaceForm); expect(eiscue.formIndex).toBe(icefaceForm);
expect(eiscue.hasAbility(Abilities.ICE_FACE)).toBe(true); expect(eiscue.hasAbility(AbilityId.ICE_FACE)).toBe(true);
}); });
it("cannot be copied", async () => { it("cannot be copied", async () => {
game.override.ability(Abilities.TRACE); game.override.ability(AbilityId.TRACE);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -276,6 +276,6 @@ describe("Abilities - Ice Face", () => {
expect(eiscue.getTag(BattlerTagType.ICE_FACE)).not.toBe(undefined); expect(eiscue.getTag(BattlerTagType.ICE_FACE)).not.toBe(undefined);
expect(eiscue.formIndex).toBe(icefaceForm); expect(eiscue.formIndex).toBe(icefaceForm);
expect(game.scene.getPlayerPokemon()!.hasAbility(Abilities.TRACE)).toBe(true); expect(game.scene.getPlayerPokemon()!.hasAbility(AbilityId.TRACE)).toBe(true);
}); });
}); });

View File

@ -1,5 +1,5 @@
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
@ -23,8 +23,8 @@ describe("Abilities - Illuminate", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset(Moves.SPLASH) .moveset(Moves.SPLASH)
.ability(Abilities.ILLUMINATE) .ability(AbilityId.ILLUMINATE)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SAND_ATTACK); .enemyMoveset(Moves.SAND_ATTACK);
}); });

View File

@ -1,6 +1,6 @@
import { Gender } from "#app/data/gender"; import { Gender } from "#app/data/gender";
import { PokeballType } from "#app/enums/pokeball"; import { PokeballType } from "#app/enums/pokeball";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -26,7 +26,7 @@ describe("Abilities - Illusion", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.ZORUA) .enemySpecies(Species.ZORUA)
.enemyAbility(Abilities.ILLUSION) .enemyAbility(AbilityId.ILLUSION)
.enemyMoveset(Moves.TACKLE) .enemyMoveset(Moves.TACKLE)
.enemyHeldItems([{ name: "WIDE_LENS", count: 3 }]) .enemyHeldItems([{ name: "WIDE_LENS", count: 3 }])
.moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE]) .moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE])
@ -66,7 +66,7 @@ describe("Abilities - Illusion", () => {
}); });
it("breaks with neutralizing gas", async () => { it("breaks with neutralizing gas", async () => {
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS); game.override.enemyAbility(AbilityId.NEUTRALIZING_GAS);
await game.classicMode.startBattle([Species.KOFFING]); await game.classicMode.startBattle([Species.KOFFING]);
const zorua = game.scene.getEnemyPokemon()!; const zorua = game.scene.getEnemyPokemon()!;
@ -76,8 +76,8 @@ describe("Abilities - Illusion", () => {
it("does not activate if neutralizing gas is active", async () => { it("does not activate if neutralizing gas is active", async () => {
game.override game.override
.enemyAbility(Abilities.NEUTRALIZING_GAS) .enemyAbility(AbilityId.NEUTRALIZING_GAS)
.ability(Abilities.ILLUSION) .ability(AbilityId.ILLUSION)
.moveset(Moves.SPLASH) .moveset(Moves.SPLASH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.MAGIKARP]);
@ -118,7 +118,7 @@ describe("Abilities - Illusion", () => {
it("does not break from indirect damage", async () => { it("does not break from indirect damage", async () => {
game.override.enemySpecies(Species.GIGALITH); game.override.enemySpecies(Species.GIGALITH);
game.override.enemyAbility(Abilities.SAND_STREAM); game.override.enemyAbility(AbilityId.SAND_STREAM);
game.override.enemyMoveset(Moves.WILL_O_WISP); game.override.enemyMoveset(Moves.WILL_O_WISP);
game.override.moveset([Moves.FLARE_BLITZ]); game.override.moveset([Moves.FLARE_BLITZ]);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -24,18 +24,18 @@ describe("Abilities - Immunity", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should remove poison when gained", async () => { it("should remove poison when gained", async () => {
game.override game.override
.ability(Abilities.IMMUNITY) .ability(AbilityId.IMMUNITY)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);

View File

@ -5,7 +5,7 @@ import { Species } from "#enums/species";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
// TODO: Add more tests once Imposter is fully implemented // TODO: Add more tests once Imposter is fully implemented
describe("Abilities - Imposter", () => { describe("Abilities - Imposter", () => {
@ -28,10 +28,10 @@ describe("Abilities - Imposter", () => {
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.MEW) .enemySpecies(Species.MEW)
.enemyLevel(200) .enemyLevel(200)
.enemyAbility(Abilities.BEAST_BOOST) .enemyAbility(AbilityId.BEAST_BOOST)
.enemyPassiveAbility(Abilities.BALL_FETCH) .enemyPassiveAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.ability(Abilities.IMPOSTER) .ability(AbilityId.IMPOSTER)
.moveset(Moves.SPLASH); .moveset(Moves.SPLASH);
}); });
@ -118,7 +118,7 @@ describe("Abilities - Imposter", () => {
}); });
it("should activate its ability if it copies one that activates on summon", async () => { it("should activate its ability if it copies one that activates on summon", async () => {
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.DITTO]); await game.classicMode.startBattle([Species.DITTO]);

View File

@ -4,7 +4,7 @@ import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -29,11 +29,11 @@ describe("Abilities - Infiltrator", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.TACKLE, Moves.WATER_GUN, Moves.SPORE, Moves.BABY_DOLL_EYES]) .moveset([Moves.TACKLE, Moves.WATER_GUN, Moves.SPORE, Moves.BABY_DOLL_EYES])
.ability(Abilities.INFILTRATOR) .ability(AbilityId.INFILTRATOR)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
@ -68,7 +68,7 @@ describe("Abilities - Infiltrator", () => {
const postScreenDmg = enemy.getAttackDamage({ source: player, move: allMoves[move] }).damage; const postScreenDmg = enemy.getAttackDamage({ source: player, move: allMoves[move] }).damage;
expect(postScreenDmg).toBe(preScreenDmg); expect(postScreenDmg).toBe(preScreenDmg);
expect(player.waveData.abilitiesApplied).toContain(Abilities.INFILTRATOR); expect(player.waveData.abilitiesApplied).toContain(AbilityId.INFILTRATOR);
}); });
it("should bypass the target's Safeguard", async () => { it("should bypass the target's Safeguard", async () => {
@ -83,7 +83,7 @@ describe("Abilities - Infiltrator", () => {
await game.phaseInterceptor.to("BerryPhase", false); await game.phaseInterceptor.to("BerryPhase", false);
expect(enemy.status?.effect).toBe(StatusEffect.SLEEP); expect(enemy.status?.effect).toBe(StatusEffect.SLEEP);
expect(player.waveData.abilitiesApplied).toContain(Abilities.INFILTRATOR); expect(player.waveData.abilitiesApplied).toContain(AbilityId.INFILTRATOR);
}); });
// TODO: fix this interaction to pass this test // TODO: fix this interaction to pass this test
@ -99,7 +99,7 @@ describe("Abilities - Infiltrator", () => {
await game.phaseInterceptor.to("MoveEndPhase"); await game.phaseInterceptor.to("MoveEndPhase");
expect(enemy.getStatStage(Stat.ATK)).toBe(-1); expect(enemy.getStatStage(Stat.ATK)).toBe(-1);
expect(player.waveData.abilitiesApplied).toContain(Abilities.INFILTRATOR); expect(player.waveData.abilitiesApplied).toContain(AbilityId.INFILTRATOR);
}); });
it("should bypass the target's Substitute", async () => { it("should bypass the target's Substitute", async () => {
@ -114,6 +114,6 @@ describe("Abilities - Infiltrator", () => {
await game.phaseInterceptor.to("MoveEndPhase"); await game.phaseInterceptor.to("MoveEndPhase");
expect(enemy.getStatStage(Stat.ATK)).toBe(-1); expect(enemy.getStatStage(Stat.ATK)).toBe(-1);
expect(player.waveData.abilitiesApplied).toContain(Abilities.INFILTRATOR); expect(player.waveData.abilitiesApplied).toContain(AbilityId.INFILTRATOR);
}); });
}); });

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -24,18 +24,18 @@ describe("Abilities - Insomnia", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should remove sleep when gained", async () => { it("should remove sleep when gained", async () => {
game.override game.override
.ability(Abilities.INSOMNIA) .ability(AbilityId.INSOMNIA)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);

View File

@ -4,7 +4,7 @@ import GameManager from "#test/testUtils/gameManager";
import { UiMode } from "#enums/ui-mode"; import { UiMode } from "#enums/ui-mode";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { getMovePosition } from "#test/testUtils/gameManagerUtils"; import { getMovePosition } from "#test/testUtils/gameManagerUtils";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -27,9 +27,9 @@ describe("Abilities - Intimidate", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyAbility(Abilities.INTIMIDATE) .enemyAbility(AbilityId.INTIMIDATE)
.enemyPassiveAbility(Abilities.HYDRATION) .enemyPassiveAbility(AbilityId.HYDRATION)
.ability(Abilities.INTIMIDATE) .ability(AbilityId.INTIMIDATE)
.startingWave(3) .startingWave(3)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -1,7 +1,7 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import { CommandPhase } from "#app/phases/command-phase"; import { CommandPhase } from "#app/phases/command-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -24,8 +24,8 @@ describe("Abilities - Intrepid Sword", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override.battleStyle("single");
game.override.enemySpecies(Species.ZACIAN); game.override.enemySpecies(Species.ZACIAN);
game.override.enemyAbility(Abilities.INTREPID_SWORD); game.override.enemyAbility(AbilityId.INTREPID_SWORD);
game.override.ability(Abilities.INTREPID_SWORD); game.override.ability(AbilityId.INTREPID_SWORD);
}); });
it("should raise ATK stat stage by 1 on entry", async () => { it("should raise ATK stat stage by 1 on entry", async () => {

View File

@ -3,7 +3,7 @@ import { PokemonType } from "#enums/pokemon-type";
import { Weather } from "#app/data/weather"; import { Weather } from "#app/data/weather";
import type { PlayerPokemon } from "#app/field/pokemon"; import type { PlayerPokemon } from "#app/field/pokemon";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome"; import { Biome } from "#enums/biome";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -31,7 +31,7 @@ describe("Abilities - Libero", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.ability(Abilities.LIBERO) .ability(AbilityId.LIBERO)
.startingLevel(100) .startingLevel(100)
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyMoveset(Moves.ENDURE); .enemyMoveset(Moves.ENDURE);
@ -68,7 +68,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.AGILITY); game.move.select(Moves.AGILITY);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO);
const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]]; const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]];
const moveType = PokemonType[allMoves[Moves.AGILITY].type]; const moveType = PokemonType[allMoves[Moves.AGILITY].type];
expect(leadPokemonType).not.toBe(moveType); expect(leadPokemonType).not.toBe(moveType);
@ -100,7 +100,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.WEATHER_BALL); game.move.select(Moves.WEATHER_BALL);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO);
expect(leadPokemon.getTypes()).toHaveLength(1); expect(leadPokemon.getTypes()).toHaveLength(1);
const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]],
moveType = PokemonType[PokemonType.FIRE]; moveType = PokemonType[PokemonType.FIRE];
@ -109,7 +109,7 @@ describe("Abilities - Libero", () => {
test("ability applies correctly even if the type has changed by another ability", async () => { test("ability applies correctly even if the type has changed by another ability", async () => {
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.passiveAbility(Abilities.REFRIGERATE); game.override.passiveAbility(AbilityId.REFRIGERATE);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -119,7 +119,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO);
expect(leadPokemon.getTypes()).toHaveLength(1); expect(leadPokemon.getTypes()).toHaveLength(1);
const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]],
moveType = PokemonType[PokemonType.ICE]; moveType = PokemonType[PokemonType.ICE];
@ -214,7 +214,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO);
}); });
test("ability is not applied if pokemon is terastallized", async () => { test("ability is not applied if pokemon is terastallized", async () => {
@ -230,7 +230,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO);
}); });
test("ability is not applied if pokemon uses struggle", async () => { test("ability is not applied if pokemon uses struggle", async () => {
@ -244,7 +244,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.STRUGGLE); game.move.select(Moves.STRUGGLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO);
}); });
test("ability is not applied if the pokemon's move fails", async () => { test("ability is not applied if the pokemon's move fails", async () => {
@ -258,7 +258,7 @@ describe("Abilities - Libero", () => {
game.move.select(Moves.BURN_UP); game.move.select(Moves.BURN_UP);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.LIBERO); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.LIBERO);
}); });
test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => {
@ -293,7 +293,7 @@ describe("Abilities - Libero", () => {
}); });
function testPokemonTypeMatchesDefaultMoveType(pokemon: PlayerPokemon, move: Moves) { function testPokemonTypeMatchesDefaultMoveType(pokemon: PlayerPokemon, move: Moves) {
expect(pokemon.waveData.abilitiesApplied).toContain(Abilities.LIBERO); expect(pokemon.waveData.abilitiesApplied).toContain(AbilityId.LIBERO);
expect(pokemon.getTypes()).toHaveLength(1); expect(pokemon.getTypes()).toHaveLength(1);
const pokemonType = PokemonType[pokemon.getTypes()[0]], const pokemonType = PokemonType[pokemon.getTypes()[0]],
moveType = PokemonType[allMoves[move].type]; moveType = PokemonType[allMoves[move].type];

View File

@ -1,5 +1,5 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
@ -25,11 +25,11 @@ describe("Abilities - Lightningrod", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH, Moves.SHOCK_WAVE]) .moveset([Moves.SPLASH, Moves.SHOCK_WAVE])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("double") .battleStyle("double")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -39,7 +39,7 @@ describe("Abilities - Lightningrod", () => {
const enemy1 = game.scene.getEnemyField()[0]; const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1]; const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = Abilities.LIGHTNING_ROD; enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
game.move.select(Moves.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(Moves.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2); game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2);
@ -55,7 +55,7 @@ describe("Abilities - Lightningrod", () => {
const enemy1 = game.scene.getEnemyField()[0]; const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1]; const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = Abilities.LIGHTNING_ROD; enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
game.move.select(Moves.AERIAL_ACE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(Moves.AERIAL_ACE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2); game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2);
@ -69,7 +69,7 @@ describe("Abilities - Lightningrod", () => {
const enemy2 = game.scene.getEnemyField()[1]; const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = Abilities.LIGHTNING_ROD; enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
game.move.select(Moves.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(Moves.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2); game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2);
@ -80,13 +80,13 @@ describe("Abilities - Lightningrod", () => {
}); });
it("should not redirect moves changed from electric type via ability", async () => { it("should not redirect moves changed from electric type via ability", async () => {
game.override.ability(Abilities.NORMALIZE); game.override.ability(AbilityId.NORMALIZE);
await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]);
const enemy1 = game.scene.getEnemyField()[0]; const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1]; const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = Abilities.LIGHTNING_ROD; enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
game.move.select(Moves.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(Moves.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2); game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2);
@ -96,13 +96,13 @@ describe("Abilities - Lightningrod", () => {
}); });
it("should redirect moves changed to electric type via ability", async () => { it("should redirect moves changed to electric type via ability", async () => {
game.override.ability(Abilities.GALVANIZE).moveset(Moves.TACKLE); game.override.ability(AbilityId.GALVANIZE).moveset(Moves.TACKLE);
await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]);
const enemy1 = game.scene.getEnemyField()[0]; const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1]; const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = Abilities.LIGHTNING_ROD; enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
game.move.select(Moves.TACKLE, BattlerIndex.PLAYER, BattlerIndex.ENEMY); game.move.select(Moves.TACKLE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2); game.move.select(Moves.SPLASH, BattlerIndex.PLAYER_2);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -24,18 +24,18 @@ describe("Abilities - Limber", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should remove paralysis when gained", async () => { it("should remove paralysis when gained", async () => {
game.override game.override
.ability(Abilities.LIMBER) .ability(AbilityId.LIMBER)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);

View File

@ -6,7 +6,7 @@ import { ArenaTagType } from "#app/enums/arena-tag-type";
import { BattlerTagType } from "#app/enums/battler-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Stat } from "#app/enums/stat"; import { Stat } from "#app/enums/stat";
import { StatusEffect } from "#app/enums/status-effect"; import { StatusEffect } from "#app/enums/status-effect";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -29,12 +29,12 @@ describe("Abilities - Magic Bounce", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.moveset([Moves.GROWL, Moves.SPLASH]) .moveset([Moves.GROWL, Moves.SPLASH])
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.MAGIC_BOUNCE) .enemyAbility(AbilityId.MAGIC_BOUNCE)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -84,7 +84,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should not bounce back a move that was just bounced", async () => { it("should not bounce back a move that was just bounced", async () => {
game.override.ability(Abilities.MAGIC_BOUNCE); game.override.ability(AbilityId.MAGIC_BOUNCE);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.GROWL); game.move.select(Moves.GROWL);
@ -94,7 +94,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should receive the stat change after reflecting a move back to a mirror armor user", async () => { it("should receive the stat change after reflecting a move back to a mirror armor user", async () => {
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.GROWL); game.move.select(Moves.GROWL);
@ -104,7 +104,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should not bounce back a move from a mold breaker user", async () => { it("should not bounce back a move from a mold breaker user", async () => {
game.override.ability(Abilities.MOLD_BREAKER); game.override.ability(AbilityId.MOLD_BREAKER);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.GROWL); game.move.select(Moves.GROWL);
@ -179,7 +179,7 @@ describe("Abilities - Magic Bounce", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
// Give the player MOLD_BREAKER for this turn to bypass Magic Bounce. // Give the player MOLD_BREAKER for this turn to bypass Magic Bounce.
vi.spyOn(playerPokemon, "getAbility").mockReturnValue(allAbilities[Abilities.MOLD_BREAKER]); vi.spyOn(playerPokemon, "getAbility").mockReturnValue(allAbilities[AbilityId.MOLD_BREAKER]);
// turn 1 // turn 1
game.move.select(Moves.ENCORE); game.move.select(Moves.ENCORE);
@ -201,7 +201,7 @@ describe("Abilities - Magic Bounce", () => {
it.todo("should not cause the bounced move to count for encore", async () => { it.todo("should not cause the bounced move to count for encore", async () => {
game.override.moveset([Moves.SPLASH, Moves.GROWL, Moves.ENCORE]); game.override.moveset([Moves.SPLASH, Moves.GROWL, Moves.ENCORE]);
game.override.enemyMoveset([Moves.GROWL, Moves.TACKLE]); game.override.enemyMoveset([Moves.GROWL, Moves.TACKLE]);
game.override.enemyAbility(Abilities.MAGIC_BOUNCE); game.override.enemyAbility(AbilityId.MAGIC_BOUNCE);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemon = game.scene.getPlayerPokemon()!;
@ -214,7 +214,7 @@ describe("Abilities - Magic Bounce", () => {
await game.toNextTurn(); await game.toNextTurn();
// Give the player MOLD_BREAKER for this turn to bypass Magic Bounce. // Give the player MOLD_BREAKER for this turn to bypass Magic Bounce.
vi.spyOn(playerPokemon, "getAbility").mockReturnValue(allAbilities[Abilities.MOLD_BREAKER]); vi.spyOn(playerPokemon, "getAbility").mockReturnValue(allAbilities[AbilityId.MOLD_BREAKER]);
// turn 2 // turn 2
game.move.select(Moves.ENCORE); game.move.select(Moves.ENCORE);
@ -271,7 +271,7 @@ describe("Abilities - Magic Bounce", () => {
it("should respect immunities when bouncing a move", async () => { it("should respect immunities when bouncing a move", async () => {
vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
game.override.moveset([Moves.THUNDER_WAVE, Moves.GROWL]); game.override.moveset([Moves.THUNDER_WAVE, Moves.GROWL]);
game.override.ability(Abilities.SOUNDPROOF); game.override.ability(AbilityId.SOUNDPROOF);
await game.classicMode.startBattle([Species.PHANPY]); await game.classicMode.startBattle([Species.PHANPY]);
// Turn 1 - thunder wave immunity test // Turn 1 - thunder wave immunity test
@ -352,7 +352,7 @@ describe("Abilities - Magic Bounce", () => {
expect(game.scene.getEnemyPokemon()!.status?.effect).toBe(StatusEffect.TOXIC); expect(game.scene.getEnemyPokemon()!.status?.effect).toBe(StatusEffect.TOXIC);
expect(game.scene.getPlayerPokemon()!.status).toBeUndefined(); expect(game.scene.getPlayerPokemon()!.status).toBeUndefined();
game.override.ability(Abilities.NO_GUARD); game.override.ability(AbilityId.NO_GUARD);
game.move.select(Moves.CHARM); game.move.select(Moves.CHARM);
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");

View File

@ -1,7 +1,7 @@
import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag"; import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag";
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -30,13 +30,13 @@ describe("Abilities - Magic Guard", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
/** Player Pokemon overrides */ /** Player Pokemon overrides */
game.override.ability(Abilities.MAGIC_GUARD); game.override.ability(AbilityId.MAGIC_GUARD);
game.override.moveset([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
game.override.startingLevel(100); game.override.startingLevel(100);
/** Enemy Pokemon overrides */ /** Enemy Pokemon overrides */
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.enemyAbility(Abilities.INSOMNIA); game.override.enemyAbility(AbilityId.INSOMNIA);
game.override.enemyMoveset(Moves.SPLASH); game.override.enemyMoveset(Moves.SPLASH);
game.override.enemyLevel(100); game.override.enemyLevel(100);
}); });
@ -108,7 +108,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage caused by burn but other non-damaging effects are still applied", async () => { it("Magic Guard prevents damage caused by burn but other non-damaging effects are still applied", async () => {
game.override.enemyStatusEffect(StatusEffect.BURN); game.override.enemyStatusEffect(StatusEffect.BURN);
game.override.enemyAbility(Abilities.MAGIC_GUARD); game.override.enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -130,7 +130,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage caused by toxic but other non-damaging effects are still applied", async () => { it("Magic Guard prevents damage caused by toxic but other non-damaging effects are still applied", async () => {
game.override.enemyStatusEffect(StatusEffect.TOXIC); game.override.enemyStatusEffect(StatusEffect.TOXIC);
game.override.enemyAbility(Abilities.MAGIC_GUARD); game.override.enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -208,7 +208,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents against damage from volatile status effects", async () => { it("Magic Guard prevents against damage from volatile status effects", async () => {
await game.classicMode.startBattle([Species.DUSKULL]); await game.classicMode.startBattle([Species.DUSKULL]);
game.override.moveset([Moves.CURSE]); game.override.moveset([Moves.CURSE]);
game.override.enemyAbility(Abilities.MAGIC_GUARD); game.override.enemyAbility(AbilityId.MAGIC_GUARD);
const leadPokemon = game.scene.getPlayerPokemon()!; const leadPokemon = game.scene.getPlayerPokemon()!;
@ -331,7 +331,7 @@ describe("Abilities - Magic Guard", () => {
game.override.statusEffect(StatusEffect.SLEEP); game.override.statusEffect(StatusEffect.SLEEP);
//enemy pokemon is given Spore just in case player pokemon somehow awakens during test //enemy pokemon is given Spore just in case player pokemon somehow awakens during test
game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]); game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]);
game.override.enemyAbility(Abilities.BAD_DREAMS); game.override.enemyAbility(AbilityId.BAD_DREAMS);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -353,7 +353,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async () => { it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async () => {
//Tests the abilities Innards Out/Aftermath //Tests the abilities Innards Out/Aftermath
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyAbility(Abilities.AFTERMATH); game.override.enemyAbility(AbilityId.AFTERMATH);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -377,7 +377,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage from abilities with PostDefendContactDamageAbAttr", async () => { it("Magic Guard prevents damage from abilities with PostDefendContactDamageAbAttr", async () => {
//Tests the abilities Iron Barbs/Rough Skin //Tests the abilities Iron Barbs/Rough Skin
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.enemyAbility(Abilities.IRON_BARBS); game.override.enemyAbility(AbilityId.IRON_BARBS);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -400,7 +400,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage from abilities with ReverseDrainAbAttr", async () => { it("Magic Guard prevents damage from abilities with ReverseDrainAbAttr", async () => {
//Tests the ability Liquid Ooze //Tests the ability Liquid Ooze
game.override.moveset([Moves.ABSORB]); game.override.moveset([Moves.ABSORB]);
game.override.enemyAbility(Abilities.LIQUID_OOZE); game.override.enemyAbility(AbilityId.LIQUID_OOZE);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -422,7 +422,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents HP loss from abilities with PostWeatherLapseDamageAbAttr", async () => { it("Magic Guard prevents HP loss from abilities with PostWeatherLapseDamageAbAttr", async () => {
//Tests the abilities Solar Power/Dry Skin //Tests the abilities Solar Power/Dry Skin
game.override.passiveAbility(Abilities.SOLAR_POWER); game.override.passiveAbility(AbilityId.SOLAR_POWER);
game.override.weather(WeatherType.SUNNY); game.override.weather(WeatherType.SUNNY);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -24,18 +24,18 @@ describe("Abilities - Magma Armor", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should remove freeze when gained", async () => { it("should remove freeze when gained", async () => {
game.override game.override
.ability(Abilities.MAGMA_ARMOR) .ability(AbilityId.MAGMA_ARMOR)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
@ -24,7 +24,7 @@ describe("Abilities - Mimicry", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.MIMICRY) .ability(AbilityId.MIMICRY)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
@ -32,7 +32,7 @@ describe("Abilities - Mimicry", () => {
}); });
it("Mimicry activates after the Pokémon with Mimicry is switched in while terrain is present, or whenever there is a change in terrain", async () => { it("Mimicry activates after the Pokémon with Mimicry is switched in while terrain is present, or whenever there is a change in terrain", async () => {
game.override.enemyAbility(Abilities.MISTY_SURGE); game.override.enemyAbility(AbilityId.MISTY_SURGE);
await game.classicMode.startBattle([Species.FEEBAS, Species.ABRA]); await game.classicMode.startBattle([Species.FEEBAS, Species.ABRA]);
const [playerPokemon1, playerPokemon2] = game.scene.getPlayerParty(); const [playerPokemon1, playerPokemon2] = game.scene.getPlayerParty();
@ -49,7 +49,7 @@ describe("Abilities - Mimicry", () => {
it("Pokemon should revert back to its original, root type once terrain ends", async () => { it("Pokemon should revert back to its original, root type once terrain ends", async () => {
game.override game.override
.moveset([Moves.SPLASH, Moves.TRANSFORM]) .moveset([Moves.SPLASH, Moves.TRANSFORM])
.enemyAbility(Abilities.MIMICRY) .enemyAbility(AbilityId.MIMICRY)
.enemyMoveset([Moves.SPLASH, Moves.PSYCHIC_TERRAIN]); .enemyMoveset([Moves.SPLASH, Moves.PSYCHIC_TERRAIN]);
await game.classicMode.startBattle([Species.REGIELEKI]); await game.classicMode.startBattle([Species.REGIELEKI]);

View File

@ -1,5 +1,5 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -30,15 +30,15 @@ describe("Ability - Mirror Armor", () => {
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyMoveset([Moves.SPLASH, Moves.STICKY_WEB, Moves.TICKLE, Moves.OCTOLOCK]) .enemyMoveset([Moves.SPLASH, Moves.STICKY_WEB, Moves.TICKLE, Moves.OCTOLOCK])
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(2000) .startingLevel(2000)
.moveset([Moves.SPLASH, Moves.STICKY_WEB, Moves.TICKLE, Moves.OCTOLOCK]) .moveset([Moves.SPLASH, Moves.STICKY_WEB, Moves.TICKLE, Moves.OCTOLOCK])
.ability(Abilities.BALL_FETCH); .ability(AbilityId.BALL_FETCH);
}); });
it("Player side + single battle Intimidate - opponent loses stats", async () => { it("Player side + single battle Intimidate - opponent loses stats", async () => {
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -54,8 +54,8 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle Intimidate - player loses stats", async () => { it("Enemy side + single battle Intimidate - player loses stats", async () => {
game.override.enemyAbility(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
game.override.ability(Abilities.INTIMIDATE); game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -72,8 +72,8 @@ describe("Ability - Mirror Armor", () => {
it("Player side + double battle Intimidate - opponents each lose -2 atk", async () => { it("Player side + double battle Intimidate - opponents each lose -2 atk", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -94,8 +94,8 @@ describe("Ability - Mirror Armor", () => {
it("Enemy side + double battle Intimidate - players each lose -2 atk", async () => { it("Enemy side + double battle Intimidate - players each lose -2 atk", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.enemyAbility(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
game.override.ability(Abilities.INTIMIDATE); game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -115,8 +115,8 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + single battle Intimidate + Tickle - opponent loses stats", async () => { it("Player side + single battle Intimidate + Tickle - opponent loses stats", async () => {
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -135,8 +135,8 @@ describe("Ability - Mirror Armor", () => {
it("Player side + double battle Intimidate + Tickle - opponents each lose -3 atk, -1 def", async () => { it("Player side + double battle Intimidate + Tickle - opponents each lose -3 atk, -1 def", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -159,8 +159,8 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle Intimidate + Tickle - player loses stats", async () => { it("Enemy side + single battle Intimidate + Tickle - player loses stats", async () => {
game.override.enemyAbility(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
game.override.ability(Abilities.INTIMIDATE); game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -178,8 +178,8 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + single battle Intimidate + oppoenent has white smoke - no one loses stats", async () => { it("Player side + single battle Intimidate + oppoenent has white smoke - no one loses stats", async () => {
game.override.enemyAbility(Abilities.WHITE_SMOKE); game.override.enemyAbility(AbilityId.WHITE_SMOKE);
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -197,8 +197,8 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle Intimidate + player has white smoke - no one loses stats", async () => { it("Enemy side + single battle Intimidate + player has white smoke - no one loses stats", async () => {
game.override.ability(Abilities.WHITE_SMOKE); game.override.ability(AbilityId.WHITE_SMOKE);
game.override.enemyAbility(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -216,7 +216,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + single battle + opponent uses octolock - does not interact with mirror armor, player loses stats", async () => { it("Player side + single battle + opponent uses octolock - does not interact with mirror armor, player loses stats", async () => {
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -234,7 +234,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle + player uses octolock - does not interact with mirror armor, opponent loses stats", async () => { it("Enemy side + single battle + player uses octolock - does not interact with mirror armor, opponent loses stats", async () => {
game.override.enemyAbility(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -252,9 +252,9 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Both sides have mirror armor - does not loop, player loses attack", async () => { it("Both sides have mirror armor - does not loop, player loses attack", async () => {
game.override.enemyAbility(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.ability(Abilities.INTIMIDATE); game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -269,7 +269,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Single battle + sticky web applied player side - player switches out and enemy should lose -1 speed", async () => { it("Single battle + sticky web applied player side - player switches out and enemy should lose -1 speed", async () => {
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -289,7 +289,7 @@ describe("Ability - Mirror Armor", () => {
it("Double battle + sticky web applied player side - player switches out and enemy 1 should lose -1 speed", async () => { it("Double battle + sticky web applied player side - player switches out and enemy 1 should lose -1 speed", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.ability(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();

View File

@ -1,6 +1,6 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -25,18 +25,18 @@ describe("Abilities - Mold Breaker", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.MOLD_BREAKER) .ability(AbilityId.MOLD_BREAKER)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should turn off the ignore abilities arena variable after the user's move", async () => { it("should turn off the ignore abilities arena variable after the user's move", async () => {
game.override game.override
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.ability(Abilities.MOLD_BREAKER) .ability(AbilityId.MOLD_BREAKER)
.moveset([Moves.ERUPTION]) .moveset([Moves.ERUPTION])
.startingLevel(100) .startingLevel(100)
.enemyLevel(2); .enemyLevel(2);

View File

@ -1,5 +1,5 @@
import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat"; import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -26,8 +26,8 @@ describe("Abilities - Moody", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.ability(Abilities.MOODY) .ability(AbilityId.MOODY)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.moveset(Moves.SPLASH); .moveset(Moves.SPLASH);
}); });

View File

@ -1,6 +1,6 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import Phaser from "phaser"; import Phaser from "phaser";
@ -29,8 +29,8 @@ describe("Abilities - Moxie", () => {
const moveToUse = Moves.AERIAL_ACE; const moveToUse = Moves.AERIAL_ACE;
game.override.battleStyle("single"); game.override.battleStyle("single");
game.override.enemySpecies(Species.RATTATA); game.override.enemySpecies(Species.RATTATA);
game.override.enemyAbility(Abilities.MOXIE); game.override.enemyAbility(AbilityId.MOXIE);
game.override.ability(Abilities.MOXIE); game.override.ability(AbilityId.MOXIE);
game.override.startingLevel(2000); game.override.startingLevel(2000);
game.override.moveset([moveToUse]); game.override.moveset([moveToUse]);
game.override.enemyMoveset(Moves.SPLASH); game.override.enemyMoveset(Moves.SPLASH);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -23,11 +23,11 @@ describe("Abilities - Mummy", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.MUMMY) .ability(AbilityId.MUMMY)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.TACKLE); .enemyMoveset(Moves.TACKLE);
}); });
@ -37,7 +37,7 @@ describe("Abilities - Mummy", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getEnemyPokemon()?.getAbility().id).toBe(Abilities.MUMMY); expect(game.scene.getEnemyPokemon()?.getAbility().id).toBe(AbilityId.MUMMY);
}); });
it("should not change the enemy's ability hit by a non-contact move", async () => { it("should not change the enemy's ability hit by a non-contact move", async () => {
@ -47,6 +47,6 @@ describe("Abilities - Mummy", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getEnemyPokemon()?.getAbility().id).toBe(Abilities.BALL_FETCH); expect(game.scene.getEnemyPokemon()?.getAbility().id).toBe(AbilityId.BALL_FETCH);
}); });
}); });

View File

@ -1,7 +1,7 @@
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { TurnStartPhase } from "#app/phases/turn-start-phase";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -28,10 +28,10 @@ describe("Abilities - Mycelium Might", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.CLEAR_BODY) .enemyAbility(AbilityId.CLEAR_BODY)
.enemyMoveset(Moves.QUICK_ATTACK) .enemyMoveset(Moves.QUICK_ATTACK)
.ability(Abilities.MYCELIUM_MIGHT) .ability(AbilityId.MYCELIUM_MIGHT)
.moveset([Moves.QUICK_ATTACK, Moves.BABY_DOLL_EYES]); .moveset([Moves.QUICK_ATTACK, Moves.BABY_DOLL_EYES]);
}); });

View File

@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle";
import type { CommandPhase } from "#app/phases/command-phase"; import type { CommandPhase } from "#app/phases/command-phase";
import { Command } from "#app/ui/command-ui-handler"; import { Command } from "#app/ui/command-ui-handler";
import { PostSummonWeatherChangeAbAttr } from "#app/data/abilities/ability"; import { PostSummonWeatherChangeAbAttr } from "#app/data/abilities/ability";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { PokeballType } from "#enums/pokeball"; import { PokeballType } from "#enums/pokeball";
@ -30,16 +30,16 @@ describe("Abilities - Neutralizing Gas", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.NEUTRALIZING_GAS) .ability(AbilityId.NEUTRALIZING_GAS)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should prevent other abilities from activating", async () => { it("should prevent other abilities from activating", async () => {
game.override.enemyAbility(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
@ -50,7 +50,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it("should allow the user's passive to activate", async () => { it("should allow the user's passive to activate", async () => {
game.override.passiveAbility(Abilities.INTREPID_SWORD); game.override.passiveAbility(AbilityId.INTREPID_SWORD);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
@ -60,7 +60,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it.todo("should activate before other abilities", async () => { it.todo("should activate before other abilities", async () => {
game.override.enemySpecies(Species.ACCELGOR).enemyLevel(100).enemyAbility(Abilities.INTIMIDATE); game.override.enemySpecies(Species.ACCELGOR).enemyLevel(100).enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
@ -73,8 +73,8 @@ describe("Abilities - Neutralizing Gas", () => {
it("should activate other abilities when removed", async () => { it("should activate other abilities when removed", async () => {
game.override game.override
.enemyAbility(Abilities.INTREPID_SWORD) .enemyAbility(AbilityId.INTREPID_SWORD)
.enemyPassiveAbility(Abilities.DAUNTLESS_SHIELD) .enemyPassiveAbility(AbilityId.DAUNTLESS_SHIELD)
.enemyMoveset(Moves.ENTRAINMENT); .enemyMoveset(Moves.ENTRAINMENT);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
@ -91,7 +91,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it("should not activate the user's other ability when removed", async () => { it("should not activate the user's other ability when removed", async () => {
game.override.passiveAbility(Abilities.INTIMIDATE).enemyMoveset(Moves.ENTRAINMENT); game.override.passiveAbility(AbilityId.INTIMIDATE).enemyMoveset(Moves.ENTRAINMENT);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
// Neutralising gas user's passive is still active // Neutralising gas user's passive is still active
@ -137,7 +137,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it("should deactivate when the pokemon faints", async () => { it("should deactivate when the pokemon faints", async () => {
game.override.ability(Abilities.BALL_FETCH).enemyAbility(Abilities.NEUTRALIZING_GAS); game.override.ability(AbilityId.BALL_FETCH).enemyAbility(AbilityId.NEUTRALIZING_GAS);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
@ -148,7 +148,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it("should deactivate upon catching a wild pokemon", async () => { it("should deactivate upon catching a wild pokemon", async () => {
game.override.battleStyle("single").enemyAbility(Abilities.NEUTRALIZING_GAS).ability(Abilities.BALL_FETCH); game.override.battleStyle("single").enemyAbility(AbilityId.NEUTRALIZING_GAS).ability(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined(); expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
@ -160,7 +160,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it("should deactivate after fleeing from a wild pokemon", async () => { it("should deactivate after fleeing from a wild pokemon", async () => {
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS).ability(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.NEUTRALIZING_GAS).ability(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined(); expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
@ -174,7 +174,7 @@ describe("Abilities - Neutralizing Gas", () => {
}); });
it("should not activate abilities of pokemon no longer on the field", async () => { it("should not activate abilities of pokemon no longer on the field", async () => {
game.override.battleStyle("single").ability(Abilities.NEUTRALIZING_GAS).enemyAbility(Abilities.DELTA_STREAM); game.override.battleStyle("single").ability(AbilityId.NEUTRALIZING_GAS).enemyAbility(AbilityId.DELTA_STREAM);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;

View File

@ -1,7 +1,7 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase";
import { MoveEndPhase } from "#app/phases/move-end-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { HitCheckResult } from "#enums/hit-check-result"; import { HitCheckResult } from "#enums/hit-check-result";
@ -27,10 +27,10 @@ describe("Abilities - No Guard", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset(Moves.ZAP_CANNON) .moveset(Moves.ZAP_CANNON)
.ability(Abilities.NO_GUARD) .ability(AbilityId.NO_GUARD)
.enemyLevel(200) .enemyLevel(200)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -1,7 +1,7 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { Moves } from "#app/enums/moves"; import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species"; import { Species } from "#app/enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -24,10 +24,10 @@ import { toDmgValue } from "#app/utils/common";
*/ */
describe.each([ describe.each([
{ ab: Abilities.GALVANIZE, ab_name: "Galvanize", ty: PokemonType.ELECTRIC, tyName: "electric" }, { ab: AbilityId.GALVANIZE, ab_name: "Galvanize", ty: PokemonType.ELECTRIC, tyName: "electric" },
{ ab: Abilities.PIXILATE, ab_name: "Pixilate", ty: PokemonType.FAIRY, tyName: "fairy" }, { ab: AbilityId.PIXILATE, ab_name: "Pixilate", ty: PokemonType.FAIRY, tyName: "fairy" },
{ ab: Abilities.REFRIGERATE, ab_name: "Refrigerate", ty: PokemonType.ICE, tyName: "ice" }, { ab: AbilityId.REFRIGERATE, ab_name: "Refrigerate", ty: PokemonType.ICE, tyName: "ice" },
{ ab: Abilities.AERILATE, ab_name: "Aerilate", ty: PokemonType.FLYING, tyName: "flying" }, { ab: AbilityId.AERILATE, ab_name: "Aerilate", ty: PokemonType.FLYING, tyName: "flying" },
])("Abilities - $ab_name", ({ ab, ty, tyName }) => { ])("Abilities - $ab_name", ({ ab, ty, tyName }) => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
let game: GameManager; let game: GameManager;
@ -52,7 +52,7 @@ describe.each([
.ability(ab) .ability(ab)
.moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES]) .moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES])
.enemySpecies(Species.DUSCLOPS) .enemySpecies(Species.DUSCLOPS)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(Moves.SPLASH)
.enemyLevel(100); .enemyLevel(100);
}); });
@ -78,9 +78,9 @@ describe.each([
}); });
// Galvanize specifically would like to check for volt absorb's activation // Galvanize specifically would like to check for volt absorb's activation
if (ab === Abilities.GALVANIZE) { if (ab === AbilityId.GALVANIZE) {
it("should cause Normal-type attacks to activate Volt Absorb", async () => { it("should cause Normal-type attacks to activate Volt Absorb", async () => {
game.override.enemyAbility(Abilities.VOLT_ABSORB); game.override.enemyAbility(AbilityId.VOLT_ABSORB);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -112,7 +112,7 @@ describe.each([
])("should not change the type of $moveName", async ({ move, expected_ty: expectedTy }) => { ])("should not change the type of $moveName", async ({ move, expected_ty: expectedTy }) => {
game.override game.override
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset([move]) .moveset([move])
.starterSpecies(Species.MAGIKARP); .starterSpecies(Species.MAGIKARP);

View File

@ -1,7 +1,7 @@
import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants"; import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants";
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -27,11 +27,11 @@ describe("Abilities - Normalize", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.TACKLE]) .moveset([Moves.TACKLE])
.ability(Abilities.NORMALIZE) .ability(AbilityId.NORMALIZE)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -24,18 +24,18 @@ describe("Abilities - Oblivious", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should remove taunt when gained", async () => { it("should remove taunt when gained", async () => {
game.override game.override
.ability(Abilities.OBLIVIOUS) .ability(AbilityId.OBLIVIOUS)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);
@ -51,8 +51,8 @@ describe("Abilities - Oblivious", () => {
it("should remove infatuation when gained", async () => { it("should remove infatuation when gained", async () => {
game.override game.override
.ability(Abilities.OBLIVIOUS) .ability(AbilityId.OBLIVIOUS)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -24,18 +24,18 @@ describe("Abilities - Own Tempo", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH]) .moveset([Moves.SPLASH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
it("should remove confusion when gained", async () => { it("should remove confusion when gained", async () => {
game.override game.override
.ability(Abilities.OWN_TEMPO) .ability(AbilityId.OWN_TEMPO)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset(Moves.SKILL_SWAP) .moveset(Moves.SKILL_SWAP)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.FEEBAS]); await game.classicMode.startBattle([Species.FEEBAS]);

View File

@ -1,7 +1,7 @@
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
@ -28,9 +28,9 @@ describe("Abilities - Parental Bond", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override.battleStyle("single");
game.override.disableCrits(); game.override.disableCrits();
game.override.ability(Abilities.PARENTAL_BOND); game.override.ability(AbilityId.PARENTAL_BOND);
game.override.enemySpecies(Species.SNORLAX); game.override.enemySpecies(Species.SNORLAX);
game.override.enemyAbility(Abilities.FUR_COAT); game.override.enemyAbility(AbilityId.FUR_COAT);
game.override.enemyMoveset(Moves.SPLASH); game.override.enemyMoveset(Moves.SPLASH);
game.override.startingLevel(100); game.override.startingLevel(100);
game.override.enemyLevel(100); game.override.enemyLevel(100);
@ -169,7 +169,7 @@ describe("Abilities - Parental Bond", () => {
it("should not apply to multi-target moves", async () => { it("should not apply to multi-target moves", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.moveset([Moves.EARTHQUAKE]); game.override.moveset([Moves.EARTHQUAKE]);
game.override.passiveAbility(Abilities.LEVITATE); game.override.passiveAbility(AbilityId.LEVITATE);
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]); await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
@ -394,7 +394,7 @@ describe("Abilities - Parental Bond", () => {
it("should not cause user to hit into Storm Drain more than once", async () => { it("should not cause user to hit into Storm Drain more than once", async () => {
game.override.moveset([Moves.WATER_GUN]); game.override.moveset([Moves.WATER_GUN]);
game.override.enemyAbility(Abilities.STORM_DRAIN); game.override.enemyAbility(AbilityId.STORM_DRAIN);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);

View File

@ -1,5 +1,5 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { CommandPhase } from "#app/phases/command-phase"; import { CommandPhase } from "#app/phases/command-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -28,7 +28,7 @@ describe("Abilities - Pastel Veil", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.TOXIC_THREAD, Moves.SPLASH]) .moveset([Moves.TOXIC_THREAD, Moves.SPLASH])
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemySpecies(Species.SUNKERN) .enemySpecies(Species.SUNKERN)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });
@ -39,7 +39,7 @@ describe("Abilities - Pastel Veil", () => {
const magikarp = game.scene.getPlayerField()[0]; const magikarp = game.scene.getPlayerField()[0];
ponyta.abilityIndex = 1; ponyta.abilityIndex = 1;
expect(ponyta.hasAbility(Abilities.PASTEL_VEIL)).toBe(true); expect(ponyta.hasAbility(AbilityId.PASTEL_VEIL)).toBe(true);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.TOXIC_THREAD, 1, BattlerIndex.PLAYER); game.move.select(Moves.TOXIC_THREAD, 1, BattlerIndex.PLAYER);
@ -55,7 +55,7 @@ describe("Abilities - Pastel Veil", () => {
const magikarp = game.scene.getPlayerField()[0]; const magikarp = game.scene.getPlayerField()[0];
ponyta.abilityIndex = 1; ponyta.abilityIndex = 1;
expect(ponyta.hasAbility(Abilities.PASTEL_VEIL)).toBe(true); expect(ponyta.hasAbility(AbilityId.PASTEL_VEIL)).toBe(true);
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
game.move.select(Moves.TOXIC_THREAD, 1, BattlerIndex.PLAYER); game.move.select(Moves.TOXIC_THREAD, 1, BattlerIndex.PLAYER);

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -25,10 +25,10 @@ describe("Abilities - Perish Song", () => {
game.override.disableCrits(); game.override.disableCrits();
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH);
game.override.starterSpecies(Species.CURSOLA); game.override.starterSpecies(Species.CURSOLA);
game.override.ability(Abilities.PERISH_BODY); game.override.ability(AbilityId.PERISH_BODY);
game.override.moveset([Moves.SPLASH]); game.override.moveset([Moves.SPLASH]);
}); });

View File

@ -1,7 +1,7 @@
import { Status } from "#app/data/status-effect"; import { Status } from "#app/data/status-effect";
import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase"; import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
@ -27,7 +27,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override game.override
.battleStyle("single") .battleStyle("single")
.ability(Abilities.POWER_CONSTRUCT) .ability(AbilityId.POWER_CONSTRUCT)
.moveset([moveToUse]) .moveset([moveToUse])
.enemyMoveset(Moves.TACKLE); .enemyMoveset(Moves.TACKLE);
}); });

View File

@ -1,5 +1,5 @@
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import { Abilities } from "#app/enums/abilities"; import { AbilityId } from "#app/enums/abilities";
import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -30,7 +30,7 @@ describe("Abilities - Power Spot", () => {
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]); game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
game.override.enemyMoveset(Moves.SPLASH); game.override.enemyMoveset(Moves.SPLASH);
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH);
}); });
it("raises the power of allies' special moves by 30%", async () => { it("raises the power of allies' special moves by 30%", async () => {

View File

@ -3,7 +3,7 @@ import { PokemonType } from "#enums/pokemon-type";
import { Weather } from "#app/data/weather"; import { Weather } from "#app/data/weather";
import type { PlayerPokemon } from "#app/field/pokemon"; import type { PlayerPokemon } from "#app/field/pokemon";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome"; import { Biome } from "#enums/biome";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
@ -31,7 +31,7 @@ describe("Abilities - Protean", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.ability(Abilities.PROTEAN) .ability(AbilityId.PROTEAN)
.startingLevel(100) .startingLevel(100)
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyMoveset(Moves.ENDURE); .enemyMoveset(Moves.ENDURE);
@ -68,7 +68,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.AGILITY); game.move.select(Moves.AGILITY);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN);
const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]]; const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]];
const moveType = PokemonType[allMoves[Moves.AGILITY].type]; const moveType = PokemonType[allMoves[Moves.AGILITY].type];
expect(leadPokemonType).not.toBe(moveType); expect(leadPokemonType).not.toBe(moveType);
@ -100,7 +100,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.WEATHER_BALL); game.move.select(Moves.WEATHER_BALL);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN);
expect(leadPokemon.getTypes()).toHaveLength(1); expect(leadPokemon.getTypes()).toHaveLength(1);
const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]],
moveType = PokemonType[PokemonType.FIRE]; moveType = PokemonType[PokemonType.FIRE];
@ -109,7 +109,7 @@ describe("Abilities - Protean", () => {
test("ability applies correctly even if the type has changed by another ability", async () => { test("ability applies correctly even if the type has changed by another ability", async () => {
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]);
game.override.passiveAbility(Abilities.REFRIGERATE); game.override.passiveAbility(AbilityId.REFRIGERATE);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -119,7 +119,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN);
expect(leadPokemon.getTypes()).toHaveLength(1); expect(leadPokemon.getTypes()).toHaveLength(1);
const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]], const leadPokemonType = PokemonType[leadPokemon.getTypes()[0]],
moveType = PokemonType[PokemonType.ICE]; moveType = PokemonType[PokemonType.ICE];
@ -214,7 +214,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN);
}); });
test("ability is not applied if pokemon is terastallized", async () => { test("ability is not applied if pokemon is terastallized", async () => {
@ -230,7 +230,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN);
}); });
test("ability is not applied if pokemon uses struggle", async () => { test("ability is not applied if pokemon uses struggle", async () => {
@ -244,7 +244,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.STRUGGLE); game.move.select(Moves.STRUGGLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN);
}); });
test("ability is not applied if the pokemon's move fails", async () => { test("ability is not applied if the pokemon's move fails", async () => {
@ -258,7 +258,7 @@ describe("Abilities - Protean", () => {
game.move.select(Moves.BURN_UP); game.move.select(Moves.BURN_UP);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
expect(leadPokemon.waveData.abilitiesApplied).not.toContain(Abilities.PROTEAN); expect(leadPokemon.waveData.abilitiesApplied).not.toContain(AbilityId.PROTEAN);
}); });
test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => {
@ -293,7 +293,7 @@ describe("Abilities - Protean", () => {
}); });
function testPokemonTypeMatchesDefaultMoveType(pokemon: PlayerPokemon, move: Moves) { function testPokemonTypeMatchesDefaultMoveType(pokemon: PlayerPokemon, move: Moves) {
expect(pokemon.waveData.abilitiesApplied).toContain(Abilities.PROTEAN); expect(pokemon.waveData.abilitiesApplied).toContain(AbilityId.PROTEAN);
expect(pokemon.getTypes()).toHaveLength(1); expect(pokemon.getTypes()).toHaveLength(1);
const pokemonType = PokemonType[pokemon.getTypes()[0]], const pokemonType = PokemonType[pokemon.getTypes()[0]],
moveType = PokemonType[allMoves[move].type]; moveType = PokemonType[allMoves[move].type];

View File

@ -1,4 +1,4 @@
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Nature } from "#enums/nature"; import { Nature } from "#enums/nature";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
@ -26,11 +26,11 @@ describe("Abilities - Protosynthesis", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset([Moves.SPLASH, Moves.TACKLE]) .moveset([Moves.SPLASH, Moves.TACKLE])
.ability(Abilities.PROTOSYNTHESIS) .ability(AbilityId.PROTOSYNTHESIS)
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH);
}); });

View File

@ -1,7 +1,7 @@
import { BypassSpeedChanceAbAttr } from "#app/data/abilities/ability"; import { BypassSpeedChanceAbAttr } from "#app/data/abilities/ability";
import { allAbilities } from "#app/data/data-lists"; import { allAbilities } from "#app/data/data-lists";
import { FaintPhase } from "#app/phases/faint-phase"; import { FaintPhase } from "#app/phases/faint-phase";
import { Abilities } from "#enums/abilities"; import { AbilityId } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -27,15 +27,15 @@ describe("Abilities - Quick Draw", () => {
game.override.battleStyle("single"); game.override.battleStyle("single");
game.override.starterSpecies(Species.MAGIKARP); game.override.starterSpecies(Species.MAGIKARP);
game.override.ability(Abilities.QUICK_DRAW); game.override.ability(AbilityId.QUICK_DRAW);
game.override.moveset([Moves.TACKLE, Moves.TAIL_WHIP]); game.override.moveset([Moves.TACKLE, Moves.TAIL_WHIP]);
game.override.enemyLevel(100); game.override.enemyLevel(100);
game.override.enemySpecies(Species.MAGIKARP); game.override.enemySpecies(Species.MAGIKARP);
game.override.enemyAbility(Abilities.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH);
game.override.enemyMoveset([Moves.TACKLE]); game.override.enemyMoveset([Moves.TACKLE]);
vi.spyOn(allAbilities[Abilities.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue( vi.spyOn(allAbilities[AbilityId.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(
100, 100,
); );
}); });
@ -54,7 +54,7 @@ describe("Abilities - Quick Draw", () => {
expect(pokemon.isFainted()).toBe(false); expect(pokemon.isFainted()).toBe(false);
expect(enemy.isFainted()).toBe(true); expect(enemy.isFainted()).toBe(true);
expect(pokemon.waveData.abilitiesApplied).contain(Abilities.QUICK_DRAW); expect(pokemon.waveData.abilitiesApplied).contain(AbilityId.QUICK_DRAW);
}, 20000); }, 20000);
test( test(
@ -76,7 +76,7 @@ describe("Abilities - Quick Draw", () => {
expect(pokemon.isFainted()).toBe(true); expect(pokemon.isFainted()).toBe(true);
expect(enemy.isFainted()).toBe(false); expect(enemy.isFainted()).toBe(false);
expect(pokemon.waveData.abilitiesApplied).not.contain(Abilities.QUICK_DRAW); expect(pokemon.waveData.abilitiesApplied).not.contain(AbilityId.QUICK_DRAW);
}, },
); );
@ -96,6 +96,6 @@ describe("Abilities - Quick Draw", () => {
expect(pokemon.isFainted()).toBe(true); expect(pokemon.isFainted()).toBe(true);
expect(enemy.isFainted()).toBe(false); expect(enemy.isFainted()).toBe(false);
expect(pokemon.waveData.abilitiesApplied).contain(Abilities.QUICK_DRAW); expect(pokemon.waveData.abilitiesApplied).contain(AbilityId.QUICK_DRAW);
}, 20000); }, 20000);
}); });

Some files were not shown because too many files have changed in this diff Show More