From 98dee7a48aea3f3ddc98c9ec7cfbb9f7e822542e Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 21 Feb 2025 18:36:12 -0800 Subject: [PATCH] Minor changes --- src/battle-scene.ts | 10 +++++----- src/phase.ts | 4 +--- src/phases/show-ability-phase.ts | 2 +- src/ui/ability-bar.ts | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 77af34c58a8..adb716f4f9c 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -3439,9 +3439,9 @@ export default class BattleScene extends SceneBase { const matchingModifier = this.findModifier( (m) => - m instanceof PokemonHeldItemModifier && - m.matchType(mod) && - m.pokemonId === target.id, + m instanceof PokemonHeldItemModifier + && m.matchType(mod) + && m.pokemonId === target.id, target.isPlayer(), ) as PokemonHeldItemModifier; @@ -3463,7 +3463,7 @@ export default class BattleScene extends SceneBase { const removeOld = mod.stackCount === 0; - return !removeOld || !source || this.canRemoveModifier(itemModifier, !source.isPlayer()); + return !removeOld || !source || this.hasModifier(itemModifier, !source.isPlayer()); } removePartyMemberModifiers(partyMemberIndex: number): Promise { @@ -3654,7 +3654,7 @@ export default class BattleScene extends SceneBase { }); } - canRemoveModifier(modifier: PersistentModifier, enemy: boolean = false): boolean { + hasModifier(modifier: PersistentModifier, enemy: boolean = false): boolean { const modifiers = !enemy ? this.modifiers : this.enemyModifiers; return modifiers.indexOf(modifier) > -1; } diff --git a/src/phase.ts b/src/phase.ts index 74554b72b38..20cc7cc4063 100644 --- a/src/phase.ts +++ b/src/phase.ts @@ -1,9 +1,7 @@ import { globalScene } from "#app/global-scene"; export class Phase { - start() { - - } + start() {} end() { globalScene.shiftPhase(); diff --git a/src/phases/show-ability-phase.ts b/src/phases/show-ability-phase.ts index 4caa5c5b332..60bb9b50198 100644 --- a/src/phases/show-ability-phase.ts +++ b/src/phases/show-ability-phase.ts @@ -14,7 +14,7 @@ export class ShowAbilityPhase extends PokemonPhase { this.passive = passive; // Set these now as the pokemon object may change before the queued phase is run this.pokemonName = getPokemonNameWithAffix(this.getPokemon()); - this.abilityName = passive ? this.getPokemon().getPassiveAbility().name : this.getPokemon().getAbility().name; + this.abilityName = (passive ? this.getPokemon().getPassiveAbility() : this.getPokemon().getAbility()).name; } start() { diff --git a/src/ui/ability-bar.ts b/src/ui/ability-bar.ts index 35cc39ee76b..84517669ad6 100644 --- a/src/ui/ability-bar.ts +++ b/src/ui/ability-bar.ts @@ -28,7 +28,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container { this.setVisible(false); } - startTween(config: any, text?: string): Promise { + public async startTween(config: any, text?: string): Promise { this.setVisible(true); if (text) { this.abilityBarText.setText(text); @@ -46,7 +46,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container { }); } - showAbility(pokemonName: string, abilityName: string, passive: boolean = false): Promise { + public async showAbility(pokemonName: string, abilityName: string, passive: boolean = false): Promise { const text = (`${i18next.t("fightUiHandler:abilityFlyInText", { pokemonName: pokemonName, passive: passive ? i18next.t("fightUiHandler:passive") : "", abilityName: abilityName })}`); globalScene.fieldUI.bringToTop(this); @@ -61,7 +61,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container { }, text); } - hide(): Promise { + public async hide(): Promise { return this.startTween({ targets: this, x: -91,