Skip to content

Commit

Permalink
Add stats get/set and batch editor suggest
Browse files Browse the repository at this point in the history
Closes #2196
  • Loading branch information
kwsch committed Dec 4, 2018
1 parent 7229ca7 commit 1d76d79
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PKHeX.Core/Editing/Bulk/BatchEditing.cs
Expand Up @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions PKHeX.Core/PKM/PKM.cs
Expand Up @@ -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 };
Expand Down

0 comments on commit 1d76d79

Please sign in to comment.