Apply Matthew's Suggestions Pt. 2

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
This commit is contained in:
Amani H. 2025-08-06 22:22:50 -04:00 committed by GitHub
parent b17d682350
commit 4490e4e9bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 14 deletions

View File

@ -379,8 +379,8 @@ export abstract class Challenge {
/** /**
* An apply function for POKEMON_MOVE. Derived classes should alter this. * An apply function for POKEMON_MOVE. Derived classes should alter this.
* @param _moveId - The move being checked * @param _moveId - The {@linkcode MoveId} being checked
* @param _status - Whether the move can be used or not * @param _status - A {@linkcode BooleanHolder} containing the move's usability status
* @returns Whether this function did anything * @returns Whether this function did anything
*/ */
applyPokemonMove(_moveId: MoveId, _status: BooleanHolder): boolean { applyPokemonMove(_moveId: MoveId, _status: BooleanHolder): boolean {

View File

@ -25,7 +25,11 @@ export class PartyHealPhase extends BattlePhase {
const preventRevive = new BooleanHolder(false); const preventRevive = new BooleanHolder(false);
applyChallenges(ChallengeType.PREVENT_REVIVE, preventRevive); applyChallenges(ChallengeType.PREVENT_REVIVE, preventRevive);
for (const pokemon of globalScene.getPlayerParty()) { for (const pokemon of globalScene.getPlayerParty()) {
// Prevent reviving fainted pokemon during certain challenges
if (!(pokemon.isFainted() && preventRevive.value)) { if (!(pokemon.isFainted() && preventRevive.value)) {
continue;
}
pokemon.hp = pokemon.getMaxHp(); pokemon.hp = pokemon.getMaxHp();
pokemon.resetStatus(true, false, false, true); pokemon.resetStatus(true, false, false, true);
for (const move of pokemon.moveset) { for (const move of pokemon.moveset) {

View File

@ -14,12 +14,12 @@ import { BooleanHolder, type NumberHolder } from "./common";
import { getPokemonSpecies } from "./pokemon-utils"; import { getPokemonSpecies } from "./pokemon-utils";
/** /**
* Apply all challenges that modify starter choice. * @param challengeType - {@linkcode ChallengeType.STARTER_CHOICE}
* @param challengeType {@link ChallengeType} ChallengeType.STARTER_CHOICE * @param pokemon - The {@linkcode PokemonSpecies} to check the validity of
* @param pokemon {@link PokemonSpecies} The pokemon to check the validity of. * @param valid - A {@linkcode BooleanHolder} holding the checked species' validity;
* @param valid {@link BooleanHolder} A BooleanHolder, the value gets set to false if the pokemon isn't allowed. * will be set to `false` if the species is disallowed
* @param dexAttr {@link DexAttrProps} The dex attributes of the pokemon. * @param dexAttr - The {@linkcode DexAttrProps | Dex attributes} of the species
* @returns True if any challenge was successfully applied. * @returns `true` if any challenge was successfully applied
*/ */
export function applyChallenges( export function applyChallenges(
challengeType: ChallengeType.STARTER_CHOICE, challengeType: ChallengeType.STARTER_CHOICE,