mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-15 17:00:23 -05:00
Fix DW and baby-only move compatibility checking
PS already tracks which evolution level an egg move or event pokemon learns a move from, but apparently this was not tracked for DW moves. This fixes a compatibility interaction between DW Marill and Azurill moves.
This commit is contained in:
parent
1ac1f2be5e
commit
7a90fa7622
|
|
@ -1545,6 +1545,9 @@ export class TeamValidator {
|
|||
if (source.charAt(1) === 'E') {
|
||||
if (babyEvo && source.slice(2) === babyEvo) return false;
|
||||
}
|
||||
if (source.charAt(1) === 'D') {
|
||||
if (babyEvo && source.slice(2) === babyEvo) return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (!setSources.sources.length && !setSources.sourcesBefore) {
|
||||
|
|
@ -1748,7 +1751,7 @@ export class TeamValidator {
|
|||
} else if (learned.charAt(1) === 'D') {
|
||||
// DW moves:
|
||||
// only if that was the source
|
||||
moveSources.add(learned);
|
||||
moveSources.add(learned + template.id);
|
||||
} else if (learned.charAt(1) === 'V') {
|
||||
// Virtual Console moves:
|
||||
// only if that was the source
|
||||
|
|
|
|||
|
|
@ -179,6 +179,12 @@ describe('Team Validator', function () {
|
|||
illegal = TeamValidator.get('gen7ou').validateTeam(team);
|
||||
assert(illegal);
|
||||
|
||||
team = [
|
||||
{species: 'marill', ability: 'hugepower', moves: ['splash', 'aquajet'], evs: {hp: 1}},
|
||||
];
|
||||
illegal = TeamValidator.get('gen7ou').validateTeam(team);
|
||||
assert(illegal);
|
||||
|
||||
team = [
|
||||
{species: 'mamoswine', ability: 'oblivious', moves: ['tackle', 'iceshard', 'amnesia', 'furyattack'], evs: {hp: 1}},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user