Flag non-pokeball GO shedinja (evo'd from nincada)

This commit is contained in:
Kurt 2022-05-03 20:17:28 -07:00
parent 703a641b4a
commit 824e868efe
2 changed files with 9 additions and 2 deletions

View file

@ -106,6 +106,7 @@ namespace PKHeX.Core
if (sf == default)
yield break;
var species = pkm.Species;
var ball = (Ball)pkm.Ball;
var met = Math.Max(sf.LevelMin, pkm.Met_Level);
EncounterSlot8GO? deferredIV = null;
@ -114,7 +115,7 @@ namespace PKHeX.Core
{
if (!slot.IsLevelWithinRange(met))
continue;
if (!slot.IsBallValid(ball))
if (!slot.IsBallValid(ball, species))
continue;
if (!slot.Shiny.IsValid(pkm))
continue;

View file

@ -26,7 +26,13 @@ namespace PKHeX.Core
/// <summary>
/// Checks if the <seealso cref="Ball"/> is compatible with the <seealso cref="PogoType"/>.
/// </summary>
public bool IsBallValid(Ball ball) => Type.IsBallValid(ball);
public bool IsBallValid(Ball ball, int currentSpecies)
{
// GO does not natively produce Shedinja when evolving Nincada, and thus must be evolved in future games.
if (currentSpecies == (int)Core.Species.Shedinja && currentSpecies != Species)
return ball == Ball.Poke;
return Type.IsBallValid(ball);
}
protected override void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteria, PKM pk)
{