コード例 #1
0
        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
            }
        }
コード例 #2
0
ファイル: EggInfoSource.cs プロジェクト: callummoffat/PKHeX
        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
            }
        }
コード例 #3
0
ファイル: EggInfoSource.cs プロジェクト: optizard/PKHeX
        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.
            var  ratio        = pkm.PersonalInfo.Gender; // Genderless/Male Only (except a few) cannot inherit.
            bool AllowLevelUp = ratio > 0 && ratio < 255 || Legal.MixedGenderBreeding.Contains(e.Species);

            Base = Legal.GetBaseEggMoves(pkm, e.Species, e.Game, e.LevelMin).ToList();

            Egg     = Legal.GetEggMoves(pkm, e.Species, pkm.AltForm).ToList();
            LevelUp = AllowLevelUp
                ? Legal.GetBaseEggMoves(pkm, e.Species, e.Game, 100).Where(x => !Base.Contains(x)).ToList()
                : new List <int>();
            Tutor = e.Game == GameVersion.C
                ? Legal.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 = Legal.GetTMHM(pkm, pkm.Species, pkm.AltForm, pkm.GenNumber, e.Game, false).ToList();

            // Non-Base moves that can magically appear in the regular movepool
            bool volt = notSpecial && (pkm.GenNumber > 3 || e.Game == GameVersion.E) && Legal.LightBall.Contains(pkm.Species);

            if (volt)
            {
                Egg.Add(344); // Volt Tackle
            }
        }