Example #1
0
        private static string GetSpeciesName1234(int species, int language, int generation)
        {
            if (species == 0)
            {
                return(GetEggName1234(species, language, generation));
            }

            string nick = GetSpeciesName(species, language);

            switch (language)
            {
            case (int)LanguageID.Korean when generation == 2:
                return(StringConverter2KOR.LocalizeKOR2(nick));

            case (int)LanguageID.Korean:
            case (int)LanguageID.Japanese:
                return(nick);    // No further processing
            }

            // All names are uppercase.
            var sb = new System.Text.StringBuilder(nick);

            for (int i = 0; i < sb.Length; i++)
            {
                sb[i] = char.ToUpper(sb[i]);
            }
            if (language == (int)LanguageID.French)
            {
                StringConverter4.StripDiacriticsFR4(sb); // strips accents on E and I
            }
            // Gen1/2 species names do not have spaces.
            if (generation < 3)
            {
                sb.Replace(" ", string.Empty);
            }

            return(sb.ToString());
        }
Example #2
0
        /// <summary>
        /// Gets a Pokémon's default name for the desired language ID and generation.
        /// </summary>
        /// <param name="species">National Dex number of the Pokémon. Should be 0 if an egg.</param>
        /// <param name="language">Language ID of the Pokémon</param>
        /// <param name="generation">Generation specific formatting option</param>
        /// <returns>Generation specific default species name</returns>
        public static string GetSpeciesNameGeneration(int species, int language, int generation)
        {
            if (generation >= 5)
            {
                // Species Names for Chinese (Simplified) were revised during Generation 8 Crown Tundra DLC (#2).
                // For a Gen7 species name request, return the old species name (hardcoded... yay).
                // In an updated Gen8 game, the species nickname will automatically reset to the correct localization (on save/load ?), fixing existing entries.
                // We don't differentiate patch revisions, just generation; Gen8 will return the latest localization.
                // Gen8 did revise CHT species names, but only for Barraskewda, Urshifu, and Zarude. These species are new (Gen8); we can just use the latest.
                if (generation == 7 && language == (int)LanguageID.ChineseS)
                {
                    switch (species)
                    {
                    // Revised in DLC1 - Isle of Armor
                    // https://cn.portal-pokemon.com/topics/event/200323190120_post_19.html
                    case (int)Species.Porygon2: return("多边兽Ⅱ");  // Later changed to 多边兽2型

                    case (int)Species.PorygonZ: return("多边兽Z");  // Later changed to 多边兽乙型

                    case (int)Species.Mimikyu: return("谜拟Q");    // Later changed to 谜拟丘

                    // Revised in DLC2 - Crown Tundra
                    //  https://cn.portal-pokemon.com/topics/event/201020170000_post_21.html
                    case (int)Species.Cofagrigus: return("死神棺"); // Later changed to 迭失棺

                    case (int)Species.Pangoro: return("流氓熊猫");   // Later changed to 霸道熊猫

                    case (int)Species.Nickit: return("偷儿狐");     // Later changed to 狡小狐

                    case (int)Species.Thievul: return("狐大盗");    // Later changed to 猾大狐

                    case (int)Species.Toxel: return("毒电婴");      // Later changed to 电音婴

                    case (int)Species.Runerigus: return("死神板");  // Later changed to 迭失板
                    }
                }

                return(GetSpeciesName(species, language));
            }

            if (species == 0)
            {
                if (generation == 3)
                {
                    return("タマゴ"); // All Gen3 eggs are treated as JPN eggs.
                }
                if (language == (int)LanguageID.French)
                {
                    return("Oeuf"); // Gen2 & Gen4 don't use Œuf like in future games
                }
            }

            string nick = GetSpeciesName(species, language);

            if (generation == 2 && language == (int)LanguageID.Korean)
            {
                return(StringConverter2KOR.LocalizeKOR2(nick));
            }

            if (generation != 4 || species != 0) // All caps GenIV and previous, except GenIV eggs.
            {
                nick = nick.ToUpper();
                if (language == (int)LanguageID.French)
                {
                    nick = StringConverter4.StripDiacriticsFR4(nick); // strips accents on E and I
                }
            }
            if (generation < 3)
            {
                nick = nick.Replace(" ", string.Empty);
            }
            return(nick);
        }