mirror of
https://github.com/kwsch/PKHeX
synced 2025-01-11 03:58:50 +00:00
03182ebd3d
Adds support for Scarlet & Violet. Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com> Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com> Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
25 lines
841 B
C#
25 lines
841 B
C#
namespace PKHeX.Core;
|
|
|
|
public interface IObedienceLevel : IObedienceLevelReadOnly
|
|
{
|
|
new byte Obedience_Level { get; set; }
|
|
}
|
|
|
|
public interface IObedienceLevelReadOnly
|
|
{
|
|
byte Obedience_Level { get; } // no setter, use for Encounters
|
|
}
|
|
|
|
public static class ObedienceExtensions
|
|
{
|
|
public static byte GetSuggestedObedienceLevel(this IObedienceLevelReadOnly _, PKM entity, int originalMet)
|
|
{
|
|
if (entity.Species is (int)Species.Koraidon or (int)Species.Miraidon && entity is PK9 { FormArgument: not 0 })
|
|
return 0; // Box Legend ride-able is default 0. Everything else is met level!
|
|
if (entity.Version is not (int)GameVersion.SL or (int)GameVersion.VL)
|
|
return (byte)entity.CurrentLevel; // foreign, play it safe.
|
|
// Can just assume min-level
|
|
return (byte)originalMet;
|
|
}
|
|
}
|
|
|