Merge branch 'hotfix-1.10.6' into fix-enemy-level-position
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 645 B After Width: | Height: | Size: 610 B |
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 417 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 162 B |
@ -1 +1 @@
|
||||
Subproject commit e0657485ae75ff0361a6e3f0fb4c7ed649a1fb39
|
||||
Subproject commit 2686cd3edc0bd2c7a7f12cc54c00c109e51a48d7
|
@ -456,7 +456,7 @@ export class CommandPhase extends FieldPhase {
|
||||
|
||||
const numBallTypes = 5;
|
||||
if (cursor < numBallTypes) {
|
||||
const targetPokemon = globalScene.getEnemyPokemon();
|
||||
const targetPokemon = globalScene.getEnemyPokemon(false);
|
||||
if (
|
||||
targetPokemon?.isBoss() &&
|
||||
targetPokemon?.bossSegmentIndex >= 1 &&
|
||||
|
@ -31,6 +31,7 @@ export class EvolutionPhase extends Phase {
|
||||
private evolutionBgm: AnySound;
|
||||
private evolutionHandler: EvolutionSceneHandler;
|
||||
|
||||
/** Container for all assets used by the scene. When the scene is cleared, the children within this are destroyed. */
|
||||
protected evolutionContainer: Phaser.GameObjects.Container;
|
||||
protected evolutionBaseBg: Phaser.GameObjects.Image;
|
||||
protected evolutionBg: Phaser.GameObjects.Video;
|
||||
@ -522,6 +523,7 @@ export class EvolutionPhase extends Phase {
|
||||
return;
|
||||
}
|
||||
if (i === lastCycle) {
|
||||
this.pokemonTintSprite.setVisible(false).setActive(false);
|
||||
this.pokemonEvoTintSprite.setScale(1);
|
||||
}
|
||||
},
|
||||
|
@ -115,6 +115,9 @@ export class EnemyBattleInfo extends BattleInfo {
|
||||
globalScene.gameData.starterData[pokemon.species.getRootSpeciesId()].classicWinCount > 0 &&
|
||||
globalScene.gameData.starterData[pokemon.species.getRootSpeciesId(true)].classicWinCount > 0
|
||||
) {
|
||||
// move the ribbon to the left if there is no owned icon
|
||||
const championRibbonX = this.ownedIcon.visible ? 8 : 0;
|
||||
this.championRibbon.setPositionRelative(this.nameText, championRibbonX, 11.75);
|
||||
this.championRibbon.setVisible(true);
|
||||
}
|
||||
|
||||
|
@ -613,6 +613,20 @@ export class PartyUiHandler extends MessageUiHandler {
|
||||
ui.playSelect();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (option === PartyOption.SUMMARY) {
|
||||
return this.processSummaryOption(pokemon);
|
||||
}
|
||||
if (option === PartyOption.POKEDEX) {
|
||||
return this.processPokedexOption(pokemon);
|
||||
}
|
||||
if (option === PartyOption.UNPAUSE_EVOLUTION) {
|
||||
return this.processUnpauseEvolutionOption(pokemon);
|
||||
}
|
||||
if (option === PartyOption.RENAME) {
|
||||
return this.processRenameOption(pokemon);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -349,6 +349,15 @@ export function getTextStyleOptions(
|
||||
styleOptions.fontSize = defaultFontSize - 42;
|
||||
styleOptions.padding = { top: 4 };
|
||||
break;
|
||||
case "ko":
|
||||
styleOptions.fontSize = defaultFontSize - 38;
|
||||
styleOptions.padding = { top: 4, left: 6 };
|
||||
break;
|
||||
case "zh-CN":
|
||||
case "zh-TW":
|
||||
styleOptions.fontSize = defaultFontSize - 42;
|
||||
styleOptions.padding = { top: 5, left: 14 };
|
||||
break;
|
||||
default:
|
||||
styleOptions.fontSize = defaultFontSize - 30;
|
||||
styleOptions.padding = { left: 12 };
|
||||
|
235
test/ui/transfer-item-options.test.ts
Normal file
@ -0,0 +1,235 @@
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { GameManager } from "#test/test-utils/game-manager";
|
||||
import { type PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler";
|
||||
import type { RenameFormUiHandler } from "#ui/rename-form-ui-handler";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
// todo: Some tests fail when running all tests at once, but pass when running individually. Seams like it's always the 2nd and 4th (non todo) tests that fail.
|
||||
describe("UI - Transfer Item Options", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.startingLevel(100)
|
||||
.startingHeldItems([
|
||||
{ name: "BERRY", count: 1, type: BerryType.SITRUS },
|
||||
{ name: "BERRY", count: 2, type: BerryType.APICOT },
|
||||
{ name: "BERRY", count: 2, type: BerryType.LUM },
|
||||
])
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
||||
await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.SQUIRTLE, SpeciesId.CHARMANDER]);
|
||||
|
||||
game.move.use(MoveId.DRAGON_CLAW);
|
||||
|
||||
await game.phaseInterceptor.to("SelectModifierPhase");
|
||||
await game.scene.ui.setModeWithoutClear(UiMode.PARTY, PartyUiMode.MODIFIER_TRANSFER);
|
||||
});
|
||||
|
||||
it.todo("should open the summary screen while transfering an item", async () => {
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// Select first party member
|
||||
handler.setCursor(0);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
// select item to transfer
|
||||
handler.processInput(Button.ACTION);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// move to second pokemon
|
||||
handler.setCursor(1);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
// select summary
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
expect(game.scene.ui.getMode()).toBe(UiMode.SUMMARY);
|
||||
});
|
||||
|
||||
it.todo("should open the pokèdex screen while transfering an item", async () => {
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// Select first party member
|
||||
handler.setCursor(0);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
// select item to transfer
|
||||
handler.processInput(Button.ACTION);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
// move to second pokemon
|
||||
handler.setCursor(1);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
// select pokèdex
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
expect(game.scene.ui.getMode()).toBe(UiMode.POKEDEX_PAGE);
|
||||
});
|
||||
|
||||
it.todo("should open the rename screen and rename the pokemon while transfering an item", async () => {
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// Select first party member
|
||||
handler.setCursor(0);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
// select item to transfer
|
||||
handler.processInput(Button.ACTION);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
let handler: PartyUiHandler | RenameFormUiHandler | undefined;
|
||||
handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// move to second pokemon
|
||||
handler.setCursor(1);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
// select rename
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
const pokemon = game.scene.getPlayerParty()[1];
|
||||
if (!pokemon) {
|
||||
expect.fail("Pokemon is undefined");
|
||||
}
|
||||
const nickname = pokemon.nickname;
|
||||
|
||||
expect(nickname).toBe(undefined);
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
expect(game.scene.ui.getMode()).toBe(UiMode.RENAME_POKEMON);
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
handler = game.scene.ui.getHandler() as RenameFormUiHandler;
|
||||
handler["inputs"][0].setText("New nickname");
|
||||
handler.processInput(Button.SUBMIT);
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
// get the sanitized name
|
||||
const sanitizedName = btoa(unescape(encodeURIComponent("New nickname")));
|
||||
expect(pokemon.nickname).toBe(sanitizedName);
|
||||
});
|
||||
|
||||
it.todo("should pause the evolution while transfering an item", async () => {
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// Select first party member
|
||||
handler.setCursor(0);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise<void>(resolve => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
// select item to transfer
|
||||
handler.processInput(Button.ACTION);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
const handler = game.scene.ui.getHandler() as PartyUiHandler;
|
||||
|
||||
// move to second pokemon
|
||||
handler.setCursor(1);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
const pokemon = game.scene.getPlayerParty()[1];
|
||||
|
||||
if (!pokemon) {
|
||||
expect.fail("Pokemon is undefined");
|
||||
}
|
||||
if (pokemon.pauseEvolutions !== undefined) {
|
||||
expect(pokemon.pauseEvolutions).toBe(false);
|
||||
}
|
||||
|
||||
// select pause evolution
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.DOWN);
|
||||
handler.processInput(Button.ACTION);
|
||||
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
expect(game.scene.ui.getMode()).toBe(UiMode.PARTY);
|
||||
expect(pokemon.pauseEvolutions).toBe(true);
|
||||
});
|
||||
});
|