mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 07:42:25 +02:00
Minor changes
This commit is contained in:
parent
210df1ceb9
commit
98dee7a48a
@ -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;
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
|
||||
export class Phase {
|
||||
start() {
|
||||
|
||||
}
|
||||
start() {}
|
||||
|
||||
end() {
|
||||
globalScene.shiftPhase();
|
||||
|
@ -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() {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user