mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-03 15:21:10 -05:00
26 lines
742 B
C#
26 lines
742 B
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
public interface IMasteryInitialMoveShop8
|
|
{
|
|
(Learnset Learn, Learnset Mastery) GetLevelUpInfo();
|
|
void LoadInitialMoveset(PA8 pa8, Span<int> moves, Learnset learn, int level);
|
|
bool IsForcedMasteryCorrect(PKM pkm);
|
|
}
|
|
|
|
public static class MasteryInitialMoveShop8Extensions
|
|
{
|
|
public static void SetInitialMastery(this IMasteryInitialMoveShop8 enc, PKM pk)
|
|
{
|
|
if (pk is PA8 pa8)
|
|
{
|
|
Span<int> moves = stackalloc int[4];
|
|
var level = pa8.Met_Level;
|
|
var (learn, mastery) = enc.GetLevelUpInfo();
|
|
enc.LoadInitialMoveset(pa8, moves, learn, level);
|
|
pa8.SetEncounterMasteryFlags(moves, mastery, level);
|
|
}
|
|
}
|
|
}
|