Defer BDSP->PK8 marsh ball mismatches

This commit is contained in:
Kurt 2022-06-05 11:28:17 -07:00
parent 267521cfdf
commit 39a09fbbbe
2 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,7 @@ public static class Locations
private const int MarshLocation_DPPt = 52;
public static bool IsSafariZoneLocation3(int loc) => loc is SafariLocation_RSE or SafariLocation_FRLG;
public static bool IsSafariZoneLocation4(int loc) => loc is MarshLocation_DPPt or SafariLocation_HGSS;
public static bool IsSafariZoneLocation8b(int loc) => loc is (>= 219 and <= 224);
public static bool IsEggLocationBred4(int loc, GameVersion ver)
{

View File

@ -149,9 +149,14 @@ public static IEnumerable<IEncounterable> GetEncountersFuzzy(PKM pkm, EvoCriteri
}
}
// Only yield if Safari and Marsh encounters match.
bool safari = pkm is PK8 { Ball: (int)Ball.Safari };
foreach (var z in GetValidWildEncounters(pkm, chain, game))
{
var marsh = Locations.IsSafariZoneLocation8b(z.Location);
var match = z.GetMatchRating(pkm);
if (safari != marsh)
match = DeferredErrors;
if (match == Match)
{
yield return z;