mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-25 13:05:21 -05:00
* Uses LearnSource more throughout the codebase when appropriate, rather than loosely coupled pivot methods. * Hides Learnset/EggMove data inside the LearnSource classes. * Extracts functionality from the large Legal class & partial Table*.cs files into better performing helper classes. * Cleans up some code from prior LearnSource commits.
25 lines
745 B
C#
25 lines
745 B
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Exposes permissions about the Move Shop
|
|
/// </summary>
|
|
public interface IMasteryInitialMoveShop8
|
|
{
|
|
(Learnset Learn, Learnset Mastery) GetLevelUpInfo();
|
|
void LoadInitialMoveset(PA8 pa8, Span<ushort> moves, Learnset learn, int level);
|
|
bool IsForcedMasteryCorrect(PKM pk);
|
|
void SetInitialMastery(PKM pk)
|
|
{
|
|
if (pk is PA8 pa8)
|
|
{
|
|
Span<ushort> moves = stackalloc ushort[4];
|
|
var level = pa8.Met_Level;
|
|
var (learn, mastery) = LearnSource8LA.GetLearnsetAndMastery(pk.Species, pk.Form);
|
|
LoadInitialMoveset(pa8, moves, learn, level);
|
|
pa8.SetEncounterMasteryFlags(moves, mastery, level);
|
|
}
|
|
}
|
|
}
|