Fix gen2 met data setting

This commit is contained in:
Kurt 2018-04-01 20:25:40 -07:00
parent d4e38dded0
commit 39f1805940
2 changed files with 21 additions and 6 deletions

View File

@ -84,9 +84,17 @@ public PKM ConvertToPKM(ITrainerInfo SAV)
pk.Gender = gender = pk.GetSaneGender(gender);
pk.Nickname = PKX.GetSpeciesNameGeneration(Species, lang, Generation);
pk.Ball = 4;
pk.Met_Level = level;
pk.Met_Location = Location;
pk.MetDate = DateTime.Today;
if (pk.Format > 2 || Version == GameVersion.C)
{
pk.Met_Location = Location;
pk.Met_Level = level;
if (Version == GameVersion.C && pk is PK2 pk2 && this is EncounterSlot1 slot)
pk2.Met_TimeOfDay = slot.Time.RandomValidTime();
if (pk.Format >= 4)
pk.MetDate = DateTime.Today;
}
pk.Language = lang;
pk.SetRandomIVs(flawless: 3);

View File

@ -96,9 +96,16 @@ public PKM ConvertToPKM(ITrainerInfo SAV)
}
pk.Nickname = PKX.GetSpeciesNameGeneration(Species, lang, Generation);
pk.Ball = Ball;
pk.Met_Level = level;
pk.Met_Location = Location;
pk.MetDate = today;
if (pk.Format > 2 || Version == GameVersion.C)
{
pk.Met_Location = Location;
pk.Met_Level = level;
if (Version == GameVersion.C && pk is PK2 pk2)
pk2.Met_TimeOfDay = EncounterTime.Any.RandomValidTime();
if (pk.Format >= 4)
pk.MetDate = DateTime.Today;
}
if (EggEncounter)
{
pk.Egg_Location = EggLocation;