Add XY friend safari sawsbuck form bypass too

See previous commit.
AO only has Deerling, so remove Sawsbuck from the Species compare.
This commit is contained in:
Kurt 2024-01-22 18:58:22 -08:00
parent 6d2de333bf
commit 26e4bf0a6a
2 changed files with 9 additions and 2 deletions

View file

@ -128,7 +128,7 @@ public sealed record EncounterSlot6AO(EncounterArea6AO Parent, ushort Species, b
if (evo.Form != Form && !IsRandomUnspecificForm)
{
if (Species is not ((ushort)Core.Species.Deerling or (ushort)Core.Species.Sawsbuck))
if (Species is not (ushort)Core.Species.Deerling)
return false;
// Deerling can change between forms if imported to a future Gen8+ game.

View file

@ -117,12 +117,19 @@ public sealed record EncounterSlot6XY(EncounterArea6XY Parent, ushort Species, b
if (!this.IsLevelWithinRange(pk.Met_Level))
return false;
if (Form != evo.Form && !IsRandomUnspecificForm && Species is not ((int)Core.Species.Burmy or (int)Core.Species.Furfrou))
if (Form != evo.Form && !IsRandomUnspecificForm && !IsValidOutOfBoundsForm(pk))
return false;
return true;
}
private bool IsValidOutOfBoundsForm(PKM pk) => Species switch
{
(int)Core.Species.Burmy or (int)Core.Species.Furfrou => true, // Can change forms in-game.
(int)Core.Species.Sawsbuck => pk.Format >= 8, // Friend Safari can change between forms if imported to a future Gen8+
_ => false,
};
public EncounterMatchRating GetMatchRating(PKM pk)
{
bool isHidden = pk.AbilityNumber == 4;