public EggInfoSource(PKM pkm, IEnumerable <int> specialMoves, EncounterEgg e) { // Eggs with special moves cannot inherit levelup moves as the current moves are predefined. Special = specialMoves.Where(m => m != 0).ToList(); bool notSpecial = Special.Count == 0; AllowInherited = notSpecial && !pkm.WasGiftEgg && pkm.Species != 489 && pkm.Species != 490; // Level up moves can only be inherited if ditto is not the mother. bool AllowLevelUp = Legal.GetCanInheritMoves(pkm, e); Base = Legal.GetBaseEggMoves(pkm, e.Species, e.Version, e.Level); Egg = Legal.GetEggMoves(pkm, e.Species, pkm.AltForm, e.Version); LevelUp = AllowLevelUp ? Legal.GetBaseEggMoves(pkm, e.Species, e.Version, 100).Except(Base).ToList() : new List <int>(); Tutor = e.Version == GameVersion.C ? MoveTutor.GetTutorMoves(pkm, pkm.Species, pkm.AltForm, false, 2).ToList() : new List <int>(); // Only TM/HM moves from the source game of the egg, not any other games from the same generation TMHM = MoveTechnicalMachine.GetTMHM(pkm, pkm.Species, pkm.AltForm, pkm.GenNumber, e.Version).ToList(); // Non-Base moves that can magically appear in the regular movepool bool volt = notSpecial && (pkm.GenNumber > 3 || e.Version == GameVersion.E) && Legal.LightBall.Contains(pkm.Species); if (volt) { Egg.Add(344); // Volt Tackle } }
public EggInfoSource(PKM pkm, EncounterEgg e) { // Eggs with special moves cannot inherit levelup moves as the current moves are predefined. AllowInherited = e.Species != 489 && e.Species != 490; // Level up moves can only be inherited if ditto is not the mother. bool AllowLevelUp = Legal.GetCanInheritMoves(e.Species); Base = Legal.GetBaseEggMoves(pkm, e.Species, e.Form, e.Version, e.Level); Egg = MoveEgg.GetEggMoves(pkm, e.Species, e.Form, e.Version); LevelUp = AllowLevelUp ? Legal.GetBaseEggMoves(pkm, e.Species, e.Form, e.Version, 100).Except(Base).ToList() : (IReadOnlyList <int>)Array.Empty <int>(); Tutor = e.Version == GameVersion.C ? MoveTutor.GetTutorMoves(pkm, e.Species, 0, false, 2).ToList() : (IReadOnlyList <int>)Array.Empty <int>(); // Only TM/HM moves from the source game of the egg, not any other games from the same generation TMHM = MoveTechnicalMachine.GetTMHM(pkm, pkm.Species, pkm.AltForm, e.Generation, e.Version).ToList(); // Non-Base moves that can magically appear in the regular movepool bool volt = (e.Generation > 3 || e.Version == GameVersion.E) && Legal.LightBall.Contains(pkm.Species); if (volt) { Egg = Egg.ToList(); // array->list Egg.Add(344); // Volt Tackle } }
private static CheckResult[] VerifyRelearnEggBase(PKM pkm, LegalInfo info, EncounterEgg e) { int[] RelearnMoves = pkm.RelearnMoves; CheckResult[] res = new CheckResult[4]; // Level up moves cannot be inherited if Ditto is the parent // that means genderless species and male only species except Nidoran and Volbeat (they breed with female nidoran and illumise) could not have level up moves as an egg bool inheritLvlMoves = Legal.GetCanInheritMoves(e.Species); // Obtain level1 moves var baseMoves = Legal.GetBaseEggMoves(pkm, e.Species, e.Version, 1); int baseCt = Math.Min(4, baseMoves.Length); // Obtain Inherited moves var inheritMoves = Legal.GetValidRelearn(pkm, e.Species, inheritLvlMoves, e.Version).ToList(); int reqBase = GetRequiredBaseMoves(RelearnMoves, baseMoves, baseCt, inheritMoves); // Check if the required amount of Base Egg Moves are present. FlagBaseEggMoves(res, reqBase, baseMoves, RelearnMoves); // Non-Base moves that can magically appear in the regular movepool if (Legal.LightBall.Contains(pkm.Species)) { inheritMoves.Add(344); // Volt Tackle } // If any splitbreed moves are invalid, flag accordingly var splitMoves = e is EncounterEggSplit s ? Legal.GetValidRelearn(pkm, s.OtherSpecies, inheritLvlMoves, e.Version).ToList() : (IReadOnlyList <int>)Array.Empty <int>(); // Inherited moves appear after the required base moves. // If the pkm is capable of split-species breeding and any inherited move is from the other split scenario, flag accordingly. bool splitInvalid = FlagInvalidInheritedMoves(res, reqBase, RelearnMoves, inheritMoves, splitMoves); if (splitInvalid) { FlagSplitbreedMoves(res, reqBase, e, pkm); } info.RelearnBase = baseMoves; return(res); }