diff --git a/PKHeX.Core/Editing/Applicators/MoveShopRecordApplicator.cs b/PKHeX.Core/Editing/Applicators/MoveShopRecordApplicator.cs
index aa5f668f6..e27d9201a 100644
--- a/PKHeX.Core/Editing/Applicators/MoveShopRecordApplicator.cs
+++ b/PKHeX.Core/Editing/Applicators/MoveShopRecordApplicator.cs
@@ -129,7 +129,7 @@ public void SetMasteredFlag(Learnset learn, Learnset mastery, byte level, int in
///
/// Sets the "mastered" move shop flag for the encounter.
///
- public void SetEncounterMasteryFlags(ReadOnlySpan moves, Learnset mastery, byte level)
+ public void SetEncounterMasteryFlags(ReadOnlySpan moves, Learnset mastery, byte metLevel, ushort alphaMove)
{
var permit = shop.Permit;
var possible = permit.RecordPermitIndexes;
@@ -145,7 +145,14 @@ public void SetEncounterMasteryFlags(ReadOnlySpan moves, Learnset master
// and it is high enough level to master it, the game will automatically
// give it the "Mastered" flag but not the "Purchased" flag
// For moves that are not in the learnset, set as mastered.
- if (!mastery.TryGetLevelLearnMove(move, out var masteryLevel) || level >= masteryLevel)
+ if (!mastery.TryGetLevelLearnMove(move, out var masteryLevel) || metLevel >= masteryLevel)
+ shop.SetMasteredRecordFlag(index, true);
+ }
+
+ if (alphaMove != 0)
+ {
+ var index = possible.IndexOf(alphaMove);
+ if (index != -1)
shop.SetMasteredRecordFlag(index, true);
}
}
diff --git a/PKHeX.Core/Editing/Bulk/Entity/Suggestion/BatchModifications.cs b/PKHeX.Core/Editing/Bulk/Entity/Suggestion/BatchModifications.cs
index 5d4cdebb5..2d2dd2eaf 100644
--- a/PKHeX.Core/Editing/Bulk/Entity/Suggestion/BatchModifications.cs
+++ b/PKHeX.Core/Editing/Bulk/Entity/Suggestion/BatchModifications.cs
@@ -54,9 +54,9 @@ public static ModifyResult SetSuggestedMasteryData(BatchInfo info, ReadOnlySpan<
if (IsNone(propValue))
return ModifyResult.Modified;
- var e = info.Legality.EncounterMatch;
- if (e is IMasteryInitialMoveShop8 enc)
- enc.SetInitialMastery(pk);
+ var enc = info.Legality.EncounterMatch;
+ if (enc is IMasteryInitialMoveShop8 shop)
+ shop.SetInitialMastery(pk, enc);
if (IsAll(propValue))
{
t.SetPurchasedFlagsAll(pk);
diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterSlot8a.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterSlot8a.cs
index 648f920be..5cebb880f 100644
--- a/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterSlot8a.cs
+++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterSlot8a.cs
@@ -125,9 +125,7 @@ private void SetEncounterMoves(PA8 pk, byte level)
var (learn, mastery) = GetLevelUpInfo();
LoadInitialMoveset(pk, moves, learn, level);
pk.SetMoves(moves);
- pk.SetEncounterMasteryFlags(moves, mastery, level);
- if (pk.AlphaMove != 0)
- pk.SetMasteryFlagMove(pk.AlphaMove);
+ pk.SetEncounterMasteryFlags(moves, mastery, level, pk.AlphaMove);
}
public void LoadInitialMoveset(PA8 pa8, Span moves, Learnset learn, byte level)
diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterStatic8a.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterStatic8a.cs
index c27d66f19..e4c9898d2 100644
--- a/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterStatic8a.cs
+++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8a/EncounterStatic8a.cs
@@ -133,9 +133,7 @@ private void SetEncounterMoves(PA8 pk, byte level)
var (learn, mastery) = GetLevelUpInfo();
LoadInitialMoveset(pk, moves, learn, level);
pk.SetMoves(moves);
- pk.SetEncounterMasteryFlags(moves, mastery, level);
- if (pk.AlphaMove != 0)
- pk.SetMasteryFlagMove(pk.AlphaMove);
+ pk.SetEncounterMasteryFlags(moves, mastery, level, pk.AlphaMove);
}
public (Learnset Learn, Learnset Mastery) GetLevelUpInfo() => LearnSource8LA.GetLearnsetAndMastery(Species, Form);
diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8a/IMasteryInitialMoveShop8.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8a/IMasteryInitialMoveShop8.cs
index c4e571b60..ececbda89 100644
--- a/PKHeX.Core/Legality/Encounters/Templates/Gen8a/IMasteryInitialMoveShop8.cs
+++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8a/IMasteryInitialMoveShop8.cs
@@ -10,18 +10,18 @@ public interface IMasteryInitialMoveShop8
(Learnset Learn, Learnset Mastery) GetLevelUpInfo();
void LoadInitialMoveset(PA8 pa8, Span moves, Learnset learn, byte level);
bool IsForcedMasteryCorrect(PKM pk);
- void SetInitialMastery(PKM pk)
+ void SetInitialMastery(PKM pk, T enc) where T : ISpeciesForm
{
if (pk is PA8 pa8)
- SetInitialMastery(pa8);
+ SetInitialMastery(pa8, enc);
}
- void SetInitialMastery(PA8 pk)
+ void SetInitialMastery(PA8 pk, T enc) where T : ISpeciesForm
{
Span moves = stackalloc ushort[4];
- var level = pk.MetLevel;
- var (learn, mastery) = LearnSource8LA.GetLearnsetAndMastery(pk.Species, pk.Form);
- LoadInitialMoveset(pk, moves, learn, level);
- pk.SetEncounterMasteryFlags(moves, mastery, level);
+ var metLevel = pk.MetLevel;
+ var (learn, mastery) = LearnSource8LA.GetLearnsetAndMastery(enc.Species, enc.Form);
+ LoadInitialMoveset(pk, moves, learn, metLevel);
+ pk.SetEncounterMasteryFlags(moves, mastery, metLevel, pk.AlphaMove);
}
}
diff --git a/PKHeX.Core/PKM/Util/Conversion/IEntityRejuvenator.cs b/PKHeX.Core/PKM/Util/Conversion/IEntityRejuvenator.cs
index ca7803f61..8f7cff07e 100644
--- a/PKHeX.Core/PKM/Util/Conversion/IEntityRejuvenator.cs
+++ b/PKHeX.Core/PKM/Util/Conversion/IEntityRejuvenator.cs
@@ -124,8 +124,8 @@ private static void ResetDataPLA(LegalityAnalysis la, IEncounterTemplate enc, PA
ResetRelearn(pa8, la);
pa8.ClearMoveShopFlags();
- if (enc is IMasteryInitialMoveShop8 e)
- e.SetInitialMastery(pa8);
+ if (enc is IMasteryInitialMoveShop8 shop)
+ shop.SetInitialMastery(pa8, enc);
pa8.SetMoveShopFlags(pa8);
}
diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs
index 6bffa1d37..767560b03 100644
--- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs
+++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs
@@ -1965,8 +1965,9 @@ private void B_MoveShop_Click(object sender, EventArgs e)
if (ModifierKeys == Keys.Shift)
{
m.ClearMoveShopFlags();
- if (Legality.EncounterMatch is IMasteryInitialMoveShop8 enc)
- enc.SetInitialMastery(Entity);
+ var enc = Legality.EncounterMatch;
+ if (enc is IMasteryInitialMoveShop8 shop)
+ shop.SetInitialMastery(Entity, enc);
m.SetMoveShopFlags(Entity);
UpdateLegality();
return;