Set Max EVs for ShowdownSet`s imported onto GBPKM with unspecified EVs

https://github.com/architdate/PKHeX-Plugins/issues/48
This commit is contained in:
Kurt 2020-09-07 10:56:25 -07:00
parent 0b8989e4ce
commit 0111c3dd6f

View file

@ -199,6 +199,12 @@ namespace PKHeX.Core
pk.CurrentLevel = Set.Level; pk.CurrentLevel = Set.Level;
pk.CurrentFriendship = Set.Friendship; pk.CurrentFriendship = Set.Friendship;
pk.IVs = Set.IVs; pk.IVs = Set.IVs;
// 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 (pk is GBPKM gb && Set.EVs.All(z => z == 0))
gb.EV_HP = gb.EV_ATK = gb.EV_DEF = gb.EV_SPC = gb.EV_SPE = gb.MaxEV;
else
pk.EVs = Set.EVs; pk.EVs = Set.EVs;
// IVs have no side effects such as hidden power type in gen 8 // IVs have no side effects such as hidden power type in gen 8