Exemple #1
0
        public static bool IsAllShadowLockValid(EncounterStaticShadow s, PIDIV pv, PKM pkm)
        {
            var teams = s.Locks;

            if (teams.Length == 0)
            {
                return(s.Version == GameVersion.COLO || !pkm.IsShiny);             // no xd shiny shadow mons
            }
            var tsv = s.Version == GameVersion.XD ? (pkm.TID ^ pkm.SID) >> 3 : -1; // no xd shiny shadow mons

            return(IsAllShadowLockValid(pv, teams, tsv));
        }
Exemple #2
0
        public static bool IsAllShadowLockValid(EncounterStaticShadow s, PIDIV pv, PKM pkm)
        {
            var teams = s.Locks;

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

            var tsv = s.Version == GameVersion.XD ? pkm.TSV : -1; // no xd shiny shadow mons

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

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

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

            return(false);
        }
Exemple #4
0
 public static bool IsFirstShadowLockValid(EncounterStaticShadow s, PIDIV pv)
 {
     return(IsFirstShadowLockValid(pv, s.Locks, s.Version == GameVersion.XD));
 }