Add more accurate daycare egg detection

uses eventflag, different index for each game

frlg:
https://www.pokecommunity.com/showthread.php?t=302347
"Flag 0x266 is set by the game engine if an Egg is in the Daycare."

emerald:
https://www.pokecommunity.com/showthread.php?t=330008
"0x86 : Daycare Centre has egg"

rs:
https://gist.github.com/rboninsegna/a4a63c2b66c42e371a94f860eae55361
" 0x86  Egg ready at Daycare"
This commit is contained in:
Kurt 2018-09-30 21:27:36 -07:00
parent 30851a0059
commit 2a2361220d

View file

@ -557,12 +557,10 @@ namespace PKHeX.Core
public override bool? IsDaycareOccupied(int loc, int slot) => IsPKMPresent(GetDaycareSlotOffset(loc, slot));
public override void SetDaycareOccupied(int loc, int slot, bool occupied) { }
public override int GetDaycareSlotOffset(int loc, int slot) => Daycare + (slot * DaycareSlotSize);
public override bool? IsDaycareHasEgg(int loc) => GetDaycareRNGSeed(loc).Any(z => z != '0');
public override void SetDaycareHasEgg(int loc, bool hasEgg)
{
SetDaycareRNGSeed(loc, E ? Util.Rand32().ToString("X8") : Util.Rand.Next(0x10000).ToString("X4"));
}
private int EggEventFlag => GameVersion.FRLG.Contains(Version) ? 0x266 : 0x86;
public override bool? IsDaycareHasEgg(int loc) => GetEventFlag(EggEventFlag);
public override void SetDaycareHasEgg(int loc, bool hasEgg) => SetEventFlag(EggEventFlag, hasEgg);
private int GetDaycareEXPOffset(int slot)
{