Replace pkm.GG references with direct version checks

No longer tied to met location
This commit is contained in:
Kurt 2020-12-31 17:45:11 -08:00
parent 8bf250ff5a
commit 080f6f827d
4 changed files with 6 additions and 5 deletions

View file

@ -56,7 +56,8 @@ namespace PKHeX.Core
{
if (format != 7)
return GetPPTable(format);
return pkm.GG ? MovePP_GG : MovePP_SM;
var lgpe = pkm.Version is (int) GameVersion.GO or (int) GameVersion.GP or (int) GameVersion.GE;
return lgpe ? MovePP_GG : MovePP_SM;
}
public static IReadOnlyList<byte> GetPPTable(int format)
@ -196,7 +197,7 @@ namespace PKHeX.Core
internal static bool HasVisitedB2W2(this PKM pkm, int species) => pkm.InhabitedGeneration(5, species);
internal static bool HasVisitedORAS(this PKM pkm, int species) => pkm.InhabitedGeneration(6, species) && (pkm.AO || !pkm.IsUntraded);
internal static bool HasVisitedUSUM(this PKM pkm, int species) => pkm.InhabitedGeneration(7, species) && (pkm.USUM || !pkm.IsUntraded);
internal static bool IsMovesetRestricted(this PKM pkm, int gen) => (pkm.GG && gen == 7) || pkm.IsUntraded;
internal static bool IsMovesetRestricted(this PKM pkm, int gen) => (gen == 7 && pkm.Version is (int)GameVersion.GO or (int)GameVersion.GP or (int)GameVersion.GE) || pkm.IsUntraded;
public static bool IsValidMissingLanguage(PKM pkm)
{

View file

@ -59,7 +59,7 @@ namespace PKHeX.Core
4 => Evolves4,
5 => Evolves5,
6 => Evolves6,
7 => (pkm.GG ? Evolves7b : Evolves7),
7 => pkm.Version is (int)GO or (int)GP or (int)GE ? Evolves7b : Evolves7,
_ => Evolves8
};
}

View file

@ -13,7 +13,7 @@ namespace PKHeX.Core
if (!pkm.InhabitedGeneration(gen, species) || (pkm.PersonalInfo.Genderless && !FixedGenderFromBiGender.Contains(species)))
return Array.Empty<int>();
if (pkm.Version == 15 || pkm.GG)
if (pkm.Version is (int)GO or (int)GP or (int)GE or (int)CXD)
return Array.Empty<int>();
if (version == Any)

View file

@ -268,7 +268,7 @@ namespace PKHeX.Core
private static void AddMovesTutor7(List<int> moves, int species, int form, PKM pkm, bool specialTutors)
{
if (pkm.GG)
if (pkm.Version is (int)GameVersion.GO or (int)GameVersion.GP or (int)GameVersion.GE)
return;
var pi = PersonalTable.USUM.GetFormEntry(species, form);
moves.AddRange(TypeTutor6.Where((_, i) => pi.TypeTutors[i]));