From d736f24bb7398f4a7dfc4e3e0c103d0e518e7f86 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 26 Dec 2019 15:28:04 -0800 Subject: [PATCH] Heal PP on transfer force everything to their current pp count --- PKHeX.Core/PKM/PB7.cs | 60 +++++++++++++++++++++++++++++++++++++++++-- PKHeX.Core/PKM/PK1.cs | 5 +--- PKHeX.Core/PKM/PK2.cs | 5 +--- PKHeX.Core/PKM/PK6.cs | 1 + 4 files changed, 61 insertions(+), 10 deletions(-) diff --git a/PKHeX.Core/PKM/PB7.cs b/PKHeX.Core/PKM/PB7.cs index 266288bbc..1e1f3f5ce 100644 --- a/PKHeX.Core/PKM/PB7.cs +++ b/PKHeX.Core/PKM/PB7.cs @@ -600,10 +600,66 @@ public static byte GetWeightScalar(float height, float weight, int avgHeight, in public PK8 ConvertToPK8() { - var pk8 = new PK8(); + var pk8 = new PK8() + { + EncryptionConstant = EncryptionConstant, + Species = Species, + TID = TID, + SID = SID, + EXP = EXP, + PID = PID, + Ability = Ability, + AbilityNumber = AbilityNumber, + Markings = Markings, + Language = Language, + EV_HP = EV_HP, + EV_ATK = EV_ATK, + EV_DEF = EV_DEF, + EV_SPA = EV_SPA, + EV_SPD = EV_SPD, + EV_SPE = EV_SPE, + Move1 = Move1, + Move2 = Move2, + Move3 = Move3, + Move4 = Move4, + Move1_PPUps = Move1_PPUps, + Move2_PPUps = Move2_PPUps, + Move3_PPUps = Move3_PPUps, + Move4_PPUps = Move4_PPUps, + RelearnMove1 = RelearnMove1, + RelearnMove2 = RelearnMove2, + RelearnMove3 = RelearnMove3, + RelearnMove4 = RelearnMove4, + IV_HP = IV_HP, + IV_ATK = IV_ATK, + IV_DEF = IV_DEF, + IV_SPA = IV_SPA, + IV_SPD = IV_SPD, + IV_SPE = IV_SPE, + IsEgg = IsEgg, + IsNicknamed = IsNicknamed, + FatefulEncounter = FatefulEncounter, + Gender = Gender, + AltForm = AltForm, + Nature = Nature, + Nickname = Nickname, + Version = Version, + OT_Name = OT_Name, + MetDate = MetDate, + EggMetDate = EggMetDate, + Met_Location = Met_Location, + Ball = Ball, + Met_Level = Met_Level, + OT_Gender = OT_Gender, - // todo: take from PK7.ConvertToPK8() + // todo: memories + OT_Memory = OT_Memory, + OT_TextVar = OT_TextVar, + OT_Feeling = OT_Feeling, + OT_Intensity = OT_Intensity, + }; + pk8.HealPP(); // Fix Checksum pk8.RefreshChecksum(); diff --git a/PKHeX.Core/PKM/PK1.cs b/PKHeX.Core/PKM/PK1.cs index ccd0d1a33..c8d4ceec3 100644 --- a/PKHeX.Core/PKM/PK1.cs +++ b/PKHeX.Core/PKM/PK1.cs @@ -146,10 +146,6 @@ public PK7 ConvertToPK7() Move2_PPUps = Move2_PPUps, Move3_PPUps = Move3_PPUps, Move4_PPUps = Move4_PPUps, - Move1_PP = Move1_PP, - Move2_PP = Move2_PP, - Move3_PP = Move3_PP, - Move4_PP = Move4_PP, Met_Location = Legal.Transfer1, // "Kanto region", hardcoded. Gender = Gender, OT_Name = StringConverter12.GetG1ConvertedString(otname, Japanese), @@ -164,6 +160,7 @@ public PK7 ConvertToPK7() Geo1_Country = PKMConverter.Country, Geo1_Region = PKMConverter.Region }; + pk7.HealPP(); pk7.Language = TransferLanguage(PKMConverter.Language); pk7.Nickname = SpeciesName.GetSpeciesNameGeneration(pk7.Species, pk7.Language, pk7.Format); if (otname[0] == StringConverter12.G1TradeOTCode) // Ingame Trade diff --git a/PKHeX.Core/PKM/PK2.cs b/PKHeX.Core/PKM/PK2.cs index 81920f4ba..55e18fae7 100644 --- a/PKHeX.Core/PKM/PK2.cs +++ b/PKHeX.Core/PKM/PK2.cs @@ -145,10 +145,6 @@ public PK7 ConvertToPK7() Move2_PPUps = Move2_PPUps, Move3_PPUps = Move3_PPUps, Move4_PPUps = Move4_PPUps, - Move1_PP = Move1_PP, - Move2_PP = Move2_PP, - Move3_PP = Move3_PP, - Move4_PP = Move4_PP, Met_Location = Legal.Transfer2, // "Johto region", hardcoded. Gender = Gender, IsNicknamed = false, @@ -163,6 +159,7 @@ public PK7 ConvertToPK7() Geo1_Country = PKMConverter.Country, Geo1_Region = PKMConverter.Region }; + pk7.HealPP(); pk7.Language = TransferLanguage(PKMConverter.Language); pk7.Nickname = SpeciesName.GetSpeciesNameGeneration(pk7.Species, pk7.Language, pk7.Format); if (otname[0] == StringConverter12.G1TradeOTCode) // Ingame Trade diff --git a/PKHeX.Core/PKM/PK6.cs b/PKHeX.Core/PKM/PK6.cs index c13bc0105..2f9a98840 100644 --- a/PKHeX.Core/PKM/PK6.cs +++ b/PKHeX.Core/PKM/PK6.cs @@ -473,6 +473,7 @@ public PK7 ConvertToPK7() pk7.Data[0x72] &= 0xFC; /* Clear lower two bits of Super training flags. */ pk7.Data[0xDE] = 0; /* Gen IV encounter type. */ + pk7.HealPP(); // Fix Checksum pk7.RefreshChecksum();