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
var spec = pkm.Species;
if (638 <= spec && spec <= 640)
return true; // Sub Legends
if (722 <= spec && spec <= 730)
return true; // Gen7 starters
if (spec > Legal.MaxSpeciesID_8_R2)
return false;
if (Legal.Legends.Contains(spec))
return false;
var pi = (PersonalInfoSWSH)PersonalTable.SWSH[spec];
var galarDex = pi.PokeDexIndex;
var armorDex = pi.ArmorDexIndex;
if (1 <= galarDex && galarDex <= 397)
return true;
if (1 <= armorDex && armorDex <= 210)
return true;
return false;
return pi.HP != 0; // exists in game
}
private static IEnumerable<RibbonResult> GetInvalidRibbonsEvent1(PKM pkm, IEncounterable enc)