diff --git a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs index ce0ad077f..c73c8a6d1 100644 --- a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs +++ b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs @@ -346,6 +346,8 @@ private static void ParseMovesByGeneration(PKM pkm, IList res, res[m] = new CheckMoveResult(Tutor, gen, Valid, native ? LMoveSourceTutor : string.Format(LMoveFTutor_0, gen), Move); else if (gen == info.Generation && learnInfo.Source.SpecialSource.Contains(move)) res[m] = new CheckMoveResult(Special, gen, Valid, LMoveSourceSpecial, Move); + else if (gen >= 8 && GetIsSharedEggMove(pkm, gen, move)) + res[m] = new CheckMoveResult(Shared, gen, Valid, native ? LMoveSourceShared : string.Format(LMoveSourceSharedF, gen), Move); if (gen >= 3 || !IsCheckValid(res[m])) continue; @@ -367,6 +369,18 @@ private static void ParseMovesByGeneration(PKM pkm, IList res, } } + private static bool GetIsSharedEggMove(PKM pkm, int gen, int move) + { + if (gen < 8 || pkm.IsEgg) + return false; + var table = PersonalTable.SWSH; + var entry = (PersonalInfoSWSH)table.GetFormeEntry(pkm.Species, pkm.AltForm); + var baseSpecies = entry.BaseSpecies; + var baseForm = entry.BaseSpeciesForm; + var egg = MoveEgg.GetEggMoves(pkm, baseSpecies, baseForm, GameVersion.SW); + return egg.Contains(move); + } + private static void ParseMovesByGeneration12(PKM pkm, CheckMoveResult[] res, int[] moves, int gen, LegalInfo info, LearnInfo learnInfo) { // Mark the gen 1 exclusive moves as illegal because the pokemon also have Non tradeback egg moves. diff --git a/PKHeX.Core/Legality/LegalityCheckStrings.cs b/PKHeX.Core/Legality/LegalityCheckStrings.cs index e04ad0936..f98276273 100644 --- a/PKHeX.Core/Legality/LegalityCheckStrings.cs +++ b/PKHeX.Core/Legality/LegalityCheckStrings.cs @@ -352,6 +352,8 @@ public static class LegalityCheckStrings public static string LMoveNincada { get; set; } = "Only one Ninjask move allowed."; public static string LMoveNincadaEvo { get; set; } = "Learned by evolving Nincada into Ninjask."; public static string LMoveNincadaEvoF_0 { get; set; } = "Learned by evolving Nincada into Ninjask in Generation {0}."; + public static string LMoveSourceShared { get; set; } = "Shared Non-Relearn Move."; + public static string LMoveSourceSharedF { get; set; } = "Shared Non-Relearn Move in Generation {0}."; public static string LMoveRelearnDexNav { get; set; } = "Not an expected DexNav move."; public static string LMoveRelearnEgg { get; set; } = "Base Egg move."; diff --git a/PKHeX.Core/Legality/Structures/CheckMoveResult.cs b/PKHeX.Core/Legality/Structures/CheckMoveResult.cs index e0c1d4c78..1f0dd66f6 100644 --- a/PKHeX.Core/Legality/Structures/CheckMoveResult.cs +++ b/PKHeX.Core/Legality/Structures/CheckMoveResult.cs @@ -18,6 +18,7 @@ public enum MoveSource SpecialEgg, ShedinjaEvo, Sketch, + Shared, } /// diff --git a/PKHeX.Core/PersonalInfo/PersonalInfoSWSH.cs b/PKHeX.Core/PersonalInfo/PersonalInfoSWSH.cs index 58fd14a49..3cc040a3f 100644 --- a/PKHeX.Core/PersonalInfo/PersonalInfoSWSH.cs +++ b/PKHeX.Core/PersonalInfo/PersonalInfoSWSH.cs @@ -101,7 +101,11 @@ public override int[] Abilities } } - public int BaseSpecies { get => BitConverter.ToUInt16(Data, 0x4C); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4C); } + public int Species { get => BitConverter.ToUInt16(Data, 0x4C); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4C); } + + public int BaseSpecies { get => BitConverter.ToUInt16(Data, 0x56); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x56); } + public int BaseSpeciesForm { get => BitConverter.ToUInt16(Data, 0x58); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x58); } + public int Flags { get => BitConverter.ToUInt16(Data, 0x58); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x5A); } // not sure public int PokeDexIndex { get => BitConverter.ToUInt16(Data, 0x5C); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x5C); } } } \ No newline at end of file