Fixed bugs

This commit is contained in:
Bertie690 2025-08-08 13:47:30 -04:00
parent 96e3b7f11c
commit a691c43d33
6 changed files with 30 additions and 15 deletions

View File

@ -748,12 +748,17 @@ export class TypeImmunityHealAbAttr extends TypeImmunityAbAttr {
const { pokemon, cancelled, simulated, passive } = params;
if (!pokemon.isFullHp() && !simulated) {
const abilityName = (!passive ? pokemon.getAbility() : pokemon.getPassiveAbility()).name;
globalScene.phaseManager.unshiftNew("PokemonHealPhase", pokemon.getBattlerIndex(), pokemon.getMaxHp() / 4, {
message: i18next.t("abilityTriggers:typeImmunityHeal", {
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
abilityName,
}),
});
globalScene.phaseManager.unshiftNew(
"PokemonHealPhase",
pokemon.getBattlerIndex(),
toDmgValue(pokemon.getMaxHp() / 4),
{
message: i18next.t("abilityTriggers:typeImmunityHeal", {
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
abilityName,
}),
},
);
cancelled.value = true; // Suppresses "No Effect" message
}
}

View File

@ -160,6 +160,7 @@ export class WishTag extends PositionalTag implements WishArgs {
message: i18next.t("arenaTag:wishTagOnAdd", {
pokemonNameWithAffix: this.pokemonName,
}),
showFullHpMessage: false,
});
}

View File

@ -90,14 +90,12 @@ export class PokemonHealPhase extends CommonAnimPhase {
}
override start() {
// Only play animation if not skipped and target is at full HP
// Only play animation if not skipped and target is not at full HP
if (!this.skipAnim && !this.getPokemon().isFullHp()) {
super.start();
}
this.heal();
super.end();
}
private heal() {

View File

@ -14,6 +14,7 @@ import {
TurnStatusEffectModifier,
} from "#modifiers/modifier";
import { FieldPhase } from "#phases/field-phase";
import { toDmgValue } from "#utils/common";
import i18next from "i18next";
export class TurnEndPhase extends FieldPhase {
@ -35,11 +36,16 @@ export class TurnEndPhase extends FieldPhase {
globalScene.applyModifiers(TurnHealModifier, pokemon.isPlayer(), pokemon);
if (globalScene.arena.terrain?.terrainType === TerrainType.GRASSY && pokemon.isGrounded()) {
globalScene.phaseManager.unshiftNew("PokemonHealPhase", pokemon.getBattlerIndex(), pokemon.getMaxHp() / 16, {
message: i18next.t("battle:turnEndHpRestore", {
pokemonName: getPokemonNameWithAffix(pokemon),
}),
});
globalScene.phaseManager.unshiftNew(
"PokemonHealPhase",
pokemon.getBattlerIndex(),
toDmgValue(pokemon.getMaxHp() / 16),
{
message: i18next.t("battle:turnEndHpRestore", {
pokemonName: getPokemonNameWithAffix(pokemon),
}),
},
);
}
if (!pokemon.isPlayer()) {

View File

@ -144,6 +144,11 @@ describe("Move - Wish", () => {
expectWishActive(0);
const healPhases = game.scene.phaseManager.phaseQueue.filter(p => p.is("PokemonHealPhase"));
// account for phase interceptor stopping jank
const currPhase = game.scene.phaseManager.getCurrentPhase()!;
if (currPhase.is("PokemonHealPhase")) {
healPhases.unshift(currPhase);
}
expect(healPhases).toHaveLength(4);
expect.soft(healPhases.map(php => php.getPokemon())).toEqual(oldOrder);

View File

@ -101,6 +101,7 @@ export class PhaseInterceptor {
* `initPhases()` so that its subclasses can use `super.start()` properly.
*/
private PHASES = [
[PokemonHealPhase, this.startPhase],
[LoginPhase, this.startPhase],
[TitlePhase, this.startPhase],
[SelectGenderPhase, this.startPhase],
@ -147,7 +148,6 @@ export class PhaseInterceptor {
[PositionalTagPhase, this.startPhase],
[PokemonTransformPhase, this.startPhase],
[MysteryEncounterPhase, this.startPhase],
[PokemonHealPhase, this.startPhase],
[MysteryEncounterOptionSelectedPhase, this.startPhase],
[MysteryEncounterBattlePhase, this.startPhase],
[MysteryEncounterRewardsPhase, this.startPhase],