From e86b8c670f115f2fa418c58f743a330060964cfa Mon Sep 17 00:00:00 2001 From: pokecal Date: Tue, 28 Nov 2017 03:35:49 +0900 Subject: [PATCH] add Crystal GS EventFlags have checked with US ver. --- PKHeX.Core/PKHeX.Core.csproj | 2 ++ PKHeX.Core/Resources/text/script/flags_c_en.txt | 3 +++ PKHeX.Core/Saves/SAV2.cs | 8 ++++++++ PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs | 3 +++ 4 files changed, 16 insertions(+) create mode 100644 PKHeX.Core/Resources/text/script/flags_c_en.txt diff --git a/PKHeX.Core/PKHeX.Core.csproj b/PKHeX.Core/PKHeX.Core.csproj index 6a60a056c..d60401d38 100644 --- a/PKHeX.Core/PKHeX.Core.csproj +++ b/PKHeX.Core/PKHeX.Core.csproj @@ -610,6 +610,7 @@ + @@ -1255,6 +1256,7 @@ + diff --git a/PKHeX.Core/Resources/text/script/flags_c_en.txt b/PKHeX.Core/Resources/text/script/flags_c_en.txt new file mode 100644 index 000000000..8fdeefa81 --- /dev/null +++ b/PKHeX.Core/Resources/text/script/flags_c_en.txt @@ -0,0 +1,3 @@ +0190 Kurt checkable GS ball +0191 Kurt ready to return GS ball (Combine with avove check) +0192 Putable GS ball in Ilex Forest Shrine \ No newline at end of file diff --git a/PKHeX.Core/Saves/SAV2.cs b/PKHeX.Core/Saves/SAV2.cs index 503312446..49d382963 100644 --- a/PKHeX.Core/Saves/SAV2.cs +++ b/PKHeX.Core/Saves/SAV2.cs @@ -117,6 +117,10 @@ namespace PKHeX.Core if (!Exportable) ClearBoxes(); + + if (Version == GameVersion.C){ + EventFlag = Japanese || Korean ? 0x1800 : 0x2600; + } } private const int SIZE_RESERVED = 0x8000; // unpacked box data @@ -220,6 +224,10 @@ namespace PKHeX.Core public override int MaxMoney => 999999; public override int MaxCoins => 9999; + // not correct, but whole contains. Data[EventFlag+0x22F]=Data[0x1A2F] means repel count. + protected override int EventFlagMax => Version == GameVersion.C ? 0x230 << 3 : base.EventFlagMax; + protected override int EventConstMax => Version == GameVersion.C ? 0 : base.EventConstMax; + public override int BoxCount => Japanese ? 9 : 14; public override int MaxEV => 65535; public override int MaxIV => 15; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs index c8ac2632d..bf137df4e 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs @@ -146,6 +146,9 @@ namespace PKHeX.WinForms case GameVersion.FRLG: gamePrefix = "frlg"; break; + case GameVersion.C: + gamePrefix = "c"; + break; default: return null; }