コード例 #1
0
        internal static int GetRandomForme(int species, bool mega, bool alola, PersonalInfo[] stats = null)
        {
            if (stats == null)
            {
                return(0);
            }
            if (stats[species].FormeCount <= 1)
            {
                return(0);
            }

            if (species == 658 && !mega) // Greninja
            {
                return(0);
            }
            if (species == 664 || species == 665 || species == 666) // vivillon
            {
                return(30);                                         // save file specific
            }
            if (species == 774)                                     // minior
            {
                return(Util.Rand.Next(7));
            }

            if (alola && EvolveToAlolanForms.Contains(species))
            {
                return(Util.Rand.Next(2));
            }
            if (!BattleExclusiveForms.Contains(species) || mega)
            {
                return(Util.Rand.Next(stats[species].FormeCount)); // Slot-Random
            }
            return(0);
        }
コード例 #2
0
        public static int GetRandomForme(int species, bool mega, bool alola, bool galar, PersonalTable stats)
        {
            if (stats == null)
            {
                return(0);
            }
            if (stats[species].FormeCount <= 1)
            {
                return(0);
            }

            if (species == 658 && !mega) // Greninja
            {
                return(0);
            }
            if (species == 664 || species == 665 || species == 666) // vivillon
            {
                return(30);                                         // save file specific
            }
            if (species == 774)                                     // minior
            {
                return(Util.Rand.Next(7));
            }
            if (species == 890) // Eternatus
            {
                return(0);
            }

            if (galar && species == 052) // Galarian Meowth is altform 2
            {
                return(Util.Rand.Next(3));
            }
            if (galar && species == 079) // todo: remove when Kanto Slowpoke is made usable in SWSH
            {
                return(1);
            }
            if (galar && species == 555) // Galarian Darmanitan is altform 2, Galarian Zen is altform 3
            {
                return(Util.Rand.Next(4));
            }

            if (stats.TableLength == 980 && (species == 25 || species == 133)) // gg tableB -- no starters, they crash trainer battles.
            {
                return(0);                                                     // Pikachu
            }
            if (EvolveToAlolanForms.Contains(species))
            {
                return(alola ? Util.Rand.Next(2) : 0);
            }
            if (EvolveToGalarForms.Contains(species))
            {
                return(galar ? Util.Rand.Next(2) : 0);
            }
            if (!BattleExclusiveForms.Contains(species) || mega)
            {
                return(Util.Rand.Next(stats[species].FormeCount)); // Slot-Random
            }
            return(0);
        }
コード例 #3
0
ファイル: Legal.cs プロジェクト: rodcybersec/pkNX
        public static int GetRandomForme(int species, bool mega, bool alola, PersonalTable stats)
        {
            if (stats == null)
            {
                return(0);
            }
            if (stats[species].FormeCount <= 1)
            {
                return(0);
            }

            if (species == 658 && !mega) // Greninja
            {
                return(0);
            }
            if (species == 664 || species == 665 || species == 666) // vivillon
            {
                return(30);                                         // save file specific
            }
            if (species == 774)                                     // minior
            {
                return(Util.Rand.Next(7));
            }

            if (stats.TableLength == 980 && (species == 25 || species == 133)) // gg tableB -- no starters, they crash trainer battles.
            {
                return(0);                                                     // Pikachu
            }
            if (EvolveToAlolanForms.Contains(species))
            {
                return(alola ? Util.Rand.Next(2) : 0);
            }
            if (!BattleExclusiveForms.Contains(species) || mega)
            {
                return(Util.Rand.Next(stats[species].FormeCount)); // Slot-Random
            }
            return(0);
        }
コード例 #4
0
ファイル: Legal.cs プロジェクト: shyunsek/pkNX
        public static int GetRandomForme(int species, bool mega, bool alola, bool galar, PersonalTable stats)
        {
            if (stats == null)
            {
                return(0);
            }
            if (stats[species].FormeCount <= 1)
            {
                return(0);
            }

            if (species == (int)Species.Unown || species == (int)Species.Deerling || species == (int)Species.Sawsbuck)
            {
                return(31); // Random
            }
            if ((species == (int)Species.Greninja && !mega) || species == (int)Species.Eternatus)
            {
                return(0);
            }
            if (species == (int)Species.Scatterbug || species == (int)Species.Spewpa || species == (int)Species.Vivillon)
            {
                return(30); // save file specific
            }
            if (species == (int)Species.Minior)
            {
                return(Util.Rand.Next(7)); // keep the core color a surprise
            }
            if (galar)
            {
                switch ((Species)species)
                {
                case Species.Meowth:
                    return(Util.Rand.Next(3));    // Kanto, Alola, Galar

                case Species.Darmanitan:
                    return(Util.Rand.Next(4));    // Standard, Zen, Galar Standard, Galar Zen

                case Species.Slowbro:
                {
                    int form = Util.Rand.Next(2);         // Slowbro-1 is Mega and Slowbro-2 is Galar, so only return 0 or 2
                    if (form == 1)
                    {
                        form++;
                    }
                    return(form);
                }
                }
            }

            if (stats.TableLength == 980 && (species == (int)Species.Pikachu || species == (int)Species.Eevee)) // gg tableB -- no starters, they crash trainer battles.
            {
                return(0);
            }
            if (stats.TableLength == 1181 && species == (int)Species.Pikachu) // SWSH -- disallow Partner Pikachu from LGPE, but allow World Cap
            {
                int form = Util.Rand.Next(9);
                if (form == 8)
                {
                    form++;
                }
                return(form);
            }
            if (EvolveToAlolanForms.Contains(species))
            {
                return(alola ? Util.Rand.Next(2) : 0);
            }
            if (EvolveToGalarForms.Contains(species))
            {
                return(galar ? Util.Rand.Next(2) : 0);
            }
            if (!BattleExclusiveForms.Contains(species) || mega)
            {
                return(Util.Rand.Next(stats[species].FormeCount)); // Slot-Random
            }
            return(0);
        }