From 3f3bbf7d85a5ebce71c6e1dfd7c3aa95fb8ac3fe Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Fri, 8 Aug 2025 01:50:56 +0200 Subject: [PATCH] Removed most uses of `allRewards` from across the code --- src/@types/rewards.ts | 3 +- .../encounters/a-trainers-test-encounter.ts | 2 +- .../an-offer-you-cant-refuse-encounter.ts | 4 +-- .../encounters/dark-deal-encounter.ts | 4 +-- .../encounters/delibirdy-encounter.ts | 15 ++++---- .../encounters/field-trip-encounter.ts | 33 +++++++++-------- .../encounters/fiery-fallout-encounter.ts | 1 - .../encounters/fight-or-flight-encounter.ts | 2 +- .../global-trade-system-encounter.ts | 2 +- .../the-expert-pokemon-breeder-encounter.ts | 8 ++--- .../the-winstrate-challenge-encounter.ts | 7 ++-- .../mystery-encounters/mystery-encounter.ts | 36 +++---------------- .../utils/encounter-phase-utils.ts | 6 ++-- src/items/held-items/item-steal.ts | 7 ++-- src/phases/game-over-phase.ts | 6 ++-- src/phases/mystery-encounter-phases.ts | 4 +-- src/phases/select-reward-phase.ts | 5 ++- src/phases/victory-phase.ts | 4 +-- src/timed-event-manager.ts | 6 ++-- 19 files changed, 63 insertions(+), 92 deletions(-) diff --git a/src/@types/rewards.ts b/src/@types/rewards.ts index e6dd7d7e0af..85203a899c1 100644 --- a/src/@types/rewards.ts +++ b/src/@types/rewards.ts @@ -49,4 +49,5 @@ export type SilentReward = | TrainerItemId | typeof RewardId.VOUCHER | typeof RewardId.VOUCHER_PLUS - | typeof RewardId.VOUCHER_PREMIUM; + | typeof RewardId.VOUCHER_PREMIUM + | typeof RewardId.ROGUE_BALL; diff --git a/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts b/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts index 4bbabe73ee4..e09af74f076 100644 --- a/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts +++ b/src/data/mystery-encounters/encounters/a-trainers-test-encounter.ts @@ -150,7 +150,7 @@ export const ATrainersTestEncounter: MysteryEncounter = MysteryEncounterBuilder. }, async () => { const encounter = globalScene.currentBattle.mysteryEncounter!; - // Battle the stat trainer for an Egg and great allRewards + // Battle the stat trainer for an Egg and great rewards const config: EnemyPartyConfig = encounter.enemyPartyConfigs[0]; await transitionMysteryEncounterIntroVisuals(); diff --git a/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts b/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts index 568be661b89..b9c952500b2 100644 --- a/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts +++ b/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts @@ -1,7 +1,7 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { globalScene } from "#app/global-scene"; import { speciesStarterCosts } from "#balance/starters"; -import { allRewards, allTrainerItems } from "#data/data-lists"; +import { allTrainerItems } from "#data/data-lists"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; @@ -136,7 +136,7 @@ export const AnOfferYouCantRefuseEncounter: MysteryEncounter = MysteryEncounterB }) .withOptionPhase(async () => { // Give the player a Shiny Charm - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.SHINY_CHARM); + globalScene.phaseManager.unshiftNew("RewardPhase", TrainerItemId.SHINY_CHARM); leaveEncounterWithoutBattle(true); }) .build(), diff --git a/src/data/mystery-encounters/encounters/dark-deal-encounter.ts b/src/data/mystery-encounters/encounters/dark-deal-encounter.ts index f6213637070..2b9e5688140 100644 --- a/src/data/mystery-encounters/encounters/dark-deal-encounter.ts +++ b/src/data/mystery-encounters/encounters/dark-deal-encounter.ts @@ -1,11 +1,11 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import { allRewards } from "#data/data-lists"; import { Challenges } from "#enums/challenges"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import type { PokemonType } from "#enums/pokemon-type"; +import { RewardId } from "#enums/reward-id"; import { SpeciesId } from "#enums/species-id"; import type { HeldItemConfiguration } from "#items/held-item-data-types"; import type { EnemyPartyConfig, EnemyPokemonConfig } from "#mystery-encounters/encounter-phase-utils"; @@ -160,7 +160,7 @@ export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder.withE .withOptionPhase(async () => { // Give the player 5 Rogue Balls const encounter = globalScene.currentBattle.mysteryEncounter!; - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.ROGUE_BALL); + globalScene.phaseManager.unshiftNew("RewardPhase", RewardId.ROGUE_BALL); // Start encounter with random legendary (7-10 starter strength) that has level additive // If this is a mono-type challenge, always ensure the required type is filtered for diff --git a/src/data/mystery-encounters/encounters/delibirdy-encounter.ts b/src/data/mystery-encounters/encounters/delibirdy-encounter.ts index d0cd73f1bc6..e489306976f 100644 --- a/src/data/mystery-encounters/encounters/delibirdy-encounter.ts +++ b/src/data/mystery-encounters/encounters/delibirdy-encounter.ts @@ -1,11 +1,12 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { timedEventManager } from "#app/global-event-manager"; import { globalScene } from "#app/global-scene"; -import { allHeldItems, allRewards } from "#data/data-lists"; +import { allHeldItems } from "#data/data-lists"; import { HeldItemCategoryId, HeldItemId, isItemInCategory } from "#enums/held-item-id"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { RewardId } from "#enums/reward-id"; import { SpeciesId } from "#enums/species-id"; import { TrainerItemId } from "#enums/trainer-item-id"; import type { PlayerPokemon, Pokemon } from "#field/pokemon"; @@ -61,10 +62,10 @@ const doEventReward = () => { return !fullStack; }); if (candidates.length > 0) { - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards[randSeedItem(candidates)]); + globalScene.phaseManager.unshiftNew("RewardPhase", randSeedItem(candidates)); } else { // At max stacks, give a Voucher instead - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.VOUCHER); + globalScene.phaseManager.unshiftNew("RewardPhase", RewardId.VOUCHER); } } }; @@ -168,7 +169,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with // At max stacks, give the first party pokemon a Shell Bell instead backupOption(); } else { - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.AMULET_COIN); + globalScene.phaseManager.unshiftNew("RewardPhase", TrainerItemId.AMULET_COIN); doEventReward(); } @@ -238,7 +239,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with // At max stacks, give the first party pokemon a Shell Bell instead backupOption(); } else { - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.CANDY_JAR); + globalScene.phaseManager.unshiftNew("RewardPhase", TrainerItemId.CANDY_JAR); doEventReward(); } } else { @@ -249,7 +250,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with // At max stacks, give the first party pokemon a Shell Bell instead backupOption(); } else { - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.BERRY_POUCH); + globalScene.phaseManager.unshiftNew("RewardPhase", TrainerItemId.BERRY_POUCH); doEventReward(); } } @@ -321,7 +322,7 @@ export const DelibirdyEncounter: MysteryEncounter = MysteryEncounterBuilder.with // At max stacks, give the first party pokemon a Shell Bell instead backupOption(); } else { - globalScene.phaseManager.unshiftNew("RewardPhase", allRewards.HEALING_CHARM); + globalScene.phaseManager.unshiftNew("RewardPhase", TrainerItemId.HEALING_CHARM); doEventReward(); } diff --git a/src/data/mystery-encounters/encounters/field-trip-encounter.ts b/src/data/mystery-encounters/encounters/field-trip-encounter.ts index 34b13527cfd..3ceb1783692 100644 --- a/src/data/mystery-encounters/encounters/field-trip-encounter.ts +++ b/src/data/mystery-encounters/encounters/field-trip-encounter.ts @@ -4,8 +4,11 @@ import { MoveCategory } from "#enums/move-category"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; +import { RewardId } from "#enums/reward-id"; import { Stat } from "#enums/stat"; +import { TrainerItemId } from "#enums/trainer-item-id"; import type { PlayerPokemon } from "#field/pokemon"; +import { generateRewardOptionFromId } from "#items/reward-utils"; import type { PokemonMove } from "#moves/pokemon-move"; import { leaveEncounterWithoutBattle, @@ -93,16 +96,16 @@ export const FieldTripEncounter: MysteryEncounter = MysteryEncounterBuilder.with .withOptionPhase(async () => { const encounter = globalScene.currentBattle.mysteryEncounter!; if (encounter.misc.correctMove) { - const modifiers = [ - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.ATK])!, - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.DEF])!, - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.SPD])!, + const rewards = [ + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.ATK })!, + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.DEF })!, + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.SPD })!, generateRewardOptionFromId(RewardId.DIRE_HIT)!, generateRewardOptionFromId(RewardId.RARER_CANDY)!, ]; setEncounterRewards({ - guaranteedRewardOptions: modifiers, + guaranteedRewardOptions: rewards, fillRemaining: false, }); } @@ -141,16 +144,16 @@ export const FieldTripEncounter: MysteryEncounter = MysteryEncounterBuilder.with .withOptionPhase(async () => { const encounter = globalScene.currentBattle.mysteryEncounter!; if (encounter.misc.correctMove) { - const modifiers = [ - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.SPATK])!, - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.SPDEF])!, - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.SPD])!, + const rewards = [ + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.SPATK })!, + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.SPDEF })!, + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.SPD })!, generateRewardOptionFromId(RewardId.DIRE_HIT)!, generateRewardOptionFromId(RewardId.RARER_CANDY)!, ]; setEncounterRewards({ - guaranteedRewardOptions: modifiers, + guaranteedRewardOptions: rewards, fillRemaining: false, }); } @@ -189,16 +192,16 @@ export const FieldTripEncounter: MysteryEncounter = MysteryEncounterBuilder.with .withOptionPhase(async () => { const encounter = globalScene.currentBattle.mysteryEncounter!; if (encounter.misc.correctMove) { - const modifiers = [ - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.ACC])!, - generateRewardOptionFromId(RewardId.TEMP_STAT_STAGE_BOOSTER, [Stat.SPD])!, + const rewards = [ + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.ACC })!, + generateRewardOptionFromId({ id: RewardId.TEMP_STAT_STAGE_BOOSTER, args: Stat.SPD })!, generateRewardOptionFromId(RewardId.GREAT_BALL)!, - generateRewardOptionFromId(RewardId.IV_SCANNER)!, + generateRewardOptionFromId(TrainerItemId.IV_SCANNER)!, generateRewardOptionFromId(RewardId.RARER_CANDY)!, ]; setEncounterRewards({ - guaranteedRewardOptions: modifiers, + guaranteedRewardOptions: rewards, fillRemaining: false, }); } diff --git a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts index a3d1da01351..897de99a84c 100644 --- a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts +++ b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts @@ -250,7 +250,6 @@ export const FieryFalloutEncounter: MysteryEncounter = MysteryEncounterBuilder.w } } - // No allRewards leaveEncounterWithoutBattle(true); }, ) diff --git a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts index c7e56c9c83c..0e03323eae4 100644 --- a/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts +++ b/src/data/mystery-encounters/encounters/fight-or-flight-encounter.ts @@ -99,7 +99,7 @@ export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder. : RarityTier.GREAT; generateRewardPoolWeights(getRewardPoolForType(RewardPoolType.PLAYER), globalScene.getPlayerParty(), 0); let item: RewardOption | null = null; - // TMs and Candy Jar excluded from possible allRewards as they're too swingy in value for a singular item reward + // TMs and Candy Jar excluded from possible rewards as they're too swingy in value for a singular item reward while (!item || isTmReward(item.type) || (item.type as TrainerItemReward).itemId === TrainerItemId.CANDY_JAR) { item = generatePlayerRewardOptions(1, globalScene.getPlayerParty(), [], { guaranteedRarityTiers: [tier], diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index bef2ee6c26c..b3fc6082270 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -426,7 +426,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil generateRewardPoolWeights(getRewardPoolForType(RewardPoolType.PLAYER), party, 0); let item: RewardOption | null = null; - // TMs excluded from possible allRewards + // TMs excluded from possible rewards while (!item || isTmReward(item.type)) { item = generatePlayerRewardOptions(1, party, [], { guaranteedRarityTiers: [tier], diff --git a/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts b/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts index 5e1e50e2c41..87b7f39b286 100644 --- a/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter.ts @@ -304,7 +304,7 @@ export const TheExpertPokemonBreederEncounter: MysteryEncounter = MysteryEncount // Remove all Pokemon from the party except the chosen Pokemon removePokemonFromPartyAndStoreHeldItems(encounter, pokemon1); - // Configure outro dialogue for egg allRewards + // Configure outro dialogue for egg rewards encounter.dialogue.outro = [ { speaker: trainerNameKey, @@ -363,7 +363,7 @@ export const TheExpertPokemonBreederEncounter: MysteryEncounter = MysteryEncount // Remove all Pokemon from the party except the chosen Pokemon removePokemonFromPartyAndStoreHeldItems(encounter, pokemon2); - // Configure outro dialogue for egg allRewards + // Configure outro dialogue for egg rewards encounter.dialogue.outro = [ { speaker: trainerNameKey, @@ -422,7 +422,7 @@ export const TheExpertPokemonBreederEncounter: MysteryEncounter = MysteryEncount // Remove all Pokemon from the party except the chosen Pokemon removePokemonFromPartyAndStoreHeldItems(encounter, pokemon3); - // Configure outro dialogue for egg allRewards + // Configure outro dialogue for egg rewards encounter.dialogue.outro = [ { speaker: trainerNameKey, @@ -640,7 +640,7 @@ function onGameOver() { const chosenPokemon = encounter.misc.chosenPokemon; chosenPokemon.friendship = 0; - // Clear all allRewards that would have been earned + // Clear all rewards that would have been earned encounter.doEncounterRewards = undefined; // Set flag that encounter was failed diff --git a/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts b/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts index e6754a5b4bb..0167d08cae9 100644 --- a/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts @@ -1,7 +1,6 @@ import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { globalScene } from "#app/global-scene"; -import { allRewards } from "#data/data-lists"; import { SpeciesFormChangeAbilityTrigger } from "#data/form-change-triggers"; import { AbilityId } from "#enums/ability-id"; import { BattlerTagType } from "#enums/battler-tag-type"; @@ -119,7 +118,7 @@ export const TheWinstrateChallengeEncounter: MysteryEncounter = MysteryEncounter ], }, async () => { - // Spawn 5 trainer battles back to back with Macho Brace in allRewards + // Spawn 5 trainer battles back to back with Macho Brace in rewards globalScene.currentBattle.mysteryEncounter!.doContinueEncounter = async () => { await endTrainerBattleAndShowDialogue(); }; @@ -158,13 +157,13 @@ async function spawnNextTrainerOrEndEncounter() { await showEncounterDialogue(`${namespace}:victory`, `${namespace}:speaker`); // Give 10x Voucher - const reward = allRewards[RewardId.VOUCHER_PREMIUM](); + const reward = generateRewardOptionFromId(RewardId.VOUCHER_PREMIUM).type; globalScene.applyReward(reward as Reward, {}); globalScene.playSound("item_fanfare"); await showEncounterText(i18next.t("battle:rewardGain", { modifierName: (reward as Reward).name })); await showEncounterDialogue(`${namespace}:victory_2`, `${namespace}:speaker`); - globalScene.ui.clearText(); // Clears "Winstrate" title from screen as allRewards get animated in + globalScene.ui.clearText(); // Clears "Winstrate" title from screen as rewards get animated in const machoBrace = generateRewardOptionFromId(HeldItemId.MACHO_BRACE)!; machoBrace.type.tier = RarityTier.MASTER; setEncounterRewards({ diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index 522a62d2def..da517f5b59d 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -174,11 +174,11 @@ export class MysteryEncounter implements IMysteryEncounter { onVisualsStart?: () => boolean; /** Event triggered prior to {@linkcode CommandPhase}, during {@linkcode TurnInitPhase} */ onTurnStart?: () => boolean; - /** Event prior to any allRewards logic in {@linkcode MysteryEncounterRewardsPhase} */ + /** Event prior to any reward logic in {@linkcode MysteryEncounterRewardsPhase} */ onRewards?: () => Promise; - /** Will provide the player party EXP before allRewards are displayed for that wave */ + /** Will provide the player party EXP before rewards are displayed for that wave */ doEncounterExp?: () => boolean; - /** Will provide the player a allRewards shop for that wave */ + /** Will provide the player a reward shop for that wave */ doEncounterRewards?: () => boolean; /** Will execute callback during VictoryPhase of a continuousEncounter */ doContinueEncounter?: () => Promise; @@ -238,7 +238,7 @@ export class MysteryEncounter implements IMysteryEncounter { encounterMode: MysteryEncounterMode; /** * Flag for checking if it's the first time a shop is being shown for an encounter. - * Defaults to true so that the first shop does not override the specified allRewards. + * Defaults to true so that the first shop does not override the specified rewards. * Will be set to false after a shop is shown (so can't reroll same rarity items for free) */ lockEncounterRarityTiers: boolean; @@ -928,34 +928,6 @@ export class MysteryEncounterBuilder implements Partial { }); } - /** - * Can set custom encounter allRewards via this callback function - * If allRewards are always deterministic for an encounter, this is a good way to set them - * - * NOTE: If allRewards are dependent on options selected, runtime data, etc., - * It may be better to programmatically set doEncounterRewards elsewhere. - * There is a helper function in mystery-encounter utils, setEncounterRewards(), which can be called programmatically to set allRewards - * @param doEncounterRewards Synchronous callback function to perform during allRewards phase of the encounter - * @returns - */ - withRewards(doEncounterRewards: () => boolean): this & Required> { - return Object.assign(this, { doEncounterRewards: doEncounterRewards }); - } - - /** - * Can set custom encounter exp via this callback function - * If exp always deterministic for an encounter, this is a good way to set them - * - * NOTE: If allRewards are dependent on options selected, runtime data, etc., - * It may be better to programmatically set doEncounterExp elsewhere. - * There is a helper function in mystery-encounter utils, setEncounterExp(), which can be called programmatically to set allRewards - * @param doEncounterExp Synchronous callback function to perform during allRewards phase of the encounter - * @returns - */ - withExp(doEncounterExp: () => boolean): this & Required> { - return Object.assign(this, { doEncounterExp: doEncounterExp }); - } - /** * Can be used to perform init logic before intro visuals are shown and before the MysteryEncounterPhase begins * Useful for performing things like procedural generation of intro sprites, etc. diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index 48968a2ff82..3433f9ed01b 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -686,7 +686,7 @@ export function selectOptionThenPokemon( /** * Will initialize reward phases to follow the mystery encounter * Can have shop displayed or skipped - * @param customShopRewards - adds a shop phase with the specified allRewards / reward tiers + * @param customShopRewards - adds a shop phase with the specified reward tiers * @param eggRewards * @param preRewardsCallback - can execute an arbitrary callback before the new phases if necessary (useful for updating items/party/injecting new phases before {@linkcode MysteryEncounterRewardsPhase}) */ @@ -768,8 +768,8 @@ export function initSubsequentOptionSelect(optionSelectSettings: OptionSelectSet /** * Can be used to exit an encounter without any battles or followup - * Will skip any shops and allRewards, and queue the next encounter phase as normal - * @param addHealPhase - when true, will add a shop phase to end of encounter with 0 allRewards but healing items are available + * Will skip any shops and rewards, and queue the next encounter phase as normal + * @param addHealPhase - when true, will add a shop phase to end of encounter with 0 rewards but healing items are available * @param encounterMode - Can set custom encounter mode if necessary (may be required for forcing Pokemon to return before next phase) */ export function leaveEncounterWithoutBattle( diff --git a/src/items/held-items/item-steal.ts b/src/items/held-items/item-steal.ts index 681a1d619b1..cc739c96b43 100644 --- a/src/items/held-items/item-steal.ts +++ b/src/items/held-items/item-steal.ts @@ -79,9 +79,8 @@ export abstract class ItemTransferHeldItem extends HeldItem { } /** - * Modifier for held items that steal items from the enemy at the end of + * Held item that steal items from the enemy at the end of * each turn. - * @see {@linkcode allRewards[MINI_BLACK_HOLE]} */ export class TurnEndItemStealHeldItem extends ItemTransferHeldItem { public effects: HeldItemEffect[] = [HeldItemEffect.TURN_END_ITEM_STEAL]; @@ -120,10 +119,8 @@ export class TurnEndItemStealHeldItem extends ItemTransferHeldItem { } /** - * Modifier for held items that add a chance to steal items from the target of a + * Held item that adds a chance to steal items from the target of a * successful attack. - * @see {@linkcode allRewards[GRIP_CLAW]} - * @see {@linkcode HeldItemTransferModifier} */ export class ContactItemStealChanceHeldItem extends ItemTransferHeldItem { public effects: HeldItemEffect[] = [HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE]; diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index debb9aacb86..c6db38be2d7 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -2,11 +2,11 @@ import { pokerogueApi } from "#api/pokerogue-api"; import { clientSessionId } from "#app/account"; import { globalScene } from "#app/global-scene"; import { pokemonEvolutions } from "#balance/pokemon-evolutions"; -import { allRewards } from "#data/data-lists"; import { getCharVariantFromDialogue } from "#data/dialogue"; import type { PokemonSpecies } from "#data/pokemon-species"; import { BattleType } from "#enums/battle-type"; import { PlayerGender } from "#enums/player-gender"; +import { RewardId } from "#enums/reward-id"; import { TrainerType } from "#enums/trainer-type"; import { UiMode } from "#enums/ui-mode"; import { Unlockables } from "#enums/unlockables"; @@ -151,10 +151,10 @@ export class GameOverPhase extends BattlePhase { this.handleUnlocks(); for (const species of this.firstRibbons) { - globalScene.phaseManager.unshiftNew("RibbonRewardPhase", allRewards.VOUCHER_PLUS, species); + globalScene.phaseManager.unshiftNew("RibbonRewardPhase", RewardId.VOUCHER_PLUS, species); } if (!firstClear) { - globalScene.phaseManager.unshiftNew("GameOverRewardPhase", allRewards.VOUCHER_PREMIUM); + globalScene.phaseManager.unshiftNew("GameOverRewardPhase", RewardId.VOUCHER_PREMIUM); } } this.getRunHistoryEntry().then(runHistoryEntry => { diff --git a/src/phases/mystery-encounter-phases.ts b/src/phases/mystery-encounter-phases.ts index 4f9c51974a1..fb475502cb3 100644 --- a/src/phases/mystery-encounter-phases.ts +++ b/src/phases/mystery-encounter-phases.ts @@ -532,13 +532,13 @@ export class MysteryEncounterRewardsPhase extends Phase { } else { this.doEncounterRewardsAndContinue(); } - // Do not use ME's seedOffset for allRewards, these should always be consistent with waveIndex (once per wave) + // Do not use ME's seedOffset for rewards, these should always be consistent with waveIndex (once per wave) }, globalScene.currentBattle.waveIndex * 1000); } } /** - * Queues encounter EXP and allRewards phases, {@linkcode PostMysteryEncounterPhase}, and ends phase + * Queues encounter EXP and reward phases, {@linkcode PostMysteryEncounterPhase}, and ends phase */ doEncounterRewardsAndContinue() { const encounter = globalScene.currentBattle.mysteryEncounter!; diff --git a/src/phases/select-reward-phase.ts b/src/phases/select-reward-phase.ts index e552b209666..ad0cce1c4f8 100644 --- a/src/phases/select-reward-phase.ts +++ b/src/phases/select-reward-phase.ts @@ -108,7 +108,7 @@ export class SelectRewardPhase extends BattlePhase { default: return false; } - // Pick an option from the allRewards + // Pick an option from the rewards case 1: return this.selectRewardOption(cursor, rewardSelectCallback); // Pick an option from the shop @@ -121,7 +121,7 @@ export class SelectRewardPhase extends BattlePhase { this.resetRewardSelect(rewardSelectCallback); } - // Pick a reward from among the allRewards and apply it + // Pick a reward from among the rewards and apply it private selectRewardOption(cursor: number, rewardSelectCallback: RewardSelectCallback): boolean { if (this.typeOptions.length === 0) { globalScene.ui.clearText(); @@ -175,7 +175,6 @@ export class SelectRewardPhase extends BattlePhase { return cost === -1; } - // Reroll allRewards private rerollRewards() { const rerollCost = this.getRerollCost(globalScene.lockRarityTiers); if (rerollCost < 0 || globalScene.money < rerollCost) { diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index 71debad6ca7..340bb87c737 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -59,7 +59,7 @@ export class VictoryPhase extends PokemonPhase { .map(r => globalScene.phaseManager.pushNew("RewardPhase", r)); break; case ClassicFixedBossWaves.EVIL_BOSS_2: - // Should get Lock Capsule on 165 before shop phase so it can be used in the allRewards shop + // Should get Lock Capsule on 165 before shop phase so it can be used in the reward shop globalScene.phaseManager.pushNew("RewardPhase", TrainerItemId.LOCK_CAPSULE); break; } @@ -124,7 +124,7 @@ export class VictoryPhase extends PokemonPhase { } /** - * If this wave is a fixed battle with special custom modifier allRewards, + * If this wave is a fixed battle with special custom rewards, * will pass those settings to the upcoming {@linkcode SelectRewardPhase}`. */ getFixedBattleCustomRewards(): CustomRewardSettings | undefined { diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index 3f51990afb5..ef96a62a3a1 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -67,7 +67,7 @@ interface TimedEvent extends EventBanner { mysteryEncounterTierChanges?: EventMysteryEncounterTier[]; luckBoostedSpecies?: SpeciesId[]; boostFusions?: boolean; //MODIFIER REWORK PLEASE - classicWaveRewards?: EventWaveReward[]; // Rival battle allRewards + classicWaveRewards?: EventWaveReward[]; // Rival battle rewards trainerShinyChance?: number; // Odds over 65536 of trainer mon generating as shiny music?: EventMusicReplacement[]; dailyRunChallenges?: EventChallenge[]; @@ -569,8 +569,8 @@ export class TimedEventManager { /** * Gets all the modifier types associated with a certain wave during an event * @see EventWaveReward - * @param wave the wave to check for associated allRewards - * @returns array of strings of the event modifier reward types + * @param wave the wave to check for associated rewards + * @returns array of strings of the event reward types */ getFixedBattleEventRewards(wave: number): SilentReward[] { const ret: SilentReward[] = [];