Esempio n. 1
0
        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
            }
        }
Esempio n. 2
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
            }
        }
Esempio n. 3
0
File: Core.cs Progetto: LLNet/PKHeX
        private static IEnumerable <int> GetMoves(PKM pkm, int species, int minlvlG1, int minlvlG2, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool specialTutors, bool Machine, bool MoveReminder, bool RemoveTransferHM, int Generation)
        {
            List <int> r = new List <int>();

            if (LVL)
            {
                r.AddRange(MoveLevelUp.GetMovesLevelUp(pkm, species, minlvlG1, minlvlG2, lvl, form, Version, MoveReminder, Generation));
            }
            if (Machine)
            {
                r.AddRange(MoveTechnicalMachine.GetTMHM(pkm, species, form, Generation, Version, RemoveTransferHM));
            }
            if (moveTutor)
            {
                r.AddRange(MoveTutor.GetTutorMoves(pkm, species, form, specialTutors, Generation));
            }
            return(r.Distinct());
        }
Esempio n. 4
0
File: Core.cs Progetto: LLNet/PKHeX
        private static IEnumerable <int> GetValidMoves(PKM pkm, GameVersion Version, IReadOnlyList <EvoCriteria> vs, int Generation, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false, bool MoveReminder = true, bool RemoveTransferHM = true)
        {
            List <int> r = new List <int> {
                0
            };

            if (vs.Count == 0)
            {
                return(r);
            }
            int species = pkm.Species;

            // Special Type Tutors Availability
            bool moveTutor = Tutor || MoveReminder; // Usually true, except when called for move suggestions (no tutored moves)

            if (FormChangeMoves.Contains(species))  // Deoxys & Shaymin & Giratina (others don't have extra but whatever)
            {
                int formcount = pkm.PersonalInfo.FormeCount;

                // In gen 3 deoxys has different forms depending on the current game, in personal info there is no alter form info
                if (species == 386 && pkm.Format == 3)
                {
                    formcount = 4;
                }

                for (int i = 0; i < formcount; i++)
                {
                    r.AddRange(GetMoves(pkm, species, minLvLG1, minLvLG2, vs[0].Level, i, Tutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation));
                }
                if (Relearn)
                {
                    r.AddRange(pkm.RelearnMoves);
                }
                return(r.Distinct());
            }

            for (var i = 0; i < vs.Count; i++)
            {
                var evo   = vs[i];
                var moves = GetEvoMoves(pkm, Version, vs, Generation, minLvLG1, minLvLG2, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, moveTutor, i, evo);
                r.AddRange(moves);
            }

            if (pkm.Format <= 3)
            {
                return(r.Distinct());
            }

            if (LVL)
            {
                MoveTutor.AddSpecialFormChangeMoves(r, pkm, Generation, species);
            }
            if (Tutor)
            {
                MoveTutor.AddSpecialTutorMoves(r, pkm, Generation, species);
            }
            if (Relearn && Generation >= 6)
            {
                r.AddRange(pkm.RelearnMoves);
            }
            return(r.Distinct());
        }