From 1d76d799fdbf727febf90405d31b5c64804027c0 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 3 Dec 2018 20:53:37 -0800 Subject: [PATCH] Add stats get/set and batch editor suggest Closes #2196 --- PKHeX.Core/Editing/Bulk/BatchEditing.cs | 3 +++ PKHeX.Core/PKM/PKM.cs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/PKHeX.Core/Editing/Bulk/BatchEditing.cs b/PKHeX.Core/Editing/Bulk/BatchEditing.cs index e70efce3932..244f55f826f 100644 --- a/PKHeX.Core/Editing/Bulk/BatchEditing.cs +++ b/PKHeX.Core/Editing/Bulk/BatchEditing.cs @@ -339,6 +339,9 @@ private static ModifyResult SetSuggestedPKMProperty(string name, PKMInfo info) var PKM = info.pkm; switch (name) { + case nameof(PKM.Stats): + PKM.SetStats(PKM.GetStats(PKM.PersonalInfo)); + return ModifyResult.Modified; case nameof(IHyperTrain.HyperTrainFlags): PKM.SetSuggestedHyperTrainingData(); return ModifyResult.Modified; diff --git a/PKHeX.Core/PKM/PKM.cs b/PKHeX.Core/PKM/PKM.cs index 28cbf7d6dc2..73b1bc9b985 100644 --- a/PKHeX.Core/PKM/PKM.cs +++ b/PKHeX.Core/PKM/PKM.cs @@ -377,6 +377,18 @@ public int[] EVs } } + public int[] Stats + { + get => new[] { Stat_HPCurrent, Stat_ATK, Stat_DEF, Stat_SPE, Stat_SPA, Stat_SPD }; + set + { + if (value?.Length != 6) + return; + Stat_HPCurrent = value[0]; Stat_ATK = value[1]; Stat_DEF = value[2]; + Stat_SPE = value[3]; Stat_SPA = value[4]; Stat_SPD = value[5]; + } + } + public int[] Moves { get => new[] { Move1, Move2, Move3, Move4 };