Ejemplo n.º 1
0
        public bool CheckResult(RNGResult result)
        {
            if (Skip)
            {
                result.hiddenpower = (byte)Pokemon.getHiddenPowerValue(result.IVs);
                if (BS != null)
                {
                    result.Stats = Pokemon.getStats(result.IVs, result.Nature, result.Level, BS);
                }
                return(true);
            }
            if (result is EggResult egg && Ball != 0 && Ball != egg.Ball)
            {
                return(false);
            }
            if (ShinyOnly && !result.Shiny)
            {
                return(false);
            }
            if (BS == null ? !CheckIVs(result) : !CheckStats(result))
            {
                return(false);
            }
            if (!CheckHiddenPower(result))
            {
                return(false);
            }
            if (!CheckNature(result.Nature))
            {
                return(false);
            }
            if (Gender != 0 && Gender != result.Gender)
            {
                return(false);
            }
            if (Ability != 0 && Ability != result.Ability)
            {
                return(false);
            }

            if (result is WildResult wildresult)
            {
                if (Level != 0 && Level != result.Level)
                {
                    return(false);
                }
                if (SpecialOnly && !wildresult.IsSpecial)
                {
                    return(false);
                }
                if (!CheckSlot(wildresult.Slot))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool CheckHiddenPower(RNGResult result)
        {
            var val = Pokemon.getHiddenPowerValue(result.IVs);

            result.hiddenpower = (byte)val;
            if (HPType.All(n => !n))
            {
                return(true);
            }
            return(HPType[val]);
        }
Ejemplo n.º 3
0
 private bool CheckStats(RNGResult result)
 {
     result.Stats = Pokemon.getStats(result.IVs, result.Nature, result.Level, BS);
     for (int i = 0; i < 6; i++)
     {
         if (Stats[i] != 0 && Stats[i] != result.Stats[i])
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 4
0
 private bool CheckIVs(RNGResult result)
 {
     for (int i = 0; i < 6; i++)
     {
         if (IVlow[i] > result.IVs[i] || result.IVs[i] > IVup[i])
         {
             return(false);
         }
     }
     if (result.IVs.Count(e => e == 31) < PerfectIVs)
     {
         return(false);
     }
     return(true);
 }