diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs
index d2e840b46..91dc7f116 100644
--- a/PKHeX.WinForms/MainWindow/Main.cs
+++ b/PKHeX.WinForms/MainWindow/Main.cs
@@ -204,7 +204,6 @@ public Main()
}
catch (Exception ex)
{
- // Todo: translate this
ErrorWindow.ShowErrorDialog("An error occurred while attempting to auto-load your save file.", ex, true);
}
@@ -894,7 +893,17 @@ private void openSAV(SaveFile sav, string path)
}
}
// Finish setting up the save file.
- if (sav.Generation == 3 && (sav.IndeterminateGame || ModifierKeys == Keys.Control))
+ if (sav.Generation == 1)
+ {
+ // Ask the user if it is a VC save file or if it is from a physical cartridge.
+ // Necessary for legality checking possibilities that are only obtainable on GSC (non VC) or event distributions.
+ var drVC = WinFormsUtil.Prompt(MessageBoxButtons.YesNoCancel, $"{sav.Version} Save File detected. Is this a Virtual Console Save File?",
+ "Yes: Virtual Console" + Environment.NewLine + "No: Physical Cartridge");
+ if (drVC == DialogResult.Cancel)
+ return;
+ Legal.AllowGBCartEra = drVC == DialogResult.No; // physical cart selected
+ }
+ else if (sav.Generation == 3 && (sav.IndeterminateGame || ModifierKeys == Keys.Control))
{
// Hacky cheats invalidated the Game Code value.
var drGame = WinFormsUtil.Prompt(MessageBoxButtons.YesNoCancel,
@@ -1670,7 +1679,7 @@ private void setMarkings()
}
}
// Clicked Label Shortcuts //
- private bool QR6Notified = false;
+ private bool QR6Notified;
private void clickQR(object sender, EventArgs e)
{
if (ModifierKeys == Keys.Alt)
diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs
index 463c0c611..98f7e08be 100644
--- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs
+++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs
@@ -423,7 +423,10 @@ private void B_GenTID_Click(object sender, EventArgs e)
{011, "Link Trades"},
{012, "Link Battles"},
{013, "Link Battle Wins"},
+ {014, "Link Battle Losses"},
{015, "Battle Spot Battles"},
+ {016, "Battle Spot Wins"},
+ {017, "Battle Spot Losses"},
{018, "Mart Stack Purchases"},
{019, "Money Spent"},
{020, "Pokémon deposited at Nursery"},
diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs
index 6df04e9a6..ff0357e64 100644
--- a/PKHeX/Legality/Checks.cs
+++ b/PKHeX/Legality/Checks.cs
@@ -209,7 +209,7 @@ private void verifyNickname()
var et = EncounterOriginal as EncounterTrade;
if (et?.TID == 0) // Gen1 Trade
{
- if (!Legal.getEncounterTrade1Valid(pkm, et))
+ if (!Legal.getEncounterTrade1Valid(pkm))
AddLine(Severity.Invalid, "Incorrect OT name for RBY in-game trade.", CheckIdentifier.Trainer);
}
else // Gen2
@@ -567,7 +567,7 @@ private CheckResult verifyEncounterTrade()
}
private CheckResult verifyEncounterG12()
{
- var obj = Legal.getEncounter12(pkm, pkm.Format < 3);
+ var obj = Legal.getEncounter12(pkm, Legal.AllowGBCartEra && pkm.Format < 3);
if (obj == null)
return new CheckResult(Severity.Invalid, "Unknown encounter.", CheckIdentifier.Encounter);
@@ -1619,11 +1619,18 @@ private void verifyHTMemory()
if (!History.Valid)
return;
- if (pkm.GenNumber == 7 || pkm.GenNumber == 1)
+ if (pkm.Format >= 7)
{
- bool check = pkm.VC1 || pkm.HT_Memory != 0;
- if (!check)
+ /*
+ * Bank Transfer adds in the Link Trade Memory.
+ * Trading 7<->7 between games (not Bank) clears this data.
+ */
+ if (pkm.HT_Memory == 0)
+ {
+ if (pkm.HT_TextVar != 0 || pkm.HT_Intensity != 0 || pkm.HT_Feeling != 0)
+ AddLine(Severity.Invalid, "HT memory not cleared properly.", CheckIdentifier.Memory);
return;
+ }
if (pkm.HT_Memory != 4)
AddLine(Severity.Invalid, "Should have a Link Trade HT Memory.", CheckIdentifier.Memory);
diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs
index 48f18f30d..e480f75cf 100644
--- a/PKHeX/Legality/Core.cs
+++ b/PKHeX/Legality/Core.cs
@@ -7,8 +7,11 @@ namespace PKHeX.Core
{
public static partial class Legal
{
- // Event Database(s)
- public static MysteryGift[] MGDB_G6, MGDB_G7 = new MysteryGift[0];
+ /// Event Database for a given Generation
+ public static MysteryGift[] MGDB_G4, MGDB_G5, MGDB_G6, MGDB_G7 = new MysteryGift[0];
+
+ /// Setting to specify if an analysis should permit data sourced from the physical cartridge era of GameBoy games.
+ public static bool AllowGBCartEra = false;
// Gen 1
private static readonly Learnset[] LevelUpRB = Learnset1.getArray(Resources.lvlmove_rb, MaxSpeciesID_1);
@@ -505,7 +508,7 @@ private static EncounterTrade getValidEncounterTradeVC1(PKM pkm, DexLevel[] p, E
return new Tuple