diff --git a/PKHeX.Core/Editing/Bulk/BatchEditing.cs b/PKHeX.Core/Editing/Bulk/BatchEditing.cs index 224ea0cbc..7d0907ee5 100644 --- a/PKHeX.Core/Editing/Bulk/BatchEditing.cs +++ b/PKHeX.Core/Editing/Bulk/BatchEditing.cs @@ -63,7 +63,7 @@ namespace PKHeX.Core internal const string CONST_RAND = "$rand"; internal const string CONST_SHINY = "$shiny"; - private const string CONST_SUGGEST = "$suggest"; + internal const string CONST_SUGGEST = "$suggest"; private const string CONST_BYTES = "$[]"; internal const string PROP_LEGAL = "Legal"; diff --git a/PKHeX.Core/Editing/Bulk/BatchMods.cs b/PKHeX.Core/Editing/Bulk/BatchMods.cs index 99d623a6d..6897dbd12 100644 --- a/PKHeX.Core/Editing/Bulk/BatchMods.cs +++ b/PKHeX.Core/Editing/Bulk/BatchMods.cs @@ -35,6 +35,7 @@ namespace PKHeX.Core new ComplexSuggestion(nameof(PKM.RelearnMoves), (_, value, info) => BatchModifications.SetSuggestedRelearnData(info, value)), new ComplexSuggestion(PROP_RIBBONS, (_, value, info) => BatchModifications.SetSuggestedRibbons(info, value)), new ComplexSuggestion(nameof(PKM.Met_Location), (_, _, info) => BatchModifications.SetSuggestedMetData(info)), + new ComplexSuggestion("ContestStats", p => p is IContestStatsMutable, (_, value, info) => BatchModifications.SetContestStats(info.Entity, info.Legality.EncounterMatch, value)), }; private static DateTime ParseDate(string val) => DateTime.ParseExact(val, "yyyyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None); diff --git a/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs b/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs index 4f39841bf..0361fccf3 100644 --- a/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs +++ b/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs @@ -66,5 +66,20 @@ namespace PKHeX.Core pk.HealPP(); return ModifyResult.Modified; } + + /// + /// Sets the contests stats as requested. + /// + /// Pokémon to modify. + /// Encounter matched to. + /// Option to apply with + public static ModifyResult SetContestStats(PKM pk, IEncounterTemplate enc, string option) + { + if (option.Length != 0 && option[BatchEditing.CONST_SUGGEST.Length..] is not "0") + pk.SetMaxContestStats(enc); + else + pk.SetSuggestedContestStats(enc); + return ModifyResult.Modified; + } } }