diff --git a/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs b/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs index 0f2bbcbba..ef6b8ca36 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs @@ -20,6 +20,8 @@ public sealed record EncounterEgg : IEncounterable public GameVersion Version { get; } public bool IsShiny => false; + public bool CanHaveVoltTackle => Species is (int)Core.Species.Pichu && (Generation > 3 || Version is GameVersion.E); + public EncounterEgg(int species, int form, int level, int gen, GameVersion game) { Species = species; diff --git a/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs index aead23381..cddf0527a 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs @@ -261,7 +261,7 @@ private static IEnumerable GetEggs(PKM pk, IReadOnlyCollection em = MoveEgg.GetEggMoves(pk.PersonalInfo, egg.Species, egg.Form, egg.Version, egg.Generation); if (egg.Generation <= 2) em = em.Concat(MoveLevelUp.GetEncounterMoves(egg.Species, 0, egg.Level, egg.Version)); - else if (Legal.LightBall.Contains(egg.Species) && needs.Contains((int)Move.VoltTackle)) + else if (egg.Species is (int)Species.Pichu && needs.Contains((int)Move.VoltTackle) && (egg.Generation > 3 || version is GameVersion.E)) em = em.Concat(new[] { (int)Move.VoltTackle }); if (!needs.Except(em).Any()) diff --git a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs index edb04c672..1e1297106 100644 --- a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs +++ b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs @@ -67,26 +67,23 @@ private static CheckMoveResult[] ParseMovesForSmeargle(PKM pkm, IReadOnlyList currentMoves, LegalInfo info, EncounterEgg e) { - var EventEggMoves = GetSpecialMoves(info.EncounterMatch); - bool notEvent = EventEggMoves.Count == 0; // Level up moves could not be inherited if Ditto is parent, // that means genderless species and male only species (except Nidoran-M and Volbeat; they breed with Nidoran-F and Illumise) could not have level up moves as an egg var pi = pkm.PersonalInfo; - var AllowLevelUp = notEvent && !pi.Genderless && !(pi.OnlyMale && Breeding.MixedGenderBreeding.Contains(e.Species)); + var AllowLevelUp = !pi.Genderless && !(pi.OnlyMale && Breeding.MixedGenderBreeding.Contains(e.Species)); int BaseLevel = AllowLevelUp ? 100 : e.LevelMin; var LevelUp = MoveList.GetBaseEggMoves(pkm, e.Species, e.Form, e.Version, BaseLevel); - var TradebackPreevo = pkm.Format == 2 && info.EncounterMatch.Species > 151; + var TradebackPreevo = pkm.Format == 2 && e.Species > 151; var NonTradebackLvlMoves = TradebackPreevo - ? MoveList.GetExclusivePreEvolutionMoves(pkm, info.EncounterMatch.Species, info.EvoChainsAllGens[2], 2, e.Version).Where(m => m > Legal.MaxMoveID_1).ToArray() + ? MoveList.GetExclusivePreEvolutionMoves(pkm, e.Species, info.EvoChainsAllGens[2], 2, e.Version).Where(m => m > Legal.MaxMoveID_1).ToArray() : Array.Empty(); var Egg = MoveEgg.GetEggMoves(pkm.PersonalInfo, e.Species, e.Form, e.Version, e.Generation); if (info.Generation < 3 && pkm.Format >= 7 && pkm.VC1) Egg = Array.FindAll(Egg, m => m <= Legal.MaxMoveID_1); - bool volt = (info.Generation > 3 || e.Version == GameVersion.E) && Legal.LightBall.Contains(pkm.Species); - var specialMoves = volt && notEvent ? new[] { (int)Move.VoltTackle } : Array.Empty(); // Volt Tackle for bred Pichu line + var specialMoves = e.CanHaveVoltTackle ? new[] { (int)Move.VoltTackle } : Array.Empty(); // Volt Tackle for bred Pichu line var source = new MoveParseSource { @@ -96,7 +93,6 @@ private static CheckMoveResult[] ParseMovesWasEggPreRelearn(PKM pkm, IReadOnlyLi EggLevelUpSource = LevelUp, EggMoveSource = Egg, - EggEventSource = EventEggMoves, }; return ParseMoves(pkm, source, info); } diff --git a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed3.cs b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed3.cs index 9d24cd627..669f05c61 100644 --- a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed3.cs +++ b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed3.cs @@ -31,7 +31,7 @@ public static EggSource34[] Validate(int species, GameVersion version, int[] mov var egg = Legal.EggMovesRS[species].Moves; var value = new BreedInfo(count, learnset, moves, level); - if (version == GameVersion.E && moves[count - 1] is (int)Move.VoltTackle) + if (species is (int)Species.Pichu && moves[count - 1] is (int)Move.VoltTackle && version == GameVersion.E) value.Actual[--count] = VoltTackle; if (count == 0) diff --git a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed4.cs b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed4.cs index 3305af227..164d3c2d4 100644 --- a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed4.cs +++ b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed4.cs @@ -32,7 +32,7 @@ public static EggSource34[] Validate(int species, GameVersion version, int[] mov var egg = (version is HG or SS ? Legal.EggMovesHGSS : Legal.EggMovesDPPt)[species].Moves; var value = new BreedInfo(count, learnset, moves, level); - if (moves[count - 1] is (int)Move.VoltTackle) + if (species is (int)Species.Pichu && moves[count - 1] is (int)Move.VoltTackle) value.Actual[--count] = VoltTackle; if (count == 0) diff --git a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed5.cs b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed5.cs index 5ec56c347..dea5688af 100644 --- a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed5.cs +++ b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed5.cs @@ -31,7 +31,7 @@ public static EggSource5[] Validate(int species, GameVersion version, int[] move var egg = Legal.EggMovesBW[species].Moves; var value = new BreedInfo(count, learnset, moves, level); - if (moves[count - 1] is (int)Move.VoltTackle) + if (species is (int)Species.Pichu && moves[count - 1] is (int)Move.VoltTackle) value.Actual[--count] = VoltTackle; if (count == 0) diff --git a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed6.cs b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed6.cs index cab541fd0..35d31060d 100644 --- a/PKHeX.Core/Legality/Moves/Breeding/MoveBreed6.cs +++ b/PKHeX.Core/Legality/Moves/Breeding/MoveBreed6.cs @@ -31,7 +31,7 @@ public static EggSource6[] Validate(int generation, int species, int form, GameV var egg = MoveEgg.GetEggMoves(generation, species, form, version); var value = new BreedInfo(count, learnset, moves, level); - if (moves[count - 1] is (int)Move.VoltTackle) + if (species is (int)Species.Pichu && moves[count - 1] is (int)Move.VoltTackle) value.Actual[--count] = VoltTackle; if (count == 0) diff --git a/PKHeX.Core/Legality/Tables/Tables.cs b/PKHeX.Core/Legality/Tables/Tables.cs index fa8573ff4..0e53ed939 100644 --- a/PKHeX.Core/Legality/Tables/Tables.cs +++ b/PKHeX.Core/Legality/Tables/Tables.cs @@ -7,11 +7,6 @@ namespace PKHeX.Core { public static partial class Legal { - /// - /// Species that trigger Light Ball yielding Volt Tackle - /// - public static readonly HashSet LightBall = new() {(int) Pikachu, (int) Raichu, (int) Pichu}; - /// /// Species that can change between their forms and get access to form-specific moves. ///