Minor changes

This commit is contained in:
Dean 2025-02-21 18:36:12 -08:00
parent 210df1ceb9
commit 98dee7a48a
4 changed files with 10 additions and 12 deletions

View File

@ -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<void> {
@ -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;
}

View File

@ -1,9 +1,7 @@
import { globalScene } from "#app/global-scene";
export class Phase {
start() {
}
start() {}
end() {
globalScene.shiftPhase();

View File

@ -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() {

View File

@ -28,7 +28,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
this.setVisible(false);
}
startTween(config: any, text?: string): Promise<void> {
public async startTween(config: any, text?: string): Promise<void> {
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<void> {
public async showAbility(pokemonName: string, abilityName: string, passive: boolean = false): Promise<void> {
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<void> {
public async hide(): Promise<void> {
return this.startTween({
targets: this,
x: -91,