From 7a90fa7622d2f73619f48edb64478d0cbb6c2138 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Mon, 11 Nov 2019 04:41:51 +1300 Subject: [PATCH] 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. --- sim/team-validator.ts | 5 ++++- test/sim/team-validator.js | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sim/team-validator.ts b/sim/team-validator.ts index 5e4f4b4070..4896df58a9 100644 --- a/sim/team-validator.ts +++ b/sim/team-validator.ts @@ -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 diff --git a/test/sim/team-validator.js b/test/sim/team-validator.js index 88728f1164..55097bee4b 100644 --- a/test/sim/team-validator.js +++ b/test/sim/team-validator.js @@ -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}}, ];