Skip to content

Commit c98b992

Browse files
authored
1 parent abcfe2b commit c98b992

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

sim/team-validator.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,11 @@ export class TeamValidator {
838838
let eventOnlyData;
839839

840840
if (!setSources.sourcesBefore && setSources.sources.length) {
841+
let skippedEggSource = true;
841842
const legalSources = [];
842843
for (const source of setSources.sources) {
844+
if (['2E', '3E'].includes(source) && set.level < 5) continue;
845+
skippedEggSource = false;
843846
if (this.validateSource(set, source, setSources, outOfBattleSpecies)) continue;
844847
legalSources.push(source);
845848
}
@@ -855,8 +858,12 @@ export class TeamValidator {
855858
}
856859
if (!nonEggSource) {
857860
// all egg moves
858-
problems.push(`${name} can't get its egg move combination (${setSources.limitedEggMoves!.join(', ')}) from any possible father.`);
859-
problems.push(`(Is this incorrect? If so, post the chainbreeding instructions in Bug Reports)`);
861+
if (skippedEggSource) {
862+
problems.push(`${name} is from a Gen 2 or 3 egg, which cannot be obtained at levels below 5.`);
863+
} else {
864+
problems.push(`${name} can't get its egg move combination (${setSources.limitedEggMoves!.join(', ')}) from any possible father.`);
865+
problems.push(`(Is this incorrect? If so, post the chainbreeding instructions in Bug Reports)`);
866+
}
860867
} else {
861868
if (species.id === 'mew' && pokemonGoProblems && !pokemonGoProblems.length) {
862869
// Whitelist Pokemon GO Mew, which cannot be sent to Let's Go

test/sim/team-validator/breeding.js

+7
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,11 @@ describe('Team Validator', function () {
251251
];
252252
assert.false.legalTeam(team, 'gen7anythinggoes');
253253
});
254+
255+
it('should not allow egg Pokemon below level 5 in Gens 2-3', function () {
256+
team = [
257+
{species: 'totodile', level: 1, ability: 'torrent', moves: ['ancientpower']},
258+
];
259+
assert.false.legalTeam(team, 'gen3ou');
260+
});
254261
});

0 commit comments

Comments
 (0)