diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic7.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic7.cs index 8101da2a3..b0792a67d 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic7.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic7.cs @@ -12,6 +12,8 @@ namespace PKHeX.Core public override int Generation => 7; public IReadOnlyList Relearn { get; init; } = Array.Empty(); + public bool IsTotem => FormInfo.IsTotemForm(Species, Form); + public EncounterStatic7(GameVersion game) : base(game) { } protected override bool IsMatchLocation(PKM pkm) @@ -26,7 +28,7 @@ namespace PKHeX.Core if (SkipFormCheck) return true; - if (FormInfo.IsTotemForm(Species, Form, 7)) + if (IsTotem) { var expectForm = pkm.Format == 7 ? Form : FormInfo.GetTotemBaseForm(Species, Form); return expectForm == evo.Form; diff --git a/PKHeX.Core/Legality/Tables/FormInfo.cs b/PKHeX.Core/Legality/Tables/FormInfo.cs index 9f76fd5fa..89da84a3a 100644 --- a/PKHeX.Core/Legality/Tables/FormInfo.cs +++ b/PKHeX.Core/Legality/Tables/FormInfo.cs @@ -201,15 +201,21 @@ namespace PKHeX.Core } /// - /// Chhecks if the for the is a Totem form. + /// Checks if the for the is a Totem form. /// /// Entity species /// Entity form /// Current generation format - public static bool IsTotemForm(int species, int form, int format) + public static bool IsTotemForm(int species, int form, int format) => format == 7 && IsTotemForm(species, form); + + /// + /// Checks if the for the is a Totem form. + /// + /// Use if you aren't 100% sure the format is 7. + /// Entity species + /// Entity form + public static bool IsTotemForm(int species, int form) { - if (format != 7) - return false; if (form == 0) return false; if (!Legal.Totem_USUM.Contains(species)) diff --git a/PKHeX.Core/Legality/Verifiers/TransferVerifier.cs b/PKHeX.Core/Legality/Verifiers/TransferVerifier.cs index b7934ff70..1f3b8a41a 100644 --- a/PKHeX.Core/Legality/Verifiers/TransferVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/TransferVerifier.cs @@ -140,7 +140,7 @@ namespace PKHeX.Core } else if (enc.Generation < 8 && pkm.Format >= 8) { - if (enc is EncounterStatic7 s && FormInfo.IsTotemForm(s.Species, s.Form, 7)) + if (enc is EncounterStatic7 {IsTotem: true} s) { if (Legal.Totem_NoTransfer.Contains(s.Species)) data.AddLine(GetInvalid(LTransferBad)); diff --git a/PKHeX.Core/PKM/PK7.cs b/PKHeX.Core/PKM/PK7.cs index 90b35e687..f229cc096 100644 --- a/PKHeX.Core/PKM/PK7.cs +++ b/PKHeX.Core/PKM/PK7.cs @@ -644,7 +644,7 @@ namespace PKHeX.Core }; // Wipe Totem Forms - if (FormInfo.IsTotemForm(Species, Form, 7)) + if (FormInfo.IsTotemForm(Species, Form)) pk8.Form = FormInfo.GetTotemBaseForm(Species, Form); // Fix PP and Stats