mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 00:13:10 +00:00
parent
915c2d52b1
commit
31c09c52e8
1 changed files with 19 additions and 0 deletions
|
@ -260,6 +260,13 @@ namespace PKHeX.Core
|
|||
if (810 <= species && species <= 818) // G8 Starters
|
||||
return VerifyBallEquals(data, (int)Poke);
|
||||
|
||||
if (IsGalarCapture(species))
|
||||
{
|
||||
if (!Legal.WildPokeballs8.Contains(pkm.Ball))
|
||||
return GetInvalid(LBallSpecies);
|
||||
return GetValid(LBallSpeciesPass);
|
||||
}
|
||||
|
||||
Ball ball = (Ball)pkm.Ball;
|
||||
|
||||
if (ball == Safari)
|
||||
|
@ -328,6 +335,18 @@ namespace PKHeX.Core
|
|||
return NONE;
|
||||
}
|
||||
|
||||
public bool IsGalarCapture(int species)
|
||||
{
|
||||
if (810 <= species && species <= 818) // starter
|
||||
return false;
|
||||
if (880 <= species && species <= 883) // fossil
|
||||
return false;
|
||||
var pt = PersonalTable.SWSH;
|
||||
if (((PersonalInfoSWSH) pt.GetFormeEntry(species, 0)).IsPresentInGame)
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
private CheckResult VerifyBallEquals(LegalityAnalysis data, int ball) => GetResult(ball == data.pkm.Ball);
|
||||
private CheckResult VerifyBallEquals(LegalityAnalysis data, HashSet<int> balls) => GetResult(balls.Contains(data.pkm.Ball));
|
||||
private CheckResult VerifyBallEquals(LegalityAnalysis data, ICollection<int> balls) => GetResult(balls.Contains(data.pkm.Ball));
|
||||
|
|
Loading…
Reference in a new issue