Exemplo n.º 1
0
        private static EncounterStatic GetSuggestedEncounterEgg(PKM pkm, int loc = -1)
        {
            int lvl = GetSuggestedEncounterEggMetLevel(pkm);

            return(new EncounterStatic
            {
                Species = Legal.GetBaseSpecies(pkm),
                Location = loc != -1 ? loc : GetSuggestedEggMetLocation(pkm),
                Level = lvl,
            });
        }
Exemplo n.º 2
0
        public EncounterStatic GetSuggestedMetInfo()
        {
            if (pkm == null)
            {
                return(null);
            }

            int loc = GetSuggestedTransferLocation(pkm);

            if (pkm.WasEgg)
            {
                int lvl = 1; // gen5+
                if (!pkm.IsNative)
                {
                    lvl = pkm.CurrentLevel; // be generous with transfer conditions
                }
                else if (pkm.Format < 5)    // and native
                {
                    lvl = 0;
                }
                return(new EncounterStatic
                {
                    Species = Legal.GetBaseSpecies(pkm),
                    Location = loc != -1 ? loc : GetSuggestedEggMetLocation(pkm),
                    Level = lvl,
                });
            }

            var area = EncounterGenerator.GetCaptureLocation(pkm);

            if (area != null)
            {
                var slots = area.Slots.OrderBy(s => s.LevelMin);
                return(new EncounterStatic
                {
                    Species = slots.First().Species,
                    Location = loc != -1 ? loc : area.Location,
                    Level = slots.First().LevelMin,
                });
            }

            var encounter = EncounterGenerator.GetStaticLocation(pkm);

            if (loc != -1 && encounter != null)
            {
                encounter.Location = loc;
            }
            return(encounter);
        }
Exemplo n.º 3
0
        private static EncounterStatic GetSuggestedEncounterEgg(PKM pkm, int loc = -1)
        {
            int lvl = 1; // gen5+

            if (!pkm.IsNative)
            {
                lvl = pkm.CurrentLevel; // be generous with transfer conditions
            }
            else if (pkm.Format < 5)    // and native
            {
                lvl = 0;
            }
            return(new EncounterStatic
            {
                Species = Legal.GetBaseSpecies(pkm),
                Location = loc != -1 ? loc : GetSuggestedEggMetLocation(pkm),
                Level = lvl,
            });
        }