misc quality of life improvements

set egg friendship
allow SetRandomIVs to use a minimum fixed IV count
This commit is contained in:
Kurt 2018-03-28 20:56:58 -07:00
parent 76b4db1477
commit e5ccae906a
2 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -903,13 +903,13 @@ namespace PKHeX.Core
/// Randomizes the IVs within game constraints.
/// </summary>
/// <returns>Randomized IVs if desired.</returns>
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++)