From 2065f4fd7f6f162653390b37a6065941614ea85f Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Tue, 17 Jun 2025 13:08:20 -0400 Subject: [PATCH 1/3] [Bug] Fix incorrect form key being checked for evo items (#5995) --- src/data/balance/pokemon-evolutions.ts | 9 +++++++-- src/modifier/modifier-type.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/data/balance/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts index e97a51fed29..5dda1912e44 100644 --- a/src/data/balance/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -291,13 +291,18 @@ export class SpeciesFormEvolution { ); } + /** + * Checks if this evolution is item-based and any conditions for it are fulfilled + * @param pokemon {@linkcode Pokemon} who wants to evolve + * @param forFusion defaults to False. Whether this evolution is meant for the secondary fused mon. In that case, use their form key. + * @returns whether this evolution uses an item and can apply to the Pokemon + */ public isValidItemEvolution(pokemon: Pokemon, forFusion = false): boolean { return ( - // If an item is given, check if it's the right one !isNullOrUndefined(this.item) && pokemon.level >= this.level && // Check form key, using the fusion's form key if we're checking the fusion - (isNullOrUndefined(this.preFormKey) || (forFusion ? pokemon.getFormKey() : pokemon.getFusionFormKey()) === this.preFormKey) && + (isNullOrUndefined(this.preFormKey) || (forFusion ? pokemon.getFusionFormKey() : pokemon.getFormKey()) === this.preFormKey) && (isNullOrUndefined(this.condition) || this.condition.conditionsFulfilled(pokemon)) ); } diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index a22486210b0..a04a5e2be47 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1603,12 +1603,12 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { ) .flatMap(p => { const evolutions = pokemonEvolutions[p.fusionSpecies!.speciesId]; - return evolutions.filter(e => e.validate(p, true)); + return evolutions.filter(e => e.isValidItemEvolution(p, true)); }), ] .flat() .flatMap(e => e.evoItem) - .filter(i => (!!i && i > 50) === rare); + .filter(i => !!i && i > 50 === rare); if (!evolutionItemPool.length) { return null; From 28b6c7e50db042e4d64acf2d3e0131448949f9b4 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Tue, 17 Jun 2025 12:35:39 -0700 Subject: [PATCH 2/3] [i18n] Map "biome" namespace to the filename change to "biomes" (#6001) * [i18n] Map "biome" to the filename "biomes" * Update locales submodule to bring in file rename --- public/locales | 2 +- src/plugins/i18n.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales b/public/locales index 4dab23d6a78..fade123e20f 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit 4dab23d6a78b6cf32db43c9953e3c2000f448007 +Subproject commit fade123e20ff951e199d7c0466686fe8c5511643 diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 8ca9005096f..eab427e7b4a 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -101,6 +101,7 @@ const namespaceMap = { doubleBattleDialogue: "dialogue-double-battle", splashMessages: "splash-texts", mysteryEncounterMessages: "mystery-encounter-texts", + biome: "biomes", }; //#region Functions From 4119dfbfecc0a0a6a5608881fdf672ee572e594f Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Tue, 17 Jun 2025 16:51:19 -0400 Subject: [PATCH 3/3] [Test] Fix flaky gastro acid test (#5996) --- test/moves/gastro_acid.test.ts | 104 ++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 47 deletions(-) diff --git a/test/moves/gastro_acid.test.ts b/test/moves/gastro_acid.test.ts index dbaa53dcb4f..39167987809 100644 --- a/test/moves/gastro_acid.test.ts +++ b/test/moves/gastro_acid.test.ts @@ -3,6 +3,7 @@ import { AbilityId } from "#enums/ability-id"; import { MoveId } from "#enums/move-id"; import { SpeciesId } from "#enums/species-id"; import { MoveResult } from "#enums/move-result"; +import { BattleType } from "#enums/battle-type"; import GameManager from "#test/testUtils/gameManager"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; @@ -23,82 +24,91 @@ describe("Moves - Gastro Acid", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .battleStyle("double") + .battleStyle("single") + .ability(AbilityId.BALL_FETCH) .startingLevel(1) - .enemyLevel(100) - .ability(AbilityId.NONE) - .moveset([MoveId.GASTRO_ACID, MoveId.WATER_GUN, MoveId.SPLASH, MoveId.CORE_ENFORCER]) .enemySpecies(SpeciesId.BIDOOF) .enemyMoveset(MoveId.SPLASH) .enemyAbility(AbilityId.WATER_ABSORB); }); - it("suppresses effect of ability", async () => { - /* - * Expected flow (enemies have WATER ABSORD, can only use SPLASH) - * - player mon 1 uses GASTRO ACID, player mon 2 uses SPLASH - * - both player mons use WATER GUN on their respective enemy mon - * - player mon 1 should have dealt damage, player mon 2 should have not - */ + it("should suppress the target's ability", async () => { + game.override.battleStyle("double"); + await game.classicMode.startBattle([SpeciesId.BIDOOF, SpeciesId.BASCULIN]); - await game.classicMode.startBattle(); + game.move.use(MoveId.GASTRO_ACID, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.use(MoveId.SPLASH, BattlerIndex.PLAYER_2); + await game.toNextTurn(); - game.move.select(MoveId.GASTRO_ACID, 0, BattlerIndex.ENEMY); - game.move.select(MoveId.SPLASH, 1); + const [enemy1, enemy2] = game.scene.getEnemyField(); + expect(enemy1.summonData.abilitySuppressed).toBe(true); + expect(enemy2.summonData.abilitySuppressed).toBe(false); - await game.phaseInterceptor.to("TurnInitPhase"); + game.move.use(MoveId.WATER_GUN, BattlerIndex.PLAYER, BattlerIndex.ENEMY); + game.move.use(MoveId.WATER_GUN, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2); + await game.toEndOfTurn(); - const enemyField = game.scene.getEnemyField(); - expect(enemyField[0].summonData.abilitySuppressed).toBe(true); - expect(enemyField[1].summonData.abilitySuppressed).toBe(false); - - game.move.select(MoveId.WATER_GUN, 0, BattlerIndex.ENEMY); - game.move.select(MoveId.WATER_GUN, 1, BattlerIndex.ENEMY_2); - - await game.phaseInterceptor.to("TurnEndPhase"); - - expect(enemyField[0].hp).toBeLessThan(enemyField[0].getMaxHp()); - expect(enemyField[1].isFullHp()).toBe(true); + expect(enemy1.summonData.abilitySuppressed).toBe(true); + expect(enemy2.summonData.abilitySuppressed).toBe(false); + expect(enemy1.hp).toBeLessThan(enemy1.getMaxHp()); + expect(enemy2.hp).toBe(enemy2.getMaxHp()); }); - it("fails if used on an enemy with an already-suppressed ability", async () => { - game.override.battleStyle("single"); + it("should be removed on switch", async () => { + game.override.battleType(BattleType.TRAINER); + await game.classicMode.startBattle([SpeciesId.BIDOOF]); - await game.classicMode.startBattle(); + game.move.use(MoveId.GASTRO_ACID); + await game.toNextTurn(); - game.move.select(MoveId.CORE_ENFORCER); + const enemy = game.field.getEnemyPokemon(); + expect(enemy.summonData.abilitySuppressed).toBe(true); + + // switch enemy out and back in, should be removed + game.move.use(MoveId.SPLASH); + game.forceEnemyToSwitch(); + await game.toNextTurn(); + game.move.use(MoveId.SPLASH); + game.forceEnemyToSwitch(); + await game.toNextTurn(); + + expect(game.field.getEnemyPokemon()).toBe(enemy); + expect(enemy.summonData.abilitySuppressed).toBe(false); + }); + + it("should fail if target's ability is already suppressed", async () => { + await game.classicMode.startBattle([SpeciesId.BIDOOF]); + + game.move.use(MoveId.CORE_ENFORCER); // Force player to be slower to enable Core Enforcer to proc its suppression effect await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); + await game.toNextTurn(); - await game.phaseInterceptor.to("TurnInitPhase"); + game.move.use(MoveId.GASTRO_ACID); + await game.toNextTurn(); - game.move.select(MoveId.GASTRO_ACID); - - await game.phaseInterceptor.to("TurnInitPhase"); - - expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(game.field.getPlayerPokemon().getLastXMoves()[0].result).toBe(MoveResult.FAIL); }); - it("should suppress the passive of a target even if its main ability is unsuppressable and not suppress main abli", async () => { - game.override - .enemyAbility(AbilityId.COMATOSE) - .enemyPassiveAbility(AbilityId.WATER_ABSORB) - .moveset([MoveId.SPLASH, MoveId.GASTRO_ACID, MoveId.WATER_GUN]); + it("should suppress target's passive even if its main ability is unsuppressable", async () => { + game.override.enemyAbility(AbilityId.COMATOSE).enemyPassiveAbility(AbilityId.WATER_ABSORB); await game.classicMode.startBattle([SpeciesId.MAGIKARP]); - const enemyPokemon = game.scene.getEnemyPokemon(); + const enemyPokemon = game.field.getEnemyPokemon(); - game.move.select(MoveId.GASTRO_ACID); + game.move.use(MoveId.GASTRO_ACID); await game.toNextTurn(); - expect(enemyPokemon?.summonData.abilitySuppressed).toBe(true); + expect(enemyPokemon.summonData.abilitySuppressed).toBe(true); game.move.select(MoveId.WATER_GUN); await game.toNextTurn(); - expect(enemyPokemon?.getHpRatio()).toBeLessThan(1); + // water gun should've dealt damage due to suppressed Water Absorb + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); game.move.select(MoveId.SPORE); - await game.phaseInterceptor.to("BerryPhase"); + await game.toEndOfTurn(); - expect(enemyPokemon?.status?.effect).toBeFalsy(); + // Comatose should block stauts effect + expect(enemyPokemon.status?.effect).toBeUndefined(); }); });