mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-15 08:50:10 -05:00
Fix Nidoqueen egg move validation
This commit is contained in:
parent
971f028742
commit
78e4d3945b
|
|
@ -24,7 +24,11 @@ type PlayerIndex = 1 | 2 | 3 | 4;
|
|||
interface BattleRequestTracker {
|
||||
rqid: number;
|
||||
request: string;
|
||||
// true = user has decided, false = user has yet to decide, 'cantUndo' = waiting on other user (U-turn, faint-switch) or uncancellable (trapping ability)
|
||||
/**
|
||||
* - true = user has decided,
|
||||
* - false = user has yet to decide,
|
||||
* - 'cantUndo' = waiting on other user (U-turn, faint-switch) or uncancellable (trapping ability)
|
||||
*/
|
||||
isWait: 'cantUndo' | true | false;
|
||||
choice: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -940,6 +940,7 @@ export class TeamValidator {
|
|||
// In Gen 5 and earlier, egg moves can only be inherited from the father
|
||||
// we'll test each possible father separately
|
||||
let eggGroups = template.eggGroups;
|
||||
if (template.id === 'nidoqueen') eggGroups = dex.getTemplate(template.prevo).eggGroups;
|
||||
if (eggGroups[0] === 'Undiscovered') eggGroups = dex.getTemplate(template.evos[0]).eggGroups;
|
||||
if (eggGroups[0] === 'Undiscovered' || !eggGroups.length) {
|
||||
throw new Error(`${template.species} has no egg groups`);
|
||||
|
|
|
|||
|
|
@ -273,6 +273,8 @@ describe('Team Validator', function () {
|
|||
team = [
|
||||
{species: 'tyranitar', ability: 'unnerve', moves: ['dragondance'], evs: {hp: 1}},
|
||||
{species: 'staraptor', ability: 'reckless', moves: ['pursuit'], evs: {hp: 1}},
|
||||
// Nidoqueen can't breed but can still get egg moves from prevos
|
||||
{species: 'nidoqueen', ability: 'poisonpoint', moves: ['charm'], evs: {hp: 1}},
|
||||
];
|
||||
illegal = TeamValidator.get('gen5ou').validateTeam(team);
|
||||
assert.strictEqual(illegal, null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user