Move pk1/2 EV maxing to class

This commit is contained in:
Kurt 2021-04-20 01:50:27 -07:00
parent b64edb751d
commit d9c22b1d74
2 changed files with 4 additions and 2 deletions

View file

@ -207,7 +207,7 @@ namespace PKHeX.Core
// In Generation 1/2 Format sets, when EVs are not specified at all, it implies maximum EVs instead!
// Under this scenario, just apply maximum EVs (65535).
if (Set.EVs.All(z => z == 0))
gb.EV_HP = gb.EV_ATK = gb.EV_DEF = gb.EV_SPC = gb.EV_SPE = gb.MaxEV;
gb.MaxEVs();
else
pk.EVs = Set.EVs;
}
@ -244,7 +244,7 @@ namespace PKHeX.Core
if (pk is PB7 b)
{
for (int i = 0; i < 6; i++)
pk.SetEV(i, 0);
b.SetEV(i, 0);
b.ResetCalculatedValues();
}
}

View file

@ -225,6 +225,8 @@ namespace PKHeX.Core
return pp + (ppUpCount * Math.Min(7, pp / 5));
}
public void MaxEVs() => EV_HP = EV_ATK = EV_DEF = EV_SPC = EV_SPE = MaxEV;
/// <summary>
/// Applies <see cref="PKM.IVs"/> to the <see cref="PKM"/> to make it shiny.
/// </summary>