diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 51b72d82234..ae2aad447e1 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -147,8 +147,8 @@ import { HeldItemId } from "#enums/held-item-id"; import { assignEnemyHeldItemsForWave, assignItemsFromConfiguration } from "./items/held-item-pool"; import type { HeldItemConfiguration } from "./items/held-item-data-types"; import { TrainerItemManager } from "./items/trainer-item-manager"; -import { type EnemyAttackStatusEffectChanceTrainerItem, TRAINER_ITEM_EFFECT } from "./items/trainer-item"; -import { applyTrainerItems, type APPLY_TRAINER_ITEMS_PARAMS } from "./items/apply-trainer-items"; +import { type EnemyAttackStatusEffectChanceTrainerItem, TrainerItemEffect } from "./items/trainer-item"; +import { applyTrainerItems, type ApplyTrainerItemsParams } from "./items/apply-trainer-items"; import { TrainerItemId } from "#enums/trainer-item-id"; import { isTrainerItemPool, @@ -1301,7 +1301,7 @@ export default class BattleScene extends SceneBase { getDoubleBattleChance(newWaveIndex: number, playerField: PlayerPokemon[]) { const doubleChance = new NumberHolder(newWaveIndex % 10 === 0 ? 32 : 8); - this.applyPlayerItems(TRAINER_ITEM_EFFECT.DOUBLE_BATTLE_CHANCE_BOOSTER, { numberHolder: doubleChance }); + this.applyPlayerItems(TrainerItemEffect.DOUBLE_BATTLE_CHANCE_BOOSTER, { numberHolder: doubleChance }); for (const p of playerField) { applyAbAttrs("DoubleBattleChanceAbAttr", { pokemon: p, chance: doubleChance }); } @@ -2650,7 +2650,7 @@ export default class BattleScene extends SceneBase { return Math.floor(moneyValue / 10) * 10; } - applyPlayerItems(effect: T, params: APPLY_TRAINER_ITEMS_PARAMS[T]) { + applyPlayerItems(effect: T, params: ApplyTrainerItemsParams[T]) { applyTrainerItems(effect, this.trainerItems, params); } @@ -2677,7 +2677,7 @@ export default class BattleScene extends SceneBase { if (modifier instanceof PokemonHpRestoreModifier) { if (!(modifier as PokemonHpRestoreModifier).fainted) { const hpRestoreMultiplier = new NumberHolder(1); - this.applyPlayerItems(TRAINER_ITEM_EFFECT.HEALING_BOOSTER, { numberHolder: hpRestoreMultiplier }); + this.applyPlayerItems(TrainerItemEffect.HEALING_BOOSTER, { numberHolder: hpRestoreMultiplier }); args.push(hpRestoreMultiplier.value); } else { args.push(1); diff --git a/src/battle.ts b/src/battle.ts index 7242c4b8650..315cdd1c798 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -36,7 +36,7 @@ import { BattleType } from "#enums/battle-type"; import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; import type { HeldItemId } from "#enums/held-item-id"; import { BattlerIndex } from "#enums/battler-index"; -import { TRAINER_ITEM_EFFECT } from "./items/trainer-item"; +import { TrainerItemEffect } from "./items/trainer-item"; export interface TurnCommand { command: Command; @@ -183,7 +183,7 @@ export default class Battle { pickUpScatteredMoney(): void { const moneyAmount = new NumberHolder(globalScene.currentBattle.moneyScattered); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); + globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); if (globalScene.arena.getTag(ArenaTagType.HAPPY_HOUR)) { moneyAmount.value *= 2; diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index c38418ca510..9ecc2bee9b4 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -83,7 +83,7 @@ import { HeldItemCategoryId, HeldItemId, isItemInCategory } from "#enums/held-it import type { ChargingMove, MoveAttrMap, MoveAttrString, MoveKindString, MoveClassMap } from "#app/@types/move-types"; import { applyMoveAttrs } from "./apply-attrs"; import { frenzyMissFunc, getMoveTargets } from "./move-utils"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; import { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "../abilities/ability"; import { applyHeldItems } from "#app/items/all-held-items"; @@ -2764,7 +2764,7 @@ export class EatBerryAttr extends MoveEffectAttr { this.chosenBerry = heldBerries[user.randBattleSeedInt(heldBerries.length)]; const preserve = new BooleanHolder(false); // check for berry pouch preservation - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.PRESERVE_BERRY, {pokemon: pokemon, doPreserve: preserve}); + globalScene.applyPlayerItems(TrainerItemEffect.PRESERVE_BERRY, {pokemon: pokemon, doPreserve: preserve}); if (!preserve.value) { this.reduceBerryModifier(pokemon); } 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 3c3a8d29475..09af8c1a919 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -49,7 +49,7 @@ import { HeldItemCategoryId, type HeldItemId, isItemInCategory } from "#enums/he import { allHeldItems } from "#app/data/data-lists"; import { RewardTier } from "#enums/reward-tier"; import { getHeldItemTier } from "#app/items/held-item-tiers"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/globalTradeSystem"; @@ -276,7 +276,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil if (timedEventManager.isEventActive()) { shinyThreshold.value *= timedEventManager.getShinyMultiplier(); } - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); + globalScene.applyPlayerItems(TrainerItemEffect.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); // Base shiny chance of 512/65536 -> 1/128, affected by events and Shiny Charms // Maximum shiny chance of 4096/65536 -> 1/16, cannot improve further after that @@ -290,7 +290,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil if (tradePokemon.species.abilityHidden) { if (tradePokemon.abilityIndex < hiddenIndex) { const hiddenAbilityChance = new NumberHolder(64); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: hiddenAbilityChance, }); diff --git a/src/data/mystery-encounters/encounters/safari-zone-encounter.ts b/src/data/mystery-encounters/encounters/safari-zone-encounter.ts index 6d47959caac..7fb436c3dce 100644 --- a/src/data/mystery-encounters/encounters/safari-zone-encounter.ts +++ b/src/data/mystery-encounters/encounters/safari-zone-encounter.ts @@ -31,7 +31,7 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-groups"; import { TrainerItemId } from "#enums/trainer-item-id"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; /** the i18n namespace for the encounter */ const namespace = "mysteryEncounters/safariZone"; @@ -298,7 +298,7 @@ async function summonSafariPokemon() { const hiddenIndex = pokemon.species.ability2 ? 2 : 1; if (pokemon.abilityIndex < hiddenIndex) { const hiddenAbilityChance = new NumberHolder(256); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: hiddenAbilityChance, }); diff --git a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts index 68aac8d9d49..9e683a85f57 100644 --- a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts +++ b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts @@ -38,10 +38,9 @@ import { Nature } from "#enums/nature"; import { trainerConfigs } from "#app/data/trainers/trainer-config"; import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; import { PartyMemberStrength } from "#enums/party-member-strength"; -import type { HeldItemConfiguration, HeldItemSpecs } from "#app/items/held-item-data-types"; -import { assignItemsFromConfiguration } from "#app/items/held-item-pool"; +import type { HeldItemConfiguration } from "#app/items/held-item-data-types"; import { HeldItemId } from "#enums/held-item-id"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; /** i18n namespace for encounter */ const namespace = "mysteryEncounters/weirdDream"; @@ -487,7 +486,7 @@ async function postProcessTransformedPokemon( const hiddenIndex = newPokemon.species.ability2 ? 2 : 1; if (newPokemon.abilityIndex < hiddenIndex) { const hiddenAbilityChance = new NumberHolder(256); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: hiddenAbilityChance, }); diff --git a/src/data/pokeball.ts b/src/data/pokeball.ts index b39b29561b4..38aeb40b433 100644 --- a/src/data/pokeball.ts +++ b/src/data/pokeball.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; import { NumberHolder } from "#app/utils/common"; import { PokeballType } from "#enums/pokeball"; import i18next from "i18next"; @@ -94,7 +94,7 @@ export function getCriticalCaptureChance(modifiedCatchRate: number): number { } const dexCount = globalScene.gameData.getSpeciesCount(d => !!d.caughtAttr); const catchingCharmMultiplier = new NumberHolder(1); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.CRITICAL_CATCH_CHANCE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.CRITICAL_CATCH_CHANCE_BOOSTER, { numberHolder: catchingCharmMultiplier, }); const dexMultiplier = diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 8cea1eadd82..df07cc020eb 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -165,7 +165,7 @@ import type { IllusionData } from "#app/@types/illusion-data"; import type { TurnMove } from "#app/@types/turn-move"; import type { DamageCalculationResult, DamageResult } from "#app/@types/damage-result"; import type { AbAttrMap, AbAttrString, TypeMultiplierAbAttrParams } from "#app/@types/ability-types"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; import type { HeldItemConfiguration } from "#app/items/held-item-data-types"; import { assignItemsFromConfiguration } from "#app/items/held-item-pool"; import { getTerrainBlockMessage } from "#app/data/terrain"; @@ -410,7 +410,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (level > 1) { const fused = new BooleanHolder(globalScene.gameMode.isSplicedOnly); if (!fused.value && this.isEnemy() && !this.hasTrainer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_FUSED_CHANCE, { booleanHolder: fused }); + globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_FUSED_CHANCE, { booleanHolder: fused }); } if (fused.value) { @@ -593,7 +593,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // Roll for hidden ability chance, applying any ability charms for enemy mons const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE); if (!this.hasTrainer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: hiddenAbilityChance, }); } @@ -1347,7 +1347,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const critStage = new NumberHolder(0); applyMoveAttrs("HighCritAttr", source, this, move, critStage); applyHeldItems(HeldItemEffect.CRIT_BOOST, { pokemon: source, critStage: critStage }); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.TEMP_CRIT_BOOSTER, { numberHolder: critStage }); + globalScene.applyPlayerItems(TrainerItemEffect.TEMP_CRIT_BOOSTER, { numberHolder: critStage }); applyAbAttrs("BonusCritAbAttr", { pokemon: source, critStage }); const critBoostTag = source.getTag(CritBoostTag); if (critBoostTag) { @@ -2784,7 +2784,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } if (!this.hasTrainer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); + globalScene.applyPlayerItems(TrainerItemEffect.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); } } else { shinyThreshold.value = thresholdOverride; @@ -2816,7 +2816,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (timedEventManager.isEventActive()) { shinyThreshold.value *= timedEventManager.getShinyMultiplier(); } - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); + globalScene.applyPlayerItems(TrainerItemEffect.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); } this.shiny = randSeedInt(65536) < shinyThreshold.value; @@ -2888,7 +2888,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const haThreshold = new NumberHolder(thresholdOverride ?? BASE_HIDDEN_ABILITY_CHANCE); if (applyModifiersToOverride) { if (!this.hasTrainer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: haThreshold }); + globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: haThreshold }); } } @@ -2902,7 +2902,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { public generateFusionSpecies(forStarter?: boolean): void { const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE); if (!this.hasTrainer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, { numberHolder: hiddenAbilityChance, }); } @@ -3418,7 +3418,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!ignoreStatStage.value) { const statStageMultiplier = new NumberHolder(Math.max(2, 2 + statStage.value) / Math.max(2, 2 - statStage.value)); if (!ignoreHeldItems) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.TEMP_STAT_STAGE_BOOSTER, { + globalScene.applyPlayerItems(TrainerItemEffect.TEMP_STAT_STAGE_BOOSTER, { numberHolder: statStageMultiplier, }); } @@ -3454,7 +3454,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { applyAbAttrs("IgnoreOpponentStatStagesAbAttr", { pokemon: this, stat: Stat.EVA, ignored: ignoreEvaStatStage }); applyMoveAttrs("IgnoreOpponentStatStagesAttr", this, target, sourceMove, ignoreEvaStatStage); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.TEMP_ACCURACY_BOOSTER, { numberHolder: userAccStage }); + globalScene.applyPlayerItems(TrainerItemEffect.TEMP_ACCURACY_BOOSTER, { numberHolder: userAccStage }); userAccStage.value = ignoreAccStatStage.value ? 0 : Math.min(userAccStage.value, 6); targetEvaStage.value = ignoreEvaStatStage.value ? 0 : targetEvaStage.value; @@ -3878,10 +3878,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { /** Apply the enemy's Damage and Resistance tokens */ if (!source.isPlayer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_BOOSTER, { numberHolder: damage }); + globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_DAMAGE_BOOSTER, { numberHolder: damage }); } if (!this.isPlayer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_REDUCER, { numberHolder: damage }); + globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_DAMAGE_REDUCER, { numberHolder: damage }); } const abAttrParams: PreAttackModifyDamageAbAttrParams = { diff --git a/src/items/all-held-items.ts b/src/items/all-held-items.ts index 54c0682a5c9..f44563e6dbb 100644 --- a/src/items/all-held-items.ts +++ b/src/items/all-held-items.ts @@ -7,51 +7,47 @@ import { SpeciesId } from "#enums/species-id"; import { Stat, type PermanentStat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import { HeldItemEffect } from "./held-item"; -import { type ACCURACY_BOOST_PARAMS, AccuracyBoosterHeldItem } from "./held-items/accuracy-booster"; +import { type AccuracyBoostParams, AccuracyBoosterHeldItem } from "./held-items/accuracy-booster"; import { - type ATTACK_TYPE_BOOST_PARAMS, + type AttackTypeBoostParams, AttackTypeBoosterHeldItem, attackTypeToHeldItem, } from "./held-items/attack-type-booster"; import { - type BASE_STAT_BOOSTER_PARAMS, + type BaseStatBoosterParams, BaseStatBoosterHeldItem, permanentStatToHeldItem, } from "./held-items/base-stat-booster"; -import { type BASE_STAT_FLAT_PARAMS, BaseStatFlatHeldItem } from "./held-items/base-stat-flat"; -import { type BASE_STAT_TOTAL_PARAMS, BaseStatTotalHeldItem } from "./held-items/base-stat-total"; -import { type BATON_PARAMS, BatonHeldItem } from "./held-items/baton"; -import { type BERRY_PARAMS, BerryHeldItem, berryTypeToHeldItem } from "./held-items/berry"; -import { type BYPASS_SPEED_CHANCE_PARAMS, BypassSpeedChanceHeldItem } from "./held-items/bypass-speed-chance"; -import { type CRIT_BOOST_PARAMS, CritBoostHeldItem, SpeciesCritBoostHeldItem } from "./held-items/crit-booster"; -import { type DAMAGE_MONEY_REWARD_PARAMS, DamageMoneyRewardHeldItem } from "./held-items/damage-money-reward"; -import { type EVO_TRACKER_PARAMS, GimmighoulEvoTrackerHeldItem } from "./held-items/evo-tracker"; -import { type EXP_BOOST_PARAMS, ExpBoosterHeldItem } from "./held-items/exp-booster"; -import { type FIELD_EFFECT_PARAMS, FieldEffectHeldItem } from "./held-items/field-effect"; -import { type FLINCH_CHANCE_PARAMS, FlinchChanceHeldItem } from "./held-items/flinch-chance"; -import { type FRIENDSHIP_BOOST_PARAMS, FriendshipBoosterHeldItem } from "./held-items/friendship-booster"; -import { type HIT_HEAL_PARAMS, HitHealHeldItem } from "./held-items/hit-heal"; -import { type INCREMENTING_STAT_PARAMS, IncrementingStatHeldItem } from "./held-items/incrementing-stat"; -import { InstantReviveHeldItem, type INSTANT_REVIVE_PARAMS } from "./held-items/instant-revive"; +import { type BaseStatFlatParams, BaseStatFlatHeldItem } from "./held-items/base-stat-flat"; +import { type BaseStatTotalParams, BaseStatTotalHeldItem } from "./held-items/base-stat-total"; +import { type BatonParams, BatonHeldItem } from "./held-items/baton"; +import { type BerryParams, BerryHeldItem, berryTypeToHeldItem } from "./held-items/berry"; +import { type BypassSpeedChanceParams, BypassSpeedChanceHeldItem } from "./held-items/bypass-speed-chance"; +import { type CritBoostParams, CritBoostHeldItem, SpeciesCritBoostHeldItem } from "./held-items/crit-booster"; +import { type DamageMoneyRewardParams, DamageMoneyRewardHeldItem } from "./held-items/damage-money-reward"; +import { type EvoTrackerParams, GimmighoulEvoTrackerHeldItem } from "./held-items/evo-tracker"; +import { type ExpBoostParams, ExpBoosterHeldItem } from "./held-items/exp-booster"; +import { type FieldEffectParams, FieldEffectHeldItem } from "./held-items/field-effect"; +import { type FlinchChanceParams, FlinchChanceHeldItem } from "./held-items/flinch-chance"; +import { type FriendshipBoostParams, FriendshipBoosterHeldItem } from "./held-items/friendship-booster"; +import { type HitHealParams, HitHealHeldItem } from "./held-items/hit-heal"; +import { type IncrementingStatParams, IncrementingStatHeldItem } from "./held-items/incrementing-stat"; +import { InstantReviveHeldItem, type InstantReviveParams } from "./held-items/instant-revive"; import { ContactItemStealChanceHeldItem, - type ITEM_STEAL_PARAMS, + type ItemStealParams, TurnEndItemStealHeldItem, } from "./held-items/item-steal"; -import { type MULTI_HIT_PARAMS, MultiHitHeldItem } from "./held-items/multi-hit"; -import { type NATURE_WEIGHT_BOOST_PARAMS, NatureWeightBoosterHeldItem } from "./held-items/nature-weight-booster"; +import { type MultiHitParams, MultiHitHeldItem } from "./held-items/multi-hit"; +import { type NatureWeightBoostParams, NatureWeightBoosterHeldItem } from "./held-items/nature-weight-booster"; import { ResetNegativeStatStageHeldItem, - type RESET_NEGATIVE_STAT_STAGE_PARAMS, + type ResetNegativeStatStageParams, } from "./held-items/reset-negative-stat-stage"; -import { - EvolutionStatBoostHeldItem, - SpeciesStatBoostHeldItem, - type STAT_BOOST_PARAMS, -} from "./held-items/stat-booster"; -import { type SURVIVE_CHANCE_PARAMS, SurviveChanceHeldItem } from "./held-items/survive-chance"; -import { type TURN_END_HEAL_PARAMS, TurnEndHealHeldItem } from "./held-items/turn-end-heal"; -import { type TURN_END_STATUS_PARAMS, TurnEndStatusHeldItem } from "./held-items/turn-end-status"; +import { EvolutionStatBoostHeldItem, SpeciesStatBoostHeldItem, type StatBoostParams } from "./held-items/stat-booster"; +import { type SurviveChanceParams, SurviveChanceHeldItem } from "./held-items/survive-chance"; +import { type TurnEndHealParams, TurnEndHealHeldItem } from "./held-items/turn-end-heal"; +import { type TurnEndStatusParams, TurnEndStatusHeldItem } from "./held-items/turn-end-status"; export function initHeldItems() { for (const berry of getEnumValues(BerryType)) { @@ -173,37 +169,37 @@ export function initHeldItems() { ); } -type APPLY_HELD_ITEMS_PARAMS = { - [HeldItemEffect.ATTACK_TYPE_BOOST]: ATTACK_TYPE_BOOST_PARAMS; - [HeldItemEffect.TURN_END_HEAL]: TURN_END_HEAL_PARAMS; - [HeldItemEffect.HIT_HEAL]: HIT_HEAL_PARAMS; - [HeldItemEffect.RESET_NEGATIVE_STAT_STAGE]: RESET_NEGATIVE_STAT_STAGE_PARAMS; - [HeldItemEffect.EXP_BOOSTER]: EXP_BOOST_PARAMS; - [HeldItemEffect.BERRY]: BERRY_PARAMS; - [HeldItemEffect.BASE_STAT_BOOSTER]: BASE_STAT_BOOSTER_PARAMS; - [HeldItemEffect.INSTANT_REVIVE]: INSTANT_REVIVE_PARAMS; - [HeldItemEffect.STAT_BOOST]: STAT_BOOST_PARAMS; - [HeldItemEffect.CRIT_BOOST]: CRIT_BOOST_PARAMS; - [HeldItemEffect.TURN_END_STATUS]: TURN_END_STATUS_PARAMS; - [HeldItemEffect.SURVIVE_CHANCE]: SURVIVE_CHANCE_PARAMS; - [HeldItemEffect.BYPASS_SPEED_CHANCE]: BYPASS_SPEED_CHANCE_PARAMS; - [HeldItemEffect.FLINCH_CHANCE]: FLINCH_CHANCE_PARAMS; - [HeldItemEffect.FIELD_EFFECT]: FIELD_EFFECT_PARAMS; - [HeldItemEffect.FRIENDSHIP_BOOSTER]: FRIENDSHIP_BOOST_PARAMS; - [HeldItemEffect.NATURE_WEIGHT_BOOSTER]: NATURE_WEIGHT_BOOST_PARAMS; - [HeldItemEffect.ACCURACY_BOOSTER]: ACCURACY_BOOST_PARAMS; - [HeldItemEffect.MULTI_HIT]: MULTI_HIT_PARAMS; - [HeldItemEffect.DAMAGE_MONEY_REWARD]: DAMAGE_MONEY_REWARD_PARAMS; - [HeldItemEffect.BATON]: BATON_PARAMS; - [HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE]: ITEM_STEAL_PARAMS; - [HeldItemEffect.TURN_END_ITEM_STEAL]: ITEM_STEAL_PARAMS; - [HeldItemEffect.BASE_STAT_TOTAL]: BASE_STAT_TOTAL_PARAMS; - [HeldItemEffect.BASE_STAT_FLAT]: BASE_STAT_FLAT_PARAMS; - [HeldItemEffect.INCREMENTING_STAT]: INCREMENTING_STAT_PARAMS; - [HeldItemEffect.EVO_TRACKER]: EVO_TRACKER_PARAMS; +type ApplyHeldItemsParams = { + [HeldItemEffect.ATTACK_TYPE_BOOST]: AttackTypeBoostParams; + [HeldItemEffect.TURN_END_HEAL]: TurnEndHealParams; + [HeldItemEffect.HIT_HEAL]: HitHealParams; + [HeldItemEffect.RESET_NEGATIVE_STAT_STAGE]: ResetNegativeStatStageParams; + [HeldItemEffect.EXP_BOOSTER]: ExpBoostParams; + [HeldItemEffect.BERRY]: BerryParams; + [HeldItemEffect.BASE_STAT_BOOSTER]: BaseStatBoosterParams; + [HeldItemEffect.INSTANT_REVIVE]: InstantReviveParams; + [HeldItemEffect.STAT_BOOST]: StatBoostParams; + [HeldItemEffect.CRIT_BOOST]: CritBoostParams; + [HeldItemEffect.TURN_END_STATUS]: TurnEndStatusParams; + [HeldItemEffect.SURVIVE_CHANCE]: SurviveChanceParams; + [HeldItemEffect.BYPASS_SPEED_CHANCE]: BypassSpeedChanceParams; + [HeldItemEffect.FLINCH_CHANCE]: FlinchChanceParams; + [HeldItemEffect.FIELD_EFFECT]: FieldEffectParams; + [HeldItemEffect.FRIENDSHIP_BOOSTER]: FriendshipBoostParams; + [HeldItemEffect.NATURE_WEIGHT_BOOSTER]: NatureWeightBoostParams; + [HeldItemEffect.ACCURACY_BOOSTER]: AccuracyBoostParams; + [HeldItemEffect.MULTI_HIT]: MultiHitParams; + [HeldItemEffect.DAMAGE_MONEY_REWARD]: DamageMoneyRewardParams; + [HeldItemEffect.BATON]: BatonParams; + [HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE]: ItemStealParams; + [HeldItemEffect.TURN_END_ITEM_STEAL]: ItemStealParams; + [HeldItemEffect.BASE_STAT_TOTAL]: BaseStatTotalParams; + [HeldItemEffect.BASE_STAT_FLAT]: BaseStatFlatParams; + [HeldItemEffect.INCREMENTING_STAT]: IncrementingStatParams; + [HeldItemEffect.EVO_TRACKER]: EvoTrackerParams; }; -export function applyHeldItems(effect: T, params: APPLY_HELD_ITEMS_PARAMS[T]) { +export function applyHeldItems(effect: T, params: ApplyHeldItemsParams[T]) { const pokemon = params.pokemon; if (pokemon) { for (const item of Object.keys(pokemon.heldItemManager.heldItems)) { diff --git a/src/items/apply-trainer-items.ts b/src/items/apply-trainer-items.ts index f6db615cb25..7135edd0ff9 100644 --- a/src/items/apply-trainer-items.ts +++ b/src/items/apply-trainer-items.ts @@ -1,41 +1,41 @@ import { allTrainerItems } from "./all-trainer-items"; import { - type BOOLEAN_HOLDER_PARAMS, - type NUMBER_HOLDER_PARAMS, - type POKEMON_PARAMS, - type PRESERVE_BERRY_PARAMS, - TRAINER_ITEM_EFFECT, + type BooleanHolderParams, + type NumberHolderParams, + type PokemonParams, + type PreserveBerryParams, + TrainerItemEffect, } from "./trainer-item"; import type { TrainerItemManager } from "./trainer-item-manager"; -export type APPLY_TRAINER_ITEMS_PARAMS = { - [TRAINER_ITEM_EFFECT.LEVEL_INCREMENT_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.PRESERVE_BERRY]: PRESERVE_BERRY_PARAMS; - [TRAINER_ITEM_EFFECT.HEALING_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.EXP_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.CRITICAL_CATCH_CHANCE_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.EXTRA_REWARD]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.HEAL_SHOP_COST]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.DOUBLE_BATTLE_CHANCE_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.TEMP_STAT_STAGE_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.TEMP_ACCURACY_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.TEMP_CRIT_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_BOOSTER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_REDUCER]: NUMBER_HOLDER_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_HEAL]: POKEMON_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_ATTACK_STATUS_CHANCE]: POKEMON_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_STATUS_HEAL_CHANCE]: POKEMON_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_ENDURE_CHANCE]: POKEMON_PARAMS; - [TRAINER_ITEM_EFFECT.ENEMY_FUSED_CHANCE]: BOOLEAN_HOLDER_PARAMS; +export type ApplyTrainerItemsParams = { + [TrainerItemEffect.LEVEL_INCREMENT_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.PRESERVE_BERRY]: PreserveBerryParams; + [TrainerItemEffect.HEALING_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.EXP_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.MONEY_MULTIPLIER]: NumberHolderParams; + [TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.SHINY_RATE_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.CRITICAL_CATCH_CHANCE_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.EXTRA_REWARD]: NumberHolderParams; + [TrainerItemEffect.HEAL_SHOP_COST]: NumberHolderParams; + [TrainerItemEffect.DOUBLE_BATTLE_CHANCE_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.TEMP_STAT_STAGE_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.TEMP_ACCURACY_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.TEMP_CRIT_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.ENEMY_DAMAGE_BOOSTER]: NumberHolderParams; + [TrainerItemEffect.ENEMY_DAMAGE_REDUCER]: NumberHolderParams; + [TrainerItemEffect.ENEMY_HEAL]: PokemonParams; + [TrainerItemEffect.ENEMY_ATTACK_STATUS_CHANCE]: PokemonParams; + [TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE]: PokemonParams; + [TrainerItemEffect.ENEMY_ENDURE_CHANCE]: PokemonParams; + [TrainerItemEffect.ENEMY_FUSED_CHANCE]: BooleanHolderParams; }; -export function applyTrainerItems( +export function applyTrainerItems( effect: T, manager: TrainerItemManager, - params: APPLY_TRAINER_ITEMS_PARAMS[T], + params: ApplyTrainerItemsParams[T], ) { if (manager) { for (const item of Object.keys(manager.trainerItems)) { diff --git a/src/items/held-items/accuracy-booster.ts b/src/items/held-items/accuracy-booster.ts index 0dcc6293a95..6ecbc883c26 100644 --- a/src/items/held-items/accuracy-booster.ts +++ b/src/items/held-items/accuracy-booster.ts @@ -3,7 +3,7 @@ import type { NumberHolder } from "#app/utils/common"; import type { HeldItemId } from "#enums/held-item-id"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface ACCURACY_BOOST_PARAMS { +export interface AccuracyBoostParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -36,7 +36,7 @@ export class AccuracyBoosterHeldItem extends HeldItem { * @param moveAccuracy {@linkcode NumberHolder} holding the move accuracy boost * @returns always `true` */ - apply(params: ACCURACY_BOOST_PARAMS): boolean { + apply(params: AccuracyBoostParams): boolean { const pokemon = params.pokemon; const moveAccuracy = params.moveAccuracy; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/attack-type-booster.ts b/src/items/held-items/attack-type-booster.ts index 09d4f3e9c50..3e102527d49 100644 --- a/src/items/held-items/attack-type-booster.ts +++ b/src/items/held-items/attack-type-booster.ts @@ -5,7 +5,7 @@ import type { NumberHolder } from "#app/utils/common"; import type Pokemon from "#app/field/pokemon"; import { HeldItemEffect, HeldItem } from "#app/items/held-item"; -export interface ATTACK_TYPE_BOOST_PARAMS { +export interface AttackTypeBoostParams { /** The pokemon with the item */ pokemon: Pokemon; /** The resolved type of the move */ @@ -66,7 +66,7 @@ export class AttackTypeBoosterHeldItem extends HeldItem { return `${HeldItemNames[this.type]?.toLowerCase()}`; } - apply(params: ATTACK_TYPE_BOOST_PARAMS): void { + apply(params: AttackTypeBoostParams): void { const pokemon = params.pokemon; const moveType = params.moveType; const movePower = params.movePower; diff --git a/src/items/held-items/base-stat-booster.ts b/src/items/held-items/base-stat-booster.ts index 1595c25b986..72428a2d572 100644 --- a/src/items/held-items/base-stat-booster.ts +++ b/src/items/held-items/base-stat-booster.ts @@ -4,7 +4,7 @@ import { getStatKey, type PermanentStat, Stat } from "#enums/stat"; import i18next from "i18next"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface BASE_STAT_BOOSTER_PARAMS { +export interface BaseStatBoosterParams { /** The pokemon with the item */ pokemon: Pokemon; baseStats: number[]; @@ -71,7 +71,7 @@ export class BaseStatBoosterHeldItem extends HeldItem { * @param baseStats the base stats of the {@linkcode Pokemon} * @returns always `true` */ - apply(params: BASE_STAT_BOOSTER_PARAMS): boolean { + apply(params: BaseStatBoosterParams): boolean { const pokemon = params.pokemon; const stackCount = pokemon.heldItemManager.getStack(this.type); const baseStats = params.baseStats; diff --git a/src/items/held-items/base-stat-flat.ts b/src/items/held-items/base-stat-flat.ts index 80285d91716..999e0788faa 100644 --- a/src/items/held-items/base-stat-flat.ts +++ b/src/items/held-items/base-stat-flat.ts @@ -3,7 +3,7 @@ import { HeldItemEffect, HeldItem } from "../held-item"; import { Stat } from "#enums/stat"; import i18next from "i18next"; -export interface BASE_STAT_FLAT_PARAMS { +export interface BaseStatFlatParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -37,7 +37,7 @@ export class BaseStatFlatHeldItem extends HeldItem { * @param baseStats The base stats of the {@linkcode Pokemon} * @returns always `true` */ - apply(params: BASE_STAT_FLAT_PARAMS): boolean { + apply(params: BaseStatFlatParams): boolean { const pokemon = params.pokemon; const baseStats = params.baseStats; const stats = this.getStats(pokemon); diff --git a/src/items/held-items/base-stat-total.ts b/src/items/held-items/base-stat-total.ts index d54602c227a..ecce12dca41 100644 --- a/src/items/held-items/base-stat-total.ts +++ b/src/items/held-items/base-stat-total.ts @@ -3,7 +3,7 @@ import i18next from "i18next"; import { HeldItemEffect, HeldItem } from "../held-item"; import type { HeldItemId } from "#enums/held-item-id"; -export interface BASE_STAT_TOTAL_PARAMS { +export interface BaseStatTotalParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -56,7 +56,7 @@ export class BaseStatTotalHeldItem extends HeldItem { * @param baseStats the base stats of the {@linkcode Pokemon} * @returns always `true` */ - apply(params: BASE_STAT_TOTAL_PARAMS): boolean { + apply(params: BaseStatTotalParams): boolean { const baseStats = params.baseStats; // Modifies the passed in baseStats[] array baseStats.forEach((v, i) => { diff --git a/src/items/held-items/baton.ts b/src/items/held-items/baton.ts index 1045b3b5a9d..9e2c31f2cf0 100644 --- a/src/items/held-items/baton.ts +++ b/src/items/held-items/baton.ts @@ -2,7 +2,7 @@ import type Pokemon from "#app/field/pokemon"; import type { NumberHolder } from "#app/utils/common"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface BATON_PARAMS { +export interface BatonParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ diff --git a/src/items/held-items/berry.ts b/src/items/held-items/berry.ts index 68e4a5b10bb..4387009761e 100644 --- a/src/items/held-items/berry.ts +++ b/src/items/held-items/berry.ts @@ -6,7 +6,7 @@ import { ConsumableHeldItem, HeldItemEffect } from "#app/items/held-item"; import { BooleanHolder } from "#app/utils/common"; import { BerryType } from "#enums/berry-type"; import { HeldItemId } from "#enums/held-item-id"; -import { TRAINER_ITEM_EFFECT } from "../trainer-item"; +import { TrainerItemEffect } from "../trainer-item"; interface BerryTypeToHeldItemMap { [key: number]: HeldItemId; @@ -26,7 +26,7 @@ export const berryTypeToHeldItem: BerryTypeToHeldItemMap = { [BerryType.LEPPA]: HeldItemId.LEPPA_BERRY, }; -export interface BERRY_PARAMS { +export interface BerryParams { /** The pokemon with the berry */ pokemon: Pokemon; } @@ -69,7 +69,7 @@ export class BerryHeldItem extends ConsumableHeldItem { * @param pokemon The {@linkcode Pokemon} that holds the berry * @returns always `true` */ - apply(params: BERRY_PARAMS): boolean { + apply(params: BerryParams): boolean { const pokemon = params.pokemon; if (!this.shouldApply(pokemon)) { @@ -77,7 +77,7 @@ export class BerryHeldItem extends ConsumableHeldItem { } const preserve = new BooleanHolder(false); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.PRESERVE_BERRY, { pokemon: pokemon, doPreserve: preserve }); + globalScene.applyPlayerItems(TrainerItemEffect.PRESERVE_BERRY, { pokemon: pokemon, doPreserve: preserve }); const consumed = !preserve.value; // munch the berry and trigger unburden-like effects diff --git a/src/items/held-items/bypass-speed-chance.ts b/src/items/held-items/bypass-speed-chance.ts index c7734b1ca48..c99f1022114 100644 --- a/src/items/held-items/bypass-speed-chance.ts +++ b/src/items/held-items/bypass-speed-chance.ts @@ -6,7 +6,7 @@ import i18next from "i18next"; import { getPokemonNameWithAffix } from "#app/messages"; import { Command } from "#enums/command"; -export interface BYPASS_SPEED_CHANCE_PARAMS { +export interface BypassSpeedChanceParams { /** The pokemon with the item */ pokemon: Pokemon; doBypassSpeed: BooleanHolder; @@ -37,7 +37,7 @@ export class BypassSpeedChanceHeldItem extends HeldItem { * @param doBypassSpeed {@linkcode BooleanHolder} that is `true` if speed should be bypassed * @returns `true` if {@linkcode BypassSpeedChanceModifier} has been applied */ - apply(params: BYPASS_SPEED_CHANCE_PARAMS): boolean { + apply(params: BypassSpeedChanceParams): boolean { const pokemon = params.pokemon; const doBypassSpeed = params.doBypassSpeed; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/crit-booster.ts b/src/items/held-items/crit-booster.ts index 646a3221a80..e6e264f9867 100644 --- a/src/items/held-items/crit-booster.ts +++ b/src/items/held-items/crit-booster.ts @@ -4,7 +4,7 @@ import type { HeldItemId } from "#enums/held-item-id"; import type { SpeciesId } from "#enums/species-id"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface CRIT_BOOST_PARAMS { +export interface CritBoostParams { /** The pokemon with the item */ pokemon: Pokemon; critStage: NumberHolder; @@ -34,7 +34,7 @@ export class CritBoostHeldItem extends HeldItem { * @param critStage {@linkcode NumberHolder} that holds the resulting critical-hit level * @returns always `true` */ - apply(params: CRIT_BOOST_PARAMS): boolean { + apply(params: CritBoostParams): boolean { params.critStage.value += this.stageIncrement; return true; } @@ -71,7 +71,7 @@ export class SpeciesCritBoostHeldItem extends CritBoostHeldItem { // ); // } - apply(params: CRIT_BOOST_PARAMS): boolean { + apply(params: CritBoostParams): boolean { const pokemon = params.pokemon; const fitsSpecies = this.species.includes(pokemon.getSpeciesForm(true).speciesId) || diff --git a/src/items/held-items/damage-money-reward.ts b/src/items/held-items/damage-money-reward.ts index 8844f08b9eb..cd97c61938f 100644 --- a/src/items/held-items/damage-money-reward.ts +++ b/src/items/held-items/damage-money-reward.ts @@ -2,9 +2,9 @@ import type Pokemon from "#app/field/pokemon"; import { globalScene } from "#app/global-scene"; import { NumberHolder } from "#app/utils/common"; import { HeldItemEffect, HeldItem } from "../held-item"; -import { TRAINER_ITEM_EFFECT } from "../trainer-item"; +import { TrainerItemEffect } from "../trainer-item"; -export interface DAMAGE_MONEY_REWARD_PARAMS { +export interface DamageMoneyRewardParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -20,12 +20,12 @@ export class DamageMoneyRewardHeldItem extends HeldItem { * @param multiplier {@linkcode NumberHolder} holding the multiplier value * @returns always `true` */ - apply(params: DAMAGE_MONEY_REWARD_PARAMS): boolean { + apply(params: DamageMoneyRewardParams): boolean { const pokemon = params.pokemon; const damage = params.damage; const stackCount = pokemon.heldItemManager.getStack(this.type); const moneyAmount = new NumberHolder(Math.floor(damage * (0.5 * stackCount))); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); + globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); globalScene.addMoney(moneyAmount.value); return true; diff --git a/src/items/held-items/evo-tracker.ts b/src/items/held-items/evo-tracker.ts index 5d7f124073d..851b1f8c7ec 100644 --- a/src/items/held-items/evo-tracker.ts +++ b/src/items/held-items/evo-tracker.ts @@ -6,7 +6,7 @@ import i18next from "i18next"; import { HeldItemEffect, HeldItem } from "../held-item"; import { TrainerItemId } from "#enums/trainer-item-id"; -export interface EVO_TRACKER_PARAMS { +export interface EvoTrackerParams { /** The pokemon with the item */ pokemon: Pokemon; } diff --git a/src/items/held-items/exp-booster.ts b/src/items/held-items/exp-booster.ts index e6d49747542..f817aafbbcf 100644 --- a/src/items/held-items/exp-booster.ts +++ b/src/items/held-items/exp-booster.ts @@ -4,7 +4,7 @@ import type { HeldItemId } from "#enums/held-item-id"; import i18next from "i18next"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface EXP_BOOST_PARAMS { +export interface ExpBoostParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -45,7 +45,7 @@ export class ExpBoosterHeldItem extends HeldItem { * @param boost {@linkcode NumberHolder} holding the exp boost value * @returns always `true` */ - apply(params: EXP_BOOST_PARAMS): boolean { + apply(params: ExpBoostParams): boolean { const pokemon = params.pokemon; const expAmount = params.expAmount; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/field-effect.ts b/src/items/held-items/field-effect.ts index 3853cf1381e..95ef5e0ab08 100644 --- a/src/items/held-items/field-effect.ts +++ b/src/items/held-items/field-effect.ts @@ -2,7 +2,7 @@ import type Pokemon from "#app/field/pokemon"; import { HeldItemEffect, HeldItem } from "#app/items/held-item"; import type { NumberHolder } from "#app/utils/common"; -export interface FIELD_EFFECT_PARAMS { +export interface FieldEffectParams { pokemon: Pokemon; /** The pokemon with the item */ fieldDuration: NumberHolder; @@ -24,7 +24,7 @@ export class FieldEffectHeldItem extends HeldItem { * @param fieldDuration {@linkcode NumberHolder} that stores the current field effect duration * @returns `true` if the field effect extension was applied successfully */ - apply(params: FIELD_EFFECT_PARAMS): boolean { + apply(params: FieldEffectParams): boolean { const pokemon = params.pokemon; const stackCount = pokemon.heldItemManager.getStack(this.type); params.fieldDuration.value += 2 * stackCount; diff --git a/src/items/held-items/flinch-chance.ts b/src/items/held-items/flinch-chance.ts index c6c5565058d..d90dd7ade41 100644 --- a/src/items/held-items/flinch-chance.ts +++ b/src/items/held-items/flinch-chance.ts @@ -3,7 +3,7 @@ import { HeldItemEffect, HeldItem } from "#app/items/held-item"; import type { BooleanHolder } from "#app/utils/common"; import type { HeldItemId } from "#enums/held-item-id"; -export interface FLINCH_CHANCE_PARAMS { +export interface FlinchChanceParams { /** The pokemon with the item */ pokemon: Pokemon; flinched: BooleanHolder; @@ -41,7 +41,7 @@ export class FlinchChanceHeldItem extends HeldItem { * @param flinched - A {@linkcode BooleanHolder} holding whether the pokemon has flinched * @returns `true` if {@linkcode FlinchChanceModifier} was applied successfully */ - apply(params: FLINCH_CHANCE_PARAMS): boolean { + apply(params: FlinchChanceParams): boolean { const pokemon = params.pokemon; const flinched = params.flinched; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/friendship-booster.ts b/src/items/held-items/friendship-booster.ts index 4e3fd32a6b1..5d187033fe6 100644 --- a/src/items/held-items/friendship-booster.ts +++ b/src/items/held-items/friendship-booster.ts @@ -3,7 +3,7 @@ import type { NumberHolder } from "#app/utils/common"; import i18next from "i18next"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface FRIENDSHIP_BOOST_PARAMS { +export interface FriendshipBoostParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -23,7 +23,7 @@ export class FriendshipBoosterHeldItem extends HeldItem { * @param friendship {@linkcode NumberHolder} holding the friendship boost value * @returns always `true` */ - apply(params: FRIENDSHIP_BOOST_PARAMS): boolean { + apply(params: FriendshipBoostParams): boolean { const pokemon = params.pokemon; const friendship = params.friendship; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/hit-heal.ts b/src/items/held-items/hit-heal.ts index 799a3e4d56d..74e5168ee62 100644 --- a/src/items/held-items/hit-heal.ts +++ b/src/items/held-items/hit-heal.ts @@ -6,7 +6,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; import { toDmgValue } from "#app/utils/common"; import { getPokemonNameWithAffix } from "#app/messages"; -export interface HIT_HEAL_PARAMS { +export interface HitHealParams { /** The pokemon with the item */ pokemon: Pokemon; } @@ -31,7 +31,7 @@ export class HitHealHeldItem extends HeldItem { * @param pokemon The {@linkcode Pokemon} that holds the item * @returns `true` if the {@linkcode Pokemon} was healed */ - apply(params: HIT_HEAL_PARAMS): boolean { + apply(params: HitHealParams): boolean { const pokemon = params.pokemon; const stackCount = pokemon.heldItemManager.getStack(this.type); if (pokemon.turnData.totalDamageDealt > 0 && !pokemon.isFullHp()) { diff --git a/src/items/held-items/incrementing-stat.ts b/src/items/held-items/incrementing-stat.ts index c6157856cc2..d95d2f81044 100644 --- a/src/items/held-items/incrementing-stat.ts +++ b/src/items/held-items/incrementing-stat.ts @@ -4,7 +4,7 @@ import { Stat } from "#enums/stat"; import type { NumberHolder } from "#app/utils/common"; import i18next from "i18next"; -export interface INCREMENTING_STAT_PARAMS { +export interface IncrementingStatParams { /** The pokemon with the item */ pokemon: Pokemon; stat: Stat; @@ -45,7 +45,7 @@ export class IncrementingStatHeldItem extends HeldItem { * @param statHolder The {@linkcode NumberHolder} that holds the stat * @returns always `true` */ - apply(params: INCREMENTING_STAT_PARAMS): boolean { + apply(params: IncrementingStatParams): boolean { const pokemon = params.pokemon; const stackCount = pokemon.heldItemManager.getStack(this.type); const statHolder = params.statHolder; diff --git a/src/items/held-items/instant-revive.ts b/src/items/held-items/instant-revive.ts index c700dcf97b2..765e3a611e5 100644 --- a/src/items/held-items/instant-revive.ts +++ b/src/items/held-items/instant-revive.ts @@ -7,7 +7,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; import { toDmgValue } from "#app/utils/common"; import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; -export interface INSTANT_REVIVE_PARAMS { +export interface InstantReviveParams { /** The pokemon with the item */ pokemon: Pokemon; } @@ -38,7 +38,7 @@ export class InstantReviveHeldItem extends ConsumableHeldItem { * @param pokemon {@linkcode Pokemon} that holds the item * @returns `true` if any stat stages were reset, false otherwise */ - apply(params: INSTANT_REVIVE_PARAMS): boolean { + apply(params: InstantReviveParams): boolean { const pokemon = params.pokemon; // Restore the Pokemon to half HP globalScene.phaseManager.unshiftPhase( diff --git a/src/items/held-items/item-steal.ts b/src/items/held-items/item-steal.ts index 3279b4d98cf..26ae198c46e 100644 --- a/src/items/held-items/item-steal.ts +++ b/src/items/held-items/item-steal.ts @@ -7,7 +7,7 @@ import { getPokemonNameWithAffix } from "#app/messages"; import { allHeldItems } from "../all-held-items"; import { globalScene } from "#app/global-scene"; -export interface ITEM_STEAL_PARAMS { +export interface ItemStealParams { /** The pokemon with the item */ pokemon: Pokemon; /** The pokemon to steal from (optional) */ @@ -30,7 +30,7 @@ export abstract class ItemTransferHeldItem extends HeldItem { * @param _args N/A * @returns `true` if an item was stolen; false otherwise. */ - apply(params: ITEM_STEAL_PARAMS): boolean { + apply(params: ItemStealParams): boolean { const opponents = this.getTargets(params); if (!opponents.length) { @@ -70,11 +70,11 @@ export abstract class ItemTransferHeldItem extends HeldItem { return !!transferredModifierTypes.length; } - abstract getTargets(params: ITEM_STEAL_PARAMS): Pokemon[]; + abstract getTargets(params: ItemStealParams): Pokemon[]; - abstract getTransferredItemCount(params: ITEM_STEAL_PARAMS): number; + abstract getTransferredItemCount(params: ItemStealParams): number; - abstract getTransferMessage(params: ITEM_STEAL_PARAMS, itemId: HeldItemId): string; + abstract getTransferMessage(params: ItemStealParams, itemId: HeldItemId): string; } /** @@ -96,15 +96,15 @@ export class TurnEndItemStealHeldItem extends ItemTransferHeldItem { * @param _args N/A * @returns the opponents of the source {@linkcode Pokemon} */ - getTargets(params: ITEM_STEAL_PARAMS): Pokemon[] { + getTargets(params: ItemStealParams): Pokemon[] { return params.pokemon instanceof Pokemon ? params.pokemon.getOpponents() : []; } - getTransferredItemCount(_params: ITEM_STEAL_PARAMS): number { + getTransferredItemCount(_params: ItemStealParams): number { return 1; } - getTransferMessage(params: ITEM_STEAL_PARAMS, itemId: HeldItemId): string { + getTransferMessage(params: ItemStealParams, itemId: HeldItemId): string { return i18next.t("modifier:turnHeldItemTransferApply", { pokemonNameWithAffix: getPokemonNameWithAffix(params.target), itemName: allHeldItems[itemId].name, @@ -148,16 +148,16 @@ export class ContactItemStealChanceHeldItem extends ItemTransferHeldItem { * @param targetPokemon The {@linkcode Pokemon} the holder is targeting with an attack * @returns The target {@linkcode Pokemon} as array for further use in `apply` implementations */ - getTargets(params: ITEM_STEAL_PARAMS): Pokemon[] { + getTargets(params: ItemStealParams): Pokemon[] { return params.target ? [params.target] : []; } - getTransferredItemCount(params: ITEM_STEAL_PARAMS): number { + getTransferredItemCount(params: ItemStealParams): number { const stackCount = params.pokemon.heldItemManager.getStack(this.type); return randSeedFloat() <= this.chance * stackCount ? 1 : 0; } - getTransferMessage(params: ITEM_STEAL_PARAMS, itemId: HeldItemId): string { + getTransferMessage(params: ItemStealParams, itemId: HeldItemId): string { return i18next.t("modifier:contactHeldItemTransferApply", { pokemonNameWithAffix: getPokemonNameWithAffix(params.target), itemName: allHeldItems[itemId].name, diff --git a/src/items/held-items/multi-hit.ts b/src/items/held-items/multi-hit.ts index 12472162afe..d4773630739 100644 --- a/src/items/held-items/multi-hit.ts +++ b/src/items/held-items/multi-hit.ts @@ -5,7 +5,7 @@ import type { MoveId } from "#enums/move-id"; import { allMoves } from "#app/data/data-lists"; import i18next from "i18next"; -export interface MULTI_HIT_PARAMS { +export interface MultiHitParams { pokemon: Pokemon; moveId: MoveId; count?: NumberHolder; @@ -33,7 +33,7 @@ export class MultiHitHeldItem extends HeldItem { * @param damageMultiplier {@linkcode NumberHolder} holding a damage multiplier applied to a strike of this move * @returns always `true` */ - apply(params: MULTI_HIT_PARAMS): boolean { + apply(params: MultiHitParams): boolean { const pokemon = params.pokemon; const move = allMoves[params.moveId]; /** diff --git a/src/items/held-items/nature-weight-booster.ts b/src/items/held-items/nature-weight-booster.ts index 76a81df6423..f24646ee4ea 100644 --- a/src/items/held-items/nature-weight-booster.ts +++ b/src/items/held-items/nature-weight-booster.ts @@ -2,7 +2,7 @@ import type Pokemon from "#app/field/pokemon"; import type { NumberHolder } from "#app/utils/common"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface NATURE_WEIGHT_BOOST_PARAMS { +export interface NatureWeightBoostParams { /** The pokemon with the item */ pokemon: Pokemon; /** The amount of exp to gain */ @@ -18,7 +18,7 @@ export class NatureWeightBoosterHeldItem extends HeldItem { * @param multiplier {@linkcode NumberHolder} holding the nature weight * @returns `true` if multiplier was applied */ - apply(params: NATURE_WEIGHT_BOOST_PARAMS): boolean { + apply(params: NatureWeightBoostParams): boolean { const pokemon = params.pokemon; const multiplier = params.multiplier; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/reset-negative-stat-stage.ts b/src/items/held-items/reset-negative-stat-stage.ts index 76b17e19ffb..fbda4a27e14 100644 --- a/src/items/held-items/reset-negative-stat-stage.ts +++ b/src/items/held-items/reset-negative-stat-stage.ts @@ -5,7 +5,7 @@ import i18next from "i18next"; import { ConsumableHeldItem, HeldItemEffect } from "../held-item"; import { getPokemonNameWithAffix } from "#app/messages"; -export interface RESET_NEGATIVE_STAT_STAGE_PARAMS { +export interface ResetNegativeStatStageParams { /** The pokemon with the item */ pokemon: Pokemon; /** Whether the move was used by a player pokemon */ @@ -38,7 +38,7 @@ export class ResetNegativeStatStageHeldItem extends ConsumableHeldItem { * @param pokemon {@linkcode Pokemon} that holds the item * @returns `true` if any stat stages were reset, false otherwise */ - apply(params: RESET_NEGATIVE_STAT_STAGE_PARAMS): boolean { + apply(params: ResetNegativeStatStageParams): boolean { const pokemon = params.pokemon; const isPlayer = params.isPlayer; let statRestored = false; diff --git a/src/items/held-items/stat-booster.ts b/src/items/held-items/stat-booster.ts index 8e6553053f5..71647cb821b 100644 --- a/src/items/held-items/stat-booster.ts +++ b/src/items/held-items/stat-booster.ts @@ -6,7 +6,7 @@ import type { SpeciesId } from "#enums/species-id"; import type { Stat } from "#enums/stat"; import { HeldItemEffect, HeldItem } from "../held-item"; -export interface STAT_BOOST_PARAMS { +export interface StatBoostParams { /** The pokemon with the item */ pokemon: Pokemon; stat: Stat; @@ -53,7 +53,7 @@ export class StatBoostHeldItem extends HeldItem { * @returns `true` if the stat boost applies successfully, false otherwise * @see shouldApply */ - apply(params: STAT_BOOST_PARAMS): boolean { + apply(params: StatBoostParams): boolean { params.statValue.value *= this.multiplier; return true; } @@ -94,7 +94,7 @@ export class EvolutionStatBoostHeldItem extends StatBoostHeldItem { * @returns `true` if the stat boost applies successfully, false otherwise * @see shouldApply */ - override apply(params: STAT_BOOST_PARAMS): boolean { + override apply(params: StatBoostParams): boolean { const pokemon = params.pokemon; const isUnevolved = pokemon.getSpeciesForm(true).speciesId in pokemonEvolutions; @@ -166,7 +166,7 @@ export class SpeciesStatBoostHeldItem extends StatBoostHeldItem { // ); // } - apply(params: STAT_BOOST_PARAMS): boolean { + apply(params: StatBoostParams): boolean { const pokemon = params.pokemon; const fitsSpecies = this.species.includes(pokemon.getSpeciesForm(true).speciesId) || diff --git a/src/items/held-items/survive-chance.ts b/src/items/held-items/survive-chance.ts index 1e3b1718ab1..2b9717163f3 100644 --- a/src/items/held-items/survive-chance.ts +++ b/src/items/held-items/survive-chance.ts @@ -5,7 +5,7 @@ import { globalScene } from "#app/global-scene"; import i18next from "i18next"; import { getPokemonNameWithAffix } from "#app/messages"; -export interface SURVIVE_CHANCE_PARAMS { +export interface SurviveChanceParams { /** The pokemon with the item */ pokemon: Pokemon; surviveDamage: BooleanHolder; @@ -36,7 +36,7 @@ export class SurviveChanceHeldItem extends HeldItem { * @param surviveDamage {@linkcode BooleanHolder} that holds the survive damage * @returns `true` if the survive damage has been applied */ - apply(params: SURVIVE_CHANCE_PARAMS): boolean { + apply(params: SurviveChanceParams): boolean { const pokemon = params.pokemon; const surviveDamage = params.surviveDamage; const stackCount = pokemon.heldItemManager.getStack(this.type); diff --git a/src/items/held-items/turn-end-heal.ts b/src/items/held-items/turn-end-heal.ts index ebd86718d7a..f78f3e91d91 100644 --- a/src/items/held-items/turn-end-heal.ts +++ b/src/items/held-items/turn-end-heal.ts @@ -6,7 +6,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; import { toDmgValue } from "#app/utils/common"; import { getPokemonNameWithAffix } from "#app/messages"; -export interface TURN_END_HEAL_PARAMS { +export interface TurnEndHealParams { /** The pokemon with the item */ pokemon: Pokemon; } @@ -14,7 +14,7 @@ export interface TURN_END_HEAL_PARAMS { export class TurnEndHealHeldItem extends HeldItem { public effects: HeldItemEffect[] = [HeldItemEffect.TURN_END_HEAL]; - apply(params: TURN_END_HEAL_PARAMS): boolean { + apply(params: TurnEndHealParams): boolean { const pokemon = params.pokemon; const stackCount = pokemon.heldItemManager.getStack(this.type); if (pokemon.isFullHp()) { diff --git a/src/items/held-items/turn-end-status.ts b/src/items/held-items/turn-end-status.ts index 6a4ae620b47..66abd455886 100644 --- a/src/items/held-items/turn-end-status.ts +++ b/src/items/held-items/turn-end-status.ts @@ -3,7 +3,7 @@ import { HeldItemEffect, HeldItem } from "#app/items/held-item"; import type { StatusEffect } from "#enums/status-effect"; import type { HeldItemId } from "#enums/held-item-id"; -export interface TURN_END_STATUS_PARAMS { +export interface TurnEndStatusParams { /** The pokemon with the item */ pokemon: Pokemon; } @@ -30,7 +30,7 @@ export class TurnEndStatusHeldItem extends HeldItem { * @param pokemon {@linkcode Pokemon} that holds the held item * @returns `true` if the status effect was applied successfully */ - apply(params: TURN_END_STATUS_PARAMS): boolean { + apply(params: TurnEndStatusParams): boolean { return params.pokemon.trySetStatus(this.effect, true, undefined, undefined, this.name); } diff --git a/src/items/trainer-item.ts b/src/items/trainer-item.ts index a5877a9ad97..bc7ce86644a 100644 --- a/src/items/trainer-item.ts +++ b/src/items/trainer-item.ts @@ -11,7 +11,7 @@ import { getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/st import { getPokemonNameWithAffix } from "#app/messages"; import { StatusEffect } from "#enums/status-effect"; -export const TRAINER_ITEM_EFFECT = { +export const TrainerItemEffect = { LEVEL_INCREMENT_BOOSTER: 1, PRESERVE_BERRY: 2, HEALING_BOOSTER: 3, @@ -38,17 +38,17 @@ export const TRAINER_ITEM_EFFECT = { ENEMY_FUSED_CHANCE: 21, } as const; -export type TRAINER_ITEM_EFFECT = (typeof TRAINER_ITEM_EFFECT)[keyof typeof TRAINER_ITEM_EFFECT]; +export type TrainerItemEffect = (typeof TrainerItemEffect)[keyof typeof TrainerItemEffect]; -export interface NUMBER_HOLDER_PARAMS { +export interface NumberHolderParams { numberHolder: NumberHolder; } -export interface BOOLEAN_HOLDER_PARAMS { +export interface BooleanHolderParams { booleanHolder: BooleanHolder; } -export interface POKEMON_PARAMS { +export interface PokemonParams { pokemon: Pokemon; } @@ -57,7 +57,7 @@ export class TrainerItem { public type: TrainerItemId; public maxStackCount: number; public isLapsing = false; - public effects: TRAINER_ITEM_EFFECT[] = []; + public effects: TrainerItemEffect[] = []; //TODO: If this is actually never changed by any subclass, perhaps it should not be here public soundName = "se/restore"; @@ -119,9 +119,9 @@ export class TrainerItem { // Candy Jar export class LevelIncrementBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.LEVEL_INCREMENT_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.LEVEL_INCREMENT_BOOSTER]; - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const count = params.numberHolder; const stack = manager.getStack(this.type); count.value += stack; @@ -129,15 +129,15 @@ export class LevelIncrementBoosterTrainerItem extends TrainerItem { } // Berry Pouch -export interface PRESERVE_BERRY_PARAMS { +export interface PreserveBerryParams { pokemon: Pokemon; doPreserve: BooleanHolder; } export class PreserveBerryTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.PRESERVE_BERRY]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.PRESERVE_BERRY]; - apply(manager: TrainerItemManager, params: PRESERVE_BERRY_PARAMS) { + apply(manager: TrainerItemManager, params: PreserveBerryParams) { const stack = manager.getStack(this.type); params.doPreserve.value ||= params.pokemon.randBattleSeedInt(10) < stack * 3; } @@ -145,7 +145,7 @@ export class PreserveBerryTrainerItem extends TrainerItem { // Healing Charm export class HealingBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.HEALING_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.HEALING_BOOSTER]; private multiplier: number; constructor(type: TrainerItemId, multiplier: number, stackCount?: number) { @@ -154,7 +154,7 @@ export class HealingBoosterTrainerItem extends TrainerItem { this.multiplier = multiplier; } - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const healingMultiplier = params.numberHolder; const stack = manager.getStack(this.type); healingMultiplier.value *= 1 + (this.multiplier - 1) * stack; @@ -163,7 +163,7 @@ export class HealingBoosterTrainerItem extends TrainerItem { // Exp Booster export class ExpBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.EXP_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.EXP_BOOSTER]; private boostPercent: number; constructor(type: TrainerItemId, boostPercent: number, stackCount?: number) { @@ -178,7 +178,7 @@ export class ExpBoosterTrainerItem extends TrainerItem { }); } - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const boost = params.numberHolder; const stack = manager.getStack(this.type); boost.value = Math.floor(boost.value * (1 + stack * this.boostPercent * 0.01)); @@ -186,9 +186,9 @@ export class ExpBoosterTrainerItem extends TrainerItem { } export class MoneyMultiplierTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.MONEY_MULTIPLIER]; - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const moneyMultiplier = params.numberHolder; const stack = manager.getStack(this.type); moneyMultiplier.value += Math.floor(moneyMultiplier.value * 0.2 * stack); @@ -196,9 +196,9 @@ export class MoneyMultiplierTrainerItem extends TrainerItem { } export class HiddenAbilityChanceBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER]; - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const boost = params.numberHolder; const stack = manager.getStack(this.type); boost.value *= Math.pow(2, -1 - stack); @@ -206,9 +206,9 @@ export class HiddenAbilityChanceBoosterTrainerItem extends TrainerItem { } export class ShinyRateBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.SHINY_RATE_BOOSTER]; - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const boost = params.numberHolder; const stack = manager.getStack(this.type); boost.value *= Math.pow(2, 1 + stack); @@ -216,9 +216,9 @@ export class ShinyRateBoosterTrainerItem extends TrainerItem { } export class CriticalCatchChanceBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.CRITICAL_CATCH_CHANCE_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.CRITICAL_CATCH_CHANCE_BOOSTER]; - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const boost = params.numberHolder; const stack = manager.getStack(this.type); boost.value *= 1.5 + stack / 2; @@ -226,9 +226,9 @@ export class CriticalCatchChanceBoosterTrainerItem extends TrainerItem { } export class ExtraRewardTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.EXTRA_REWARD]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.EXTRA_REWARD]; - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: NumberHolderParams) { const count = params.numberHolder; const stack = manager.getStack(this.type); count.value += stack; @@ -236,7 +236,7 @@ export class ExtraRewardTrainerItem extends TrainerItem { } export class HealShopCostTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.HEAL_SHOP_COST]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.HEAL_SHOP_COST]; public readonly shopMultiplier: number; constructor(type: TrainerItemId, shopMultiplier: number, stackCount?: number) { @@ -245,7 +245,7 @@ export class HealShopCostTrainerItem extends TrainerItem { this.shopMultiplier = shopMultiplier; } - apply(_manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(_manager: TrainerItemManager, params: NumberHolderParams) { const moneyCost = params.numberHolder; moneyCost.value = Math.floor(moneyCost.value * this.shopMultiplier); } @@ -281,7 +281,7 @@ export class LapsingTrainerItem extends TrainerItem { } export class DoubleBattleChanceBoosterTrainerItem extends LapsingTrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.DOUBLE_BATTLE_CHANCE_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.DOUBLE_BATTLE_CHANCE_BOOSTER]; get description(): string { return i18next.t("modifierType:ModifierType.DoubleBattleChanceBoosterModifierType.description", { @@ -289,7 +289,7 @@ export class DoubleBattleChanceBoosterTrainerItem extends LapsingTrainerItem { }); } - apply(_manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(_manager: TrainerItemManager, params: NumberHolderParams) { const doubleBattleChance = params.numberHolder; // This is divided because the chance is generated as a number from 0 to doubleBattleChance.value using randSeedInt // A double battle will initiate if the generated number is 0 @@ -311,7 +311,7 @@ export const tempStatToTrainerItem: TempStatToTrainerItemMap = { }; export class TempStatStageBoosterTrainerItem extends LapsingTrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.TEMP_STAT_STAGE_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.TEMP_STAT_STAGE_BOOSTER]; private stat: TempBattleStat; constructor(type: TrainerItemId, stat: TempBattleStat, stackCount?: number) { @@ -332,7 +332,7 @@ export class TempStatStageBoosterTrainerItem extends LapsingTrainerItem { }); } - apply(_manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(_manager: TrainerItemManager, params: NumberHolderParams) { const statLevel = params.numberHolder; const boost = 0.3; statLevel.value += boost; @@ -340,7 +340,7 @@ export class TempStatStageBoosterTrainerItem extends LapsingTrainerItem { } export class TempAccuracyBoosterTrainerItem extends LapsingTrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.TEMP_ACCURACY_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.TEMP_ACCURACY_BOOSTER]; get name(): string { return i18next.t(`modifierType:TempStatStageBoosterItem.${TrainerItemNames[this.type]?.toLowerCase()}`); @@ -354,7 +354,7 @@ export class TempAccuracyBoosterTrainerItem extends LapsingTrainerItem { }); } - apply(_manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(_manager: TrainerItemManager, params: NumberHolderParams) { const statLevel = params.numberHolder; const boost = 1; statLevel.value += boost; @@ -362,7 +362,7 @@ export class TempAccuracyBoosterTrainerItem extends LapsingTrainerItem { } export class TempCritBoosterTrainerItem extends LapsingTrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.TEMP_CRIT_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.TEMP_CRIT_BOOSTER]; get description(): string { return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { @@ -371,21 +371,21 @@ export class TempCritBoosterTrainerItem extends LapsingTrainerItem { }); } - apply(_manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { + apply(_manager: TrainerItemManager, params: NumberHolderParams) { const critLevel = params.numberHolder; critLevel.value++; } } export class EnemyDamageBoosterTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_BOOSTER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_DAMAGE_BOOSTER]; public damageBoost = 1.05; get iconName(): string { return "wl_item_drop"; } - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS): boolean { + apply(manager: TrainerItemManager, params: NumberHolderParams): boolean { const stack = manager.getStack(this.type); const multiplier = params.numberHolder; @@ -400,14 +400,14 @@ export class EnemyDamageBoosterTrainerItem extends TrainerItem { } export class EnemyDamageReducerTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_REDUCER]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_DAMAGE_REDUCER]; public damageReduction = 0.975; get iconName(): string { return "wl_guard_spec"; } - apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS): boolean { + apply(manager: TrainerItemManager, params: NumberHolderParams): boolean { const stack = manager.getStack(this.type); const multiplier = params.numberHolder; @@ -422,14 +422,14 @@ export class EnemyDamageReducerTrainerItem extends TrainerItem { } export class EnemyTurnHealTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_HEAL]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_HEAL]; public healPercent = 2; get iconName(): string { return "wl_potion"; } - apply(manager: TrainerItemManager, params: POKEMON_PARAMS): boolean { + apply(manager: TrainerItemManager, params: PokemonParams): boolean { const stack = manager.getStack(this.type); const enemyPokemon = params.pokemon; @@ -455,7 +455,7 @@ export class EnemyTurnHealTrainerItem extends TrainerItem { } export class EnemyAttackStatusEffectChanceTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_ATTACK_STATUS_CHANCE]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_ATTACK_STATUS_CHANCE]; public effect: StatusEffect; constructor(type: TrainerItemId, effect: StatusEffect, stackCount?: number) { @@ -484,7 +484,7 @@ export class EnemyAttackStatusEffectChanceTrainerItem extends TrainerItem { }); } - apply(manager: TrainerItemManager, params: POKEMON_PARAMS): boolean { + apply(manager: TrainerItemManager, params: PokemonParams): boolean { const stack = manager.getStack(this.type); const enemyPokemon = params.pokemon; const chance = this.getChance(); @@ -502,14 +502,14 @@ export class EnemyAttackStatusEffectChanceTrainerItem extends TrainerItem { } export class EnemyStatusEffectHealChanceTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_STATUS_HEAL_CHANCE]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE]; public chance = 0.025; get iconName(): string { return "wl_full_heal"; } - apply(manager: TrainerItemManager, params: POKEMON_PARAMS): boolean { + apply(manager: TrainerItemManager, params: PokemonParams): boolean { const stack = manager.getStack(this.type); const enemyPokemon = params.pokemon; @@ -527,7 +527,7 @@ export class EnemyStatusEffectHealChanceTrainerItem extends TrainerItem { } export class EnemyEndureChanceTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_ENDURE_CHANCE]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_ENDURE_CHANCE]; public chance = 2; get iconName(): string { @@ -540,7 +540,7 @@ export class EnemyEndureChanceTrainerItem extends TrainerItem { }); } - apply(manager: TrainerItemManager, params: POKEMON_PARAMS): boolean { + apply(manager: TrainerItemManager, params: PokemonParams): boolean { const stack = manager.getStack(this.type); const target = params.pokemon; @@ -557,14 +557,14 @@ export class EnemyEndureChanceTrainerItem extends TrainerItem { } export class EnemyFusionChanceTrainerItem extends TrainerItem { - public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.ENEMY_FUSED_CHANCE]; + public effects: TrainerItemEffect[] = [TrainerItemEffect.ENEMY_FUSED_CHANCE]; public chance = 0.01; get iconName(): string { return "wl_custom_spliced"; } - apply(manager: TrainerItemManager, params: BOOLEAN_HOLDER_PARAMS) { + apply(manager: TrainerItemManager, params: BooleanHolderParams) { const stack = manager.getStack(this.type); const isFusion = params.booleanHolder; if (randSeedFloat() > this.chance * stack) { diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 6bf1c517795..f9bf653c978 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -74,7 +74,7 @@ import { getNewAttackTypeBoosterHeldItem, getNewBerryHeldItem, getNewVitaminHeld import { berryTypeToHeldItem } from "#app/items/held-items/berry"; import { TrainerItemId } from "#enums/trainer-item-id"; import { allTrainerItems } from "#app/data/data-lists"; -import { tempStatToTrainerItem, TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { tempStatToTrainerItem, TrainerItemEffect } from "#app/items/trainer-item"; type NewModifierFunc = (type: ModifierType, args: any[]) => Modifier | null; @@ -818,7 +818,7 @@ export class MoneyRewardModifierType extends ModifierType { getDescription(): string { const moneyAmount = new NumberHolder(globalScene.getWaveMoneyAmount(this.moneyMultiplier)); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); + globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); const formattedMoney = formatMoney(globalScene.moneyFormat, moneyAmount.value); return i18next.t("modifierType:ModifierType.MoneyRewardModifierType.description", { diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 716937289b4..dfaf897018c 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -23,7 +23,7 @@ import type { ModifierInstanceMap, ModifierString } from "#app/@types/modifier-t import { assignItemsFromConfiguration } from "#app/items/held-item-pool"; import type { HeldItemConfiguration } from "#app/items/held-item-data-types"; import { HeldItemId } from "#enums/held-item-id"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; import type { TrainerItemConfiguration } from "#app/items/trainer-item-data-types"; export type ModifierPredicate = (modifier: Modifier) => boolean; @@ -383,7 +383,7 @@ export class PokemonLevelIncrementModifier extends ConsumablePokemonModifier { * @returns always `true` */ override apply(playerPokemon: PlayerPokemon, levelCount: NumberHolder = new NumberHolder(1)): boolean { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.LEVEL_INCREMENT_BOOSTER, { numberHolder: levelCount }); + globalScene.applyPlayerItems(TrainerItemEffect.LEVEL_INCREMENT_BOOSTER, { numberHolder: levelCount }); playerPokemon.level += levelCount.value; if (playerPokemon.level <= globalScene.getMaxExpLevel(true)) { @@ -532,7 +532,7 @@ export class MoneyRewardModifier extends ConsumableModifier { override apply(): boolean { const moneyAmount = new NumberHolder(globalScene.getWaveMoneyAmount(this.moneyMultiplier)); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); + globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); globalScene.addMoney(moneyAmount.value); diff --git a/src/phases/exp-phase.ts b/src/phases/exp-phase.ts index 123d03de62b..24bec4de725 100644 --- a/src/phases/exp-phase.ts +++ b/src/phases/exp-phase.ts @@ -3,7 +3,7 @@ import { getPokemonNameWithAffix } from "#app/messages"; import i18next from "i18next"; import { NumberHolder } from "#app/utils/common"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export class ExpPhase extends PlayerPartyMemberPokemonPhase { public readonly phaseName = "ExpPhase"; @@ -20,7 +20,7 @@ export class ExpPhase extends PlayerPartyMemberPokemonPhase { const pokemon = this.getPokemon(); const exp = new NumberHolder(this.expValue); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.EXP_BOOSTER, { numberHolder: exp }); + globalScene.applyPlayerItems(TrainerItemEffect.EXP_BOOSTER, { numberHolder: exp }); exp.value = Math.floor(exp.value); globalScene.ui.showText( i18next.t("battle:expGain", { diff --git a/src/phases/money-reward-phase.ts b/src/phases/money-reward-phase.ts index 6fff53542ae..30aa451989c 100644 --- a/src/phases/money-reward-phase.ts +++ b/src/phases/money-reward-phase.ts @@ -3,7 +3,7 @@ import { ArenaTagType } from "#app/enums/arena-tag-type"; import i18next from "i18next"; import { NumberHolder } from "#app/utils/common"; import { BattlePhase } from "./battle-phase"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export class MoneyRewardPhase extends BattlePhase { public readonly phaseName = "MoneyRewardPhase"; @@ -18,7 +18,7 @@ export class MoneyRewardPhase extends BattlePhase { start() { const moneyAmount = new NumberHolder(globalScene.getWaveMoneyAmount(this.moneyMultiplier)); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); + globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount }); if (globalScene.arena.getTag(ArenaTagType.HAPPY_HOUR)) { moneyAmount.value *= 2; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 2e006c3a46f..22dccec3eb7 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -43,7 +43,7 @@ import { DamageAchv } from "#app/system/achv"; import { applyHeldItems } from "#app/items/all-held-items"; import { HeldItemEffect } from "#app/items/held-item"; import { isVirtual, isReflected, MoveUseMode } from "#enums/move-use-mode"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier]; @@ -856,7 +856,7 @@ export class MoveEffectPhase extends PokemonPhase { if (isBlockedBySubstitute) { substitute.hp -= dmg; } else if (!target.isPlayer() && dmg >= target.hp) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_ENDURE_CHANCE, { pokemon: target }); + globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_ENDURE_CHANCE, { pokemon: target }); } const damage = isBlockedBySubstitute diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index 1f758133d87..af7fd7fe404 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -11,7 +11,7 @@ import { NumberHolder } from "#app/utils/common"; import { CommonAnimPhase } from "./common-anim-phase"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import type { HealBlockTag } from "#app/data/battler-tags"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export class PokemonHealPhase extends CommonAnimPhase { public readonly phaseName = "PokemonHealPhase"; @@ -75,7 +75,7 @@ export class PokemonHealPhase extends CommonAnimPhase { if (healOrDamage) { const hpRestoreMultiplier = new NumberHolder(1); if (!this.revive) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HEALING_BOOSTER, { numberHolder: hpRestoreMultiplier }); + globalScene.applyPlayerItems(TrainerItemEffect.HEALING_BOOSTER, { numberHolder: hpRestoreMultiplier }); } const healAmount = new NumberHolder(Math.floor(this.hpHealed * hpRestoreMultiplier.value)); if (healAmount.value < 0) { diff --git a/src/phases/select-modifier-phase.ts b/src/phases/select-modifier-phase.ts index 50b7594ca3e..301280b1636 100644 --- a/src/phases/select-modifier-phase.ts +++ b/src/phases/select-modifier-phase.ts @@ -27,7 +27,7 @@ import { BattlePhase } from "./battle-phase"; import Overrides from "#app/overrides"; import type { CustomModifierSettings } from "#app/modifier/modifier-type"; import { isNullOrUndefined, NumberHolder } from "#app/utils/common"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export type ModifierSelectCallback = (rowCursor: number, cursor: number) => boolean; @@ -152,7 +152,7 @@ export class SelectModifierPhase extends BattlePhase { const modifierType = shopOption.type; // Apply Black Sludge to healing item cost const healingItemCost = new NumberHolder(shopOption.cost); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HEAL_SHOP_COST, { numberHolder: healingItemCost }); + globalScene.applyPlayerItems(TrainerItemEffect.HEAL_SHOP_COST, { numberHolder: healingItemCost }); const cost = healingItemCost.value; if (globalScene.money < cost && !Overrides.WAIVE_ROLL_FEE_OVERRIDE) { @@ -403,7 +403,7 @@ export class SelectModifierPhase extends BattlePhase { // Function that determines how many reward slots are available private getModifierCount(): number { const modifierCountHolder = new NumberHolder(3); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.EXTRA_REWARD, { numberHolder: modifierCountHolder }); + globalScene.applyPlayerItems(TrainerItemEffect.EXTRA_REWARD, { numberHolder: modifierCountHolder }); // If custom modifiers are specified, overrides default item count if (this.customModifierSettings) { @@ -474,7 +474,7 @@ export class SelectModifierPhase extends BattlePhase { // Apply Black Sludge to reroll cost const modifiedRerollCost = new NumberHolder(baseMultiplier); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HEAL_SHOP_COST, { numberHolder: modifiedRerollCost }); + globalScene.applyPlayerItems(TrainerItemEffect.HEAL_SHOP_COST, { numberHolder: modifiedRerollCost }); return modifiedRerollCost.value; } diff --git a/src/phases/show-party-exp-bar-phase.ts b/src/phases/show-party-exp-bar-phase.ts index 6c4e01fe840..613e2a3f5c9 100644 --- a/src/phases/show-party-exp-bar-phase.ts +++ b/src/phases/show-party-exp-bar-phase.ts @@ -3,7 +3,7 @@ import { ExpGainsSpeed } from "#app/enums/exp-gains-speed"; import { ExpNotification } from "#app/enums/exp-notification"; import { NumberHolder } from "#app/utils/common"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase { public readonly phaseName = "ShowPartyExpBarPhase"; @@ -20,7 +20,7 @@ export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase { const pokemon = this.getPokemon(); const exp = new NumberHolder(this.expValue); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.EXP_BOOSTER, { numberHolder: exp }); + globalScene.applyPlayerItems(TrainerItemEffect.EXP_BOOSTER, { numberHolder: exp }); exp.value = Math.floor(exp.value); const lastLevel = pokemon.level; diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index a222734161d..895db0a888a 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -10,7 +10,7 @@ import { FieldPhase } from "./field-phase"; import { globalScene } from "#app/global-scene"; import { applyHeldItems } from "#app/items/all-held-items"; import { HeldItemEffect } from "#app/items/held-item"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export class TurnEndPhase extends FieldPhase { public readonly phaseName = "TurnEndPhase"; @@ -41,8 +41,8 @@ export class TurnEndPhase extends FieldPhase { } if (!pokemon.isPlayer()) { - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_HEAL, { pokemon: pokemon }); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_STATUS_HEAL_CHANCE, { pokemon: pokemon }); + globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_HEAL, { pokemon: pokemon }); + globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE, { pokemon: pokemon }); } applyAbAttrs("PostTurnAbAttr", { pokemon }); diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 8f3cddbdb52..4776310062e 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -16,7 +16,7 @@ import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; import Phaser from "phaser"; import type { PokeballType } from "#enums/pokeball"; import { TrainerItemId } from "#enums/trainer-item-id"; -import { TRAINER_ITEM_EFFECT } from "#app/items/trainer-item"; +import { TrainerItemEffect } from "#app/items/trainer-item"; export const SHOP_OPTIONS_ROW_LIMIT = 7; const SINGLE_SHOP_ROW_YOFFSET = 12; @@ -214,7 +214,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { const typeOptions = args[1] as ModifierTypeOption[]; const removeHealShop = globalScene.gameMode.hasNoShop; const baseShopCost = new NumberHolder(globalScene.getWaveMoneyAmount(1)); - globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HEAL_SHOP_COST, { numberHolder: baseShopCost }); + globalScene.applyPlayerItems(TrainerItemEffect.HEAL_SHOP_COST, { numberHolder: baseShopCost }); const shopTypeOptions = !removeHealShop ? getPlayerShopModifierTypeOptionsForWave(globalScene.currentBattle.waveIndex, baseShopCost.value) : [];