diff --git a/src/data/challenge.ts b/src/data/challenge.ts index a82ae3a1432..30e2025f3b1 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -19,7 +19,7 @@ import { Challenges } from "#enums/challenges"; import { SpeciesId } from "#enums/species-id"; import { TrainerType } from "#enums/trainer-type"; import { Nature } from "#enums/nature"; -import type { MoveId } from "#enums/move-id"; +import { MoveId } from "#enums/move-id"; import { TypeColor, TypeShadow } from "#enums/color"; import { ModifierTier } from "#enums/modifier-tier"; import { globalScene } from "#app/global-scene"; @@ -1017,7 +1017,7 @@ export class HardcoreChallenge extends Challenge { } applyMoveBlacklist(move: PokemonMove, moveCanBeUsed: BooleanHolder): boolean { - const moveBlacklist = [Moves.REVIVAL_BLESSING]; + const moveBlacklist = [MoveId.REVIVAL_BLESSING]; moveCanBeUsed.value = !moveBlacklist.includes(move.moveId); return true; } diff --git a/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts b/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts index d67a5fdc964..6912905fbf9 100644 --- a/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-pokemon-utils.ts @@ -38,7 +38,8 @@ import type { AbilityId } from "#enums/ability-id"; import type { PokeballType } from "#enums/pokeball"; import { StatusEffect } from "#enums/status-effect"; import { BooleanHolder } from "#app/utils/common"; -import { ChallengeType, applyChallenges } from "#app/data/challenge"; +import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; /** Will give +1 level every 10 waves */ export const STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER = 1; diff --git a/src/enums/challenge-type.ts b/src/enums/challenge-type.ts index d9b1fce3e6e..25371c8fffa 100644 --- a/src/enums/challenge-type.ts +++ b/src/enums/challenge-type.ts @@ -65,5 +65,44 @@ export enum ChallengeType { /** * Modifies what the pokemon stats for Flip Stat Mode. */ - FLIP_STAT + FLIP_STAT, + /** + * Challenge that modifies if the player should auto heal every 10th wave + */ + NO_HEAL_PHASE, + /** + * Modifies if the shop item is blacklisted + * @see {@linkcode Challenge.applyShopItemBlacklist} + */ + SHOP_ITEM_BLACKLIST, + /** + * Modifies if the random item is blacklisted + * @see {@linkcode Challenge.applyRandomItemBlacklist} + */ + RANDOM_ITEM_BLACKLIST, + /** + * Modifies if the move is blacklisted + * @see {@linkcode Challenge.applyMoveBlacklist} + */ + MOVE_BLACKLIST, + /** + * Modifies if pokemon are allowed to be revived from fainting + * @see {@linkcode Challenge.applyRevivePrevention} + */ + PREVENT_REVIVE, + /** + * Modifies if pokemon are allowed to be revived from fainting + * @see {@linkcode Challenge.applyDeletePokemon} + */ + DELETE_POKEMON, + /** + * Challenge that modifies if the player should catch pokemon on waves other than the first + * @see {@linkcode Challenge.applyAddPokemonToParty} + */ + ADD_POKEMON_TO_PARTY, + /** + * Modifies if pokemon are allowed to fuse + * @see {@linkcode Challenge.applyShouldFuse} + */ + SHOULD_FUSE, } diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 70f0abc820b..57a3297865d 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -130,6 +130,7 @@ import { ModifierPoolType } from "#enums/modifier-pool-type"; import { getModifierPoolForType, getModifierType } from "#app/utils/modifier-utils"; import type { ModifierTypeFunc, WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types"; import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; const outputModifierData = false; const useMaxWeightForOutput = false; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index c4519e09acd..ff0f0221596 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -46,6 +46,7 @@ import { applyAbAttrs, applyPostItemLostAbAttrs } from "#app/data/abilities/appl import { globalScene } from "#app/global-scene"; import type { ModifierInstanceMap, ModifierString } from "#app/@types/modifier-types"; import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; export type ModifierPredicate = (modifier: Modifier) => boolean; diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index 84bc677f4c4..13e0437ae9f 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -25,7 +25,8 @@ import i18next from "i18next"; import { globalScene } from "#app/global-scene"; import { Gender } from "#app/data/gender"; import { BooleanHolder } from "#app/utils/common"; -import { ChallengeType, applyChallenges } from "#app/data/challenge"; +import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; export class AttemptCapturePhase extends PokemonPhase { public readonly phaseName = "AttemptCapturePhase"; diff --git a/src/phases/battle-end-phase.ts b/src/phases/battle-end-phase.ts index 7dc2e9d4622..a38d697a078 100644 --- a/src/phases/battle-end-phase.ts +++ b/src/phases/battle-end-phase.ts @@ -3,7 +3,8 @@ import { applyPostBattleAbAttrs } from "#app/data/abilities/apply-ab-attrs"; import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier"; import { BattlePhase } from "./battle-phase"; import { BooleanHolder } from "#app/utils/common"; -import { applyChallenges, ChallengeType } from "#app/data/challenge"; +import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; export class BattleEndPhase extends BattlePhase { public readonly phaseName = "BattleEndPhase"; diff --git a/src/phases/party-heal-phase.ts b/src/phases/party-heal-phase.ts index 594f6f9072d..e93a5b642b9 100644 --- a/src/phases/party-heal-phase.ts +++ b/src/phases/party-heal-phase.ts @@ -1,7 +1,8 @@ import { globalScene } from "#app/global-scene"; import { BooleanHolder, fixedInt } from "#app/utils/common"; import { BattlePhase } from "./battle-phase"; -import { applyChallenges, ChallengeType } from "#app/data/challenge"; +import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; export class PartyHealPhase extends BattlePhase { public readonly phaseName = "PartyHealPhase"; diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index 9ccc28d6bd7..fa54b80558e 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -8,6 +8,7 @@ import { handleMysteryEncounterVictory } from "#app/data/mystery-encounters/util import { globalScene } from "#app/global-scene"; import { timedEventManager } from "#app/global-event-manager"; +import { ChallengeType } from "#enums/challenge-type"; import { BooleanHolder } from "#app/utils/common"; import { applyChallenges } from "#app/data/challenge"; @@ -111,7 +112,12 @@ export class VictoryPhase extends PokemonPhase { } if (!isHealPhaseActive.value) { //Push shop instead of healing phase for NoHealChallenge - globalScene.pushPhase(new SelectModifierPhase(undefined, undefined, this.getFixedBattleCustomModifiers())); + globalScene.phaseManager.pushNew( + "SelectModifierPhase", + undefined, + undefined, + this.getFixedBattleCustomModifiers(), + ); } } diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 68ee8f60c44..e9b3357ead5 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -16,7 +16,8 @@ import i18next from "i18next"; import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; import Phaser from "phaser"; import type { PokeballType } from "#enums/pokeball"; -import { applyChallenges, ChallengeType } from "#app/data/challenge"; +import { applyChallenges } from "#app/data/challenge"; +import { ChallengeType } from "#enums/challenge-type"; import { BooleanHolder } from "#app/utils/common"; export const SHOP_OPTIONS_ROW_LIMIT = 7;