Beispiel #1
0
        private static bool GetColoStarterMatch(PKM pk, uint top, uint bot, uint[] IVs, out PIDIV pidiv)
        {
            if (pk.Version != 15 || (pk.Species != 196 && pk.Species != 197))
            {
                return(GetNonMatch(out pidiv));
            }

            var iv1 = GetIVChunk(IVs, 0);
            var iv2 = GetIVChunk(IVs, 3);
            var xdc = GetSeedsFromPIDEuclid(RNG.XDRNG, top, bot);

            foreach (var seed in xdc)
            {
                uint origin = seed;
                if (!LockFinder.IsColoStarterValid(pk.Species, ref origin, pk.TID, pk.SID, pk.PID, iv1, iv2))
                {
                    continue;
                }

                pidiv = new PIDIV {
                    OriginSeed = origin, RNG = RNG.XDRNG, Type = PIDType.CXD_ColoStarter
                };
                return(true);
            }
            return(GetNonMatch(out pidiv));
        }
Beispiel #2
0
        private static bool GetColoStarterMatch(PKM pk, uint top, uint bot, ReadOnlySpan <uint> IVs, out PIDIV pidiv)
        {
            if (pk.Version != (int)GameVersion.CXD || pk.Species is not((int)Species.Espeon or(int) Species.Umbreon))
            {
                return(GetNonMatch(out pidiv));
            }

            var iv1 = GetIVChunk(IVs, 0);
            var iv2 = GetIVChunk(IVs, 3);
            var xdc = GetSeedsFromPIDEuclid(RNG.XDRNG, top, bot);

            foreach (var seed in xdc)
            {
                uint origin = seed;
                if (!LockFinder.IsColoStarterValid(pk.Species, ref origin, pk.TID, pk.SID, pk.PID, iv1, iv2))
                {
                    continue;
                }

                pidiv = new PIDIV(CXD_ColoStarter, origin);
                return(true);
            }
            return(GetNonMatch(out pidiv));
        }