Check current level on GB Era event gift eggs

Closes #3963
This commit is contained in:
Kurt 2023-08-15 16:09:08 -07:00
parent 218a29a16a
commit 0a9300874b
5 changed files with 10 additions and 7 deletions

View file

@ -26,7 +26,7 @@ public sealed record EncounterGift2(ushort Species, byte Level, GameVersion Vers
public Moveset Moves { get; init; }
public bool EggEncounter => EggCycles != 0;
public string Name => "Static Encounter";
public string Name => "GB Era Event Gift";
public string LongName => Name;
public byte LevelMin => Level;
public byte LevelMax => Level;
@ -245,9 +245,11 @@ public sealed record EncounterGift2(ushort Species, byte Level, GameVersion Vers
private bool IsMatchLevel(PKM pk, EvoCriteria evo)
{
if (evo.LevelMax < Level)
return false;
if (pk is ICaughtData2 { CaughtData: not 0 })
return pk.Met_Level == (EggEncounter ? 1 : Level);
return evo.LevelMax >= Level;
return true;
}
#endregion

View file

@ -174,10 +174,11 @@ public sealed record EncounterStatic2(ushort Species, byte Level, GameVersion Ve
private bool IsMatchLevel(PKM pk, EvoCriteria evo)
{
if (evo.LevelMax < Level)
return false;
if (pk is ICaughtData2 { CaughtData: not 0 })
return pk.Met_Level == (EggEncounter ? 1 : Level);
return Level <= evo.LevelMax;
return true;
}
// Routes 29-46, except 40 & 41; total 16.

View file

@ -36,7 +36,7 @@ public sealed record EncounterGift3Colo : IEncounterable, IEncounterMatch, IEnco
Version = game;
}
public string Name => "Static Encounter";
public string Name => "Gift Encounter";
public string LongName => Name;
public byte LevelMin => Level;
public byte LevelMax => Level;

View file

@ -46,7 +46,7 @@ public sealed record EncounterTrade3XD : IEncounterable, IEncounterMatch, IEncou
Nicknames = nicknames;
}
public string Name => "Static Encounter";
public string Name => "Trade Encounter";
public string LongName => Name;
public byte LevelMin => Level;
public byte LevelMax => Level;

View file

@ -140,7 +140,7 @@ public sealed class LegalityAnalysis
if (info.EncounterOriginal is not EncounterInvalid enc)
return false;
if (enc.Generation <= 3)
return true;
return pk.Format <= 3;
if (!pk.FatefulEncounter)
return false;
if (enc.Generation < 6)