Normalize naming

This commit is contained in:
NightKev 2025-07-10 01:41:18 -07:00
parent d576d66617
commit fee6320502
47 changed files with 254 additions and 259 deletions

View File

@ -147,8 +147,8 @@ import { HeldItemId } from "#enums/held-item-id";
import { assignEnemyHeldItemsForWave, assignItemsFromConfiguration } from "./items/held-item-pool"; import { assignEnemyHeldItemsForWave, assignItemsFromConfiguration } from "./items/held-item-pool";
import type { HeldItemConfiguration } from "./items/held-item-data-types"; import type { HeldItemConfiguration } from "./items/held-item-data-types";
import { TrainerItemManager } from "./items/trainer-item-manager"; import { TrainerItemManager } from "./items/trainer-item-manager";
import { type EnemyAttackStatusEffectChanceTrainerItem, TRAINER_ITEM_EFFECT } from "./items/trainer-item"; import { type EnemyAttackStatusEffectChanceTrainerItem, TrainerItemEffect } from "./items/trainer-item";
import { applyTrainerItems, type APPLY_TRAINER_ITEMS_PARAMS } from "./items/apply-trainer-items"; import { applyTrainerItems, type ApplyTrainerItemsParams } from "./items/apply-trainer-items";
import { TrainerItemId } from "#enums/trainer-item-id"; import { TrainerItemId } from "#enums/trainer-item-id";
import { import {
isTrainerItemPool, isTrainerItemPool,
@ -1301,7 +1301,7 @@ export default class BattleScene extends SceneBase {
getDoubleBattleChance(newWaveIndex: number, playerField: PlayerPokemon[]) { getDoubleBattleChance(newWaveIndex: number, playerField: PlayerPokemon[]) {
const doubleChance = new NumberHolder(newWaveIndex % 10 === 0 ? 32 : 8); 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) { for (const p of playerField) {
applyAbAttrs("DoubleBattleChanceAbAttr", { pokemon: p, chance: doubleChance }); applyAbAttrs("DoubleBattleChanceAbAttr", { pokemon: p, chance: doubleChance });
} }
@ -2650,7 +2650,7 @@ export default class BattleScene extends SceneBase {
return Math.floor(moneyValue / 10) * 10; return Math.floor(moneyValue / 10) * 10;
} }
applyPlayerItems<T extends TRAINER_ITEM_EFFECT>(effect: T, params: APPLY_TRAINER_ITEMS_PARAMS[T]) { applyPlayerItems<T extends TrainerItemEffect>(effect: T, params: ApplyTrainerItemsParams[T]) {
applyTrainerItems(effect, this.trainerItems, params); applyTrainerItems(effect, this.trainerItems, params);
} }
@ -2677,7 +2677,7 @@ export default class BattleScene extends SceneBase {
if (modifier instanceof PokemonHpRestoreModifier) { if (modifier instanceof PokemonHpRestoreModifier) {
if (!(modifier as PokemonHpRestoreModifier).fainted) { if (!(modifier as PokemonHpRestoreModifier).fainted) {
const hpRestoreMultiplier = new NumberHolder(1); 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); args.push(hpRestoreMultiplier.value);
} else { } else {
args.push(1); args.push(1);

View File

@ -36,7 +36,7 @@ import { BattleType } from "#enums/battle-type";
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves"; import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
import type { HeldItemId } from "#enums/held-item-id"; import type { HeldItemId } from "#enums/held-item-id";
import { BattlerIndex } from "#enums/battler-index"; import { BattlerIndex } from "#enums/battler-index";
import { TRAINER_ITEM_EFFECT } from "./items/trainer-item"; import { TrainerItemEffect } from "./items/trainer-item";
export interface TurnCommand { export interface TurnCommand {
command: Command; command: Command;
@ -183,7 +183,7 @@ export default class Battle {
pickUpScatteredMoney(): void { pickUpScatteredMoney(): void {
const moneyAmount = new NumberHolder(globalScene.currentBattle.moneyScattered); 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)) { if (globalScene.arena.getTag(ArenaTagType.HAPPY_HOUR)) {
moneyAmount.value *= 2; moneyAmount.value *= 2;

View File

@ -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 type { ChargingMove, MoveAttrMap, MoveAttrString, MoveKindString, MoveClassMap } from "#app/@types/move-types";
import { applyMoveAttrs } from "./apply-attrs"; import { applyMoveAttrs } from "./apply-attrs";
import { frenzyMissFunc, getMoveTargets } from "./move-utils"; 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 { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "../abilities/ability";
import { applyHeldItems } from "#app/items/all-held-items"; import { applyHeldItems } from "#app/items/all-held-items";
@ -2764,7 +2764,7 @@ export class EatBerryAttr extends MoveEffectAttr {
this.chosenBerry = heldBerries[user.randBattleSeedInt(heldBerries.length)]; this.chosenBerry = heldBerries[user.randBattleSeedInt(heldBerries.length)];
const preserve = new BooleanHolder(false); const preserve = new BooleanHolder(false);
// check for berry pouch preservation // 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) { if (!preserve.value) {
this.reduceBerryModifier(pokemon); this.reduceBerryModifier(pokemon);
} }

View File

@ -49,7 +49,7 @@ import { HeldItemCategoryId, type HeldItemId, isItemInCategory } from "#enums/he
import { allHeldItems } from "#app/data/data-lists"; import { allHeldItems } from "#app/data/data-lists";
import { RewardTier } from "#enums/reward-tier"; import { RewardTier } from "#enums/reward-tier";
import { getHeldItemTier } from "#app/items/held-item-tiers"; 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 */ /** the i18n namespace for the encounter */
const namespace = "mysteryEncounters/globalTradeSystem"; const namespace = "mysteryEncounters/globalTradeSystem";
@ -276,7 +276,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil
if (timedEventManager.isEventActive()) { if (timedEventManager.isEventActive()) {
shinyThreshold.value *= timedEventManager.getShinyMultiplier(); 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 // 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 // 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.species.abilityHidden) {
if (tradePokemon.abilityIndex < hiddenIndex) { if (tradePokemon.abilityIndex < hiddenIndex) {
const hiddenAbilityChance = new NumberHolder(64); const hiddenAbilityChance = new NumberHolder(64);
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
numberHolder: hiddenAbilityChance, numberHolder: hiddenAbilityChance,
}); });

View File

@ -31,7 +31,7 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-groups"; import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-groups";
import { TrainerItemId } from "#enums/trainer-item-id"; 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 */ /** the i18n namespace for the encounter */
const namespace = "mysteryEncounters/safariZone"; const namespace = "mysteryEncounters/safariZone";
@ -298,7 +298,7 @@ async function summonSafariPokemon() {
const hiddenIndex = pokemon.species.ability2 ? 2 : 1; const hiddenIndex = pokemon.species.ability2 ? 2 : 1;
if (pokemon.abilityIndex < hiddenIndex) { if (pokemon.abilityIndex < hiddenIndex) {
const hiddenAbilityChance = new NumberHolder(256); const hiddenAbilityChance = new NumberHolder(256);
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
numberHolder: hiddenAbilityChance, numberHolder: hiddenAbilityChance,
}); });

View File

@ -38,10 +38,9 @@ import { Nature } from "#enums/nature";
import { trainerConfigs } from "#app/data/trainers/trainer-config"; import { trainerConfigs } from "#app/data/trainers/trainer-config";
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate"; import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
import { PartyMemberStrength } from "#enums/party-member-strength"; import { PartyMemberStrength } from "#enums/party-member-strength";
import type { HeldItemConfiguration, HeldItemSpecs } from "#app/items/held-item-data-types"; import type { HeldItemConfiguration } from "#app/items/held-item-data-types";
import { assignItemsFromConfiguration } from "#app/items/held-item-pool";
import { HeldItemId } from "#enums/held-item-id"; 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 */ /** i18n namespace for encounter */
const namespace = "mysteryEncounters/weirdDream"; const namespace = "mysteryEncounters/weirdDream";
@ -487,7 +486,7 @@ async function postProcessTransformedPokemon(
const hiddenIndex = newPokemon.species.ability2 ? 2 : 1; const hiddenIndex = newPokemon.species.ability2 ? 2 : 1;
if (newPokemon.abilityIndex < hiddenIndex) { if (newPokemon.abilityIndex < hiddenIndex) {
const hiddenAbilityChance = new NumberHolder(256); const hiddenAbilityChance = new NumberHolder(256);
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
numberHolder: hiddenAbilityChance, numberHolder: hiddenAbilityChance,
}); });

View File

@ -1,5 +1,5 @@
import { globalScene } from "#app/global-scene"; 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 { NumberHolder } from "#app/utils/common";
import { PokeballType } from "#enums/pokeball"; import { PokeballType } from "#enums/pokeball";
import i18next from "i18next"; import i18next from "i18next";
@ -94,7 +94,7 @@ export function getCriticalCaptureChance(modifiedCatchRate: number): number {
} }
const dexCount = globalScene.gameData.getSpeciesCount(d => !!d.caughtAttr); const dexCount = globalScene.gameData.getSpeciesCount(d => !!d.caughtAttr);
const catchingCharmMultiplier = new NumberHolder(1); const catchingCharmMultiplier = new NumberHolder(1);
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.CRITICAL_CATCH_CHANCE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.CRITICAL_CATCH_CHANCE_BOOSTER, {
numberHolder: catchingCharmMultiplier, numberHolder: catchingCharmMultiplier,
}); });
const dexMultiplier = const dexMultiplier =

View File

@ -165,7 +165,7 @@ import type { IllusionData } from "#app/@types/illusion-data";
import type { TurnMove } from "#app/@types/turn-move"; import type { TurnMove } from "#app/@types/turn-move";
import type { DamageCalculationResult, DamageResult } from "#app/@types/damage-result"; import type { DamageCalculationResult, DamageResult } from "#app/@types/damage-result";
import type { AbAttrMap, AbAttrString, TypeMultiplierAbAttrParams } from "#app/@types/ability-types"; 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 type { HeldItemConfiguration } from "#app/items/held-item-data-types";
import { assignItemsFromConfiguration } from "#app/items/held-item-pool"; import { assignItemsFromConfiguration } from "#app/items/held-item-pool";
import { getTerrainBlockMessage } from "#app/data/terrain"; import { getTerrainBlockMessage } from "#app/data/terrain";
@ -410,7 +410,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (level > 1) { if (level > 1) {
const fused = new BooleanHolder(globalScene.gameMode.isSplicedOnly); const fused = new BooleanHolder(globalScene.gameMode.isSplicedOnly);
if (!fused.value && this.isEnemy() && !this.hasTrainer()) { 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) { 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 // Roll for hidden ability chance, applying any ability charms for enemy mons
const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE); const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE);
if (!this.hasTrainer()) { if (!this.hasTrainer()) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
numberHolder: hiddenAbilityChance, numberHolder: hiddenAbilityChance,
}); });
} }
@ -1347,7 +1347,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const critStage = new NumberHolder(0); const critStage = new NumberHolder(0);
applyMoveAttrs("HighCritAttr", source, this, move, critStage); applyMoveAttrs("HighCritAttr", source, this, move, critStage);
applyHeldItems(HeldItemEffect.CRIT_BOOST, { pokemon: source, critStage: 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 }); applyAbAttrs("BonusCritAbAttr", { pokemon: source, critStage });
const critBoostTag = source.getTag(CritBoostTag); const critBoostTag = source.getTag(CritBoostTag);
if (critBoostTag) { if (critBoostTag) {
@ -2784,7 +2784,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
} }
if (!this.hasTrainer()) { if (!this.hasTrainer()) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold }); globalScene.applyPlayerItems(TrainerItemEffect.SHINY_RATE_BOOSTER, { numberHolder: shinyThreshold });
} }
} else { } else {
shinyThreshold.value = thresholdOverride; shinyThreshold.value = thresholdOverride;
@ -2816,7 +2816,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (timedEventManager.isEventActive()) { if (timedEventManager.isEventActive()) {
shinyThreshold.value *= timedEventManager.getShinyMultiplier(); 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; 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); const haThreshold = new NumberHolder(thresholdOverride ?? BASE_HIDDEN_ABILITY_CHANCE);
if (applyModifiersToOverride) { if (applyModifiersToOverride) {
if (!this.hasTrainer()) { 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 { public generateFusionSpecies(forStarter?: boolean): void {
const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE); const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE);
if (!this.hasTrainer()) { if (!this.hasTrainer()) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
numberHolder: hiddenAbilityChance, numberHolder: hiddenAbilityChance,
}); });
} }
@ -3418,7 +3418,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (!ignoreStatStage.value) { if (!ignoreStatStage.value) {
const statStageMultiplier = new NumberHolder(Math.max(2, 2 + statStage.value) / Math.max(2, 2 - statStage.value)); const statStageMultiplier = new NumberHolder(Math.max(2, 2 + statStage.value) / Math.max(2, 2 - statStage.value));
if (!ignoreHeldItems) { if (!ignoreHeldItems) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.TEMP_STAT_STAGE_BOOSTER, { globalScene.applyPlayerItems(TrainerItemEffect.TEMP_STAT_STAGE_BOOSTER, {
numberHolder: statStageMultiplier, numberHolder: statStageMultiplier,
}); });
} }
@ -3454,7 +3454,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyAbAttrs("IgnoreOpponentStatStagesAbAttr", { pokemon: this, stat: Stat.EVA, ignored: ignoreEvaStatStage }); applyAbAttrs("IgnoreOpponentStatStagesAbAttr", { pokemon: this, stat: Stat.EVA, ignored: ignoreEvaStatStage });
applyMoveAttrs("IgnoreOpponentStatStagesAttr", this, target, sourceMove, 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); userAccStage.value = ignoreAccStatStage.value ? 0 : Math.min(userAccStage.value, 6);
targetEvaStage.value = ignoreEvaStatStage.value ? 0 : targetEvaStage.value; 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 */ /** Apply the enemy's Damage and Resistance tokens */
if (!source.isPlayer()) { if (!source.isPlayer()) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_BOOSTER, { numberHolder: damage }); globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_DAMAGE_BOOSTER, { numberHolder: damage });
} }
if (!this.isPlayer()) { if (!this.isPlayer()) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_REDUCER, { numberHolder: damage }); globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_DAMAGE_REDUCER, { numberHolder: damage });
} }
const abAttrParams: PreAttackModifyDamageAbAttrParams = { const abAttrParams: PreAttackModifyDamageAbAttrParams = {

View File

@ -7,51 +7,47 @@ import { SpeciesId } from "#enums/species-id";
import { Stat, type PermanentStat } from "#enums/stat"; import { Stat, type PermanentStat } from "#enums/stat";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import { HeldItemEffect } from "./held-item"; 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 { import {
type ATTACK_TYPE_BOOST_PARAMS, type AttackTypeBoostParams,
AttackTypeBoosterHeldItem, AttackTypeBoosterHeldItem,
attackTypeToHeldItem, attackTypeToHeldItem,
} from "./held-items/attack-type-booster"; } from "./held-items/attack-type-booster";
import { import {
type BASE_STAT_BOOSTER_PARAMS, type BaseStatBoosterParams,
BaseStatBoosterHeldItem, BaseStatBoosterHeldItem,
permanentStatToHeldItem, permanentStatToHeldItem,
} from "./held-items/base-stat-booster"; } from "./held-items/base-stat-booster";
import { type BASE_STAT_FLAT_PARAMS, BaseStatFlatHeldItem } from "./held-items/base-stat-flat"; import { type BaseStatFlatParams, BaseStatFlatHeldItem } from "./held-items/base-stat-flat";
import { type BASE_STAT_TOTAL_PARAMS, BaseStatTotalHeldItem } from "./held-items/base-stat-total"; import { type BaseStatTotalParams, BaseStatTotalHeldItem } from "./held-items/base-stat-total";
import { type BATON_PARAMS, BatonHeldItem } from "./held-items/baton"; import { type BatonParams, BatonHeldItem } from "./held-items/baton";
import { type BERRY_PARAMS, BerryHeldItem, berryTypeToHeldItem } from "./held-items/berry"; import { type BerryParams, BerryHeldItem, berryTypeToHeldItem } from "./held-items/berry";
import { type BYPASS_SPEED_CHANCE_PARAMS, BypassSpeedChanceHeldItem } from "./held-items/bypass-speed-chance"; import { type BypassSpeedChanceParams, BypassSpeedChanceHeldItem } from "./held-items/bypass-speed-chance";
import { type CRIT_BOOST_PARAMS, CritBoostHeldItem, SpeciesCritBoostHeldItem } from "./held-items/crit-booster"; import { type CritBoostParams, CritBoostHeldItem, SpeciesCritBoostHeldItem } from "./held-items/crit-booster";
import { type DAMAGE_MONEY_REWARD_PARAMS, DamageMoneyRewardHeldItem } from "./held-items/damage-money-reward"; import { type DamageMoneyRewardParams, DamageMoneyRewardHeldItem } from "./held-items/damage-money-reward";
import { type EVO_TRACKER_PARAMS, GimmighoulEvoTrackerHeldItem } from "./held-items/evo-tracker"; import { type EvoTrackerParams, GimmighoulEvoTrackerHeldItem } from "./held-items/evo-tracker";
import { type EXP_BOOST_PARAMS, ExpBoosterHeldItem } from "./held-items/exp-booster"; import { type ExpBoostParams, ExpBoosterHeldItem } from "./held-items/exp-booster";
import { type FIELD_EFFECT_PARAMS, FieldEffectHeldItem } from "./held-items/field-effect"; import { type FieldEffectParams, FieldEffectHeldItem } from "./held-items/field-effect";
import { type FLINCH_CHANCE_PARAMS, FlinchChanceHeldItem } from "./held-items/flinch-chance"; import { type FlinchChanceParams, FlinchChanceHeldItem } from "./held-items/flinch-chance";
import { type FRIENDSHIP_BOOST_PARAMS, FriendshipBoosterHeldItem } from "./held-items/friendship-booster"; import { type FriendshipBoostParams, FriendshipBoosterHeldItem } from "./held-items/friendship-booster";
import { type HIT_HEAL_PARAMS, HitHealHeldItem } from "./held-items/hit-heal"; import { type HitHealParams, HitHealHeldItem } from "./held-items/hit-heal";
import { type INCREMENTING_STAT_PARAMS, IncrementingStatHeldItem } from "./held-items/incrementing-stat"; import { type IncrementingStatParams, IncrementingStatHeldItem } from "./held-items/incrementing-stat";
import { InstantReviveHeldItem, type INSTANT_REVIVE_PARAMS } from "./held-items/instant-revive"; import { InstantReviveHeldItem, type InstantReviveParams } from "./held-items/instant-revive";
import { import {
ContactItemStealChanceHeldItem, ContactItemStealChanceHeldItem,
type ITEM_STEAL_PARAMS, type ItemStealParams,
TurnEndItemStealHeldItem, TurnEndItemStealHeldItem,
} from "./held-items/item-steal"; } from "./held-items/item-steal";
import { type MULTI_HIT_PARAMS, MultiHitHeldItem } from "./held-items/multi-hit"; import { type MultiHitParams, MultiHitHeldItem } from "./held-items/multi-hit";
import { type NATURE_WEIGHT_BOOST_PARAMS, NatureWeightBoosterHeldItem } from "./held-items/nature-weight-booster"; import { type NatureWeightBoostParams, NatureWeightBoosterHeldItem } from "./held-items/nature-weight-booster";
import { import {
ResetNegativeStatStageHeldItem, ResetNegativeStatStageHeldItem,
type RESET_NEGATIVE_STAT_STAGE_PARAMS, type ResetNegativeStatStageParams,
} from "./held-items/reset-negative-stat-stage"; } from "./held-items/reset-negative-stat-stage";
import { import { EvolutionStatBoostHeldItem, SpeciesStatBoostHeldItem, type StatBoostParams } from "./held-items/stat-booster";
EvolutionStatBoostHeldItem, import { type SurviveChanceParams, SurviveChanceHeldItem } from "./held-items/survive-chance";
SpeciesStatBoostHeldItem, import { type TurnEndHealParams, TurnEndHealHeldItem } from "./held-items/turn-end-heal";
type STAT_BOOST_PARAMS, import { type TurnEndStatusParams, TurnEndStatusHeldItem } from "./held-items/turn-end-status";
} 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";
export function initHeldItems() { export function initHeldItems() {
for (const berry of getEnumValues(BerryType)) { for (const berry of getEnumValues(BerryType)) {
@ -173,37 +169,37 @@ export function initHeldItems() {
); );
} }
type APPLY_HELD_ITEMS_PARAMS = { type ApplyHeldItemsParams = {
[HeldItemEffect.ATTACK_TYPE_BOOST]: ATTACK_TYPE_BOOST_PARAMS; [HeldItemEffect.ATTACK_TYPE_BOOST]: AttackTypeBoostParams;
[HeldItemEffect.TURN_END_HEAL]: TURN_END_HEAL_PARAMS; [HeldItemEffect.TURN_END_HEAL]: TurnEndHealParams;
[HeldItemEffect.HIT_HEAL]: HIT_HEAL_PARAMS; [HeldItemEffect.HIT_HEAL]: HitHealParams;
[HeldItemEffect.RESET_NEGATIVE_STAT_STAGE]: RESET_NEGATIVE_STAT_STAGE_PARAMS; [HeldItemEffect.RESET_NEGATIVE_STAT_STAGE]: ResetNegativeStatStageParams;
[HeldItemEffect.EXP_BOOSTER]: EXP_BOOST_PARAMS; [HeldItemEffect.EXP_BOOSTER]: ExpBoostParams;
[HeldItemEffect.BERRY]: BERRY_PARAMS; [HeldItemEffect.BERRY]: BerryParams;
[HeldItemEffect.BASE_STAT_BOOSTER]: BASE_STAT_BOOSTER_PARAMS; [HeldItemEffect.BASE_STAT_BOOSTER]: BaseStatBoosterParams;
[HeldItemEffect.INSTANT_REVIVE]: INSTANT_REVIVE_PARAMS; [HeldItemEffect.INSTANT_REVIVE]: InstantReviveParams;
[HeldItemEffect.STAT_BOOST]: STAT_BOOST_PARAMS; [HeldItemEffect.STAT_BOOST]: StatBoostParams;
[HeldItemEffect.CRIT_BOOST]: CRIT_BOOST_PARAMS; [HeldItemEffect.CRIT_BOOST]: CritBoostParams;
[HeldItemEffect.TURN_END_STATUS]: TURN_END_STATUS_PARAMS; [HeldItemEffect.TURN_END_STATUS]: TurnEndStatusParams;
[HeldItemEffect.SURVIVE_CHANCE]: SURVIVE_CHANCE_PARAMS; [HeldItemEffect.SURVIVE_CHANCE]: SurviveChanceParams;
[HeldItemEffect.BYPASS_SPEED_CHANCE]: BYPASS_SPEED_CHANCE_PARAMS; [HeldItemEffect.BYPASS_SPEED_CHANCE]: BypassSpeedChanceParams;
[HeldItemEffect.FLINCH_CHANCE]: FLINCH_CHANCE_PARAMS; [HeldItemEffect.FLINCH_CHANCE]: FlinchChanceParams;
[HeldItemEffect.FIELD_EFFECT]: FIELD_EFFECT_PARAMS; [HeldItemEffect.FIELD_EFFECT]: FieldEffectParams;
[HeldItemEffect.FRIENDSHIP_BOOSTER]: FRIENDSHIP_BOOST_PARAMS; [HeldItemEffect.FRIENDSHIP_BOOSTER]: FriendshipBoostParams;
[HeldItemEffect.NATURE_WEIGHT_BOOSTER]: NATURE_WEIGHT_BOOST_PARAMS; [HeldItemEffect.NATURE_WEIGHT_BOOSTER]: NatureWeightBoostParams;
[HeldItemEffect.ACCURACY_BOOSTER]: ACCURACY_BOOST_PARAMS; [HeldItemEffect.ACCURACY_BOOSTER]: AccuracyBoostParams;
[HeldItemEffect.MULTI_HIT]: MULTI_HIT_PARAMS; [HeldItemEffect.MULTI_HIT]: MultiHitParams;
[HeldItemEffect.DAMAGE_MONEY_REWARD]: DAMAGE_MONEY_REWARD_PARAMS; [HeldItemEffect.DAMAGE_MONEY_REWARD]: DamageMoneyRewardParams;
[HeldItemEffect.BATON]: BATON_PARAMS; [HeldItemEffect.BATON]: BatonParams;
[HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE]: ITEM_STEAL_PARAMS; [HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE]: ItemStealParams;
[HeldItemEffect.TURN_END_ITEM_STEAL]: ITEM_STEAL_PARAMS; [HeldItemEffect.TURN_END_ITEM_STEAL]: ItemStealParams;
[HeldItemEffect.BASE_STAT_TOTAL]: BASE_STAT_TOTAL_PARAMS; [HeldItemEffect.BASE_STAT_TOTAL]: BaseStatTotalParams;
[HeldItemEffect.BASE_STAT_FLAT]: BASE_STAT_FLAT_PARAMS; [HeldItemEffect.BASE_STAT_FLAT]: BaseStatFlatParams;
[HeldItemEffect.INCREMENTING_STAT]: INCREMENTING_STAT_PARAMS; [HeldItemEffect.INCREMENTING_STAT]: IncrementingStatParams;
[HeldItemEffect.EVO_TRACKER]: EVO_TRACKER_PARAMS; [HeldItemEffect.EVO_TRACKER]: EvoTrackerParams;
}; };
export function applyHeldItems<T extends HeldItemEffect>(effect: T, params: APPLY_HELD_ITEMS_PARAMS[T]) { export function applyHeldItems<T extends HeldItemEffect>(effect: T, params: ApplyHeldItemsParams[T]) {
const pokemon = params.pokemon; const pokemon = params.pokemon;
if (pokemon) { if (pokemon) {
for (const item of Object.keys(pokemon.heldItemManager.heldItems)) { for (const item of Object.keys(pokemon.heldItemManager.heldItems)) {

View File

@ -1,41 +1,41 @@
import { allTrainerItems } from "./all-trainer-items"; import { allTrainerItems } from "./all-trainer-items";
import { import {
type BOOLEAN_HOLDER_PARAMS, type BooleanHolderParams,
type NUMBER_HOLDER_PARAMS, type NumberHolderParams,
type POKEMON_PARAMS, type PokemonParams,
type PRESERVE_BERRY_PARAMS, type PreserveBerryParams,
TRAINER_ITEM_EFFECT, TrainerItemEffect,
} from "./trainer-item"; } from "./trainer-item";
import type { TrainerItemManager } from "./trainer-item-manager"; import type { TrainerItemManager } from "./trainer-item-manager";
export type APPLY_TRAINER_ITEMS_PARAMS = { export type ApplyTrainerItemsParams = {
[TRAINER_ITEM_EFFECT.LEVEL_INCREMENT_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.LEVEL_INCREMENT_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.PRESERVE_BERRY]: PRESERVE_BERRY_PARAMS; [TrainerItemEffect.PRESERVE_BERRY]: PreserveBerryParams;
[TRAINER_ITEM_EFFECT.HEALING_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.HEALING_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.EXP_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.EXP_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.MONEY_MULTIPLIER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.MONEY_MULTIPLIER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.HIDDEN_ABILITY_CHANCE_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.SHINY_RATE_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.SHINY_RATE_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.CRITICAL_CATCH_CHANCE_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.CRITICAL_CATCH_CHANCE_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.EXTRA_REWARD]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.EXTRA_REWARD]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.HEAL_SHOP_COST]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.HEAL_SHOP_COST]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.DOUBLE_BATTLE_CHANCE_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.DOUBLE_BATTLE_CHANCE_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.TEMP_STAT_STAGE_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.TEMP_STAT_STAGE_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.TEMP_ACCURACY_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.TEMP_ACCURACY_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.TEMP_CRIT_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.TEMP_CRIT_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_BOOSTER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.ENEMY_DAMAGE_BOOSTER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.ENEMY_DAMAGE_REDUCER]: NUMBER_HOLDER_PARAMS; [TrainerItemEffect.ENEMY_DAMAGE_REDUCER]: NumberHolderParams;
[TRAINER_ITEM_EFFECT.ENEMY_HEAL]: POKEMON_PARAMS; [TrainerItemEffect.ENEMY_HEAL]: PokemonParams;
[TRAINER_ITEM_EFFECT.ENEMY_ATTACK_STATUS_CHANCE]: POKEMON_PARAMS; [TrainerItemEffect.ENEMY_ATTACK_STATUS_CHANCE]: PokemonParams;
[TRAINER_ITEM_EFFECT.ENEMY_STATUS_HEAL_CHANCE]: POKEMON_PARAMS; [TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE]: PokemonParams;
[TRAINER_ITEM_EFFECT.ENEMY_ENDURE_CHANCE]: POKEMON_PARAMS; [TrainerItemEffect.ENEMY_ENDURE_CHANCE]: PokemonParams;
[TRAINER_ITEM_EFFECT.ENEMY_FUSED_CHANCE]: BOOLEAN_HOLDER_PARAMS; [TrainerItemEffect.ENEMY_FUSED_CHANCE]: BooleanHolderParams;
}; };
export function applyTrainerItems<T extends TRAINER_ITEM_EFFECT>( export function applyTrainerItems<T extends TrainerItemEffect>(
effect: T, effect: T,
manager: TrainerItemManager, manager: TrainerItemManager,
params: APPLY_TRAINER_ITEMS_PARAMS[T], params: ApplyTrainerItemsParams[T],
) { ) {
if (manager) { if (manager) {
for (const item of Object.keys(manager.trainerItems)) { for (const item of Object.keys(manager.trainerItems)) {

View File

@ -3,7 +3,7 @@ import type { NumberHolder } from "#app/utils/common";
import type { HeldItemId } from "#enums/held-item-id"; import type { HeldItemId } from "#enums/held-item-id";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface ACCURACY_BOOST_PARAMS { export interface AccuracyBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -36,7 +36,7 @@ export class AccuracyBoosterHeldItem extends HeldItem {
* @param moveAccuracy {@linkcode NumberHolder} holding the move accuracy boost * @param moveAccuracy {@linkcode NumberHolder} holding the move accuracy boost
* @returns always `true` * @returns always `true`
*/ */
apply(params: ACCURACY_BOOST_PARAMS): boolean { apply(params: AccuracyBoostParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const moveAccuracy = params.moveAccuracy; const moveAccuracy = params.moveAccuracy;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -5,7 +5,7 @@ import type { NumberHolder } from "#app/utils/common";
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { HeldItemEffect, HeldItem } from "#app/items/held-item"; import { HeldItemEffect, HeldItem } from "#app/items/held-item";
export interface ATTACK_TYPE_BOOST_PARAMS { export interface AttackTypeBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The resolved type of the move */ /** The resolved type of the move */
@ -66,7 +66,7 @@ export class AttackTypeBoosterHeldItem extends HeldItem {
return `${HeldItemNames[this.type]?.toLowerCase()}`; return `${HeldItemNames[this.type]?.toLowerCase()}`;
} }
apply(params: ATTACK_TYPE_BOOST_PARAMS): void { apply(params: AttackTypeBoostParams): void {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const moveType = params.moveType; const moveType = params.moveType;
const movePower = params.movePower; const movePower = params.movePower;

View File

@ -4,7 +4,7 @@ import { getStatKey, type PermanentStat, Stat } from "#enums/stat";
import i18next from "i18next"; import i18next from "i18next";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface BASE_STAT_BOOSTER_PARAMS { export interface BaseStatBoosterParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
baseStats: number[]; baseStats: number[];
@ -71,7 +71,7 @@ export class BaseStatBoosterHeldItem extends HeldItem {
* @param baseStats the base stats of the {@linkcode Pokemon} * @param baseStats the base stats of the {@linkcode Pokemon}
* @returns always `true` * @returns always `true`
*/ */
apply(params: BASE_STAT_BOOSTER_PARAMS): boolean { apply(params: BaseStatBoosterParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);
const baseStats = params.baseStats; const baseStats = params.baseStats;

View File

@ -3,7 +3,7 @@ import { HeldItemEffect, HeldItem } from "../held-item";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import i18next from "i18next"; import i18next from "i18next";
export interface BASE_STAT_FLAT_PARAMS { export interface BaseStatFlatParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -37,7 +37,7 @@ export class BaseStatFlatHeldItem extends HeldItem {
* @param baseStats The base stats of the {@linkcode Pokemon} * @param baseStats The base stats of the {@linkcode Pokemon}
* @returns always `true` * @returns always `true`
*/ */
apply(params: BASE_STAT_FLAT_PARAMS): boolean { apply(params: BaseStatFlatParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const baseStats = params.baseStats; const baseStats = params.baseStats;
const stats = this.getStats(pokemon); const stats = this.getStats(pokemon);

View File

@ -3,7 +3,7 @@ import i18next from "i18next";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
import type { HeldItemId } from "#enums/held-item-id"; import type { HeldItemId } from "#enums/held-item-id";
export interface BASE_STAT_TOTAL_PARAMS { export interface BaseStatTotalParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -56,7 +56,7 @@ export class BaseStatTotalHeldItem extends HeldItem {
* @param baseStats the base stats of the {@linkcode Pokemon} * @param baseStats the base stats of the {@linkcode Pokemon}
* @returns always `true` * @returns always `true`
*/ */
apply(params: BASE_STAT_TOTAL_PARAMS): boolean { apply(params: BaseStatTotalParams): boolean {
const baseStats = params.baseStats; const baseStats = params.baseStats;
// Modifies the passed in baseStats[] array // Modifies the passed in baseStats[] array
baseStats.forEach((v, i) => { baseStats.forEach((v, i) => {

View File

@ -2,7 +2,7 @@ import type Pokemon from "#app/field/pokemon";
import type { NumberHolder } from "#app/utils/common"; import type { NumberHolder } from "#app/utils/common";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface BATON_PARAMS { export interface BatonParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */

View File

@ -6,7 +6,7 @@ import { ConsumableHeldItem, HeldItemEffect } from "#app/items/held-item";
import { BooleanHolder } from "#app/utils/common"; import { BooleanHolder } from "#app/utils/common";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { HeldItemId } from "#enums/held-item-id"; import { HeldItemId } from "#enums/held-item-id";
import { TRAINER_ITEM_EFFECT } from "../trainer-item"; import { TrainerItemEffect } from "../trainer-item";
interface BerryTypeToHeldItemMap { interface BerryTypeToHeldItemMap {
[key: number]: HeldItemId; [key: number]: HeldItemId;
@ -26,7 +26,7 @@ export const berryTypeToHeldItem: BerryTypeToHeldItemMap = {
[BerryType.LEPPA]: HeldItemId.LEPPA_BERRY, [BerryType.LEPPA]: HeldItemId.LEPPA_BERRY,
}; };
export interface BERRY_PARAMS { export interface BerryParams {
/** The pokemon with the berry */ /** The pokemon with the berry */
pokemon: Pokemon; pokemon: Pokemon;
} }
@ -69,7 +69,7 @@ export class BerryHeldItem extends ConsumableHeldItem {
* @param pokemon The {@linkcode Pokemon} that holds the berry * @param pokemon The {@linkcode Pokemon} that holds the berry
* @returns always `true` * @returns always `true`
*/ */
apply(params: BERRY_PARAMS): boolean { apply(params: BerryParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
if (!this.shouldApply(pokemon)) { if (!this.shouldApply(pokemon)) {
@ -77,7 +77,7 @@ export class BerryHeldItem extends ConsumableHeldItem {
} }
const preserve = new BooleanHolder(false); 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; const consumed = !preserve.value;
// munch the berry and trigger unburden-like effects // munch the berry and trigger unburden-like effects

View File

@ -6,7 +6,7 @@ import i18next from "i18next";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
import { Command } from "#enums/command"; import { Command } from "#enums/command";
export interface BYPASS_SPEED_CHANCE_PARAMS { export interface BypassSpeedChanceParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
doBypassSpeed: BooleanHolder; doBypassSpeed: BooleanHolder;
@ -37,7 +37,7 @@ export class BypassSpeedChanceHeldItem extends HeldItem {
* @param doBypassSpeed {@linkcode BooleanHolder} that is `true` if speed should be bypassed * @param doBypassSpeed {@linkcode BooleanHolder} that is `true` if speed should be bypassed
* @returns `true` if {@linkcode BypassSpeedChanceModifier} has been applied * @returns `true` if {@linkcode BypassSpeedChanceModifier} has been applied
*/ */
apply(params: BYPASS_SPEED_CHANCE_PARAMS): boolean { apply(params: BypassSpeedChanceParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const doBypassSpeed = params.doBypassSpeed; const doBypassSpeed = params.doBypassSpeed;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -4,7 +4,7 @@ import type { HeldItemId } from "#enums/held-item-id";
import type { SpeciesId } from "#enums/species-id"; import type { SpeciesId } from "#enums/species-id";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface CRIT_BOOST_PARAMS { export interface CritBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
critStage: NumberHolder; critStage: NumberHolder;
@ -34,7 +34,7 @@ export class CritBoostHeldItem extends HeldItem {
* @param critStage {@linkcode NumberHolder} that holds the resulting critical-hit level * @param critStage {@linkcode NumberHolder} that holds the resulting critical-hit level
* @returns always `true` * @returns always `true`
*/ */
apply(params: CRIT_BOOST_PARAMS): boolean { apply(params: CritBoostParams): boolean {
params.critStage.value += this.stageIncrement; params.critStage.value += this.stageIncrement;
return true; 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 pokemon = params.pokemon;
const fitsSpecies = const fitsSpecies =
this.species.includes(pokemon.getSpeciesForm(true).speciesId) || this.species.includes(pokemon.getSpeciesForm(true).speciesId) ||

View File

@ -2,9 +2,9 @@ import type Pokemon from "#app/field/pokemon";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { NumberHolder } from "#app/utils/common"; import { NumberHolder } from "#app/utils/common";
import { HeldItemEffect, HeldItem } from "../held-item"; 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 */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -20,12 +20,12 @@ export class DamageMoneyRewardHeldItem extends HeldItem {
* @param multiplier {@linkcode NumberHolder} holding the multiplier value * @param multiplier {@linkcode NumberHolder} holding the multiplier value
* @returns always `true` * @returns always `true`
*/ */
apply(params: DAMAGE_MONEY_REWARD_PARAMS): boolean { apply(params: DamageMoneyRewardParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const damage = params.damage; const damage = params.damage;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);
const moneyAmount = new NumberHolder(Math.floor(damage * (0.5 * stackCount))); 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); globalScene.addMoney(moneyAmount.value);
return true; return true;

View File

@ -6,7 +6,7 @@ import i18next from "i18next";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
import { TrainerItemId } from "#enums/trainer-item-id"; import { TrainerItemId } from "#enums/trainer-item-id";
export interface EVO_TRACKER_PARAMS { export interface EvoTrackerParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
} }

View File

@ -4,7 +4,7 @@ import type { HeldItemId } from "#enums/held-item-id";
import i18next from "i18next"; import i18next from "i18next";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface EXP_BOOST_PARAMS { export interface ExpBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -45,7 +45,7 @@ export class ExpBoosterHeldItem extends HeldItem {
* @param boost {@linkcode NumberHolder} holding the exp boost value * @param boost {@linkcode NumberHolder} holding the exp boost value
* @returns always `true` * @returns always `true`
*/ */
apply(params: EXP_BOOST_PARAMS): boolean { apply(params: ExpBoostParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const expAmount = params.expAmount; const expAmount = params.expAmount;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -2,7 +2,7 @@ import type Pokemon from "#app/field/pokemon";
import { HeldItemEffect, HeldItem } from "#app/items/held-item"; import { HeldItemEffect, HeldItem } from "#app/items/held-item";
import type { NumberHolder } from "#app/utils/common"; import type { NumberHolder } from "#app/utils/common";
export interface FIELD_EFFECT_PARAMS { export interface FieldEffectParams {
pokemon: Pokemon; pokemon: Pokemon;
/** The pokemon with the item */ /** The pokemon with the item */
fieldDuration: NumberHolder; fieldDuration: NumberHolder;
@ -24,7 +24,7 @@ export class FieldEffectHeldItem extends HeldItem {
* @param fieldDuration {@linkcode NumberHolder} that stores the current field effect duration * @param fieldDuration {@linkcode NumberHolder} that stores the current field effect duration
* @returns `true` if the field effect extension was applied successfully * @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 pokemon = params.pokemon;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);
params.fieldDuration.value += 2 * stackCount; params.fieldDuration.value += 2 * stackCount;

View File

@ -3,7 +3,7 @@ import { HeldItemEffect, HeldItem } from "#app/items/held-item";
import type { BooleanHolder } from "#app/utils/common"; import type { BooleanHolder } from "#app/utils/common";
import type { HeldItemId } from "#enums/held-item-id"; import type { HeldItemId } from "#enums/held-item-id";
export interface FLINCH_CHANCE_PARAMS { export interface FlinchChanceParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
flinched: BooleanHolder; flinched: BooleanHolder;
@ -41,7 +41,7 @@ export class FlinchChanceHeldItem extends HeldItem {
* @param flinched - A {@linkcode BooleanHolder} holding whether the pokemon has flinched * @param flinched - A {@linkcode BooleanHolder} holding whether the pokemon has flinched
* @returns `true` if {@linkcode FlinchChanceModifier} was applied successfully * @returns `true` if {@linkcode FlinchChanceModifier} was applied successfully
*/ */
apply(params: FLINCH_CHANCE_PARAMS): boolean { apply(params: FlinchChanceParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const flinched = params.flinched; const flinched = params.flinched;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -3,7 +3,7 @@ import type { NumberHolder } from "#app/utils/common";
import i18next from "i18next"; import i18next from "i18next";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface FRIENDSHIP_BOOST_PARAMS { export interface FriendshipBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -23,7 +23,7 @@ export class FriendshipBoosterHeldItem extends HeldItem {
* @param friendship {@linkcode NumberHolder} holding the friendship boost value * @param friendship {@linkcode NumberHolder} holding the friendship boost value
* @returns always `true` * @returns always `true`
*/ */
apply(params: FRIENDSHIP_BOOST_PARAMS): boolean { apply(params: FriendshipBoostParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const friendship = params.friendship; const friendship = params.friendship;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -6,7 +6,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
export interface HIT_HEAL_PARAMS { export interface HitHealParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
} }
@ -31,7 +31,7 @@ export class HitHealHeldItem extends HeldItem {
* @param pokemon The {@linkcode Pokemon} that holds the item * @param pokemon The {@linkcode Pokemon} that holds the item
* @returns `true` if the {@linkcode Pokemon} was healed * @returns `true` if the {@linkcode Pokemon} was healed
*/ */
apply(params: HIT_HEAL_PARAMS): boolean { apply(params: HitHealParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);
if (pokemon.turnData.totalDamageDealt > 0 && !pokemon.isFullHp()) { if (pokemon.turnData.totalDamageDealt > 0 && !pokemon.isFullHp()) {

View File

@ -4,7 +4,7 @@ import { Stat } from "#enums/stat";
import type { NumberHolder } from "#app/utils/common"; import type { NumberHolder } from "#app/utils/common";
import i18next from "i18next"; import i18next from "i18next";
export interface INCREMENTING_STAT_PARAMS { export interface IncrementingStatParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
stat: Stat; stat: Stat;
@ -45,7 +45,7 @@ export class IncrementingStatHeldItem extends HeldItem {
* @param statHolder The {@linkcode NumberHolder} that holds the stat * @param statHolder The {@linkcode NumberHolder} that holds the stat
* @returns always `true` * @returns always `true`
*/ */
apply(params: INCREMENTING_STAT_PARAMS): boolean { apply(params: IncrementingStatParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);
const statHolder = params.statHolder; const statHolder = params.statHolder;

View File

@ -7,7 +7,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs";
export interface INSTANT_REVIVE_PARAMS { export interface InstantReviveParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
} }
@ -38,7 +38,7 @@ export class InstantReviveHeldItem extends ConsumableHeldItem {
* @param pokemon {@linkcode Pokemon} that holds the item * @param pokemon {@linkcode Pokemon} that holds the item
* @returns `true` if any stat stages were reset, false otherwise * @returns `true` if any stat stages were reset, false otherwise
*/ */
apply(params: INSTANT_REVIVE_PARAMS): boolean { apply(params: InstantReviveParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
// Restore the Pokemon to half HP // Restore the Pokemon to half HP
globalScene.phaseManager.unshiftPhase( globalScene.phaseManager.unshiftPhase(

View File

@ -7,7 +7,7 @@ import { getPokemonNameWithAffix } from "#app/messages";
import { allHeldItems } from "../all-held-items"; import { allHeldItems } from "../all-held-items";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
export interface ITEM_STEAL_PARAMS { export interface ItemStealParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The pokemon to steal from (optional) */ /** The pokemon to steal from (optional) */
@ -30,7 +30,7 @@ export abstract class ItemTransferHeldItem extends HeldItem {
* @param _args N/A * @param _args N/A
* @returns `true` if an item was stolen; false otherwise. * @returns `true` if an item was stolen; false otherwise.
*/ */
apply(params: ITEM_STEAL_PARAMS): boolean { apply(params: ItemStealParams): boolean {
const opponents = this.getTargets(params); const opponents = this.getTargets(params);
if (!opponents.length) { if (!opponents.length) {
@ -70,11 +70,11 @@ export abstract class ItemTransferHeldItem extends HeldItem {
return !!transferredModifierTypes.length; 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 * @param _args N/A
* @returns the opponents of the source {@linkcode Pokemon} * @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() : []; return params.pokemon instanceof Pokemon ? params.pokemon.getOpponents() : [];
} }
getTransferredItemCount(_params: ITEM_STEAL_PARAMS): number { getTransferredItemCount(_params: ItemStealParams): number {
return 1; return 1;
} }
getTransferMessage(params: ITEM_STEAL_PARAMS, itemId: HeldItemId): string { getTransferMessage(params: ItemStealParams, itemId: HeldItemId): string {
return i18next.t("modifier:turnHeldItemTransferApply", { return i18next.t("modifier:turnHeldItemTransferApply", {
pokemonNameWithAffix: getPokemonNameWithAffix(params.target), pokemonNameWithAffix: getPokemonNameWithAffix(params.target),
itemName: allHeldItems[itemId].name, 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 * @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 * @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] : []; return params.target ? [params.target] : [];
} }
getTransferredItemCount(params: ITEM_STEAL_PARAMS): number { getTransferredItemCount(params: ItemStealParams): number {
const stackCount = params.pokemon.heldItemManager.getStack(this.type); const stackCount = params.pokemon.heldItemManager.getStack(this.type);
return randSeedFloat() <= this.chance * stackCount ? 1 : 0; 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", { return i18next.t("modifier:contactHeldItemTransferApply", {
pokemonNameWithAffix: getPokemonNameWithAffix(params.target), pokemonNameWithAffix: getPokemonNameWithAffix(params.target),
itemName: allHeldItems[itemId].name, itemName: allHeldItems[itemId].name,

View File

@ -5,7 +5,7 @@ import type { MoveId } from "#enums/move-id";
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
import i18next from "i18next"; import i18next from "i18next";
export interface MULTI_HIT_PARAMS { export interface MultiHitParams {
pokemon: Pokemon; pokemon: Pokemon;
moveId: MoveId; moveId: MoveId;
count?: NumberHolder; 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 * @param damageMultiplier {@linkcode NumberHolder} holding a damage multiplier applied to a strike of this move
* @returns always `true` * @returns always `true`
*/ */
apply(params: MULTI_HIT_PARAMS): boolean { apply(params: MultiHitParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const move = allMoves[params.moveId]; const move = allMoves[params.moveId];
/** /**

View File

@ -2,7 +2,7 @@ import type Pokemon from "#app/field/pokemon";
import type { NumberHolder } from "#app/utils/common"; import type { NumberHolder } from "#app/utils/common";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface NATURE_WEIGHT_BOOST_PARAMS { export interface NatureWeightBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** The amount of exp to gain */ /** The amount of exp to gain */
@ -18,7 +18,7 @@ export class NatureWeightBoosterHeldItem extends HeldItem {
* @param multiplier {@linkcode NumberHolder} holding the nature weight * @param multiplier {@linkcode NumberHolder} holding the nature weight
* @returns `true` if multiplier was applied * @returns `true` if multiplier was applied
*/ */
apply(params: NATURE_WEIGHT_BOOST_PARAMS): boolean { apply(params: NatureWeightBoostParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const multiplier = params.multiplier; const multiplier = params.multiplier;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -5,7 +5,7 @@ import i18next from "i18next";
import { ConsumableHeldItem, HeldItemEffect } from "../held-item"; import { ConsumableHeldItem, HeldItemEffect } from "../held-item";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
export interface RESET_NEGATIVE_STAT_STAGE_PARAMS { export interface ResetNegativeStatStageParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
/** Whether the move was used by a player 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 * @param pokemon {@linkcode Pokemon} that holds the item
* @returns `true` if any stat stages were reset, false otherwise * @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 pokemon = params.pokemon;
const isPlayer = params.isPlayer; const isPlayer = params.isPlayer;
let statRestored = false; let statRestored = false;

View File

@ -6,7 +6,7 @@ import type { SpeciesId } from "#enums/species-id";
import type { Stat } from "#enums/stat"; import type { Stat } from "#enums/stat";
import { HeldItemEffect, HeldItem } from "../held-item"; import { HeldItemEffect, HeldItem } from "../held-item";
export interface STAT_BOOST_PARAMS { export interface StatBoostParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
stat: Stat; stat: Stat;
@ -53,7 +53,7 @@ export class StatBoostHeldItem extends HeldItem {
* @returns `true` if the stat boost applies successfully, false otherwise * @returns `true` if the stat boost applies successfully, false otherwise
* @see shouldApply * @see shouldApply
*/ */
apply(params: STAT_BOOST_PARAMS): boolean { apply(params: StatBoostParams): boolean {
params.statValue.value *= this.multiplier; params.statValue.value *= this.multiplier;
return true; return true;
} }
@ -94,7 +94,7 @@ export class EvolutionStatBoostHeldItem extends StatBoostHeldItem {
* @returns `true` if the stat boost applies successfully, false otherwise * @returns `true` if the stat boost applies successfully, false otherwise
* @see shouldApply * @see shouldApply
*/ */
override apply(params: STAT_BOOST_PARAMS): boolean { override apply(params: StatBoostParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const isUnevolved = pokemon.getSpeciesForm(true).speciesId in pokemonEvolutions; 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 pokemon = params.pokemon;
const fitsSpecies = const fitsSpecies =
this.species.includes(pokemon.getSpeciesForm(true).speciesId) || this.species.includes(pokemon.getSpeciesForm(true).speciesId) ||

View File

@ -5,7 +5,7 @@ import { globalScene } from "#app/global-scene";
import i18next from "i18next"; import i18next from "i18next";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
export interface SURVIVE_CHANCE_PARAMS { export interface SurviveChanceParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
surviveDamage: BooleanHolder; surviveDamage: BooleanHolder;
@ -36,7 +36,7 @@ export class SurviveChanceHeldItem extends HeldItem {
* @param surviveDamage {@linkcode BooleanHolder} that holds the survive damage * @param surviveDamage {@linkcode BooleanHolder} that holds the survive damage
* @returns `true` if the survive damage has been applied * @returns `true` if the survive damage has been applied
*/ */
apply(params: SURVIVE_CHANCE_PARAMS): boolean { apply(params: SurviveChanceParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const surviveDamage = params.surviveDamage; const surviveDamage = params.surviveDamage;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);

View File

@ -6,7 +6,7 @@ import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
import { toDmgValue } from "#app/utils/common"; import { toDmgValue } from "#app/utils/common";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
export interface TURN_END_HEAL_PARAMS { export interface TurnEndHealParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
} }
@ -14,7 +14,7 @@ export interface TURN_END_HEAL_PARAMS {
export class TurnEndHealHeldItem extends HeldItem { export class TurnEndHealHeldItem extends HeldItem {
public effects: HeldItemEffect[] = [HeldItemEffect.TURN_END_HEAL]; public effects: HeldItemEffect[] = [HeldItemEffect.TURN_END_HEAL];
apply(params: TURN_END_HEAL_PARAMS): boolean { apply(params: TurnEndHealParams): boolean {
const pokemon = params.pokemon; const pokemon = params.pokemon;
const stackCount = pokemon.heldItemManager.getStack(this.type); const stackCount = pokemon.heldItemManager.getStack(this.type);
if (pokemon.isFullHp()) { if (pokemon.isFullHp()) {

View File

@ -3,7 +3,7 @@ import { HeldItemEffect, HeldItem } from "#app/items/held-item";
import type { StatusEffect } from "#enums/status-effect"; import type { StatusEffect } from "#enums/status-effect";
import type { HeldItemId } from "#enums/held-item-id"; import type { HeldItemId } from "#enums/held-item-id";
export interface TURN_END_STATUS_PARAMS { export interface TurnEndStatusParams {
/** The pokemon with the item */ /** The pokemon with the item */
pokemon: Pokemon; pokemon: Pokemon;
} }
@ -30,7 +30,7 @@ export class TurnEndStatusHeldItem extends HeldItem {
* @param pokemon {@linkcode Pokemon} that holds the held item * @param pokemon {@linkcode Pokemon} that holds the held item
* @returns `true` if the status effect was applied successfully * @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); return params.pokemon.trySetStatus(this.effect, true, undefined, undefined, this.name);
} }

View File

@ -11,7 +11,7 @@ import { getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/st
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
export const TRAINER_ITEM_EFFECT = { export const TrainerItemEffect = {
LEVEL_INCREMENT_BOOSTER: 1, LEVEL_INCREMENT_BOOSTER: 1,
PRESERVE_BERRY: 2, PRESERVE_BERRY: 2,
HEALING_BOOSTER: 3, HEALING_BOOSTER: 3,
@ -38,17 +38,17 @@ export const TRAINER_ITEM_EFFECT = {
ENEMY_FUSED_CHANCE: 21, ENEMY_FUSED_CHANCE: 21,
} as const; } 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; numberHolder: NumberHolder;
} }
export interface BOOLEAN_HOLDER_PARAMS { export interface BooleanHolderParams {
booleanHolder: BooleanHolder; booleanHolder: BooleanHolder;
} }
export interface POKEMON_PARAMS { export interface PokemonParams {
pokemon: Pokemon; pokemon: Pokemon;
} }
@ -57,7 +57,7 @@ export class TrainerItem {
public type: TrainerItemId; public type: TrainerItemId;
public maxStackCount: number; public maxStackCount: number;
public isLapsing = false; 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 //TODO: If this is actually never changed by any subclass, perhaps it should not be here
public soundName = "se/restore"; public soundName = "se/restore";
@ -119,9 +119,9 @@ export class TrainerItem {
// Candy Jar // Candy Jar
export class LevelIncrementBoosterTrainerItem extends TrainerItem { 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 count = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
count.value += stack; count.value += stack;
@ -129,15 +129,15 @@ export class LevelIncrementBoosterTrainerItem extends TrainerItem {
} }
// Berry Pouch // Berry Pouch
export interface PRESERVE_BERRY_PARAMS { export interface PreserveBerryParams {
pokemon: Pokemon; pokemon: Pokemon;
doPreserve: BooleanHolder; doPreserve: BooleanHolder;
} }
export class PreserveBerryTrainerItem extends TrainerItem { 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); const stack = manager.getStack(this.type);
params.doPreserve.value ||= params.pokemon.randBattleSeedInt(10) < stack * 3; params.doPreserve.value ||= params.pokemon.randBattleSeedInt(10) < stack * 3;
} }
@ -145,7 +145,7 @@ export class PreserveBerryTrainerItem extends TrainerItem {
// Healing Charm // Healing Charm
export class HealingBoosterTrainerItem extends TrainerItem { export class HealingBoosterTrainerItem extends TrainerItem {
public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.HEALING_BOOSTER]; public effects: TrainerItemEffect[] = [TrainerItemEffect.HEALING_BOOSTER];
private multiplier: number; private multiplier: number;
constructor(type: TrainerItemId, multiplier: number, stackCount?: number) { constructor(type: TrainerItemId, multiplier: number, stackCount?: number) {
@ -154,7 +154,7 @@ export class HealingBoosterTrainerItem extends TrainerItem {
this.multiplier = multiplier; this.multiplier = multiplier;
} }
apply(manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { apply(manager: TrainerItemManager, params: NumberHolderParams) {
const healingMultiplier = params.numberHolder; const healingMultiplier = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
healingMultiplier.value *= 1 + (this.multiplier - 1) * stack; healingMultiplier.value *= 1 + (this.multiplier - 1) * stack;
@ -163,7 +163,7 @@ export class HealingBoosterTrainerItem extends TrainerItem {
// Exp Booster // Exp Booster
export class ExpBoosterTrainerItem extends TrainerItem { export class ExpBoosterTrainerItem extends TrainerItem {
public effects: TRAINER_ITEM_EFFECT[] = [TRAINER_ITEM_EFFECT.EXP_BOOSTER]; public effects: TrainerItemEffect[] = [TrainerItemEffect.EXP_BOOSTER];
private boostPercent: number; private boostPercent: number;
constructor(type: TrainerItemId, boostPercent: number, stackCount?: 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 boost = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
boost.value = Math.floor(boost.value * (1 + stack * this.boostPercent * 0.01)); 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 { 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 moneyMultiplier = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
moneyMultiplier.value += Math.floor(moneyMultiplier.value * 0.2 * stack); moneyMultiplier.value += Math.floor(moneyMultiplier.value * 0.2 * stack);
@ -196,9 +196,9 @@ export class MoneyMultiplierTrainerItem extends TrainerItem {
} }
export class HiddenAbilityChanceBoosterTrainerItem 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 boost = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
boost.value *= Math.pow(2, -1 - stack); boost.value *= Math.pow(2, -1 - stack);
@ -206,9 +206,9 @@ export class HiddenAbilityChanceBoosterTrainerItem extends TrainerItem {
} }
export class ShinyRateBoosterTrainerItem 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 boost = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
boost.value *= Math.pow(2, 1 + stack); boost.value *= Math.pow(2, 1 + stack);
@ -216,9 +216,9 @@ export class ShinyRateBoosterTrainerItem extends TrainerItem {
} }
export class CriticalCatchChanceBoosterTrainerItem 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 boost = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
boost.value *= 1.5 + stack / 2; boost.value *= 1.5 + stack / 2;
@ -226,9 +226,9 @@ export class CriticalCatchChanceBoosterTrainerItem extends TrainerItem {
} }
export class ExtraRewardTrainerItem 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 count = params.numberHolder;
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
count.value += stack; count.value += stack;
@ -236,7 +236,7 @@ export class ExtraRewardTrainerItem extends TrainerItem {
} }
export class HealShopCostTrainerItem 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; public readonly shopMultiplier: number;
constructor(type: TrainerItemId, shopMultiplier: number, stackCount?: number) { constructor(type: TrainerItemId, shopMultiplier: number, stackCount?: number) {
@ -245,7 +245,7 @@ export class HealShopCostTrainerItem extends TrainerItem {
this.shopMultiplier = shopMultiplier; this.shopMultiplier = shopMultiplier;
} }
apply(_manager: TrainerItemManager, params: NUMBER_HOLDER_PARAMS) { apply(_manager: TrainerItemManager, params: NumberHolderParams) {
const moneyCost = params.numberHolder; const moneyCost = params.numberHolder;
moneyCost.value = Math.floor(moneyCost.value * this.shopMultiplier); moneyCost.value = Math.floor(moneyCost.value * this.shopMultiplier);
} }
@ -281,7 +281,7 @@ export class LapsingTrainerItem extends TrainerItem {
} }
export class DoubleBattleChanceBoosterTrainerItem extends LapsingTrainerItem { 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 { get description(): string {
return i18next.t("modifierType:ModifierType.DoubleBattleChanceBoosterModifierType.description", { 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; const doubleBattleChance = params.numberHolder;
// This is divided because the chance is generated as a number from 0 to doubleBattleChance.value using randSeedInt // 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 // A double battle will initiate if the generated number is 0
@ -311,7 +311,7 @@ export const tempStatToTrainerItem: TempStatToTrainerItemMap = {
}; };
export class TempStatStageBoosterTrainerItem extends LapsingTrainerItem { 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; private stat: TempBattleStat;
constructor(type: TrainerItemId, stat: TempBattleStat, stackCount?: number) { 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 statLevel = params.numberHolder;
const boost = 0.3; const boost = 0.3;
statLevel.value += boost; statLevel.value += boost;
@ -340,7 +340,7 @@ export class TempStatStageBoosterTrainerItem extends LapsingTrainerItem {
} }
export class TempAccuracyBoosterTrainerItem 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 { get name(): string {
return i18next.t(`modifierType:TempStatStageBoosterItem.${TrainerItemNames[this.type]?.toLowerCase()}`); 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 statLevel = params.numberHolder;
const boost = 1; const boost = 1;
statLevel.value += boost; statLevel.value += boost;
@ -362,7 +362,7 @@ export class TempAccuracyBoosterTrainerItem extends LapsingTrainerItem {
} }
export class TempCritBoosterTrainerItem 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 { get description(): string {
return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { 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; const critLevel = params.numberHolder;
critLevel.value++; critLevel.value++;
} }
} }
export class EnemyDamageBoosterTrainerItem extends TrainerItem { 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; public damageBoost = 1.05;
get iconName(): string { get iconName(): string {
return "wl_item_drop"; 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 stack = manager.getStack(this.type);
const multiplier = params.numberHolder; const multiplier = params.numberHolder;
@ -400,14 +400,14 @@ export class EnemyDamageBoosterTrainerItem extends TrainerItem {
} }
export class EnemyDamageReducerTrainerItem 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; public damageReduction = 0.975;
get iconName(): string { get iconName(): string {
return "wl_guard_spec"; 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 stack = manager.getStack(this.type);
const multiplier = params.numberHolder; const multiplier = params.numberHolder;
@ -422,14 +422,14 @@ export class EnemyDamageReducerTrainerItem extends TrainerItem {
} }
export class EnemyTurnHealTrainerItem 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; public healPercent = 2;
get iconName(): string { get iconName(): string {
return "wl_potion"; return "wl_potion";
} }
apply(manager: TrainerItemManager, params: POKEMON_PARAMS): boolean { apply(manager: TrainerItemManager, params: PokemonParams): boolean {
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
const enemyPokemon = params.pokemon; const enemyPokemon = params.pokemon;
@ -455,7 +455,7 @@ export class EnemyTurnHealTrainerItem extends TrainerItem {
} }
export class EnemyAttackStatusEffectChanceTrainerItem 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; public effect: StatusEffect;
constructor(type: TrainerItemId, effect: StatusEffect, stackCount?: number) { 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 stack = manager.getStack(this.type);
const enemyPokemon = params.pokemon; const enemyPokemon = params.pokemon;
const chance = this.getChance(); const chance = this.getChance();
@ -502,14 +502,14 @@ export class EnemyAttackStatusEffectChanceTrainerItem extends TrainerItem {
} }
export class EnemyStatusEffectHealChanceTrainerItem 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; public chance = 0.025;
get iconName(): string { get iconName(): string {
return "wl_full_heal"; return "wl_full_heal";
} }
apply(manager: TrainerItemManager, params: POKEMON_PARAMS): boolean { apply(manager: TrainerItemManager, params: PokemonParams): boolean {
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
const enemyPokemon = params.pokemon; const enemyPokemon = params.pokemon;
@ -527,7 +527,7 @@ export class EnemyStatusEffectHealChanceTrainerItem extends TrainerItem {
} }
export class EnemyEndureChanceTrainerItem 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; public chance = 2;
get iconName(): string { 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 stack = manager.getStack(this.type);
const target = params.pokemon; const target = params.pokemon;
@ -557,14 +557,14 @@ export class EnemyEndureChanceTrainerItem extends TrainerItem {
} }
export class EnemyFusionChanceTrainerItem 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; public chance = 0.01;
get iconName(): string { get iconName(): string {
return "wl_custom_spliced"; return "wl_custom_spliced";
} }
apply(manager: TrainerItemManager, params: BOOLEAN_HOLDER_PARAMS) { apply(manager: TrainerItemManager, params: BooleanHolderParams) {
const stack = manager.getStack(this.type); const stack = manager.getStack(this.type);
const isFusion = params.booleanHolder; const isFusion = params.booleanHolder;
if (randSeedFloat() > this.chance * stack) { if (randSeedFloat() > this.chance * stack) {

View File

@ -74,7 +74,7 @@ import { getNewAttackTypeBoosterHeldItem, getNewBerryHeldItem, getNewVitaminHeld
import { berryTypeToHeldItem } from "#app/items/held-items/berry"; import { berryTypeToHeldItem } from "#app/items/held-items/berry";
import { TrainerItemId } from "#enums/trainer-item-id"; import { TrainerItemId } from "#enums/trainer-item-id";
import { allTrainerItems } from "#app/data/data-lists"; 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; type NewModifierFunc = (type: ModifierType, args: any[]) => Modifier | null;
@ -818,7 +818,7 @@ export class MoneyRewardModifierType extends ModifierType {
getDescription(): string { getDescription(): string {
const moneyAmount = new NumberHolder(globalScene.getWaveMoneyAmount(this.moneyMultiplier)); 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); const formattedMoney = formatMoney(globalScene.moneyFormat, moneyAmount.value);
return i18next.t("modifierType:ModifierType.MoneyRewardModifierType.description", { return i18next.t("modifierType:ModifierType.MoneyRewardModifierType.description", {

View File

@ -23,7 +23,7 @@ import type { ModifierInstanceMap, ModifierString } from "#app/@types/modifier-t
import { assignItemsFromConfiguration } from "#app/items/held-item-pool"; import { assignItemsFromConfiguration } from "#app/items/held-item-pool";
import type { HeldItemConfiguration } from "#app/items/held-item-data-types"; import type { HeldItemConfiguration } from "#app/items/held-item-data-types";
import { HeldItemId } from "#enums/held-item-id"; 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"; import type { TrainerItemConfiguration } from "#app/items/trainer-item-data-types";
export type ModifierPredicate = (modifier: Modifier) => boolean; export type ModifierPredicate = (modifier: Modifier) => boolean;
@ -383,7 +383,7 @@ export class PokemonLevelIncrementModifier extends ConsumablePokemonModifier {
* @returns always `true` * @returns always `true`
*/ */
override apply(playerPokemon: PlayerPokemon, levelCount: NumberHolder = new NumberHolder(1)): boolean { 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; playerPokemon.level += levelCount.value;
if (playerPokemon.level <= globalScene.getMaxExpLevel(true)) { if (playerPokemon.level <= globalScene.getMaxExpLevel(true)) {
@ -532,7 +532,7 @@ export class MoneyRewardModifier extends ConsumableModifier {
override apply(): boolean { override apply(): boolean {
const moneyAmount = new NumberHolder(globalScene.getWaveMoneyAmount(this.moneyMultiplier)); 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); globalScene.addMoney(moneyAmount.value);

View File

@ -3,7 +3,7 @@ import { getPokemonNameWithAffix } from "#app/messages";
import i18next from "i18next"; import i18next from "i18next";
import { NumberHolder } from "#app/utils/common"; import { NumberHolder } from "#app/utils/common";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; 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 { export class ExpPhase extends PlayerPartyMemberPokemonPhase {
public readonly phaseName = "ExpPhase"; public readonly phaseName = "ExpPhase";
@ -20,7 +20,7 @@ export class ExpPhase extends PlayerPartyMemberPokemonPhase {
const pokemon = this.getPokemon(); const pokemon = this.getPokemon();
const exp = new NumberHolder(this.expValue); 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); exp.value = Math.floor(exp.value);
globalScene.ui.showText( globalScene.ui.showText(
i18next.t("battle:expGain", { i18next.t("battle:expGain", {

View File

@ -3,7 +3,7 @@ import { ArenaTagType } from "#app/enums/arena-tag-type";
import i18next from "i18next"; import i18next from "i18next";
import { NumberHolder } from "#app/utils/common"; import { NumberHolder } from "#app/utils/common";
import { BattlePhase } from "./battle-phase"; 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 { export class MoneyRewardPhase extends BattlePhase {
public readonly phaseName = "MoneyRewardPhase"; public readonly phaseName = "MoneyRewardPhase";
@ -18,7 +18,7 @@ export class MoneyRewardPhase extends BattlePhase {
start() { start() {
const moneyAmount = new NumberHolder(globalScene.getWaveMoneyAmount(this.moneyMultiplier)); 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)) { if (globalScene.arena.getTag(ArenaTagType.HAPPY_HOUR)) {
moneyAmount.value *= 2; moneyAmount.value *= 2;

View File

@ -43,7 +43,7 @@ import { DamageAchv } from "#app/system/achv";
import { applyHeldItems } from "#app/items/all-held-items"; import { applyHeldItems } from "#app/items/all-held-items";
import { HeldItemEffect } from "#app/items/held-item"; import { HeldItemEffect } from "#app/items/held-item";
import { isVirtual, isReflected, MoveUseMode } from "#enums/move-use-mode"; 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]; export type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier];
@ -856,7 +856,7 @@ export class MoveEffectPhase extends PokemonPhase {
if (isBlockedBySubstitute) { if (isBlockedBySubstitute) {
substitute.hp -= dmg; substitute.hp -= dmg;
} else if (!target.isPlayer() && dmg >= target.hp) { } 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 const damage = isBlockedBySubstitute

View File

@ -11,7 +11,7 @@ import { NumberHolder } from "#app/utils/common";
import { CommonAnimPhase } from "./common-anim-phase"; import { CommonAnimPhase } from "./common-anim-phase";
import { BattlerTagType } from "#app/enums/battler-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import type { HealBlockTag } from "#app/data/battler-tags"; 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 { export class PokemonHealPhase extends CommonAnimPhase {
public readonly phaseName = "PokemonHealPhase"; public readonly phaseName = "PokemonHealPhase";
@ -75,7 +75,7 @@ export class PokemonHealPhase extends CommonAnimPhase {
if (healOrDamage) { if (healOrDamage) {
const hpRestoreMultiplier = new NumberHolder(1); const hpRestoreMultiplier = new NumberHolder(1);
if (!this.revive) { 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)); const healAmount = new NumberHolder(Math.floor(this.hpHealed * hpRestoreMultiplier.value));
if (healAmount.value < 0) { if (healAmount.value < 0) {

View File

@ -27,7 +27,7 @@ import { BattlePhase } from "./battle-phase";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";
import type { CustomModifierSettings } from "#app/modifier/modifier-type"; import type { CustomModifierSettings } from "#app/modifier/modifier-type";
import { isNullOrUndefined, NumberHolder } from "#app/utils/common"; 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; export type ModifierSelectCallback = (rowCursor: number, cursor: number) => boolean;
@ -152,7 +152,7 @@ export class SelectModifierPhase extends BattlePhase {
const modifierType = shopOption.type; const modifierType = shopOption.type;
// Apply Black Sludge to healing item cost // Apply Black Sludge to healing item cost
const healingItemCost = new NumberHolder(shopOption.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; const cost = healingItemCost.value;
if (globalScene.money < cost && !Overrides.WAIVE_ROLL_FEE_OVERRIDE) { 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 // Function that determines how many reward slots are available
private getModifierCount(): number { private getModifierCount(): number {
const modifierCountHolder = new NumberHolder(3); 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 custom modifiers are specified, overrides default item count
if (this.customModifierSettings) { if (this.customModifierSettings) {
@ -474,7 +474,7 @@ export class SelectModifierPhase extends BattlePhase {
// Apply Black Sludge to reroll cost // Apply Black Sludge to reroll cost
const modifiedRerollCost = new NumberHolder(baseMultiplier); 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; return modifiedRerollCost.value;
} }

View File

@ -3,7 +3,7 @@ import { ExpGainsSpeed } from "#app/enums/exp-gains-speed";
import { ExpNotification } from "#app/enums/exp-notification"; import { ExpNotification } from "#app/enums/exp-notification";
import { NumberHolder } from "#app/utils/common"; import { NumberHolder } from "#app/utils/common";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; 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 { export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase {
public readonly phaseName = "ShowPartyExpBarPhase"; public readonly phaseName = "ShowPartyExpBarPhase";
@ -20,7 +20,7 @@ export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase {
const pokemon = this.getPokemon(); const pokemon = this.getPokemon();
const exp = new NumberHolder(this.expValue); 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); exp.value = Math.floor(exp.value);
const lastLevel = pokemon.level; const lastLevel = pokemon.level;

View File

@ -10,7 +10,7 @@ import { FieldPhase } from "./field-phase";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { applyHeldItems } from "#app/items/all-held-items"; import { applyHeldItems } from "#app/items/all-held-items";
import { HeldItemEffect } from "#app/items/held-item"; 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 { export class TurnEndPhase extends FieldPhase {
public readonly phaseName = "TurnEndPhase"; public readonly phaseName = "TurnEndPhase";
@ -41,8 +41,8 @@ export class TurnEndPhase extends FieldPhase {
} }
if (!pokemon.isPlayer()) { if (!pokemon.isPlayer()) {
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_HEAL, { pokemon: pokemon }); globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_HEAL, { pokemon: pokemon });
globalScene.applyPlayerItems(TRAINER_ITEM_EFFECT.ENEMY_STATUS_HEAL_CHANCE, { pokemon: pokemon }); globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE, { pokemon: pokemon });
} }
applyAbAttrs("PostTurnAbAttr", { pokemon }); applyAbAttrs("PostTurnAbAttr", { pokemon });

View File

@ -16,7 +16,7 @@ import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
import Phaser from "phaser"; import Phaser from "phaser";
import type { PokeballType } from "#enums/pokeball"; import type { PokeballType } from "#enums/pokeball";
import { TrainerItemId } from "#enums/trainer-item-id"; 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; export const SHOP_OPTIONS_ROW_LIMIT = 7;
const SINGLE_SHOP_ROW_YOFFSET = 12; const SINGLE_SHOP_ROW_YOFFSET = 12;
@ -214,7 +214,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
const typeOptions = args[1] as ModifierTypeOption[]; const typeOptions = args[1] as ModifierTypeOption[];
const removeHealShop = globalScene.gameMode.hasNoShop; const removeHealShop = globalScene.gameMode.hasNoShop;
const baseShopCost = new NumberHolder(globalScene.getWaveMoneyAmount(1)); 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 const shopTypeOptions = !removeHealShop
? getPlayerShopModifierTypeOptionsForWave(globalScene.currentBattle.waveIndex, baseShopCost.value) ? getPlayerShopModifierTypeOptionsForWave(globalScene.currentBattle.waveIndex, baseShopCost.value)
: []; : [];