From 4490e4e9bfc99a15d04a0299755ca9281d6c47bf Mon Sep 17 00:00:00 2001 From: "Amani H." <109637146+xsn34kzx@users.noreply.github.com> Date: Wed, 6 Aug 2025 22:22:50 -0400 Subject: [PATCH] Apply Matthew's Suggestions Pt. 2 Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com> --- src/data/challenge.ts | 4 ++-- src/phases/party-heal-phase.ts | 16 ++++++++++------ src/utils/challenge-utils.ts | 12 ++++++------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 1be0d243eb3..117c2597f17 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -379,8 +379,8 @@ export abstract class Challenge { /** * An apply function for POKEMON_MOVE. Derived classes should alter this. - * @param _moveId - The move being checked - * @param _status - Whether the move can be used or not + * @param _moveId - The {@linkcode MoveId} being checked + * @param _status - A {@linkcode BooleanHolder} containing the move's usability status * @returns Whether this function did anything */ applyPokemonMove(_moveId: MoveId, _status: BooleanHolder): boolean { diff --git a/src/phases/party-heal-phase.ts b/src/phases/party-heal-phase.ts index 9596be86c09..5155bfbdeb4 100644 --- a/src/phases/party-heal-phase.ts +++ b/src/phases/party-heal-phase.ts @@ -25,13 +25,17 @@ export class PartyHealPhase extends BattlePhase { const preventRevive = new BooleanHolder(false); applyChallenges(ChallengeType.PREVENT_REVIVE, preventRevive); for (const pokemon of globalScene.getPlayerParty()) { + // Prevent reviving fainted pokemon during certain challenges if (!(pokemon.isFainted() && preventRevive.value)) { - pokemon.hp = pokemon.getMaxHp(); - pokemon.resetStatus(true, false, false, true); - for (const move of pokemon.moveset) { - move.ppUsed = 0; - } - pokemon.updateInfo(true); + continue; + } + + pokemon.hp = pokemon.getMaxHp(); + pokemon.resetStatus(true, false, false, true); + for (const move of pokemon.moveset) { + move.ppUsed = 0; + } + pokemon.updateInfo(true); } } const healSong = globalScene.playSoundWithoutBgm("heal"); diff --git a/src/utils/challenge-utils.ts b/src/utils/challenge-utils.ts index c38bb887a00..43297027e04 100644 --- a/src/utils/challenge-utils.ts +++ b/src/utils/challenge-utils.ts @@ -14,12 +14,12 @@ import { BooleanHolder, type NumberHolder } from "./common"; import { getPokemonSpecies } from "./pokemon-utils"; /** - * Apply all challenges that modify starter choice. - * @param challengeType {@link ChallengeType} ChallengeType.STARTER_CHOICE - * @param pokemon {@link PokemonSpecies} The pokemon to check the validity of. - * @param valid {@link BooleanHolder} A BooleanHolder, the value gets set to false if the pokemon isn't allowed. - * @param dexAttr {@link DexAttrProps} The dex attributes of the pokemon. - * @returns True if any challenge was successfully applied. + * @param challengeType - {@linkcode ChallengeType.STARTER_CHOICE} + * @param pokemon - The {@linkcode PokemonSpecies} to check the validity of + * @param valid - A {@linkcode BooleanHolder} holding the checked species' validity; + * will be set to `false` if the species is disallowed + * @param dexAttr - The {@linkcode DexAttrProps | Dex attributes} of the species + * @returns `true` if any challenge was successfully applied */ export function applyChallenges( challengeType: ChallengeType.STARTER_CHOICE,