diff --git a/PKHeX.Core/Legality/LegalityCheckStrings.cs b/PKHeX.Core/Legality/LegalityCheckStrings.cs index ca930f280..c35b401fc 100644 --- a/PKHeX.Core/Legality/LegalityCheckStrings.cs +++ b/PKHeX.Core/Legality/LegalityCheckStrings.cs @@ -111,6 +111,7 @@ public static class LegalityCheckStrings public static string LEggPP { get; set; } = "Eggs cannot have modified move PP counts."; public static string LEggPPUp { get; set; } = "Cannot apply PP Ups to an Egg."; public static string LEggShinyLeaf { get; set; } = "Eggs cannot have Shiny Leaf/Crown."; + public static string LEggShinyPokeStar { get; set; } = "Eggs cannot be a Pokéstar Studios star."; public static string LEggSpecies { get; set; } = "Can't obtain Egg for this species."; public static string LEggUnhatched { get; set; } = "Valid un-hatched Egg."; diff --git a/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs b/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs index bc23bd30c..082daf673 100644 --- a/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs @@ -23,6 +23,9 @@ public override void Verify(LegalityAnalysis data) switch (pkm) { + case PK5 pk5 when pk5.PokeStarFame != 0 && pk5.IsEgg: + data.AddLine(GetInvalid(LEggShinyPokeStar, CheckIdentifier.Egg)); + break; case PK4 pk4 when pk4.ShinyLeaf != 0: data.AddLine(GetInvalid(LEggShinyLeaf, CheckIdentifier.Egg)); break; diff --git a/PKHeX.Core/PKM/PK5.cs b/PKHeX.Core/PKM/PK5.cs index fee65bf06..870483cf6 100644 --- a/PKHeX.Core/PKM/PK5.cs +++ b/PKHeX.Core/PKM/PK5.cs @@ -8,7 +8,13 @@ public sealed class PK5 : PKM, IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetUni { private static readonly byte[] Unused = { - 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x5E, 0x63, 0x64, 0x65, 0x66, 0x67, 0x87 + 0x87, // PokeStar Fame -- this is first to prevent 0x42 from being the first ExtraByte as this byte has GUI functionality + 0x42, // Hidden Ability/NPokemon + 0x43, 0x44, 0x45, 0x46, 0x47, + 0x5E, // unused + 0x63, // last 8 bits of a 32bit ribbonset + 0x64, 0x65, 0x66, 0x67, // unused 32bit ribbonset? + 0x86, // unused }; public override byte[] ExtraBytes => Unused; @@ -239,7 +245,9 @@ public PK5(byte[] decryptedData, string ident = null) public override int Met_Level { get => Data[0x84] & ~0x80; set => Data[0x84] = (byte)((Data[0x84] & 0x80) | value); } public override int OT_Gender { get => Data[0x84] >> 7; set => Data[0x84] = (byte)((Data[0x84] & ~0x80) | value << 7); } public override int EncounterType { get => Data[0x85]; set => Data[0x85] = (byte)value; } - // 0x86-0x87 Unused + // 0x86 Unused + public byte PokeStarFame { get => Data[0x87]; set => Data[0x87] = value; } + public bool IsPokeStar { get => PokeStarFame > 250; set => PokeStarFame = 255; } #endregion #region Battle Stats