mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 22:54:14 +00:00
misc quality of life improvements
set egg friendship allow SetRandomIVs to use a minimum fixed IV count
This commit is contained in:
parent
76b4db1477
commit
e5ccae906a
2 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue