mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Allow past gen moves to be learned via HOME relearner (#11362)
This commit is contained in:
parent
643d650c03
commit
60a4698695
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user