mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-26 22:10:21 +00:00
Gen2: Add MysteryGiftIsUnlocked flag in Simple Editor (#4007)
The flag indicates whether the option "Mystery Gift" has been unlocked and it is displayed in the start menu. Note: It is unlocked after talking with the little girl on the fifth floor of the Goldenrod Department Store.
This commit is contained in:
parent
0015beb8d8
commit
fda815c3e5
2 changed files with 24 additions and 0 deletions
|
@ -507,6 +507,26 @@ public sealed class SAV2 : SaveFile, ILangDeviantSave, IEventFlagArray, IEventWo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool MysteryGiftIsUnlocked
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int ofs = Offsets.MysteryGiftIsUnlocked;
|
||||||
|
if (ofs == -1)
|
||||||
|
return false;
|
||||||
|
return Data[ofs] == 0x00;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
int ofs = Offsets.MysteryGiftIsUnlocked;
|
||||||
|
if (ofs == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Data[ofs] = (byte)(value ? 0x00 : 0xFF);
|
||||||
|
Data[ofs + 2] = Data[ofs];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override IReadOnlyList<InventoryPouch> Inventory
|
public override IReadOnlyList<InventoryPouch> Inventory
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -46,6 +46,7 @@ internal sealed class SAV2Offsets
|
||||||
public int Daycare { get; }
|
public int Daycare { get; }
|
||||||
|
|
||||||
public int BlueCardPoints { get; private set; } = -1;
|
public int BlueCardPoints { get; private set; } = -1;
|
||||||
|
public int MysteryGiftIsUnlocked { get; private set; } = -1;
|
||||||
|
|
||||||
public int PouchTMHM { get; private set; } = -1;
|
public int PouchTMHM { get; private set; } = -1;
|
||||||
public int PouchItem { get; private set; } = -1;
|
public int PouchItem { get; private set; } = -1;
|
||||||
|
@ -60,6 +61,8 @@ internal sealed class SAV2Offsets
|
||||||
Rival = 0x2021;
|
Rival = 0x2021;
|
||||||
DaylightSavings = 0x2042;
|
DaylightSavings = 0x2042;
|
||||||
OtherCurrentBox = 0x284C;
|
OtherCurrentBox = 0x284C;
|
||||||
|
MysteryGiftIsUnlocked = 0xBE3; // And 0xBE5;
|
||||||
|
|
||||||
switch (version)
|
switch (version)
|
||||||
{
|
{
|
||||||
case GameVersion.GS:
|
case GameVersion.GS:
|
||||||
|
@ -125,6 +128,7 @@ internal sealed class SAV2Offsets
|
||||||
Palette = 0x204C;
|
Palette = 0x204C;
|
||||||
CurrentBox = 0x2D10;
|
CurrentBox = 0x2D10;
|
||||||
OtherCurrentBox = 0x2842;
|
OtherCurrentBox = 0x2842;
|
||||||
|
MysteryGiftIsUnlocked = 0xB51; // And 0xB53;
|
||||||
|
|
||||||
switch (version)
|
switch (version)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue