Force alpha move state for below learn level

This commit is contained in:
Kurt 2022-09-18 22:00:46 -07:00
parent 84be9da49d
commit 3a5aa22c6f
3 changed files with 7 additions and 3 deletions

View file

@ -67,6 +67,8 @@ public sealed record EncounterSlot8a : EncounterSlot, IAlpha, IMasteryInitialMov
pk.SetMoves(moves);
pk.SetMaximumPPCurrent(moves);
pa8.SetEncounterMasteryFlags(moves, mastery, level);
if (pa8.AlphaMove != 0)
pa8.SetMasteryFlagMove(pa8.AlphaMove);
}
public void LoadInitialMoveset(PA8 pa8, Span<ushort> moves, Learnset learn, int level)

View file

@ -55,7 +55,7 @@ public sealed record EncounterStatic8a(GameVersion Version) : EncounterStatic(Ve
var (_, slotSeed) = Overworld8aRNG.ApplyDetails(pk, criteria, para, IsAlpha);
// We don't override LevelMin, so just handle the two species cases.
if (Species == (int)Core.Species.Zorua)
pk.CurrentLevel = pk.Met_Level = Overworld8aRNG.GetRandomLevel(slotSeed, 26, 28);
pk.CurrentLevel = pk.Met_Level = Overworld8aRNG.GetRandomLevel(slotSeed, 27, 29);
else if (Species == (int)Core.Species.Phione)
pk.CurrentLevel = pk.Met_Level = Overworld8aRNG.GetRandomLevel(slotSeed, 33, 36);
@ -159,6 +159,8 @@ public sealed record EncounterStatic8a(GameVersion Version) : EncounterStatic(Ve
pk.SetMoves(moves);
pk.SetMaximumPPCurrent(moves);
pa8.SetEncounterMasteryFlags(moves, mastery, level);
if (pa8.AlphaMove != 0)
pa8.SetMasteryFlagMove(pa8.AlphaMove);
}
public (Learnset Learn, Learnset Mastery) GetLevelUpInfo()

View file

@ -824,10 +824,10 @@ public sealed class PA8 : PKM, ISanityChecksum, IMoveReset,
SetMasteryFlagMove(GetMove(i));
}
public void SetMasteryFlagMove(int move)
public void SetMasteryFlagMove(ushort move)
{
var moves = MoveShopPermitIndexes;
int flagIndex = moves.IndexOf((ushort)move);
int flagIndex = moves.IndexOf(move);
if (flagIndex == -1)
return;
if (MoveShopPermitFlags[flagIndex])