Ejemplo n.º 1
0
        /// <summary>
        /// Gets a living dex (one per species, not every form)
        /// </summary>
        /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
        /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
        public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav)
        {
            var species = Enumerable.Range(1, sav.MaxSpeciesID);

            if (sav.GG)
            {
                species = species.Where(z => z <= 151 || z >= 808); // only include Kanto and M&M
            }
            return(sav.GenerateLivingDex(species));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a living dex (one per species, not every form)
        /// </summary>
        /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
        /// <param name="attempts"></param>
        /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
        public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav, out int attempts)
        {
            var species = Enumerable.Range(1, sav.MaxSpeciesID);

            species = sav switch
            {
                SAV7b => species.Where(z => z is <= 151 or 808 or 809),
                SAV8SWSH => species.Where(z => ((PersonalInfoSWSH)PersonalTable.SWSH.GetFormEntry(z, 0)).IsPresentInGame || SimpleEdits.Zukan8Additions.Contains(z)),
                SAV8BS => species.Where(z => ((PersonalInfoBDSP)PersonalTable.BDSP.GetFormEntry(z, 0)).IsPresentInGame),
                _ => species,
            };
            return(sav.GenerateLivingDex(species, includeforms: IncludeForms, shiny: SetShiny, alpha: SetAlpha, out attempts));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets a living dex (one per species, not every form)
        /// </summary>
        /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
        /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
        public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav)
        {
            var species = Enumerable.Range(1, sav.MaxSpeciesID);

            if (sav is SAV7b)
            {
                species = species.Where(z => z is <= 151 or 808 or 809); // only include Kanto and M&M
            }
            if (sav is SAV8)
            {
                species = species.Where(z => ((PersonalInfoSWSH)PersonalTable.SWSH.GetFormEntry(z, 0)).IsPresentInGame || SimpleEdits.Zukan8Additions.Contains(z));
            }
            return(sav.GenerateLivingDex(species));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets a living dex (one per species, not every form)
        /// </summary>
        /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
        /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
        public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav)
        {
            var species = Enumerable.Range(1, sav.MaxSpeciesID);

            if (sav is SAV7b)
            {
                species = species.Where(z => z <= 151 || (z == 808 || z == 809)); // only include Kanto and M&M
            }
            if (sav is SAV8)
            {
                species = species.Where(z => Zukan8.DexLookup.TryGetValue(z, out int value));
            }
            return(sav.GenerateLivingDex(species));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets a living dex (one per species, not every form)
 /// </summary>
 /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
 /// <param name="speciesIDs">Species IDs to generate</param>
 /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
 public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav, params int[] speciesIDs) =>
 sav.GenerateLivingDex((IEnumerable <int>)speciesIDs);
Ejemplo n.º 6
0
 /// <summary>
 /// Gets a living dex (one per species, not every form)
 /// </summary>
 /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
 /// <param name="speciesIDs">Species IDs to generate</param>
 /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
 public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav, params int[] speciesIDs) =>
 sav.GenerateLivingDex(speciesIDs, includeforms: IncludeForms, shiny: SetShiny, out int attempts);
Ejemplo n.º 7
0
        /// <summary>
        /// Gets a living dex (one per species, not every form)
        /// </summary>
        /// <param name="sav">Save File to receive the generated <see cref="PKM"/>.</param>
        /// <param name="attempts"></param>
        /// <returns>Consumable list of newly generated <see cref="PKM"/> data.</returns>
        public static IEnumerable <PKM> GenerateLivingDex(this SaveFile sav, out int attempts)
        {
            var species = Enumerable.Range(1, sav.MaxSpeciesID).Where(sav.Personal.IsSpeciesInGame);

            return(sav.GenerateLivingDex(species, includeforms: IncludeForms, shiny: SetShiny, alpha: SetAlpha, out attempts));
        }