mirror of
https://github.com/kwsch/PKHeX
synced 2024-09-21 23:02:00 +00:00
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:
parent
30851a0059
commit
2a2361220d
1 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue