Hotfix 1.10.2

Hotfix 1.10.2 to main
This commit is contained in:
Madmadness65 2025-08-23 19:09:53 -05:00 committed by GitHub
commit 58d1209d92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 121 additions and 48 deletions

View File

@ -6,11 +6,13 @@ on:
- main - main
- beta - beta
- release - release
- 'hotfix*'
pull_request: pull_request:
branches: branches:
- main - main
- beta - beta
- release - release
- 'hotfix*'
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]

View File

@ -6,11 +6,13 @@ on:
- main - main
- beta - beta
- release - release
- 'hotfix*'
pull_request: pull_request:
branches: branches:
- main - main
- beta - beta
- release - release
- 'hotfix*'
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]

View File

@ -6,11 +6,13 @@ on:
- main - main
- beta - beta
- release - release
- 'hotfix*'
pull_request: pull_request:
branches: branches:
- main - main
- beta - beta
- release - release
- 'hotfix*'
merge_group: merge_group:
types: [checks_requested] types: [checks_requested]
workflow_dispatch: workflow_dispatch:

View File

@ -1,7 +1,7 @@
{ {
"name": "pokemon-rogue-battle", "name": "pokemon-rogue-battle",
"private": true, "private": true,
"version": "1.10.1", "version": "1.10.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite", "start": "vite",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 151 B

@ -1 +1 @@
Subproject commit 58fa5f9b6e94469017bfbe69bef992ed48ef5343 Subproject commit a73ea68fdda09bb5018f524cbe6b7e73a3ddf4e0

View File

@ -53,12 +53,6 @@ export const defaultStarterSpecies: SpeciesId[] = [
SpeciesId.QUAXLY, SpeciesId.QUAXLY,
]; ];
export const defaultStarterSpeciesAndEvolutions: SpeciesId[] = defaultStarterSpecies.flatMap(id => [
id,
(id + 1) as SpeciesId,
(id + 2) as SpeciesId,
]);
export const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary export const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary
/** /**

View File

@ -937,7 +937,7 @@ class StealthRockTag extends DamagingTrapTag {
protected override getTriggerMessage(pokemon: Pokemon): string { protected override getTriggerMessage(pokemon: Pokemon): string {
return i18next.t("arenaTag:stealthRockActivateTrap", { return i18next.t("arenaTag:stealthRockActivateTrap", {
pokemonName: getPokemonNameWithAffix(pokemon), pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
}); });
} }

View File

@ -187,7 +187,7 @@ export const speciesEggMoves = {
[SpeciesId.WYNAUT]: [ MoveId.RECOVER, MoveId.SHED_TAIL, MoveId.TAUNT, MoveId.COMEUPPANCE ], [SpeciesId.WYNAUT]: [ MoveId.RECOVER, MoveId.SHED_TAIL, MoveId.TAUNT, MoveId.COMEUPPANCE ],
[SpeciesId.SNORUNT]: [ MoveId.SPARKLY_SWIRL, MoveId.NASTY_PLOT, MoveId.EARTH_POWER, MoveId.BLOOD_MOON ], [SpeciesId.SNORUNT]: [ MoveId.SPARKLY_SWIRL, MoveId.NASTY_PLOT, MoveId.EARTH_POWER, MoveId.BLOOD_MOON ],
[SpeciesId.SPHEAL]: [ MoveId.FLIP_TURN, MoveId.FREEZE_DRY, MoveId.SLACK_OFF, MoveId.STEAM_ERUPTION ], [SpeciesId.SPHEAL]: [ MoveId.FLIP_TURN, MoveId.FREEZE_DRY, MoveId.SLACK_OFF, MoveId.STEAM_ERUPTION ],
[SpeciesId.CLAMPERL]: [ MoveId.SHELL_SIDE_ARM, MoveId.BOUNCY_BUBBLE, MoveId.FREEZE_DRY, MoveId.STEAM_ERUPTION ], [SpeciesId.CLAMPERL]: [ MoveId.SHELL_SIDE_ARM, MoveId.SNIPE_SHOT, MoveId.GIGA_DRAIN, MoveId.BOUNCY_BUBBLE ],
[SpeciesId.RELICANTH]: [ MoveId.DRAGON_DANCE, MoveId.SHORE_UP, MoveId.WAVE_CRASH, MoveId.DIAMOND_STORM ], [SpeciesId.RELICANTH]: [ MoveId.DRAGON_DANCE, MoveId.SHORE_UP, MoveId.WAVE_CRASH, MoveId.DIAMOND_STORM ],
[SpeciesId.LUVDISC]: [ MoveId.BATON_PASS, MoveId.HEART_SWAP, MoveId.GLITZY_GLOW, MoveId.REVIVAL_BLESSING ], [SpeciesId.LUVDISC]: [ MoveId.BATON_PASS, MoveId.HEART_SWAP, MoveId.GLITZY_GLOW, MoveId.REVIVAL_BLESSING ],
[SpeciesId.BAGON]: [ MoveId.HEADLONG_RUSH, MoveId.FIRE_LASH, MoveId.DRAGON_DANCE, MoveId.DRAGON_DARTS ], [SpeciesId.BAGON]: [ MoveId.HEADLONG_RUSH, MoveId.FIRE_LASH, MoveId.DRAGON_DANCE, MoveId.DRAGON_DARTS ],

View File

@ -402,7 +402,7 @@ export const starterPassiveAbilities: StarterPassiveAbilities = {
[SpeciesId.SPHEAL]: { 0: AbilityId.UNAWARE }, [SpeciesId.SPHEAL]: { 0: AbilityId.UNAWARE },
[SpeciesId.SEALEO]: { 0: AbilityId.UNAWARE }, [SpeciesId.SEALEO]: { 0: AbilityId.UNAWARE },
[SpeciesId.WALREIN]: { 0: AbilityId.UNAWARE }, [SpeciesId.WALREIN]: { 0: AbilityId.UNAWARE },
[SpeciesId.CLAMPERL]: { 0: AbilityId.DAUNTLESS_SHIELD }, [SpeciesId.CLAMPERL]: { 0: AbilityId.OVERCOAT },
[SpeciesId.GOREBYSS]: { 0: AbilityId.ARENA_TRAP }, [SpeciesId.GOREBYSS]: { 0: AbilityId.ARENA_TRAP },
[SpeciesId.HUNTAIL]: { 0: AbilityId.ARENA_TRAP }, [SpeciesId.HUNTAIL]: { 0: AbilityId.ARENA_TRAP },
[SpeciesId.RELICANTH]: { 0: AbilityId.PRIMORDIAL_SEA }, [SpeciesId.RELICANTH]: { 0: AbilityId.PRIMORDIAL_SEA },

View File

@ -1,3 +1,4 @@
import { defaultStarterSpecies } from "#app/constants";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { speciesStarterCosts } from "#balance/starters"; import { speciesStarterCosts } from "#balance/starters";
import { allMoves } from "#data/data-lists"; import { allMoves } from "#data/data-lists";
@ -1883,6 +1884,15 @@ export function initPokemonPrevolutions(): void {
// TODO: This may cause funny business for double starters such as Pichu/Pikachu // TODO: This may cause funny business for double starters such as Pichu/Pikachu
export const pokemonStarters: PokemonPrevolutions = {}; export const pokemonStarters: PokemonPrevolutions = {};
/**
* The default species and all their evolutions
*/
export const defaultStarterSpeciesAndEvolutions: SpeciesId[] = defaultStarterSpecies.flatMap(id => {
const stage2ids = pokemonEvolutions[id]?.map(e => e.speciesId) ?? [];
const stage3ids = stage2ids.flatMap(s2id => pokemonEvolutions[s2id]?.map(e => e.speciesId) ?? []);
return [id, ...stage2ids, ...stage3ids];
});
export function initPokemonStarters(): void { export function initPokemonStarters(): void {
const starterKeys = Object.keys(pokemonPrevolutions); const starterKeys = Object.keys(pokemonPrevolutions);
starterKeys.forEach(pk => { starterKeys.forEach(pk => {

View File

@ -1,6 +1,6 @@
import type { FixedBattleConfig } from "#app/battle"; import type { FixedBattleConfig } from "#app/battle";
import { getRandomTrainerFunc } from "#app/battle"; import { getRandomTrainerFunc } from "#app/battle";
import { defaultStarterSpeciesAndEvolutions } from "#app/constants"; import { defaultStarterSpeciesAndEvolutions } from "#balance/pokemon-evolutions";
import { speciesStarterCosts } from "#balance/starters"; import { speciesStarterCosts } from "#balance/starters";
import type { PokemonSpecies } from "#data/pokemon-species"; import type { PokemonSpecies } from "#data/pokemon-species";
import { AbilityAttr } from "#enums/ability-attr"; import { AbilityAttr } from "#enums/ability-attr";

View File

@ -2325,6 +2325,13 @@ export class HealOnAllyAttr extends HealAttr {
// Don't trigger if not targeting an ally // Don't trigger if not targeting an ally
return target === user.getAlly() && super.canApply(user, target, _move, _args); return target === user.getAlly() && super.canApply(user, target, _move, _args);
} }
override apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean {
if (user.isOpponent(target)) {
return false;
}
return super.apply(user, target, _move, _args);
}
} }
/** /**
@ -3270,7 +3277,6 @@ export class DelayedAttackAttr extends OverrideMoveEffectAttr {
) )
) )
user.pushMoveHistory({move: move.id, targets: [target.getBattlerIndex()], result: MoveResult.OTHER, useMode, turn: globalScene.currentBattle.turn})
user.pushMoveHistory({move: move.id, targets: [target.getBattlerIndex()], result: MoveResult.OTHER, useMode, turn: globalScene.currentBattle.turn}) user.pushMoveHistory({move: move.id, targets: [target.getBattlerIndex()], result: MoveResult.OTHER, useMode, turn: globalScene.currentBattle.turn})
// Queue up an attack on the given slot. // Queue up an attack on the given slot.
globalScene.arena.positionalTagManager.addTag<PositionalTagType.DELAYED_ATTACK>({ globalScene.arena.positionalTagManager.addTag<PositionalTagType.DELAYED_ATTACK>({

View File

@ -237,7 +237,7 @@ export const BerriesAboundEncounter: MysteryEncounter = MysteryEncounterBuilder.
const config = globalScene.currentBattle.mysteryEncounter!.enemyPartyConfigs[0]; const config = globalScene.currentBattle.mysteryEncounter!.enemyPartyConfigs[0];
config.pokemonConfigs![0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON]; config.pokemonConfigs![0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON];
config.pokemonConfigs![0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => { config.pokemonConfigs![0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => {
queueEncounterMessage(`${namespace}:option.2.boss_enraged`); queueEncounterMessage(`${namespace}:option.2.bossEnraged`);
globalScene.phaseManager.unshiftNew( globalScene.phaseManager.unshiftNew(
"StatStageChangePhase", "StatStageChangePhase",
pokemon.getBattlerIndex(), pokemon.getBattlerIndex(),

View File

@ -249,7 +249,7 @@ async function tryApplyDigRewardItems() {
await showEncounterText( await showEncounterText(
i18next.t("battle:rewardGainCount", { i18next.t("battle:rewardGainCount", {
modifierName: leftovers.name, modifierName: leftovers.name,
count: 2, count: 1,
}), }),
null, null,
undefined, undefined,

View File

@ -795,7 +795,7 @@ export class PokemonSpecies extends PokemonSpeciesForm implements Localizable {
return Gender.GENDERLESS; return Gender.GENDERLESS;
} }
if (randSeedFloat() <= this.malePercent) { if (randSeedFloat() * 100 <= this.malePercent) {
return Gender.MALE; return Gender.MALE;
} }
return Gender.FEMALE; return Gender.FEMALE;

View File

@ -454,7 +454,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
getNameToRender(useIllusion = true) { getNameToRender(useIllusion = true) {
const illusion = this.summonData.illusion; const illusion = this.summonData.illusion;
const name = useIllusion ? (illusion?.name ?? this.name) : this.name; const name = useIllusion ? (illusion?.name ?? this.name) : this.name;
const nickname: string | undefined = useIllusion ? illusion?.nickname : this.nickname; const nickname: string | undefined = useIllusion ? (illusion?.nickname ?? this.nickname) : this.nickname;
try { try {
if (nickname) { if (nickname) {
return decodeURIComponent(escape(atob(nickname))); // TODO: Remove `atob` and `escape`... eventually... return decodeURIComponent(escape(atob(nickname))); // TODO: Remove `atob` and `escape`... eventually...
@ -1781,7 +1781,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
* @returns Whether this Pokemon is currently fused with another species. * @returns Whether this Pokemon is currently fused with another species.
*/ */
isFusion(useIllusion = false): boolean { isFusion(useIllusion = false): boolean {
return useIllusion ? !!this.summonData.illusion?.fusionSpecies : !!this.fusionSpecies; return !!(useIllusion ? (this.summonData.illusion?.fusionSpecies ?? this.fusionSpecies) : this.fusionSpecies);
} }
/** /**

View File

@ -177,7 +177,7 @@ export class SelectModifierPhase extends BattlePhase {
this.openModifierMenu(modifierType, cost, modifierSelectCallback); this.openModifierMenu(modifierType, cost, modifierSelectCallback);
} }
} else { } else {
this.applyModifier(modifierType.newModifier()!); this.applyModifier(modifierType.newModifier()!, cost);
} }
return cost === -1; return cost === -1;
} }

View File

@ -563,7 +563,7 @@ export class PartyUiHandler extends MessageUiHandler {
const ui = this.getUi(); const ui = this.getUi();
const option = this.options[this.optionsCursor]; const option = this.options[this.optionsCursor];
if (option === PartyOption.TRANSFER) { if (this.transferMode && option === PartyOption.TRANSFER) {
return this.processTransferOption(); return this.processTransferOption();
} }
@ -1021,7 +1021,8 @@ export class PartyUiHandler extends MessageUiHandler {
} }
// Toggle item transfer mode to discard items or vice versa // Toggle item transfer mode to discard items or vice versa
if (this.cursor === 7) { // Prevent changing mode, when currently transfering an item
if (this.cursor === 7 && !this.transferMode) {
switch (this.partyUiMode) { switch (this.partyUiMode) {
case PartyUiMode.DISCARD: case PartyUiMode.DISCARD:
this.partyUiMode = PartyUiMode.MODIFIER_TRANSFER; this.partyUiMode = PartyUiMode.MODIFIER_TRANSFER;
@ -1609,7 +1610,7 @@ export class PartyUiHandler extends MessageUiHandler {
const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM]; const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM];
optionName = `${modifier.active ? i18next.t("partyUiHandler:deactivate") : i18next.t("partyUiHandler:activate")} ${modifier.type.name}`; optionName = `${modifier.active ? i18next.t("partyUiHandler:deactivate") : i18next.t("partyUiHandler:activate")} ${modifier.type.name}`;
} else if (option === PartyOption.UNPAUSE_EVOLUTION) { } else if (option === PartyOption.UNPAUSE_EVOLUTION) {
optionName = `${pokemon.pauseEvolutions ? i18next.t("partyUiHandler:unpausedEvolution") : i18next.t("partyUiHandler:pauseEvolution")}`; optionName = `${pokemon.pauseEvolutions ? i18next.t("partyUiHandler:unpauseEvolution") : i18next.t("partyUiHandler:pauseEvolution")}`;
} else { } else {
if (this.localizedOptions.includes(option)) { if (this.localizedOptions.includes(option)) {
optionName = i18next.t(`partyUiHandler:${toCamelCase(PartyOption[option])}`); optionName = i18next.t(`partyUiHandler:${toCamelCase(PartyOption[option])}`);

View File

@ -181,7 +181,7 @@ export class SaveSlotSelectUiHandler extends MessageUiHandler {
ui.setOverlayMode( ui.setOverlayMode(
UiMode.CONFIRM, UiMode.CONFIRM,
() => { () => {
globalScene.gameData.tryClearSession(cursor).then(response => { globalScene.gameData.deleteSession(cursor).then(response => {
if (response[0] === false) { if (response[0] === false) {
globalScene.reset(true); globalScene.reset(true);
} else { } else {

View File

@ -2095,28 +2095,22 @@ export class StarterSelectUiHandler extends MessageUiHandler {
const passiveAttr = starterData.passiveAttr; const passiveAttr = starterData.passiveAttr;
if (passiveAttr & PassiveAttr.UNLOCKED) { if (passiveAttr & PassiveAttr.UNLOCKED) {
// this is for enabling and disabling the passive // this is for enabling and disabling the passive
if (!(passiveAttr & PassiveAttr.ENABLED)) { const label = i18next.t(
passiveAttr & PassiveAttr.ENABLED
? "starterSelectUiHandler:disablePassive"
: "starterSelectUiHandler:enablePassive",
);
options.push({ options.push({
label: i18next.t("starterSelectUiHandler:enablePassive"), label,
handler: () => {
starterData.passiveAttr |= PassiveAttr.ENABLED;
ui.setMode(UiMode.STARTER_SELECT);
this.setSpeciesDetails(this.lastSpecies);
return true;
},
});
} else {
options.push({
label: i18next.t("starterSelectUiHandler:disablePassive"),
handler: () => { handler: () => {
starterData.passiveAttr ^= PassiveAttr.ENABLED; starterData.passiveAttr ^= PassiveAttr.ENABLED;
persistentStarterData.passiveAttr ^= PassiveAttr.ENABLED;
ui.setMode(UiMode.STARTER_SELECT); ui.setMode(UiMode.STARTER_SELECT);
this.setSpeciesDetails(this.lastSpecies); this.setSpeciesDetails(this.lastSpecies);
return true; return true;
}, },
}); });
} }
}
// if container.favorite is false, show the favorite option // if container.favorite is false, show the favorite option
const isFavorite = starterAttributes?.favorite ?? false; const isFavorite = starterAttributes?.favorite ?? false;
if (!isFavorite) { if (!isFavorite) {
@ -4618,6 +4612,8 @@ export class StarterSelectUiHandler extends MessageUiHandler {
clear(): void { clear(): void {
super.clear(); super.clear();
saveStarterPreferences(this.originalStarterPreferences);
this.clearStarterPreferences(); this.clearStarterPreferences();
this.cursor = -1; this.cursor = -1;
this.hideInstructions(); this.hideInstructions();

View File

@ -2,7 +2,6 @@ import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id"; import { SpeciesId } from "#enums/species-id";
import { DamageAnimPhase } from "#phases/damage-anim-phase"; import { DamageAnimPhase } from "#phases/damage-anim-phase";
import { TurnEndPhase } from "#phases/turn-end-phase";
import { GameManager } from "#test/test-utils/game-manager"; import { GameManager } from "#test/test-utils/game-manager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -54,7 +53,7 @@ describe("Items - Leftovers", () => {
const leadHpAfterDamage = leadPokemon.hp; const leadHpAfterDamage = leadPokemon.hp;
// Check if leftovers heal us // Check if leftovers heal us
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("PokemonHealPhase");
expect(leadPokemon.hp).toBeGreaterThan(leadHpAfterDamage); expect(leadPokemon.hp).toBeGreaterThan(leadHpAfterDamage);
}); });
}); });

View File

@ -200,7 +200,7 @@ describe("Moves - Entry Hazards", () => {
expect(enemy).toHaveTakenDamage(enemy.getMaxHp() * 0.125 * multi); expect(enemy).toHaveTakenDamage(enemy.getMaxHp() * 0.125 * multi);
expect(game.textInterceptor.logs).toContain( expect(game.textInterceptor.logs).toContain(
i18next.t("arenaTag:stealthRockActivateTrap", { i18next.t("arenaTag:stealthRockActivateTrap", {
pokemonName: getPokemonNameWithAffix(enemy), pokemonNameWithAffix: getPokemonNameWithAffix(enemy),
}), }),
); );
}); });

View File

@ -61,4 +61,16 @@ describe("Moves - Pollen Puff", () => {
expect(target.battleData.hitCount).toBe(2); expect(target.battleData.hitCount).toBe(2);
}); });
// Regression test for pollen puff healing an enemy after dealing damage
it("should not heal an enemy after dealing damage", async () => {
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
const target = game.field.getEnemyPokemon();
game.move.use(MoveId.POLLEN_PUFF);
await game.phaseInterceptor.to("BerryPhase", false);
expect(target.hp).not.toBe(target.getMaxHp());
expect(game.phaseInterceptor.log).not.toContain("PokemonHealPhase");
});
}); });

View File

@ -37,6 +37,7 @@ import { NewBiomeEncounterPhase } from "#phases/new-biome-encounter-phase";
import { NextEncounterPhase } from "#phases/next-encounter-phase"; import { NextEncounterPhase } from "#phases/next-encounter-phase";
import { PartyExpPhase } from "#phases/party-exp-phase"; import { PartyExpPhase } from "#phases/party-exp-phase";
import { PartyHealPhase } from "#phases/party-heal-phase"; import { PartyHealPhase } from "#phases/party-heal-phase";
import { PokemonHealPhase } from "#phases/pokemon-heal-phase";
import { PokemonTransformPhase } from "#phases/pokemon-transform-phase"; import { PokemonTransformPhase } from "#phases/pokemon-transform-phase";
import { PositionalTagPhase } from "#phases/positional-tag-phase"; import { PositionalTagPhase } from "#phases/positional-tag-phase";
import { PostGameOverPhase } from "#phases/post-game-over-phase"; import { PostGameOverPhase } from "#phases/post-game-over-phase";
@ -181,6 +182,7 @@ export class PhaseInterceptor {
UnlockPhase, UnlockPhase,
PostGameOverPhase, PostGameOverPhase,
RevivalBlessingPhase, RevivalBlessingPhase,
PokemonHealPhase,
]; ];
private endBySetMode = [ private endBySetMode = [

View File

@ -6,7 +6,7 @@ import { UiMode } from "#enums/ui-mode";
import type { Pokemon } from "#field/pokemon"; import type { Pokemon } from "#field/pokemon";
import { GameManager } from "#test/test-utils/game-manager"; import { GameManager } from "#test/test-utils/game-manager";
import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
import type { PartyUiHandler } from "#ui/party-ui-handler"; import { type PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -169,4 +169,51 @@ describe("UI - Transfer Items", () => {
expect(pokemon.getHeldItems().map(h => h.stackCount)).toEqual([2, 2]); expect(pokemon.getHeldItems().map(h => h.stackCount)).toEqual([2, 2]);
} }
}); });
// TODO: This test breaks when running all tests on github. Fix this once hotfix period is over.
it.todo("should not allow changing to discard mode when transfering items", async () => {
let handler: PartyUiHandler | undefined;
const { resolve, promise } = Promise.withResolvers<void>();
game.onNextPrompt("SelectModifierPhase", UiMode.MODIFIER_SELECT, async () => {
await new Promise(r => setTimeout(r, 100));
const modifierHandler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
modifierHandler.processInput(Button.DOWN);
modifierHandler.setCursor(1);
modifierHandler.processInput(Button.ACTION);
});
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, async () => {
await new Promise(r => setTimeout(r, 100));
handler = game.scene.ui.getHandler() as PartyUiHandler;
handler.setCursor(0);
handler.processInput(Button.ACTION);
await new Promise(r => setTimeout(r, 100));
handler.processInput(Button.ACTION);
resolve();
});
await promise;
expect(handler).toBeDefined();
if (handler) {
const partyMode = handler["partyUiMode"];
expect(partyMode).toBe(PartyUiMode.MODIFIER_TRANSFER);
handler.setCursor(7);
handler.processInput(Button.ACTION);
// Should not change mode to discard
expect(handler["partyUiMode"]).toBe(PartyUiMode.MODIFIER_TRANSFER);
handler.processInput(Button.CANCEL);
handler.setCursor(7);
handler.processInput(Button.ACTION);
// Should change mode to discard
expect(handler["partyUiMode"]).toBe(PartyUiMode.DISCARD);
}
});
}); });