[Hotfix] Fix tyrogue evo (#6414)

* Fixed tyrogue evo condition

* Added test for tyrogue evolution

* Update src/data/balance/pokemon-evolutions.ts

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Update src/data/balance/pokemon-evolutions.ts

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Update src/data/balance/pokemon-evolutions.ts

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

* Added missing typeof in suggestion

---------

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-08-26 08:57:11 +02:00 committed by GitHub
parent 88e42ba4c4
commit 63c1c34746
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 2 deletions

View File

@ -77,7 +77,8 @@ export enum EvolutionItem {
LEADERS_CREST LEADERS_CREST
} }
type TyrogueMove = MoveId.LOW_SWEEP | MoveId.MACH_PUNCH | MoveId.RAPID_SPIN; const tyrogueMoves = [MoveId.LOW_SWEEP, MoveId.MACH_PUNCH, MoveId.RAPID_SPIN] as const;
type TyrogueMove = typeof tyrogueMoves[number];
/** /**
* Pokemon Evolution tuple type consisting of: * Pokemon Evolution tuple type consisting of:
@ -192,7 +193,7 @@ export class SpeciesEvolutionCondition {
case EvoCondKey.WEATHER: case EvoCondKey.WEATHER:
return cond.weather.includes(globalScene.arena.getWeatherType()); return cond.weather.includes(globalScene.arena.getWeatherType());
case EvoCondKey.TYROGUE: case EvoCondKey.TYROGUE:
return pokemon.getMoveset(true).find(m => m.moveId as TyrogueMove)?.moveId === cond.move; return pokemon.getMoveset(true).find(m => (tyrogueMoves as readonly MoveId[]) .includes(m.moveId))?.moveId === cond.move;
case EvoCondKey.NATURE: case EvoCondKey.NATURE:
return cond.nature.includes(pokemon.getNature()); return cond.nature.includes(pokemon.getNature());
case EvoCondKey.RANDOM_FORM: { case EvoCondKey.RANDOM_FORM: {

View File

@ -175,4 +175,27 @@ describe("Evolution", () => {
expect(fourForm.evoFormKey).toBe("four"); // meanwhile, according to the pokemon-forms, the evoFormKey for a 4 family maushold is "four" expect(fourForm.evoFormKey).toBe("four"); // meanwhile, according to the pokemon-forms, the evoFormKey for a 4 family maushold is "four"
} }
}); });
it("tyrogue should evolve if move is not in first slot", async () => {
game.override
.moveset([MoveId.TACKLE, MoveId.RAPID_SPIN, MoveId.LOW_KICK])
.enemySpecies(SpeciesId.GOLEM)
.enemyMoveset(MoveId.SPLASH)
.startingWave(41)
.startingLevel(19)
.enemyLevel(30);
await game.classicMode.startBattle([SpeciesId.TYROGUE]);
const tyrogue = game.field.getPlayerPokemon();
const golem = game.field.getEnemyPokemon();
golem.hp = 1;
expect(golem.hp).toBe(1);
game.move.select(MoveId.TACKLE);
await game.phaseInterceptor.to("EndEvolutionPhase");
expect(tyrogue.species.speciesId).toBe(SpeciesId.HITMONTOP);
});
}); });