Heal PP on transfer

force everything to their current pp count
This commit is contained in:
Kurt 2019-12-26 15:28:04 -08:00
parent 26b4c991cb
commit d736f24bb7
4 changed files with 61 additions and 10 deletions

View file

@ -600,10 +600,66 @@ namespace PKHeX.Core
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();

View file

@ -146,10 +146,6 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
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

View file

@ -145,10 +145,6 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
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

View file

@ -473,6 +473,7 @@ namespace PKHeX.Core
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();