Allow past gen moves to be learned via HOME relearner (#11362)

This commit is contained in:
dot-Comfey 2025-08-13 13:35:48 -07:00 committed by GitHub
parent 643d650c03
commit 60a4698695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -2530,6 +2530,7 @@ export class TeamValidator {
}
}
let canUseHomeRelearner = false;
for (let learned of sources) {
// Every `learned` represents a single way a pokemon might
// learn a move. This can be handled one of several ways:
@ -2557,7 +2558,7 @@ export class TeamValidator {
}
continue;
}
if (learnedGen < this.minSourceGen) {
if (learnedGen < this.minSourceGen && !canUseHomeRelearner) {
if (!cantLearnReason) {
cantLearnReason = `can't be transferred from Gen ${learnedGen} to ${this.minSourceGen}.`;
}
@ -2570,6 +2571,8 @@ export class TeamValidator {
continue;
}
if (learnedGen === 9 && learned.charAt(1) !== 'S') canUseHomeRelearner = true;
if (
baseSpecies.evoRegion === 'Alola' && checkingPrevo && learnedGen >= 8 &&
(dex.gen < 9 || learned.charAt(1) !== 'E')

View File

@ -241,4 +241,12 @@ describe('Team Validator', () => {
assert.equal(accepted, allowed);
});
it('should allow moves learned via HOME relearner', () => {
const team = [
{ species: 'bronzor', level: 1, ability: 'levitate', moves: ['hypnosis'] },
{ species: 'porygon', level: 25, ability: 'trace', moves: ['triattack'], evs: { hp: 1 } },
];
assert.legalTeam(team, 'gen9ubers');
});
});