Handle Ranked Battle Series 7 permissions

Closes #3070
Exclude all classified as Legends; everything else is permitted assuming it can exist in SW/SH.

Co-Authored-By: Chris <28743231+Bappsack@users.noreply.github.com>
This commit is contained in:
Kurt 2020-11-02 16:38:00 -08:00
parent 51c872f4e1
commit c60ae57ab0

View file

@ -403,20 +403,12 @@ namespace PKHeX.Core
// Clamp to permitted species // Clamp to permitted species
var spec = pkm.Species; var spec = pkm.Species;
if (spec > Legal.MaxSpeciesID_8_R2)
if (638 <= spec && spec <= 640) return false;
return true; // Sub Legends if (Legal.Legends.Contains(spec))
if (722 <= spec && spec <= 730) return false;
return true; // Gen7 starters
var pi = (PersonalInfoSWSH)PersonalTable.SWSH[spec]; var pi = (PersonalInfoSWSH)PersonalTable.SWSH[spec];
var galarDex = pi.PokeDexIndex; return pi.HP != 0; // exists in game
var armorDex = pi.ArmorDexIndex;
if (1 <= galarDex && galarDex <= 397)
return true;
if (1 <= armorDex && armorDex <= 210)
return true;
return false;
} }
private static IEnumerable<RibbonResult> GetInvalidRibbonsEvent1(PKM pkm, IEncounterable enc) private static IEnumerable<RibbonResult> GetInvalidRibbonsEvent1(PKM pkm, IEncounterable enc)