mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-15 21:02:18 +02:00
Hide substitute sprite during catch attempts
This commit is contained in:
parent
21e61054b7
commit
7d25580b95
@ -1,20 +1,21 @@
|
||||
import BattleScene from "#app/battle-scene.js";
|
||||
import { BattlerIndex } from "#app/battle.js";
|
||||
import { getPokeballCatchMultiplier, getPokeballAtlasKey, getPokeballTintColor, doPokeballBounceAnim } from "#app/data/pokeball.js";
|
||||
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect.js";
|
||||
import { PokeballType } from "#app/enums/pokeball.js";
|
||||
import { StatusEffect } from "#app/enums/status-effect.js";
|
||||
import { addPokeballOpenParticles, addPokeballCaptureStars } from "#app/field/anims.js";
|
||||
import { EnemyPokemon } from "#app/field/pokemon.js";
|
||||
import { getPokemonNameWithAffix } from "#app/messages.js";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier.js";
|
||||
import { achvs } from "#app/system/achv.js";
|
||||
import { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js";
|
||||
import { SummaryUiMode } from "#app/ui/summary-ui-handler.js";
|
||||
import { Mode } from "#app/ui/ui.js";
|
||||
import BattleScene from "#app/battle-scene";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { getPokeballCatchMultiplier, getPokeballAtlasKey, getPokeballTintColor, doPokeballBounceAnim } from "#app/data/pokeball";
|
||||
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
|
||||
import { PokeballType } from "#app/enums/pokeball";
|
||||
import { StatusEffect } from "#app/enums/status-effect";
|
||||
import { addPokeballOpenParticles, addPokeballCaptureStars } from "#app/field/anims";
|
||||
import { EnemyPokemon } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { achvs } from "#app/system/achv";
|
||||
import { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
|
||||
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import i18next from "i18next";
|
||||
import { PokemonPhase } from "./pokemon-phase";
|
||||
import { VictoryPhase } from "./victory-phase";
|
||||
import { SubstituteTag } from "#app/data/battler-tags";
|
||||
|
||||
export class AttemptCapturePhase extends PokemonPhase {
|
||||
private pokeballType: PokeballType;
|
||||
@ -36,6 +37,11 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||
return this.end();
|
||||
}
|
||||
|
||||
const substitute = pokemon.getTag(SubstituteTag);
|
||||
if (substitute) {
|
||||
substitute.sprite.setVisible(false);
|
||||
}
|
||||
|
||||
this.scene.pokeballCounts[this.pokeballType]--;
|
||||
|
||||
this.originalY = pokemon.y;
|
||||
@ -165,6 +171,11 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||
pokemon.setVisible(true);
|
||||
pokemon.untint(250, "Sine.easeOut");
|
||||
|
||||
const substitute = pokemon.getTag(SubstituteTag);
|
||||
if (substitute) {
|
||||
substitute.sprite.setVisible(true);
|
||||
}
|
||||
|
||||
const pokeballAtlasKey = getPokeballAtlasKey(this.pokeballType);
|
||||
this.pokeball.setTexture("pb", `${pokeballAtlasKey}_opening`);
|
||||
this.scene.time.delayedCall(17, () => this.pokeball.setTexture("pb", `${pokeballAtlasKey}_open`));
|
||||
|
Loading…
Reference in New Issue
Block a user