diff --git a/src/data/balance/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts index bcd3b44b74d..3276a95f1fd 100644 --- a/src/data/balance/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -86,8 +86,7 @@ type TyrogueMove = Moves.LOW_SWEEP | Moves.MACH_PUNCH | Moves.RAPID_SPIN; export type EvolutionLevel = [species: Species, level: number]; enum EvoCondKey { - NONE, - FRIENDSHIP, + FRIENDSHIP = 1, TIME, MOVE, MOVE_TYPE, @@ -119,7 +118,7 @@ type EvolutionConditionData = {key: EvoCondKey.NATURE, nature: Nature[]} | {key: EvoCondKey.WEATHER, weather: WeatherType[]} | {key: EvoCondKey.TYROGUE, move: TyrogueMove} | - {key: EvoCondKey.SHEDINJA | EvoCondKey.NONE} + {key: EvoCondKey.SHEDINJA} ; export class SpeciesEvolutionCondition { @@ -162,10 +161,10 @@ export class SpeciesEvolutionCondition { case EvoCondKey.RECOIL_DAMAGE_COUNT: return i18next.t("pokemonEvolutions:recoil"); case EvoCondKey.HELD_ITEM: - return i18next.t("pokemonEvolutions:heldItem"); + return i18next.t(`pokemonEvolutions:heldItem.${cond.itemKey}`); } }).filter(s => !isNullOrUndefined(s)); // Filter out stringless conditions - return str.join(i18next.t("pokemonEvolutions:connector")); + return str.join(i18next.t("pokemonEvolutions:connector")); // A comma or something of the sort } public conditionsFulfilled(pokemon: Pokemon): boolean { diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 9603bfa10b9..a27a83ef43b 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -790,15 +790,8 @@ export class MoveEffectPhase extends PokemonPhase { globalScene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger); // Increment evo counter for Primeape and Stantler - if ( - (user.isPlayer() && - ((user.hasSpecies(Species.PRIMEAPE) && this.move.id === Moves.RAGE_FIST) || - (user.hasSpecies(Species.STANTLER) && this.move.id === Moves.PSYSHIELD_BASH)))) { - const modifier = (this.move.id === Moves.RAGE_FIST ? - modifierTypes.EVOLUTION_TRACKER_PRIMEAPE().withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_PRIMEAPE) : - modifierTypes.EVOLUTION_TRACKER_STANTLER().withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_STANTLER)) - .newModifier(user) as EvoTrackerMoveUseModifier; - globalScene.addModifier(modifier); + if (user.isPlayer()) { + this.incrementMoveUseEvoCounters(user); } // Multi-hit check for Wimp Out/Emergency Exit @@ -808,6 +801,23 @@ export class MoveEffectPhase extends PokemonPhase { } } + /** + * Increments evolution tracker stack for "Use move X times" evolutions, namely Primeape and Stantler + * @param user {@linkcode Pokemon} the move's user + */ + incrementMoveUseEvoCounters(user: Pokemon) { + // Increment evo counter for Primeape and Stantler + if ( + ((user.hasSpecies(Species.PRIMEAPE) && this.move.id === Moves.RAGE_FIST) || + (user.hasSpecies(Species.STANTLER) && this.move.id === Moves.PSYSHIELD_BASH))) { + const modifier = (this.move.id === Moves.RAGE_FIST ? + modifierTypes.EVOLUTION_TRACKER_PRIMEAPE().withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_PRIMEAPE) : + modifierTypes.EVOLUTION_TRACKER_STANTLER().withIdFromFunc(modifierTypes.EVOLUTION_TRACKER_STANTLER)) + .newModifier(user) as EvoTrackerMoveUseModifier; + globalScene.addModifier(modifier); // Adds modifier or increments existing stack + } + } + /** * Sub-method of for {@linkcode applyMoveEffects} that applies damage to the target. *