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:
Samuel Magnan 2023-10-28 00:09:15 -04:00 committed by GitHub
parent 0015beb8d8
commit fda815c3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -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

View file

@ -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)
{ {