From 5f456d705cc2781899636d5599621311008191aa Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 13 Nov 2018 19:16:14 -0800 Subject: [PATCH] Add misc setup objects --- .../Substructures/Gen7/BelugaBlockIndex.cs | 29 ++++++++++++++ .../Saves/Substructures/Gen7/EventVarType.cs | 34 ++++++++++++++++ .../Saves/Substructures/Gen7/IEventWork.cs | 23 +++++++++++ PKHeX.Core/Saves/Substructures/Gen7/MyItem.cs | 8 ++++ .../Saves/Substructures/Gen7/PouchSize7b.cs | 40 +++++++++++++++++++ 5 files changed, 134 insertions(+) create mode 100644 PKHeX.Core/Saves/Substructures/Gen7/BelugaBlockIndex.cs create mode 100644 PKHeX.Core/Saves/Substructures/Gen7/EventVarType.cs create mode 100644 PKHeX.Core/Saves/Substructures/Gen7/IEventWork.cs create mode 100644 PKHeX.Core/Saves/Substructures/Gen7/MyItem.cs create mode 100644 PKHeX.Core/Saves/Substructures/Gen7/PouchSize7b.cs diff --git a/PKHeX.Core/Saves/Substructures/Gen7/BelugaBlockIndex.cs b/PKHeX.Core/Saves/Substructures/Gen7/BelugaBlockIndex.cs new file mode 100644 index 000000000..af88036c9 --- /dev/null +++ b/PKHeX.Core/Saves/Substructures/Gen7/BelugaBlockIndex.cs @@ -0,0 +1,29 @@ +namespace PKHeX.Core +{ + public enum BelugaBlockIndex + { + /* 00 @ 0x00000, len = 0x00D90 */ MyItem, + /* 01 @ 0x00E00, len = 0x00200 */ _01, + /* 02 @ 0x01000, len = 0x00168 */ MyStatus, + /* 03 @ 0x01200, len = 0x01800 */ EventWork, + /* 04 @ 0x02A00, len = 0x020E8 */ Zukan, + /* 05 @ 0x04C00, len = 0x00930 */ Misc, // rival stuff + /* 06 @ 0x05600, len = 0x00004 */ ConfigSave, + /* 07 @ 0x05800, len = 0x00130 */ PlayerGeoLocation, + /* 08 @ 0x05A00, len = 0x00012 */ PokeListHeader, + /* 09 @ 0x05C00, len = 0x3F7A0 */ PokeListPokemon, + /* 10 @ 0x45400, len = 0x00008 */ PlayTime, + /* 11 @ 0x45600, len = 0x00E90 */ _11, + /* 12 @ 0x46600, len = 0x010A4 */ _12, + /* 13 @ 0x47800, len = 0x000F0 */ _13, + /* 14 @ 0x47A00, len = 0x06010 */ _14, + /* 15 @ 0x4DC00, len = 0x00200 */ _15, // stuff containing data about recent captures? + /* 16 @ 0x4DE00, len = 0x00098 */ _16, + /* 17 @ 0x4E000, len = 0x00068 */ _17, + /* 18 @ 0x4E200, len = 0x69780 */ GoGoPark, + /* 19 @ 0xB7A00, len = 0x000B0 */ GoGoParkNames, + /* 20 @ 0xB7C00, len = 0x00940 */ _20, // Go Park Names + + Record, + } +} diff --git a/PKHeX.Core/Saves/Substructures/Gen7/EventVarType.cs b/PKHeX.Core/Saves/Substructures/Gen7/EventVarType.cs new file mode 100644 index 000000000..3d03f3748 --- /dev/null +++ b/PKHeX.Core/Saves/Substructures/Gen7/EventVarType.cs @@ -0,0 +1,34 @@ +namespace PKHeX.Core +{ + public enum EventVarType + { + /// + /// Toggles data in the map. + /// + Zone, + + /// + /// Toggles certain game features on and off. + /// + System, + + /// + /// Hides overworld entities if flag is set. + /// + /// Flag only + Vanish, + + /// + /// Tweaks overworld entities depending on the work value. + /// + /// Work Value only + /// + /// + Scene = Vanish, + + /// + /// Tracks game progress. + /// + Event, + } +} \ No newline at end of file diff --git a/PKHeX.Core/Saves/Substructures/Gen7/IEventWork.cs b/PKHeX.Core/Saves/Substructures/Gen7/IEventWork.cs new file mode 100644 index 000000000..fbb4aae6f --- /dev/null +++ b/PKHeX.Core/Saves/Substructures/Gen7/IEventWork.cs @@ -0,0 +1,23 @@ +namespace PKHeX.Core +{ + public interface IEventWork + { + int MaxFlag { get; } + int MaxWork { get; } + + T GetWork(int index); + void SetWork(int index, T value); + T GetWork(EventVarType type, int index); + void SetWork(EventVarType type, int index, T value); + + bool GetFlag(int index); + void SetFlag(int index, bool value = true); + bool GetFlag(EventVarType type, int index); + void SetFlag(EventVarType type, int index, bool value = true); + + EventVarType GetFlagType(int index, out int subIndex); + EventVarType GetWorkType(int index, out int subIndex); + int GetFlagRawIndex(EventVarType type, int index); + int GetWorkRawIndex(EventVarType type, int index); + } +} \ No newline at end of file diff --git a/PKHeX.Core/Saves/Substructures/Gen7/MyItem.cs b/PKHeX.Core/Saves/Substructures/Gen7/MyItem.cs new file mode 100644 index 000000000..0f0df519d --- /dev/null +++ b/PKHeX.Core/Saves/Substructures/Gen7/MyItem.cs @@ -0,0 +1,8 @@ +namespace PKHeX.Core +{ + public abstract class MyItem : SaveBlock + { + public abstract InventoryPouch[] Inventory { get; set; } + protected MyItem(SaveFile SAV) : base(SAV) { } + } +} \ No newline at end of file diff --git a/PKHeX.Core/Saves/Substructures/Gen7/PouchSize7b.cs b/PKHeX.Core/Saves/Substructures/Gen7/PouchSize7b.cs new file mode 100644 index 000000000..fb4ebcf81 --- /dev/null +++ b/PKHeX.Core/Saves/Substructures/Gen7/PouchSize7b.cs @@ -0,0 +1,40 @@ +namespace PKHeX.Core +{ + public static class PouchSize7b + { + /// + /// Pouch0 Item Max Capacity + /// + public const int Medicine = 60; + + /// + /// Pouch1 Item Max Capacity + /// + public const int TM = 108; + + /// + /// Pouch2 Item Max Capacity + /// + public const int Candy = 200; + + /// + /// Pouch3 Item Max Capacity + /// + public const int PowerUp = 150; + + /// + /// Pouch4 Item Max Capacity + /// + public const int Catching = 50; + + /// + /// Pouch5 Item Max Capacity + /// + public const int Battle = 150; + + /// + /// Pouch6 Item Max Capacity + /// + public const int Items = 150; + } +} \ No newline at end of file