mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-25 10:37:02 -05:00
Set legal default ball for bdsp bred egg templates
This commit is contained in:
@@ -34,7 +34,7 @@ public PKM ConvertToPKM(ITrainerInfo sav, EncounterCriteria criteria)
|
||||
pk.Nickname = SpeciesName.GetSpeciesNameGeneration(Species, lang, gen);
|
||||
pk.CurrentLevel = Level;
|
||||
pk.Version = (int)version;
|
||||
pk.Ball = (int)Ball.Poke;
|
||||
pk.Ball = (int)BallBreedLegality.GetDefaultBall(Version, Species);
|
||||
pk.OT_Friendship = pk.PersonalInfo.BaseFriendship;
|
||||
|
||||
SetEncounterMoves(pk, version);
|
||||
|
||||
@@ -1037,5 +1037,23 @@ internal static class BallBreedLegality
|
||||
|
||||
(int)Phione,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets a legal <see cref="Ball"/> value for a bred egg encounter.
|
||||
/// </summary>
|
||||
/// <param name="version">Version the egg was created on.</param>
|
||||
/// <param name="species">Species the egg contained.</param>
|
||||
/// <returns>Valid ball to hatch with.</returns>
|
||||
/// <remarks>Not all things can hatch with a Poké Ball!</remarks>
|
||||
public static Ball GetDefaultBall(GameVersion version, int species)
|
||||
{
|
||||
if (GameVersion.BDSP.Contains(version))
|
||||
{
|
||||
if (BanInheritedExceptSafari_BDSP.Contains(species))
|
||||
return Ball.Safari;
|
||||
}
|
||||
|
||||
return Ball.Poke;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user