mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 23:57:12 -05:00
Fixes shiny rayquaza some lowering int->byte Fix event3 random restricted seed fetch for gender Fix gen8a encdb filters excluding static encounters, now will be properly excluded
29 lines
1017 B
C#
29 lines
1017 B
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// <inheritdoc cref="IObedienceLevelReadOnly"/>
|
|
/// </summary>
|
|
public interface IObedienceLevel : IObedienceLevelReadOnly
|
|
{
|
|
/// <summary>
|
|
/// <inheritdoc cref="IObedienceLevelReadOnly.ObedienceLevel"/>
|
|
/// </summary>
|
|
new byte ObedienceLevel { get; set; }
|
|
}
|
|
|
|
public static class ObedienceExtensions
|
|
{
|
|
/// <summary>
|
|
/// Suggests the <see cref="IObedienceLevelReadOnly.ObedienceLevel"/> for the entity.
|
|
/// </summary>
|
|
public static byte GetSuggestedObedienceLevel(this IObedienceLevelReadOnly _, PKM entity, byte 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 (GameVersion.SL or GameVersion.VL))
|
|
return entity.CurrentLevel; // foreign, play it safe.
|
|
// Can just assume min-level
|
|
return originalMet;
|
|
}
|
|
}
|