From 4e6ff7e72c3ac329058b965aa3c9dd595b860ac2 Mon Sep 17 00:00:00 2001 From: Leonard Craft III Date: Fri, 23 Oct 2020 06:28:12 -0500 Subject: [PATCH] Validator: Allow Hidden Ability Entei/Raikou/Suicune in Gen 8 natively (#7563) --- sim/team-validator.ts | 2 +- test/sim/team-validator.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sim/team-validator.ts b/sim/team-validator.ts index 483a302da2..7804f8818a 100644 --- a/sim/team-validator.ts +++ b/sim/team-validator.ts @@ -514,7 +514,7 @@ export class TeamValidator { if (unreleasedHidden && ruleTable.has('-unreleased')) { problems.push(`${name}'s Hidden Ability is unreleased.`); - } else if (['entei', 'suicune', 'raikou'].includes(species.id) && this.minSourceGen > 1) { + } else if (dex.gen === 7 && ['entei', 'suicune', 'raikou'].includes(species.id) && this.minSourceGen > 1) { problems.push(`${name}'s Hidden Ability is only available from Virtual Console, which is not allowed in this format.`); } else if (dex.gen === 6 && ability.name === 'Symbiosis' && (set.species.endsWith('Orange') || set.species.endsWith('White'))) { diff --git a/test/sim/team-validator.js b/test/sim/team-validator.js index 5ffb2ad9bd..627cff5e49 100644 --- a/test/sim/team-validator.js +++ b/test/sim/team-validator.js @@ -579,6 +579,23 @@ describe('Team Validator', function () { assert(illegal); }); + it('should allow use of a Hidden Ability if the format has the item Ability Patch', function () { + let team = [ + {species: 'heatran', ability: 'flamebody', moves: ['sleeptalk'], evs: {hp: 1}}, + {species: 'entei', ability: 'innerfocus', moves: ['sleeptalk'], evs: {hp: 1}}, + {species: 'dracovish', ability: 'sandrush', moves: ['sleeptalk'], evs: {hp: 1}}, + {species: 'zapdos', ability: 'static', moves: ['sleeptalk'], evs: {hp: 1}}, + ]; + let illegal = TeamValidator.get('gen8vgc2021').validateTeam(team); + assert.equal(illegal, null); + + team = [ + {species: 'heatran', ability: 'flamebody', moves: ['sleeptalk'], evs: {hp: 1}}, + ]; + illegal = TeamValidator.get('gen7anythinggoes').validateTeam(team); + assert(illegal); + }); + /********************************************************* * Custom rules