Exemple #1
0
    public static bool IsAllShadowLockValid(EncounterStaticShadow s, PIDIV pv, PKM pk)
    {
        if (s.Version == GameVersion.XD && pk.IsShiny)
        {
            return(false); // no xd shiny shadow mons
        }
        var teams = s.Locks;

        if (teams.Length == 0)
        {
            return(true);
        }

        var tsv = s.Version == GameVersion.XD ? (pk.TID ^ pk.SID) >> 3 : -1; // no xd shiny shadow mons

        return(IsAllShadowLockValid(pv, teams, tsv));
    }
    private static bool GetIsShadowLockValid(PKM pk, LegalInfo info, EncounterStaticShadow s)
    {
        if (s.IVs.Count == 0) // not E-Reader
        {
            return(LockFinder.IsAllShadowLockValid(s, info.PIDIV, pk));
        }

        // E-Reader have fixed IVs, and aren't recognized as CXD (no PID-IV correlation).
        var possible = MethodFinder.GetColoEReaderMatches(pk.EncryptionConstant);

        foreach (var poss in possible)
        {
            if (!LockFinder.IsAllShadowLockValid(s, poss, pk))
            {
                continue;
            }
            info.PIDIV = poss;
            return(true);
        }

        return(false);
    }