mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-07-30 22:16:09 -05:00
Defer Gift ball check
Now returns invalid ball instead of invalid encounter
This commit is contained in:
parent
4d1c621eb5
commit
a733b99b31
|
|
@ -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.")
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user