mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +02:00
Merge branch 'beta' into pokemon.ts-cleanup
This commit is contained in:
commit
e67c173e03
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"textures": [
|
||||
{
|
||||
"image": "statuses_es.png",
|
||||
"image": "statuses_es-ES.png",
|
||||
"format": "RGBA8888",
|
||||
"size": {
|
||||
"w": 22,
|
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 441 B |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"textures": [
|
||||
{
|
||||
"image": "types_es.png",
|
||||
"image": "types_es-ES.png",
|
||||
"format": "RGBA8888",
|
||||
"size": {
|
||||
"w": 32,
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@ -1 +1 @@
|
||||
Subproject commit 71390cba88f4103d0d2273d59a6dd8340a4fa54f
|
||||
Subproject commit 3cf6d553541d79ba165387bc73fb06544d00f1f9
|
@ -3614,22 +3614,19 @@ export class MoodyAbAttr extends PostTurnAbAttr {
|
||||
}
|
||||
}
|
||||
|
||||
export class PostTurnStatStageChangeAbAttr extends PostTurnAbAttr {
|
||||
private stats: BattleStat[];
|
||||
private stages: number;
|
||||
export class SpeedBoostAbAttr extends PostTurnAbAttr {
|
||||
|
||||
constructor(stats: BattleStat[], stages: number) {
|
||||
constructor() {
|
||||
super(true);
|
||||
|
||||
this.stats = Array.isArray(stats)
|
||||
? stats
|
||||
: [ stats ];
|
||||
this.stages = stages;
|
||||
}
|
||||
|
||||
applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
|
||||
if (!simulated) {
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.stages));
|
||||
if (!pokemon.turnData.switchedInThisTurn && !pokemon.turnData.failedRunAway) {
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.SPD ], 1));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -5011,7 +5008,7 @@ export function initAbilities() {
|
||||
.attr(PostSummonWeatherChangeAbAttr, WeatherType.RAIN)
|
||||
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.RAIN),
|
||||
new Ability(Abilities.SPEED_BOOST, 3)
|
||||
.attr(PostTurnStatStageChangeAbAttr, [ Stat.SPD ], 1),
|
||||
.attr(SpeedBoostAbAttr),
|
||||
new Ability(Abilities.BATTLE_ARMOR, 3)
|
||||
.attr(BlockCritAbAttr)
|
||||
.ignorable(),
|
||||
|
@ -1443,7 +1443,7 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||
],
|
||||
[Species.ROCKRUFF]: [
|
||||
new SpeciesFormEvolution(Species.LYCANROC, "", "midday", 25, null, new SpeciesEvolutionCondition(p => (p.scene.arena.getTimeOfDay() === TimeOfDay.DAWN || p.scene.arena.getTimeOfDay() === TimeOfDay.DAY) && (p.formIndex === 0))),
|
||||
new SpeciesFormEvolution(Species.LYCANROC, "", "dusk", 25, null, new SpeciesEvolutionCondition(p => p.formIndex === 1)),
|
||||
new SpeciesFormEvolution(Species.LYCANROC, "own-tempo", "dusk", 25, null, new SpeciesEvolutionCondition(p => p.formIndex === 1)),
|
||||
new SpeciesFormEvolution(Species.LYCANROC, "", "midnight", 25, null, new SpeciesEvolutionCondition(p => (p.scene.arena.getTimeOfDay() === TimeOfDay.DUSK || p.scene.arena.getTimeOfDay() === TimeOfDay.NIGHT) && (p.formIndex === 0)))
|
||||
],
|
||||
[Species.STEENEE]: [
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1420,6 +1420,11 @@ export class RecoilAttr extends MoveEffectAttr {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Chloroblast and Struggle should not deal recoil damage if the move was not successful
|
||||
if (this.useHp && [ MoveResult.FAIL, MoveResult.MISS ].includes(user.getLastXMoves(1)[0]?.result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const damageValue = (!this.useHp ? user.turnData.damageDealt : user.getMaxHp()) * this.damageRatio;
|
||||
const minValue = user.turnData.damageDealt ? 1 : 0;
|
||||
const recoilDamage = Utils.toDmgValue(damageValue, minValue);
|
||||
@ -2177,7 +2182,10 @@ export class StatusEffectAttr extends MoveEffectAttr {
|
||||
|
||||
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
||||
const moveChance = this.getMoveChance(user, target, move, this.selfTarget, false);
|
||||
return !(this.selfTarget ? user : target).status && (this.selfTarget ? user : target).canSetStatus(this.effect, true, false, user) ? Math.floor(moveChance * -0.1) : 0;
|
||||
const score = (moveChance < 0) ? -10 : Math.floor(moveChance * -0.1);
|
||||
const pokemon = this.selfTarget ? user : target;
|
||||
|
||||
return !pokemon.status && pokemon.canSetStatus(this.effect, true, false, user) ? score : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2197,7 +2205,10 @@ export class MultiStatusEffectAttr extends StatusEffectAttr {
|
||||
|
||||
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
||||
const moveChance = this.getMoveChance(user, target, move, this.selfTarget, false);
|
||||
return !(this.selfTarget ? user : target).status && (this.selfTarget ? user : target).canSetStatus(this.effect, true, false, user) ? Math.floor(moveChance * -0.1) : 0;
|
||||
const score = (moveChance < 0) ? -10 : Math.floor(moveChance * -0.1);
|
||||
const pokemon = this.selfTarget ? user : target;
|
||||
|
||||
return !pokemon.status && pokemon.canSetStatus(this.effect, true, false, user) ? score : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2228,7 +2239,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr {
|
||||
}
|
||||
|
||||
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
||||
return !(this.selfTarget ? user : target).status && (this.selfTarget ? user : target).canSetStatus(user.status?.effect, true, false, user) ? Math.floor(move.chance * -0.1) : 0;
|
||||
return !target.status && target.canSetStatus(user.status?.effect, true, false, user) ? -10 : 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -5739,6 +5750,11 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't allow wild mons to flee with U-turn et al
|
||||
if (this.selfSwitch && !user.isPlayer() && move.category !== MoveCategory.STATUS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (switchOutTarget.hp > 0) {
|
||||
switchOutTarget.leaveField(false);
|
||||
user.scene.queueMessage(i18next.t("moveTriggers:fled", { pokemonName: getPokemonNameWithAffix(switchOutTarget) }), null, true, 500);
|
||||
|
@ -3,6 +3,8 @@
|
||||
* or {@linkcode SwitchSummonPhase} will carry out.
|
||||
*/
|
||||
export enum SwitchType {
|
||||
/** Switchout specifically for when combat starts and the player is prompted if they will switch Pokemon */
|
||||
INITIAL_SWITCH,
|
||||
/** Basic switchout where the Pokemon to switch in is selected */
|
||||
SWITCH,
|
||||
/** Transfers stat stages and other effects from the returning Pokemon to the switched in Pokemon */
|
||||
|
@ -794,7 +794,7 @@ export class Arena {
|
||||
case Biome.VOLCANO:
|
||||
return 17.637;
|
||||
case Biome.GRAVEYARD:
|
||||
return 3.232;
|
||||
return 13.711;
|
||||
case Biome.DOJO:
|
||||
return 6.205;
|
||||
case Biome.FACTORY:
|
||||
|
@ -5153,6 +5153,8 @@ export class PokemonTurnData {
|
||||
public statStagesDecreased: boolean = false;
|
||||
public moveEffectiveness: TypeDamageMultiplier | null = null;
|
||||
public combiningPledge?: Moves;
|
||||
public switchedInThisTurn: boolean = false;
|
||||
public failedRunAway: boolean = false;
|
||||
}
|
||||
|
||||
export enum AiType {
|
||||
|
@ -244,7 +244,7 @@ export class LoadingScene extends SceneBase {
|
||||
this.loadAtlas("statuses", "");
|
||||
this.loadAtlas("types", "");
|
||||
}
|
||||
const availableLangs = [ "en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN" ];
|
||||
const availableLangs = [ "en", "de", "it", "fr", "ja", "ko", "es-ES", "pt-BR", "zh-CN" ];
|
||||
if (lang && availableLangs.includes(lang)) {
|
||||
this.loadImage("halloween2024-event-" + lang, "events");
|
||||
} else {
|
||||
|
@ -10,6 +10,10 @@ import { NewBattlePhase } from "./new-battle-phase";
|
||||
import { PokemonPhase } from "./pokemon-phase";
|
||||
|
||||
export class AttemptRunPhase extends PokemonPhase {
|
||||
|
||||
/** For testing purposes: this is to force the pokemon to fail and escape */
|
||||
public forceFailEscape = false;
|
||||
|
||||
constructor(scene: BattleScene, fieldIndex: number) {
|
||||
super(scene, fieldIndex);
|
||||
}
|
||||
@ -28,7 +32,7 @@ export class AttemptRunPhase extends PokemonPhase {
|
||||
|
||||
applyAbAttrs(RunSuccessAbAttr, playerPokemon, null, false, escapeChance);
|
||||
|
||||
if (playerPokemon.randSeedInt(100) < escapeChance.value) {
|
||||
if (playerPokemon.randSeedInt(100) < escapeChance.value && !this.forceFailEscape) {
|
||||
this.scene.playSound("se/flee");
|
||||
this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500);
|
||||
|
||||
@ -51,6 +55,7 @@ export class AttemptRunPhase extends PokemonPhase {
|
||||
this.scene.pushPhase(new BattleEndPhase(this.scene));
|
||||
this.scene.pushPhase(new NewBattlePhase(this.scene));
|
||||
} else {
|
||||
playerPokemon.turnData.failedRunAway = true;
|
||||
this.scene.queueMessage(i18next.t("battle:runAwayCannotEscape"), null, true, 500);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ export class CheckSwitchPhase extends BattlePhase {
|
||||
this.scene.ui.setMode(Mode.CONFIRM, () => {
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.tryRemovePhase(p => p instanceof PostSummonPhase && p.player && p.fieldIndex === this.fieldIndex);
|
||||
this.scene.unshiftPhase(new SwitchPhase(this.scene, SwitchType.SWITCH, this.fieldIndex, false, true));
|
||||
this.scene.unshiftPhase(new SwitchPhase(this.scene, SwitchType.INITIAL_SWITCH, this.fieldIndex, false, true));
|
||||
this.end();
|
||||
}, () => {
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
|
@ -65,6 +65,15 @@ export class FaintPhase extends PokemonPhase {
|
||||
}
|
||||
}
|
||||
|
||||
/** In case the current pokemon was just switched in, make sure it is counted as participating in the combat */
|
||||
this.scene.getPlayerField().forEach((pokemon, i) => {
|
||||
if (pokemon?.isActive(true)) {
|
||||
if (pokemon.isPlayer()) {
|
||||
this.scene.currentBattle.addParticipant(pokemon as PlayerPokemon);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!this.tryOverrideForBattleSpec()) {
|
||||
this.doFaint();
|
||||
}
|
||||
|
@ -64,10 +64,8 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||
}
|
||||
|
||||
const pokemon = this.getPokemon();
|
||||
|
||||
(this.player ? this.scene.getEnemyField() : this.scene.getPlayerField()).forEach(enemyPokemon => enemyPokemon.removeTagsBySourceId(pokemon.id));
|
||||
|
||||
if (this.switchType === SwitchType.SWITCH) {
|
||||
if (this.switchType === SwitchType.SWITCH || this.switchType === SwitchType.INITIAL_SWITCH) {
|
||||
const substitute = pokemon.getTag(SubstituteTag);
|
||||
if (substitute) {
|
||||
this.scene.tweens.add({
|
||||
@ -186,6 +184,11 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
|
||||
pokemon.resetTurnData();
|
||||
pokemon.turnData.switchedInThisTurn = true;
|
||||
}
|
||||
|
||||
this.lastPokemon?.resetSummonData();
|
||||
|
||||
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
|
||||
|
@ -153,7 +153,7 @@ export async function initI18n(): Promise<void> {
|
||||
i18next.use(new KoreanPostpositionProcessor());
|
||||
await i18next.init({
|
||||
fallbackLng: "en",
|
||||
supportedLngs: [ "en", "es", "fr", "it", "de", "zh-CN", "zh-TW", "pt-BR", "ko", "ja", "ca-ES" ],
|
||||
supportedLngs: [ "en", "es-ES", "fr", "it", "de", "zh-CN", "zh-TW", "pt-BR", "ko", "ja", "ca-ES" ],
|
||||
backend: {
|
||||
loadPath(lng: string, [ ns ]: string[]) {
|
||||
let fileName: string;
|
||||
|
@ -866,8 +866,8 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
|
||||
handler: () => changeLocaleHandler("en")
|
||||
},
|
||||
{
|
||||
label: "Español",
|
||||
handler: () => changeLocaleHandler("es")
|
||||
label: "Español (ES)",
|
||||
handler: () => changeLocaleHandler("es-ES")
|
||||
},
|
||||
{
|
||||
label: "Italiano",
|
||||
|
125
src/test/abilities/speed_boost.test.ts
Normal file
125
src/test/abilities/speed_boost.test.ts
Normal file
@ -0,0 +1,125 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { AttemptRunPhase } from "#app/phases/attempt-run-phase";
|
||||
|
||||
describe("Abilities - Speed Boost", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.enemySpecies(Species.DRAGAPULT)
|
||||
.ability(Abilities.SPEED_BOOST)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.moveset([ Moves.SPLASH, Moves.U_TURN ]);
|
||||
});
|
||||
|
||||
it("should increase speed by 1 stage at end of turn",
|
||||
async () => {
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
||||
});
|
||||
|
||||
it("should not trigger this turn if pokemon was switched into combat via attack, but the turn after",
|
||||
async () => {
|
||||
await game.classicMode.startBattle([
|
||||
Species.SHUCKLE,
|
||||
Species.NINJASK
|
||||
]);
|
||||
|
||||
game.move.select(Moves.U_TURN);
|
||||
game.doSelectPartyPokemon(1);
|
||||
await game.toNextTurn();
|
||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
||||
});
|
||||
|
||||
it("checking back to back swtiches",
|
||||
async () => {
|
||||
await game.classicMode.startBattle([
|
||||
Species.SHUCKLE,
|
||||
Species.NINJASK
|
||||
]);
|
||||
|
||||
game.move.select(Moves.U_TURN);
|
||||
game.doSelectPartyPokemon(1);
|
||||
await game.toNextTurn();
|
||||
let playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0);
|
||||
|
||||
game.move.select(Moves.U_TURN);
|
||||
game.doSelectPartyPokemon(1);
|
||||
await game.toNextTurn();
|
||||
playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
||||
});
|
||||
|
||||
it("should not trigger this turn if pokemon was switched into combat via normal switch, but the turn after",
|
||||
async () => {
|
||||
await game.classicMode.startBattle([
|
||||
Species.SHUCKLE,
|
||||
Species.NINJASK
|
||||
]);
|
||||
|
||||
game.doSwitchPokemon(1);
|
||||
await game.toNextTurn();
|
||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
||||
});
|
||||
|
||||
it("should not trigger if pokemon fails to escape",
|
||||
async () => {
|
||||
await game.classicMode.startBattle([ Species.SHUCKLE ]);
|
||||
|
||||
const commandPhase = game.scene.getCurrentPhase() as CommandPhase;
|
||||
commandPhase.handleCommand(Command.RUN, 0);
|
||||
const runPhase = game.scene.getCurrentPhase() as AttemptRunPhase;
|
||||
runPhase.forceFailEscape = true;
|
||||
await game.phaseInterceptor.to(AttemptRunPhase);
|
||||
await game.toNextTurn();
|
||||
|
||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.toNextTurn();
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
||||
});
|
||||
});
|
42
src/test/moves/chloroblast.test.ts
Normal file
42
src/test/moves/chloroblast.test.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Moves - Chloroblast", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.CHLOROBLAST ])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.PROTECT);
|
||||
});
|
||||
|
||||
it("should not deal recoil damage if the opponent uses protect", async () => {
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
|
||||
game.move.select(Moves.CHLOROBLAST);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(game.scene.getPlayerPokemon()!.isFullHp()).toBe(true);
|
||||
});
|
||||
});
|
@ -35,7 +35,7 @@ const timedEvents: TimedEvent[] = [
|
||||
endDate: new Date(Date.UTC(2024, 10, 4, 0)),
|
||||
bannerKey: "halloween2024-event-",
|
||||
scale: 0.21,
|
||||
availableLangs: [ "en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN" ]
|
||||
availableLangs: [ "en", "de", "it", "fr", "ja", "ko", "es-ES", "pt-BR", "zh-CN" ]
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -107,7 +107,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
let pokemonIconX = -20;
|
||||
let pokemonIconY = 6;
|
||||
|
||||
if ([ "de", "es", "fr", "ko", "pt-BR" ].includes(currentLanguage)) {
|
||||
if ([ "de", "es-ES", "fr", "ko", "pt-BR" ].includes(currentLanguage)) {
|
||||
gachaTextStyle = TextStyle.SMALLER_WINDOW_ALT;
|
||||
gachaX = 2;
|
||||
gachaY = 2;
|
||||
@ -115,7 +115,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
|
||||
let legendaryLabelX = gachaX;
|
||||
let legendaryLabelY = gachaY;
|
||||
if ([ "de", "es" ].includes(currentLanguage)) {
|
||||
if ([ "de", "es-ES" ].includes(currentLanguage)) {
|
||||
pokemonIconX = -25;
|
||||
pokemonIconY = 10;
|
||||
legendaryLabelX = -6;
|
||||
@ -128,7 +128,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
|
||||
switch (gachaType as GachaType) {
|
||||
case GachaType.LEGENDARY:
|
||||
if ([ "de", "es" ].includes(currentLanguage)) {
|
||||
if ([ "de", "es-ES" ].includes(currentLanguage)) {
|
||||
gachaUpLabel.setAlign("center");
|
||||
gachaUpLabel.setY(0);
|
||||
}
|
||||
@ -149,7 +149,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
||||
gachaInfoContainer.add(pokemonIcon);
|
||||
break;
|
||||
case GachaType.MOVE:
|
||||
if ([ "de", "es", "fr", "pt-BR" ].includes(currentLanguage)) {
|
||||
if ([ "de", "es-ES", "fr", "pt-BR" ].includes(currentLanguage)) {
|
||||
gachaUpLabel.setAlign("center");
|
||||
gachaUpLabel.setY(0);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ let wikiUrl = "https://wiki.pokerogue.net/start";
|
||||
const discordUrl = "https://discord.gg/uWpTfdKG49";
|
||||
const githubUrl = "https://github.com/pagefaultgames/pokerogue";
|
||||
const redditUrl = "https://www.reddit.com/r/pokerogue";
|
||||
const donateUrl = "https://github.com/sponsors/patapancakes";
|
||||
const donateUrl = "https://github.com/sponsors/pagefaultgames";
|
||||
|
||||
export default class MenuUiHandler extends MessageUiHandler {
|
||||
private readonly textPadding = 8;
|
||||
|
@ -21,24 +21,6 @@ interface LanguageSetting {
|
||||
}
|
||||
|
||||
const languageSettings: { [key: string]: LanguageSetting } = {
|
||||
"en": {
|
||||
infoContainerTextSize: "64px"
|
||||
},
|
||||
"de": {
|
||||
infoContainerTextSize: "64px",
|
||||
},
|
||||
"es": {
|
||||
infoContainerTextSize: "64px"
|
||||
},
|
||||
"fr": {
|
||||
infoContainerTextSize: "64px"
|
||||
},
|
||||
"it": {
|
||||
infoContainerTextSize: "64px"
|
||||
},
|
||||
"zh": {
|
||||
infoContainerTextSize: "64px"
|
||||
},
|
||||
"pt": {
|
||||
infoContainerTextSize: "60px",
|
||||
infoContainerLabelXPos: -15,
|
||||
@ -237,14 +219,20 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
||||
|
||||
const formKey = (pokemon.species?.forms?.[pokemon.formIndex!]?.formKey);
|
||||
const formText = Utils.capitalizeString(formKey, "-", false, false) || "";
|
||||
const speciesName = Utils.capitalizeString(Species[pokemon.species.getRootSpeciesId()], "_", true, false);
|
||||
const speciesName = Utils.capitalizeString(Species[pokemon.species.speciesId], "_", true, false);
|
||||
|
||||
let formName = "";
|
||||
if (pokemon.species.speciesId === Species.ARCEUS) {
|
||||
formName = i18next.t(`pokemonInfo:Type.${formText?.toUpperCase()}`);
|
||||
} else {
|
||||
const i18key = `pokemonForm:${speciesName}${formText}`;
|
||||
formName = i18next.exists(i18key) ? i18next.t(i18key) : formText;
|
||||
if (i18next.exists(i18key)) {
|
||||
formName = i18next.t(i18key);
|
||||
} else {
|
||||
const rootSpeciesName = Utils.capitalizeString(Species[pokemon.species.getRootSpeciesId()], "_", true, false);
|
||||
const i18RootKey = `pokemonForm:${rootSpeciesName}${formText}`;
|
||||
formName = i18next.exists(i18RootKey) ? i18next.t(i18RootKey) : formText;
|
||||
}
|
||||
}
|
||||
|
||||
if (formName) {
|
||||
|
@ -13,7 +13,7 @@ interface LanguageSetting {
|
||||
}
|
||||
|
||||
const languageSettings: { [key: string]: LanguageSetting } = {
|
||||
"es":{
|
||||
"es-ES": {
|
||||
inputFieldFontSize: "50px",
|
||||
errorMessageFontSize: "40px",
|
||||
}
|
||||
|
@ -674,7 +674,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
const def = i18next.t("pokemonInfo:Stat.DEFshortened") + ": " + pStats[2];
|
||||
const spatk = i18next.t("pokemonInfo:Stat.SPATKshortened") + ": " + pStats[3];
|
||||
const spdef = i18next.t("pokemonInfo:Stat.SPDEFshortened") + ": " + pStats[4];
|
||||
const speedLabel = (currentLanguage === "es" || currentLanguage === "pt_BR") ? i18next.t("runHistory:SPDshortened") : i18next.t("pokemonInfo:Stat.SPDshortened");
|
||||
const speedLabel = (currentLanguage === "es-ES" || currentLanguage === "pt_BR") ? i18next.t("runHistory:SPDshortened") : i18next.t("pokemonInfo:Stat.SPDshortened");
|
||||
const speed = speedLabel + ": " + pStats[5];
|
||||
// Column 1: HP Atk Def
|
||||
const pokeStatText1 = addBBCodeTextObject(this.scene, -5, 0, hp, TextStyle.SUMMARY, { fontSize: textContainerFontSize, lineSpacing: lineSpacing });
|
||||
|
@ -29,10 +29,10 @@ export default class SettingsDisplayUiHandler extends AbstractSettingsUiHandler
|
||||
label: "English",
|
||||
};
|
||||
break;
|
||||
case "es":
|
||||
case "es-ES":
|
||||
this.settings[languageIndex].options[0] = {
|
||||
value: "Español",
|
||||
label: "Español",
|
||||
value: "Español (ES)",
|
||||
label: "Español (ES)",
|
||||
};
|
||||
break;
|
||||
case "it":
|
||||
|
@ -81,7 +81,7 @@ const languageSettings: { [key: string]: LanguageSetting } = {
|
||||
instructionTextSize: "35px",
|
||||
starterInfoXPos: 33,
|
||||
},
|
||||
"es":{
|
||||
"es-ES":{
|
||||
starterInfoTextSize: "56px",
|
||||
instructionTextSize: "35px",
|
||||
},
|
||||
|
@ -184,6 +184,7 @@ export default class TargetSelectUiHandler extends UiHandler {
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.cursor = -1;
|
||||
super.clear();
|
||||
this.eraseCursor();
|
||||
}
|
||||
|
@ -487,7 +487,7 @@ export function verifyLang(lang?: string): boolean {
|
||||
}
|
||||
|
||||
switch (lang) {
|
||||
case "es":
|
||||
case "es-ES":
|
||||
case "fr":
|
||||
case "de":
|
||||
case "it":
|
||||
|
Loading…
Reference in New Issue
Block a user