[Bug] Prevent Relearnable Egg Moves in Fresh Start (#3466)

* [Bug] Prevent Relearnable Egg Moves in Fresh Start

* Mention Condition in Docs

* Use `isFreshStartChallenge()`
This commit is contained in:
Amani H. 2024-08-12 01:49:32 -04:00 committed by GitHub
parent 63b5195b14
commit d2c6aa5df8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -916,13 +916,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
* excluding any moves already known.
*
* Available egg moves are only included if the {@linkcode Pokemon} was
* in the starting party of the run.
* in the starting party of the run and if Fresh Start is not active.
* @returns an array of {@linkcode Moves}, the length of which is determined
* by how many learnable moves there are for the {@linkcode Pokemon}.
*/
getLearnableLevelMoves(): Moves[] {
let levelMoves = this.getLevelMoves(1, true).map(lm => lm[1]);
if (this.metBiome === -1) {
if (this.metBiome === -1 && !this.scene.gameMode.isFreshStartChallenge()) {
levelMoves = this.getUnlockedEggMoves().concat(levelMoves);
}
return levelMoves.filter(lm => !this.moveset.some(m => m?.moveId === lm));