From e5ccae906ae1be5cf9a00f695d74da10261417f0 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 28 Mar 2018 20:56:58 -0700 Subject: [PATCH] misc quality of life improvements set egg friendship allow SetRandomIVs to use a minimum fixed IV count --- PKHeX.Core/Legality/Encounters/EncounterEgg.cs | 5 ++++- PKHeX.Core/PKM/PKM.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterEgg.cs b/PKHeX.Core/Legality/Encounters/EncounterEgg.cs index d106081a9..d106ede0e 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterEgg.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterEgg.cs @@ -30,7 +30,9 @@ namespace PKHeX.Core var moves = Legal.GetEggMoves(pk, Species, pk.AltForm, Game); pk.Moves = moves; pk.SetMaximumPPCurrent(moves); - pk.SetRandomIVs(); + pk.OT_Friendship = pk.PersonalInfo.BaseFriendship; + + pk.SetRandomIVs(flawless: 3); if (pk.Format <= 2 && Game != GameVersion.C) return pk; @@ -56,6 +58,7 @@ namespace PKHeX.Core { pk.HT_Name = SAV.OT; pk.HT_Gender = SAV.Gender; + pk.HT_Friendship = pk.OT_Friendship; if (SAV.Generation == 6) { pk.Geo1_Country = SAV.Country; diff --git a/PKHeX.Core/PKM/PKM.cs b/PKHeX.Core/PKM/PKM.cs index 1756db812..2f2a4899d 100644 --- a/PKHeX.Core/PKM/PKM.cs +++ b/PKHeX.Core/PKM/PKM.cs @@ -903,13 +903,13 @@ namespace PKHeX.Core /// Randomizes the IVs within game constraints. /// /// Randomized IVs if desired. - public int[] SetRandomIVs() + public int[] SetRandomIVs(int? flawless = null) { int[] ivs = new int[6]; for (int i = 0; i < 6; i++) ivs[i] = (int)(Util.Rand32() & MaxIV); - int count = GetFlawlessIVCount(); + int count = flawless ?? GetFlawlessIVCount(); if (count != 0) { for (int i = 0; i < count; i++)