Address formatting

This commit is contained in:
AJ Fontaine 2025-06-03 15:39:27 -04:00
parent a5af779af1
commit 446d6455c5
2 changed files with 23 additions and 14 deletions

View File

@ -86,8 +86,7 @@ type TyrogueMove = Moves.LOW_SWEEP | Moves.MACH_PUNCH | Moves.RAPID_SPIN;
export type EvolutionLevel = [species: Species, level: number]; export type EvolutionLevel = [species: Species, level: number];
enum EvoCondKey { enum EvoCondKey {
NONE, FRIENDSHIP = 1,
FRIENDSHIP,
TIME, TIME,
MOVE, MOVE,
MOVE_TYPE, MOVE_TYPE,
@ -119,7 +118,7 @@ type EvolutionConditionData =
{key: EvoCondKey.NATURE, nature: Nature[]} | {key: EvoCondKey.NATURE, nature: Nature[]} |
{key: EvoCondKey.WEATHER, weather: WeatherType[]} | {key: EvoCondKey.WEATHER, weather: WeatherType[]} |
{key: EvoCondKey.TYROGUE, move: TyrogueMove} | {key: EvoCondKey.TYROGUE, move: TyrogueMove} |
{key: EvoCondKey.SHEDINJA | EvoCondKey.NONE} {key: EvoCondKey.SHEDINJA}
; ;
export class SpeciesEvolutionCondition { export class SpeciesEvolutionCondition {
@ -162,10 +161,10 @@ export class SpeciesEvolutionCondition {
case EvoCondKey.RECOIL_DAMAGE_COUNT: case EvoCondKey.RECOIL_DAMAGE_COUNT:
return i18next.t("pokemonEvolutions:recoil"); return i18next.t("pokemonEvolutions:recoil");
case EvoCondKey.HELD_ITEM: case EvoCondKey.HELD_ITEM:
return i18next.t("pokemonEvolutions:heldItem"); return i18next.t(`pokemonEvolutions:heldItem.${cond.itemKey}`);
} }
}).filter(s => !isNullOrUndefined(s)); // Filter out stringless conditions }).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 { public conditionsFulfilled(pokemon: Pokemon): boolean {

View File

@ -790,15 +790,8 @@ export class MoveEffectPhase extends PokemonPhase {
globalScene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger); globalScene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger);
// Increment evo counter for Primeape and Stantler // Increment evo counter for Primeape and Stantler
if ( if (user.isPlayer()) {
(user.isPlayer() && this.incrementMoveUseEvoCounters(user);
((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);
} }
// Multi-hit check for Wimp Out/Emergency Exit // 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. * Sub-method of for {@linkcode applyMoveEffects} that applies damage to the target.
* *