コード例 #1
0
ファイル: MethodFinder.cs プロジェクト: tools-env/PKHeX
 public static IEnumerable <uint> GetSeedsFromIVsEuclid(RNG method, uint rand1, uint rand2)
 {
     return(method.RecoverLower16BitsEuclid15(rand1 << 16, rand2 << 16));
 }
コード例 #2
0
ファイル: FrameGenerator.cs プロジェクト: 04sama/PKHeX
        /// <summary>
        /// Gets the Search Criteria parameters necessary for generating <see cref="SeedInfo"/> and <see cref="Frame"/> objects for Gen3/4 mainline games.
        /// </summary>
        /// <param name="pk"><see cref="PKM"/> object containing various accessible information required for the encounter.</param>
        /// <returns>Object containing search criteria to be passed by reference to search/filter methods.</returns>
        public FrameGenerator(PKM pk)
        {
            RNG = RNG.LCRNG;
            var ver = (GameVersion)pk.Version;

            switch (ver)
            {
            // Method H
            case GameVersion.R:
            case GameVersion.S:
            case GameVersion.FR:
            case GameVersion.LG:
            case GameVersion.E:
                DPPt      = false;
                FrameType = FrameType.MethodH;
                Safari3   = pk.Ball == 5 && !pk.FRLG;

                if (ver != GameVersion.E)
                {
                    return;
                }

                AllowLeads = true;

                // Cute Charm waits for gender too!
                var  gender   = pk.Gender;
                bool gendered = gender != 2;
                if (!gendered)
                {
                    return;
                }

                var gr = pk.PersonalInfo.Gender;
                Gendered   = true;
                GenderLow  = GetGenderMinMax(gender, gr, false);
                GenderHigh = GetGenderMinMax(gender, gr, true);
                return;

            // Method J
            case GameVersion.D:
            case GameVersion.P:
            case GameVersion.Pt:
                DPPt       = true;
                AllowLeads = true;
                FrameType  = FrameType.MethodJ;
                RNG        = RNG.LCRNG;
                return;

            // Method K
            case GameVersion.HG:
            case GameVersion.SS:
                DPPt       = false;
                AllowLeads = true;
                FrameType  = FrameType.MethodK;
                RNG        = RNG.LCRNG;
                return;

            default:
                throw new ArgumentException(nameof(ver));
            }
        }