diff --git a/PKHeX.Core/Legality/Structures/ITrainerInfo.cs b/PKHeX.Core/Legality/Structures/ITrainerInfo.cs index 25489f4fc..a3580590e 100644 --- a/PKHeX.Core/Legality/Structures/ITrainerInfo.cs +++ b/PKHeX.Core/Legality/Structures/ITrainerInfo.cs @@ -48,7 +48,11 @@ namespace PKHeX.Core { pk6.Geo1_Country = o.Country; pk6.Geo1_Region = o.Region; - pk6.SetTradeMemoryHT(true); + pk6.SetTradeMemoryHT6(true); + } + else if (pk is PK8 pk8) + { + pk8.SetTradeMemoryHT8(); } } diff --git a/PKHeX.Core/PKM/PK1.cs b/PKHeX.Core/PKM/PK1.cs index d1ade6a2f..81798e924 100644 --- a/PKHeX.Core/PKM/PK1.cs +++ b/PKHeX.Core/PKM/PK1.cs @@ -217,7 +217,7 @@ namespace PKHeX.Core pk7.Nickname = StringConverter12Transporter.GetString(RawNickname, Japanese); } - pk7.SetTradeMemoryHT(bank:true); // oh no, memories on gen7 pkm + pk7.SetTradeMemoryHT6(bank:true); // oh no, memories on gen7 pkm pk7.RefreshChecksum(); return pk7; diff --git a/PKHeX.Core/PKM/PK2.cs b/PKHeX.Core/PKM/PK2.cs index 2b9b00542..e60e6938f 100644 --- a/PKHeX.Core/PKM/PK2.cs +++ b/PKHeX.Core/PKM/PK2.cs @@ -207,7 +207,7 @@ namespace PKHeX.Core pk7.OT_Gender = OT_Gender; // Crystal pk7.OT_Friendship = pk7.HT_Friendship = PersonalTable.SM[Species].BaseFriendship; - pk7.SetTradeMemoryHT(bank: true); // oh no, memories on gen7 pkm + pk7.SetTradeMemoryHT6(bank: true); // oh no, memories on gen7 pkm // Dizzy Punch cannot be transferred { diff --git a/PKHeX.Core/PKM/PK6.cs b/PKHeX.Core/PKM/PK6.cs index 5b84576e3..a675ff057 100644 --- a/PKHeX.Core/PKM/PK6.cs +++ b/PKHeX.Core/PKM/PK6.cs @@ -443,7 +443,7 @@ namespace PKHeX.Core // Make a memory if no memory already exists. Pretty terrible way of doing this but I'd rather not overwrite existing memories. if (HT_Memory == 0) - this.SetTradeMemory(false); + this.SetTradeMemoryHT6(false); } // Maximums @@ -475,7 +475,7 @@ namespace PKHeX.Core break; } - pk7.SetTradeMemory(bank: true); // oh no, memories on gen7 pkm + pk7.SetTradeMemoryHT6(true); // oh no, memories on gen7 pkm PKMConverter.SetFirstCountryRegion(pk7); // Bank-accurate data zeroing diff --git a/PKHeX.Core/PKM/PK7.cs b/PKHeX.Core/PKM/PK7.cs index 6ee94f4fb..9cdcf487f 100644 --- a/PKHeX.Core/PKM/PK7.cs +++ b/PKHeX.Core/PKM/PK7.cs @@ -462,7 +462,7 @@ namespace PKHeX.Core if (Generation < 7) // must be transferred via bank, and must have memories { - this.SetTradeMemory(true); + this.SetTradeMemoryHT6(true); // oh no, memories on gen7 pkm // georegions cleared on 6->7, no need to set } } diff --git a/PKHeX.Core/PKM/PK8.cs b/PKHeX.Core/PKM/PK8.cs index 4aaa8cc59..6cb50db88 100644 --- a/PKHeX.Core/PKM/PK8.cs +++ b/PKHeX.Core/PKM/PK8.cs @@ -550,7 +550,7 @@ namespace PKHeX.Core if (gen < 6) OT_TextVar = OT_Memory = OT_Intensity = OT_Feeling = 0; if (gen != 8) // must be transferred via HOME, and must have memories - TradeMemory(); + this.SetTradeMemoryHT8(); // not faking HOME tracker. } private bool TradeOT(ITrainerInfo tr) @@ -573,11 +573,7 @@ namespace PKHeX.Core CurrentHandler = 1; HT_Gender = tr.Gender; HT_Language = tr.Language; - } - - // Misc Updates - public static void TradeMemory() - { + this.SetTradeMemoryHT8(); } // Maximums diff --git a/PKHeX.Core/PKM/Shared/IMemoryHT.cs b/PKHeX.Core/PKM/Shared/IMemoryHT.cs index 582ae8cf4..28d01baab 100644 --- a/PKHeX.Core/PKM/Shared/IMemoryHT.cs +++ b/PKHeX.Core/PKM/Shared/IMemoryHT.cs @@ -16,7 +16,7 @@ /// /// Sets a Link Trade memory to the . /// - public static void SetTradeMemoryHT(this IMemoryHT ht, bool bank) + public static void SetTradeMemoryHT6(this IMemoryHT ht, bool bank) { ht.HT_Memory = 4; // Link trade to [VAR: General Location] ht.HT_TextVar = bank ? 0 : 9; // Somewhere (Bank) : Pokécenter (Trade) @@ -24,6 +24,17 @@ ht.HT_Feeling = MemoryContext6.GetRandomFeeling6(4, bank ? 10 : 20); // 0-9 Bank, 0-19 Trade } + /// + /// Sets a Link Trade memory to the . + /// + public static void SetTradeMemoryHT8(this IMemoryHT ht) + { + ht.HT_Memory = 4; // Link trade to [VAR: General Location] + ht.HT_TextVar = 9; // Pokécenter (Trade) + ht.HT_Intensity = 1; + ht.HT_Feeling = MemoryContext8.GetRandomFeeling8(4, 20); // 0-19 Trade + } + /// /// Sets all values to zero. /// diff --git a/PKHeX.Core/PKM/Shared/ITrainerMemories.cs b/PKHeX.Core/PKM/Shared/ITrainerMemories.cs index 49164e35d..27680c317 100644 --- a/PKHeX.Core/PKM/Shared/ITrainerMemories.cs +++ b/PKHeX.Core/PKM/Shared/ITrainerMemories.cs @@ -3,12 +3,4 @@ public interface ITrainerMemories : IMemoryOT, IMemoryHT { } - - public static partial class Extensions - { - public static void SetTradeMemory(this ITrainerMemories m, bool bank) - { - m.SetTradeMemoryHT(bank); - } - } } diff --git a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 8/196 - Espeon - 85F87989E70A ability capsule evolved single ability.pk8 b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 8/196 - Espeon - 84F87989E70A ability capsule evolved single ability.pk8 similarity index 71% rename from Tests/PKHeX.Core.Tests/Legality/Legal/Generation 8/196 - Espeon - 85F87989E70A ability capsule evolved single ability.pk8 rename to Tests/PKHeX.Core.Tests/Legality/Legal/Generation 8/196 - Espeon - 84F87989E70A ability capsule evolved single ability.pk8 index 727c82cb0..a6859585c 100644 Binary files a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 8/196 - Espeon - 85F87989E70A ability capsule evolved single ability.pk8 and b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 8/196 - Espeon - 84F87989E70A ability capsule evolved single ability.pk8 differ