diff --git a/Legality/Checks.cs b/Legality/Checks.cs index fd2b6a757..f25e001bc 100644 --- a/Legality/Checks.cs +++ b/Legality/Checks.cs @@ -451,9 +451,17 @@ private LegalityCheck verifyBall() return new LegalityCheck(Severity.Valid, "Standard Poké Ball."); if (EncounterType == typeof(EncounterStatic)) + { + EncounterStatic enc = EncounterMatch as EncounterStatic; + if (enc.Gift) + return enc.Ball != pk6.Ball // Pokéball by default + ? new LegalityCheck(Severity.Invalid, "Incorrect ball on ingame gift.") + : new LegalityCheck(Severity.Valid, "Correct ball on ingame gift."); + return !Legal.WildPokeballs.Contains(pk6.Ball) ? new LegalityCheck(Severity.Invalid, "Incorrect ball on ingame static encounter.") : new LegalityCheck(Severity.Valid, "Correct ball on ingame static encounter."); + } if (EncounterType == typeof(EncounterSlot[])) return !Legal.WildPokeballs.Contains(pk6.Ball) ? new LegalityCheck(Severity.Invalid, "Incorrect ball on ingame encounter.") diff --git a/Legality/Core.cs b/Legality/Core.cs index 592e49d7f..f83ce25e9 100644 --- a/Legality/Core.cs +++ b/Legality/Core.cs @@ -231,8 +231,10 @@ internal static EncounterStatic getValidStaticEncounter(PK6 pk6) continue; if (e.Shiny != null && e.Shiny != pk6.IsShiny) continue; - if (e.Gift && pk6.Ball != 4) // PokéBall - continue; + + // Defer ball check to later + // if (e.Gift && pk6.Ball != 4) // PokéBall + // continue; // Passes all checks, valid encounter return e; diff --git a/Legality/Data.cs b/Legality/Data.cs index 61106f730..af849bf03 100644 --- a/Legality/Data.cs +++ b/Legality/Data.cs @@ -184,6 +184,7 @@ public class EncounterStatic public int EggLocation = 0; public Nature Nature = Nature.Random; public bool Gift = false; + public int Ball = 4; // Gift Only public GameVersion Version = GameVersion.Any; public int[] IVs = {-1, -1, -1, -1, -1, -1}; public int[] Contest = {0, 0, 0, 0, 0, 0};