mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-21 01:43:10 +00:00
ccf87242c1
struct implementing interface is boxed when passed to method that accepts interface (not generic method). Removes IDexLevel (no other inheritors but EvoCriteria) and uses the primitive the data is stored (array, not IReadOnlyList) for slightly better perf.
30 lines
936 B
C#
30 lines
936 B
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Generation 5 Dream Radar gift encounters
|
|
/// </summary>
|
|
/// <inheritdoc cref="EncounterStatic"/>
|
|
public sealed record EncounterStatic5DR : EncounterStatic5
|
|
{
|
|
public EncounterStatic5DR(int species, int form, AbilityPermission ability = AbilityPermission.OnlyHidden) : base(GameVersion.B2W2)
|
|
{
|
|
Species = species;
|
|
Form = form;
|
|
Ability = ability;
|
|
Location = 30015;
|
|
Gift = true;
|
|
Ball = 25;
|
|
Level = 5; // to 40
|
|
Shiny = Shiny.Never;
|
|
}
|
|
|
|
protected override bool IsMatchLevel(PKM pkm, EvoCriteria evo)
|
|
{
|
|
// Level from 5->40 depends on the number of badges
|
|
var met = pkm.Met_Level;
|
|
if (met % 5 != 0)
|
|
return false;
|
|
return (uint) (met - 5) <= 35; // 5 <= x <= 40
|
|
}
|
|
}
|
|
}
|