mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-10 17:39:31 +02:00
fix typos in variable/parameter/class names
This commit is contained in:
parent
d07d72a9ea
commit
9b94e9853b
@ -6444,23 +6444,23 @@ export class PostDamageForceSwitchAbAttr extends PostDamageAbAttr {
|
||||
public override canApply({ pokemon, source, damage }: PostDamageAbAttrParams): boolean {
|
||||
const moveHistory = pokemon.getMoveHistory();
|
||||
// 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) {
|
||||
const lastMoveUsed = moveHistory[moveHistory.length - 1];
|
||||
if (fordbiddenAttackingMoves.includes(lastMoveUsed.move)) {
|
||||
if (forbiddenAttackingMoves.includes(lastMoveUsed.move)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
const enemyMoveHistory = source.getMoveHistory();
|
||||
if (enemyMoveHistory.length > 0) {
|
||||
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.
|
||||
if (
|
||||
fordbiddenDefendingMoves.includes(enemyLastMoveUsed.move) ||
|
||||
forbiddenDefendingMoves.includes(enemyLastMoveUsed.move) ||
|
||||
(enemyLastMoveUsed.move === MoveId.SKY_DROP && enemyLastMoveUsed.result === MoveResult.OTHER)
|
||||
) {
|
||||
return false;
|
||||
|
@ -5206,38 +5206,38 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
}
|
||||
|
||||
updateFusionPalette(ignoreOveride?: boolean): void {
|
||||
if (!this.getFusionSpeciesForm(ignoreOveride)) {
|
||||
updateFusionPalette(ignoreOverride?: boolean): void {
|
||||
if (!this.getFusionSpeciesForm(ignoreOverride)) {
|
||||
[this.getSprite(), this.getTintSprite()]
|
||||
.filter(s => !!s)
|
||||
.map(s => {
|
||||
s.pipelineData[`spriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = [];
|
||||
s.pipelineData[`fusionSpriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = [];
|
||||
s.pipelineData[`spriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] = [];
|
||||
s.pipelineData[`fusionSpriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] = [];
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const speciesForm = this.getSpeciesForm(ignoreOveride);
|
||||
const fusionSpeciesForm = this.getFusionSpeciesForm(ignoreOveride);
|
||||
const speciesForm = this.getSpeciesForm(ignoreOverride);
|
||||
const fusionSpeciesForm = this.getFusionSpeciesForm(ignoreOverride);
|
||||
|
||||
const spriteKey = speciesForm.getSpriteKey(
|
||||
this.getGender(ignoreOveride) === Gender.FEMALE,
|
||||
this.getGender(ignoreOverride) === Gender.FEMALE,
|
||||
speciesForm.formIndex,
|
||||
this.shiny,
|
||||
this.variant,
|
||||
);
|
||||
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__");
|
||||
const fusionSpriteKey = fusionSpeciesForm.getSpriteKey(
|
||||
this.getFusionGender(ignoreOveride) === Gender.FEMALE,
|
||||
this.getFusionGender(ignoreOverride) === Gender.FEMALE,
|
||||
fusionSpeciesForm.formIndex,
|
||||
this.fusionShiny,
|
||||
this.fusionVariant,
|
||||
);
|
||||
const fusionBackSpriteKey = fusionSpeciesForm
|
||||
.getSpriteKey(
|
||||
this.getFusionGender(ignoreOveride) === Gender.FEMALE,
|
||||
this.getFusionGender(ignoreOverride) === Gender.FEMALE,
|
||||
fusionSpeciesForm.formIndex,
|
||||
this.fusionShiny,
|
||||
this.fusionVariant,
|
||||
@ -5522,8 +5522,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
[this.getSprite(), this.getTintSprite()]
|
||||
.filter(s => !!s)
|
||||
.map(s => {
|
||||
s.pipelineData[`spriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] = spriteColors;
|
||||
s.pipelineData[`fusionSpriteColors${ignoreOveride && this.summonData.speciesForm ? "Base" : ""}`] =
|
||||
s.pipelineData[`spriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] = spriteColors;
|
||||
s.pipelineData[`fusionSpriteColors${ignoreOverride && this.summonData.speciesForm ? "Base" : ""}`] =
|
||||
fusionSpriteColors;
|
||||
});
|
||||
|
||||
|
@ -105,7 +105,7 @@ import {
|
||||
TempExtraModifierModifier,
|
||||
TempStatStageBoosterModifier,
|
||||
TerastallizeAccessModifier,
|
||||
TerrastalizeModifier,
|
||||
TerastallizeModifier,
|
||||
TmModifier,
|
||||
TurnHealModifier,
|
||||
TurnHeldItemTransferModifier,
|
||||
@ -431,7 +431,7 @@ export class TerastallizeModifierType extends PokemonModifierType {
|
||||
super(
|
||||
"",
|
||||
`${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) => {
|
||||
if (
|
||||
[pokemon.species.speciesId, pokemon.fusionSpecies?.speciesId].filter(
|
||||
|
@ -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 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
|
||||
* @returns `true` if the {@linkcode TerrastalizeModifier} should be applied
|
||||
* @returns `true` if the {@linkcode TerastallizeModifier} should be applied
|
||||
*/
|
||||
override shouldApply(playerPokemon?: PlayerPokemon): boolean {
|
||||
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
|
||||
* @returns `true` if hp was restored
|
||||
*/
|
||||
@ -3875,7 +3875,7 @@ const ModifierClassMap = Object.freeze({
|
||||
ResetNegativeStatStageModifier,
|
||||
FieldEffectModifier,
|
||||
ConsumablePokemonModifier,
|
||||
TerrastalizeModifier,
|
||||
TerastallizeModifier,
|
||||
PokemonHpRestoreModifier,
|
||||
PokemonStatusHealModifier,
|
||||
ConsumablePokemonMoveModifier,
|
||||
|
@ -112,7 +112,7 @@ export class CommandPhase extends FieldPhase {
|
||||
* 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.
|
||||
private clearUnusuableMoves(): void {
|
||||
private clearUnusableMoves(): void {
|
||||
const playerPokemon = this.getPokemon();
|
||||
const moveQueue = playerPokemon.getMoveQueue();
|
||||
if (moveQueue.length === 0) {
|
||||
@ -143,7 +143,7 @@ export class CommandPhase extends FieldPhase {
|
||||
* @returns Whether a queued move was successfully set to be executed.
|
||||
*/
|
||||
private tryExecuteQueuedMove(): boolean {
|
||||
this.clearUnusuableMoves();
|
||||
this.clearUnusableMoves();
|
||||
const playerPokemon = globalScene.getPlayerField()[this.fieldIndex];
|
||||
const moveQueue = playerPokemon.getMoveQueue();
|
||||
|
||||
|
@ -36,7 +36,7 @@ interface ArenaEffectInfo {
|
||||
/** The enum string representation of the effect */
|
||||
name: string;
|
||||
/** {@linkcode ArenaEffectType} type of effect */
|
||||
effecType: ArenaEffectType;
|
||||
effectType: ArenaEffectType;
|
||||
|
||||
/** The maximum duration set by the effect */
|
||||
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
|
||||
let textObject: Phaser.GameObjects.Text;
|
||||
switch (fieldEffectInfo.effecType) {
|
||||
switch (fieldEffectInfo.effectType) {
|
||||
case ArenaEffectType.PLAYER:
|
||||
textObject = this.flyoutTextPlayer;
|
||||
break;
|
||||
@ -300,7 +300,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
|
||||
|
||||
const existingTrapTagIndex = isArenaTrapTag
|
||||
? this.fieldEffectInfo.findIndex(
|
||||
e => tagAddedEvent.arenaTagType === e.tagType && arenaEffectType === e.effecType,
|
||||
e => tagAddedEvent.arenaTagType === e.tagType && arenaEffectType === e.effectType,
|
||||
)
|
||||
: -1;
|
||||
let name: string = getFieldEffectText(ArenaTagType[tagAddedEvent.arenaTagType]);
|
||||
@ -318,7 +318,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
|
||||
|
||||
this.fieldEffectInfo.push({
|
||||
name,
|
||||
effecType: arenaEffectType,
|
||||
effectType: arenaEffectType,
|
||||
maxDuration: tagAddedEvent.duration,
|
||||
duration: tagAddedEvent.duration,
|
||||
tagType: tagAddedEvent.arenaTagType,
|
||||
@ -353,7 +353,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
|
||||
? WeatherType[fieldEffectChangedEvent.newWeatherType]
|
||||
: TerrainType[fieldEffectChangedEvent.newTerrainType],
|
||||
),
|
||||
effecType:
|
||||
effectType:
|
||||
fieldEffectChangedEvent instanceof WeatherChangedEvent ? ArenaEffectType.WEATHER : ArenaEffectType.TERRAIN,
|
||||
maxDuration: fieldEffectChangedEvent.duration,
|
||||
duration: fieldEffectChangedEvent.duration,
|
||||
|
@ -198,11 +198,11 @@ export class PlayerBattleInfo extends BattleInfo {
|
||||
this.lastLevelCapped = isLevelCapped;
|
||||
|
||||
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),
|
||||
0.1,
|
||||
);
|
||||
await this.updatePokemonExp(pokemon, false, durationMultipler);
|
||||
await this.updatePokemonExp(pokemon, false, durationMultiplier);
|
||||
} else if (isLevelCapped !== oldLevelCapped) {
|
||||
this.setLevel(pokemon.level);
|
||||
}
|
||||
|
@ -702,11 +702,11 @@ export class RunInfoUiHandler extends UiHandler {
|
||||
rules.push(i18next.t("challenges:inverseBattle.shortName"));
|
||||
break;
|
||||
default: {
|
||||
const localisationKey = Challenges[this.runInfo.challenges[i].id]
|
||||
const localizationKey = Challenges[this.runInfo.challenges[i].id]
|
||||
.split("_")
|
||||
.map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()))
|
||||
.join("");
|
||||
rules.push(i18next.t(`challenges:${localisationKey}.name`));
|
||||
rules.push(i18next.t(`challenges:${localizationKey}.name`));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
||||
type CancelFn = (succes?: boolean) => boolean;
|
||||
type CancelFn = (success?: boolean) => boolean;
|
||||
|
||||
/**
|
||||
* Abstract class for handling UI elements related to button bindings.
|
||||
|
@ -13,7 +13,7 @@ export class TestDialogueUiHandler extends FormModalUiHandler {
|
||||
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 ?? {})
|
||||
.map((t, 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
|
||||
// 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,
|
||||
);
|
||||
}
|
||||
@ -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
|
||||
|
||||
// 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);
|
||||
|
Loading…
Reference in New Issue
Block a user