Add more egg verification for statnature/techrecord

This commit is contained in:
Kurt 2019-12-21 14:51:52 -08:00
parent 7889a0abe6
commit 8309060298
3 changed files with 18 additions and 0 deletions

View file

@ -106,10 +106,12 @@ namespace PKHeX.Core
public static string LEggLocationTrade { get; set; } = "Able to hatch a traded Egg at Met Location.";
public static string LEggLocationTradeFail { get; set; } = "Invalid Egg Location, shouldn't be 'traded' while an Egg.";
public static string LEggMetLocationFail { get; set; } = "Can't obtain Egg from Egg Location.";
public static string LEggNature { get; set; } = "Eggs cannot have their Stat Nature changed.";
public static string LEggPokeathlon { get; set; } = "Eggs cannot have Pokéathlon stats.";
public static string LEggPokerus { get; set; } = "Eggs cannot be infected with Pokérus.";
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 LEggRelearnFlags { get; set; } = "Expected no Relearn Move Flags.";
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.";

View file

@ -199,6 +199,14 @@ namespace PKHeX.Core
var msg = string.Format(LMoveFExpect_0, moves);
data.AddLine(GetInvalid(msg, Egg));
}
if (pkm is PK8 pk8)
{
if (pk8.HasAnyMoveRecordFlag())
data.AddLine(GetInvalid(LEggRelearnFlags, Egg));
if (pk8.StatNature != pk8.Nature)
data.AddLine(GetInvalid(LEggNature, Egg));
}
}
private static void VerifyFatefulMysteryGift(LegalityAnalysis data, MysteryGift g)

View file

@ -548,6 +548,14 @@ namespace PKHeX.Core
FlagUtil.SetFlag(Data, 0x127 + ofs, index & 7, value);
}
public bool HasAnyMoveRecordFlag()
{
for (int i = 0x127; i < 0x127 + 14; i++)
if (Data[i] != 0)
return true;
return false;
}
public byte GetFromArrayD1(int index)
{
if ((uint)index >= 19)