fix typos in variable/parameter/class names

This commit is contained in:
fabske0 2025-08-07 12:21:54 +02:00 committed by Sirz Benjie
parent d07d72a9ea
commit 9b94e9853b
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
10 changed files with 38 additions and 38 deletions

View File

@ -6444,23 +6444,23 @@ export class PostDamageForceSwitchAbAttr extends PostDamageAbAttr {
public override canApply({ pokemon, source, damage }: PostDamageAbAttrParams): boolean { public override canApply({ pokemon, source, damage }: PostDamageAbAttrParams): boolean {
const moveHistory = pokemon.getMoveHistory(); const moveHistory = pokemon.getMoveHistory();
// Will not activate when the Pokémon's HP is lowered by cutting its own HP // Will not activate when the Pokémon's HP is lowered by cutting its own HP
const fordbiddenAttackingMoves = [MoveId.BELLY_DRUM, MoveId.SUBSTITUTE, MoveId.CURSE, MoveId.PAIN_SPLIT]; const forbiddenAttackingMoves = [MoveId.BELLY_DRUM, MoveId.SUBSTITUTE, MoveId.CURSE, MoveId.PAIN_SPLIT];
if (moveHistory.length > 0) { if (moveHistory.length > 0) {
const lastMoveUsed = moveHistory[moveHistory.length - 1]; const lastMoveUsed = moveHistory[moveHistory.length - 1];
if (fordbiddenAttackingMoves.includes(lastMoveUsed.move)) { if (forbiddenAttackingMoves.includes(lastMoveUsed.move)) {
return false; return false;
} }
} }
// Dragon Tail and Circle Throw switch out Pokémon before the Ability activates. // Dragon Tail and Circle Throw switch out Pokémon before the Ability activates.
const fordbiddenDefendingMoves = [MoveId.DRAGON_TAIL, MoveId.CIRCLE_THROW]; const forbiddenDefendingMoves = [MoveId.DRAGON_TAIL, MoveId.CIRCLE_THROW];
if (source) { if (source) {
const enemyMoveHistory = source.getMoveHistory(); const enemyMoveHistory = source.getMoveHistory();
if (enemyMoveHistory.length > 0) { if (enemyMoveHistory.length > 0) {
const enemyLastMoveUsed = enemyMoveHistory[enemyMoveHistory.length - 1]; const enemyLastMoveUsed = enemyMoveHistory[enemyMoveHistory.length - 1];
// Will not activate if the Pokémon's HP falls below half while it is in the air during Sky Drop. // Will not activate if the Pokémon's HP falls below half while it is in the air during Sky Drop.
if ( if (
fordbiddenDefendingMoves.includes(enemyLastMoveUsed.move) || forbiddenDefendingMoves.includes(enemyLastMoveUsed.move) ||
(enemyLastMoveUsed.move === MoveId.SKY_DROP && enemyLastMoveUsed.result === MoveResult.OTHER) (enemyLastMoveUsed.move === MoveId.SKY_DROP && enemyLastMoveUsed.result === MoveResult.OTHER)
) { ) {
return false; return false;

View File

@ -5206,38 +5206,38 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
} }
} }
updateFusionPalette(ignoreOveride?: boolean): void { updateFusionPalette(ignoreOverride?: boolean): void {
if (!this.getFusionSpeciesForm(ignoreOveride)) { if (!this.getFusionSpeciesForm(ignoreOverride)) {
[this.getSprite(), this.getTintSprite()] [this.getSprite(), this.getTintSprite()]
.filter(s => !!s) .filter(s => !!s)
.map(s => { .map(s => {
s.pipelineData[`spriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = []; s.pipelineData[`spriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] = [];
s.pipelineData[`fusionSpriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = []; s.pipelineData[`fusionSpriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] = [];
}); });
return; return;
} }
const speciesForm = this.getSpeciesForm(ignoreOveride); const speciesForm = this.getSpeciesForm(ignoreOverride);
const fusionSpeciesForm = this.getFusionSpeciesForm(ignoreOveride); const fusionSpeciesForm = this.getFusionSpeciesForm(ignoreOverride);
const spriteKey = speciesForm.getSpriteKey( const spriteKey = speciesForm.getSpriteKey(
this.getGender(ignoreOveride) === Gender.FEMALE, this.getGender(ignoreOverride) === Gender.FEMALE,
speciesForm.formIndex, speciesForm.formIndex,
this.shiny, this.shiny,
this.variant, this.variant,
); );
const backSpriteKey = speciesForm const backSpriteKey = speciesForm
.getSpriteKey(this.getGender(ignoreOveride) === Gender.FEMALE, speciesForm.formIndex, this.shiny, this.variant) .getSpriteKey(this.getGender(ignoreOverride) === Gender.FEMALE, speciesForm.formIndex, this.shiny, this.variant)
.replace("pkmn__", "pkmn__back__"); .replace("pkmn__", "pkmn__back__");
const fusionSpriteKey = fusionSpeciesForm.getSpriteKey( const fusionSpriteKey = fusionSpeciesForm.getSpriteKey(
this.getFusionGender(ignoreOveride) === Gender.FEMALE, this.getFusionGender(ignoreOverride) === Gender.FEMALE,
fusionSpeciesForm.formIndex, fusionSpeciesForm.formIndex,
this.fusionShiny, this.fusionShiny,
this.fusionVariant, this.fusionVariant,
); );
const fusionBackSpriteKey = fusionSpeciesForm const fusionBackSpriteKey = fusionSpeciesForm
.getSpriteKey( .getSpriteKey(
this.getFusionGender(ignoreOveride) === Gender.FEMALE, this.getFusionGender(ignoreOverride) === Gender.FEMALE,
fusionSpeciesForm.formIndex, fusionSpeciesForm.formIndex,
this.fusionShiny, this.fusionShiny,
this.fusionVariant, this.fusionVariant,
@ -5522,8 +5522,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
[this.getSprite(), this.getTintSprite()] [this.getSprite(), this.getTintSprite()]
.filter(s => !!s) .filter(s => !!s)
.map(s => { .map(s => {
s.pipelineData[`spriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = spriteColors; s.pipelineData[`spriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] = spriteColors;
s.pipelineData[`fusionSpriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = s.pipelineData[`fusionSpriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] =
fusionSpriteColors; fusionSpriteColors;
}); });

View File

@ -105,7 +105,7 @@ import {
TempExtraModifierModifier, TempExtraModifierModifier,
TempStatStageBoosterModifier, TempStatStageBoosterModifier,
TerastallizeAccessModifier, TerastallizeAccessModifier,
TerrastalizeModifier, TerastallizeModifier,
TmModifier, TmModifier,
TurnHealModifier, TurnHealModifier,
TurnHeldItemTransferModifier, TurnHeldItemTransferModifier,
@ -431,7 +431,7 @@ export class TerastallizeModifierType extends PokemonModifierType {
super( super(
"", "",
`${PokemonType[teraType].toLowerCase()}_tera_shard`, `${PokemonType[teraType].toLowerCase()}_tera_shard`,
(type, args) => new TerrastalizeModifier(type as TerastallizeModifierType, (args[0] as Pokemon).id, teraType), (type, args) => new TerastallizeModifier(type as TerastallizeModifierType, (args[0] as Pokemon).id, teraType),
(pokemon: PlayerPokemon) => { (pokemon: PlayerPokemon) => {
if ( if (
[pokemon.species.speciesId, pokemon.fusionSpecies?.speciesId].filter( [pokemon.species.speciesId, pokemon.fusionSpecies?.speciesId].filter(

View File

@ -2073,7 +2073,7 @@ export abstract class ConsumablePokemonModifier extends ConsumableModifier {
} }
} }
export class TerrastalizeModifier extends ConsumablePokemonModifier { export class TerastallizeModifier extends ConsumablePokemonModifier {
public declare type: TerastallizeModifierType; public declare type: TerastallizeModifierType;
public teraType: PokemonType; public teraType: PokemonType;
@ -2084,9 +2084,9 @@ export class TerrastalizeModifier extends ConsumablePokemonModifier {
} }
/** /**
* Checks if {@linkcode TerrastalizeModifier} should be applied * Checks if {@linkcode TerastallizeModifier} should be applied
* @param playerPokemon The {@linkcode PlayerPokemon} that consumes the item * @param playerPokemon The {@linkcode PlayerPokemon} that consumes the item
* @returns `true` if the {@linkcode TerrastalizeModifier} should be applied * @returns `true` if the {@linkcode TerastallizeModifier} should be applied
*/ */
override shouldApply(playerPokemon?: PlayerPokemon): boolean { override shouldApply(playerPokemon?: PlayerPokemon): boolean {
return ( return (
@ -2098,7 +2098,7 @@ export class TerrastalizeModifier extends ConsumablePokemonModifier {
} }
/** /**
* Applies {@linkcode TerrastalizeModifier} * Applies {@linkcode TerastallizeModifier}
* @param pokemon The {@linkcode PlayerPokemon} that consumes the item * @param pokemon The {@linkcode PlayerPokemon} that consumes the item
* @returns `true` if hp was restored * @returns `true` if hp was restored
*/ */
@ -3875,7 +3875,7 @@ const ModifierClassMap = Object.freeze({
ResetNegativeStatStageModifier, ResetNegativeStatStageModifier,
FieldEffectModifier, FieldEffectModifier,
ConsumablePokemonModifier, ConsumablePokemonModifier,
TerrastalizeModifier, TerastallizeModifier,
PokemonHpRestoreModifier, PokemonHpRestoreModifier,
PokemonStatusHealModifier, PokemonStatusHealModifier,
ConsumablePokemonMoveModifier, ConsumablePokemonMoveModifier,

View File

@ -112,7 +112,7 @@ export class CommandPhase extends FieldPhase {
* Clear out all unusable moves in front of the currently acting pokemon's move queue. * Clear out all unusable moves in front of the currently acting pokemon's move queue.
*/ */
// TODO: Refactor move queue handling to ensure that this method is not necessary. // TODO: Refactor move queue handling to ensure that this method is not necessary.
private clearUnusuableMoves(): void { private clearUnusableMoves(): void {
const playerPokemon = this.getPokemon(); const playerPokemon = this.getPokemon();
const moveQueue = playerPokemon.getMoveQueue(); const moveQueue = playerPokemon.getMoveQueue();
if (moveQueue.length === 0) { if (moveQueue.length === 0) {
@ -143,7 +143,7 @@ export class CommandPhase extends FieldPhase {
* @returns Whether a queued move was successfully set to be executed. * @returns Whether a queued move was successfully set to be executed.
*/ */
private tryExecuteQueuedMove(): boolean { private tryExecuteQueuedMove(): boolean {
this.clearUnusuableMoves(); this.clearUnusableMoves();
const playerPokemon = globalScene.getPlayerField()[this.fieldIndex]; const playerPokemon = globalScene.getPlayerField()[this.fieldIndex];
const moveQueue = playerPokemon.getMoveQueue(); const moveQueue = playerPokemon.getMoveQueue();

View File

@ -36,7 +36,7 @@ interface ArenaEffectInfo {
/** The enum string representation of the effect */ /** The enum string representation of the effect */
name: string; name: string;
/** {@linkcode ArenaEffectType} type of effect */ /** {@linkcode ArenaEffectType} type of effect */
effecType: ArenaEffectType; effectType: ArenaEffectType;
/** The maximum duration set by the effect */ /** The maximum duration set by the effect */
maxDuration: number; maxDuration: number;
@ -246,7 +246,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
// Creates a proxy object to decide which text object needs to be updated // Creates a proxy object to decide which text object needs to be updated
let textObject: Phaser.GameObjects.Text; let textObject: Phaser.GameObjects.Text;
switch (fieldEffectInfo.effecType) { switch (fieldEffectInfo.effectType) {
case ArenaEffectType.PLAYER: case ArenaEffectType.PLAYER:
textObject = this.flyoutTextPlayer; textObject = this.flyoutTextPlayer;
break; break;
@ -300,7 +300,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
const existingTrapTagIndex = isArenaTrapTag const existingTrapTagIndex = isArenaTrapTag
? this.fieldEffectInfo.findIndex( ? this.fieldEffectInfo.findIndex(
e => tagAddedEvent.arenaTagType === e.tagType && arenaEffectType === e.effecType, e => tagAddedEvent.arenaTagType === e.tagType && arenaEffectType === e.effectType,
) )
: -1; : -1;
let name: string = getFieldEffectText(ArenaTagType[tagAddedEvent.arenaTagType]); let name: string = getFieldEffectText(ArenaTagType[tagAddedEvent.arenaTagType]);
@ -318,7 +318,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
this.fieldEffectInfo.push({ this.fieldEffectInfo.push({
name, name,
effecType: arenaEffectType, effectType: arenaEffectType,
maxDuration: tagAddedEvent.duration, maxDuration: tagAddedEvent.duration,
duration: tagAddedEvent.duration, duration: tagAddedEvent.duration,
tagType: tagAddedEvent.arenaTagType, tagType: tagAddedEvent.arenaTagType,
@ -353,7 +353,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
? WeatherType[fieldEffectChangedEvent.newWeatherType] ? WeatherType[fieldEffectChangedEvent.newWeatherType]
: TerrainType[fieldEffectChangedEvent.newTerrainType], : TerrainType[fieldEffectChangedEvent.newTerrainType],
), ),
effecType: effectType:
fieldEffectChangedEvent instanceof WeatherChangedEvent ? ArenaEffectType.WEATHER : ArenaEffectType.TERRAIN, fieldEffectChangedEvent instanceof WeatherChangedEvent ? ArenaEffectType.WEATHER : ArenaEffectType.TERRAIN,
maxDuration: fieldEffectChangedEvent.duration, maxDuration: fieldEffectChangedEvent.duration,
duration: fieldEffectChangedEvent.duration, duration: fieldEffectChangedEvent.duration,

View File

@ -198,11 +198,11 @@ export class PlayerBattleInfo extends BattleInfo {
this.lastLevelCapped = isLevelCapped; this.lastLevelCapped = isLevelCapped;
if (this.lastExp !== pokemon.exp || this.lastLevel !== pokemon.level) { if (this.lastExp !== pokemon.exp || this.lastLevel !== pokemon.level) {
const durationMultipler = Math.max( const durationMultiplier = Math.max(
Phaser.Tweens.Builders.GetEaseFunction("Cubic.easeIn")(1 - Math.min(pokemon.level - this.lastLevel, 10) / 10), Phaser.Tweens.Builders.GetEaseFunction("Cubic.easeIn")(1 - Math.min(pokemon.level - this.lastLevel, 10) / 10),
0.1, 0.1,
); );
await this.updatePokemonExp(pokemon, false, durationMultipler); await this.updatePokemonExp(pokemon, false, durationMultiplier);
} else if (isLevelCapped !== oldLevelCapped) { } else if (isLevelCapped !== oldLevelCapped) {
this.setLevel(pokemon.level); this.setLevel(pokemon.level);
} }

View File

@ -702,11 +702,11 @@ export class RunInfoUiHandler extends UiHandler {
rules.push(i18next.t("challenges:inverseBattle.shortName")); rules.push(i18next.t("challenges:inverseBattle.shortName"));
break; break;
default: { default: {
const localisationKey = Challenges[this.runInfo.challenges[i].id] const localizationKey = Challenges[this.runInfo.challenges[i].id]
.split("_") .split("_")
.map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase())) .map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()))
.join(""); .join("");
rules.push(i18next.t(`challenges:${localisationKey}.name`)); rules.push(i18next.t(`challenges:${localizationKey}.name`));
break; break;
} }
} }

View File

@ -8,7 +8,7 @@ import { UiHandler } from "#ui/ui-handler";
import { addWindow } from "#ui/ui-theme"; import { addWindow } from "#ui/ui-theme";
import i18next from "i18next"; import i18next from "i18next";
type CancelFn = (succes?: boolean) => boolean; type CancelFn = (success?: boolean) => boolean;
/** /**
* Abstract class for handling UI elements related to button bindings. * Abstract class for handling UI elements related to button bindings.

View File

@ -13,7 +13,7 @@ export class TestDialogueUiHandler extends FormModalUiHandler {
setup() { setup() {
super.setup(); super.setup();
const flattenKeys = (object?: any, topKey?: string, midleKey?: string[]): Array<any> => { const flattenKeys = (object?: any, topKey?: string, middleKey?: string[]): Array<any> => {
return Object.keys(object ?? {}) return Object.keys(object ?? {})
.map((t, i) => { .map((t, i) => {
const value = Object.values(object)[i]; const value = Object.values(object)[i];
@ -23,7 +23,7 @@ export class TestDialogueUiHandler extends FormModalUiHandler {
// If the value is an object, execute the same process // If the value is an object, execute the same process
// si el valor es un objeto ejecuta el mismo proceso // si el valor es un objeto ejecuta el mismo proceso
return flattenKeys(value, topKey ?? t, topKey ? (midleKey ? [...midleKey, t] : [t]) : undefined).filter( return flattenKeys(value, topKey ?? t, topKey ? (middleKey ? [...middleKey, t] : [t]) : undefined).filter(
t => t.length > 0, t => t.length > 0,
); );
} }
@ -31,7 +31,7 @@ export class TestDialogueUiHandler extends FormModalUiHandler {
// we check for null or undefined here as per above - the typeof is still an object but the value is null so we need to exit out of this and pass the null key // we check for null or undefined here as per above - the typeof is still an object but the value is null so we need to exit out of this and pass the null key
// Return in the format expected by i18next // Return in the format expected by i18next
return midleKey ? `${topKey}:${midleKey.map(m => m).join(".")}.${t}` : `${topKey}:${t}`; return middleKey ? `${topKey}:${middleKey.map(m => m).join(".")}.${t}` : `${topKey}:${t}`;
} }
}) })
.filter(t => t); .filter(t => t);