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( const matchingModifier = this.findModifier(
(m) => (m) =>
m instanceof PokemonHeldItemModifier && m instanceof PokemonHeldItemModifier
m.matchType(mod) && && m.matchType(mod)
m.pokemonId === target.id, && m.pokemonId === target.id,
target.isPlayer(), target.isPlayer(),
) as PokemonHeldItemModifier; ) as PokemonHeldItemModifier;
@ -3463,7 +3463,7 @@ export default class BattleScene extends SceneBase {
const removeOld = mod.stackCount === 0; 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> { 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; const modifiers = !enemy ? this.modifiers : this.enemyModifiers;
return modifiers.indexOf(modifier) > -1; return modifiers.indexOf(modifier) > -1;
} }

View File

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

View File

@ -14,7 +14,7 @@ export class ShowAbilityPhase extends PokemonPhase {
this.passive = passive; this.passive = passive;
// Set these now as the pokemon object may change before the queued phase is run // Set these now as the pokemon object may change before the queued phase is run
this.pokemonName = getPokemonNameWithAffix(this.getPokemon()); 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() { start() {

View File

@ -28,7 +28,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
this.setVisible(false); this.setVisible(false);
} }
startTween(config: any, text?: string): Promise<void> { public async startTween(config: any, text?: string): Promise<void> {
this.setVisible(true); this.setVisible(true);
if (text) { if (text) {
this.abilityBarText.setText(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 })}`); const text = (`${i18next.t("fightUiHandler:abilityFlyInText", { pokemonName: pokemonName, passive: passive ? i18next.t("fightUiHandler:passive") : "", abilityName: abilityName })}`);
globalScene.fieldUI.bringToTop(this); globalScene.fieldUI.bringToTop(this);
@ -61,7 +61,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
}, text); }, text);
} }
hide(): Promise<void> { public async hide(): Promise<void> {
return this.startTween({ return this.startTween({
targets: this, targets: this,
x: -91, x: -91,