Ejemplo n.º 1
0
        public override bool IsMatch(PKM pkm, DexLevel evo)
        {
            if (!base.IsMatch(pkm, evo))
            {
                return(false);
            }

            if (Language != EncounterGBLanguage.Any && pkm.Japanese != (Language == EncounterGBLanguage.Japanese))
            {
                return(false);
            }

            if (TID != -1 && pkm.TID != TID)
            {
                return(false);
            }

            if (OT_Name.Length != 0)
            {
                if (pkm.OT_Name != OT_Name)
                {
                    return(false);
                }
            }
            else if (OT_Names.Count != 0)
            {
                if (!OT_Names.Contains(pkm.OT_Name))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
 public override bool IsMatch(PKM pkm, DexLevel evo)
 {
     if (pkm is IDynamaxLevel d && d.DynamaxLevel < DynamaxLevel)
     {
         return(false);
     }
     return(base.IsMatch(pkm, evo));
 }
Ejemplo n.º 3
0
 protected virtual bool IsMatchForm(PKM pkm, DexLevel evo)
 {
     if (SkipFormCheck)
     {
         return(true);
     }
     return(Form == evo.Form || Legal.IsFormChangeable(Species, Form, pkm.AltForm, pkm.Format));
 }
Ejemplo n.º 4
0
        public override bool IsMatch(PKM pkm, DexLevel evo)
        {
            if (pkm.FlawlessIVCount < FlawlessIVCount)
            {
                return(false);
            }

            return(base.IsMatch(pkm, evo));
        }
Ejemplo n.º 5
0
        protected override bool IsMatchLevel(PKM pkm, DexLevel evo)
        {
            if (pkm is ICaughtData2 pk2 && pk2.CaughtData != 0)
            {
                return(pkm.Met_Level == (EggEncounter ? 1 : Level));
            }

            return(Level <= evo.Level);
        }
Ejemplo n.º 6
0
        protected override bool IsMatchLevel(PKM pkm, DexLevel evo)
        {
            // Level from 5->40 depends on the number of badges
            var met = pkm.Met_Level;

            if (met % 5 != 0)
            {
                return(false);
            }
            return((uint)(met - 5) <= 35); // 5 <= x <= 40
        }
Ejemplo n.º 7
0
 public override bool IsMatch(PKM pkm, DexLevel evo, int lvl)
 {
     if (pkm is IDynamaxLevel d && d.DynamaxLevel < DynamaxLevel)
     {
         return(false);
     }
     if (pkm.FlawlessIVCount < FlawlessIVCount)
     {
         return(false);
     }
     return(base.IsMatch(pkm, evo, lvl));
 }
Ejemplo n.º 8
0
        protected override bool IsMatchLevel(PKM pkm, DexLevel evo)
        {
            if (pkm.Format != 3) // Met Level lost on PK3=>PK4
            {
                return(Level <= evo.Level);
            }

            if (EggEncounter)
            {
                return(pkm.Met_Level == 0 && pkm.CurrentLevel >= 5); // met level 0, origin level 5
            }
            return(pkm.Met_Level == Level);
        }
Ejemplo n.º 9
0
        public override bool IsMatch(PKM pkm, DexLevel evo)
        {
            if (!base.IsMatch(pkm, evo))
            {
                return(false);
            }

            if (Language != EncounterGBLanguage.Any && pkm.Japanese != (Language == EncounterGBLanguage.Japanese))
            {
                return(false);
            }

            if (CurrentLevel != -1 && CurrentLevel > pkm.CurrentLevel)
            {
                return(false);
            }

            // EC/PID check doesn't exist for these, so check Shiny state here.
            if (!IsShinyValid(pkm))
            {
                return(false);
            }

            if (EggEncounter && !pkm.IsEgg)
            {
                return(true);
            }

            // Check OT Details
            if (TID != -1 && pkm.TID != TID)
            {
                return(false);
            }

            if (OT_Name.Length != 0)
            {
                if (pkm.OT_Name != OT_Name)
                {
                    return(false);
                }
            }
            else if (OT_Names.Count != 0)
            {
                if (!OT_Names.Contains(pkm.OT_Name))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 10
0
        protected override bool IsMatchLevel(PKM pkm, DexLevel evo)
        {
            var met = pkm.Met_Level;

            if (met == Level)
            {
                return(true);
            }
            if (EncounterArea8.IsBoostedArea60(Location))
            {
                return(met == 60);
            }
            return(false);
        }
Ejemplo n.º 11
0
        protected override bool IsMatchForm(PKM pkm, DexLevel evo)
        {
            if (SkipFormCheck)
            {
                return(true);
            }

            if (FormConverter.IsTotemForm(Species, Form, Generation))
            {
                var expectForm = pkm.Format == 7 ? Form : FormConverter.GetTotemBaseForm(Species, Form);
                return(expectForm == evo.Form);
            }

            return(Form == evo.Form || Legal.IsFormChangeable(Species, Form, pkm.AltForm, pkm.Format));
        }
Ejemplo n.º 12
0
 private static bool IsMatch(DexLevel evo, EncounterSlot slot)
 {
     if (evo.Species != slot.Species)
     {
         return(false);
     }
     if (evo.Form == slot.Form)
     {
         return(true);
     }
     if (Legal.FormChange.Contains(evo.Species))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 13
0
        public virtual bool IsMatch(PKM pkm, DexLevel evo)
        {
            if (Nature != Nature.Random && pkm.Nature != (int)Nature)
            {
                return(false);
            }

            if (!IsMatchEggLocation(pkm))
            {
                return(false);
            }
            if (!IsMatchLocation(pkm))
            {
                return(false);
            }
            if (!IsMatchLevel(pkm, evo))
            {
                return(false);
            }
            if (!IsMatchGender(pkm))
            {
                return(false);
            }
            if (!IsMatchForm(pkm, evo))
            {
                return(false);
            }
            if (!IsMatchIVs(pkm))
            {
                return(false);
            }

            if (this is IContestStats es && pkm is IContestStats s && s.IsContestBelow(es))
            {
                return(false);
            }

            // Defer to EC/PID check
            // if (e.Shiny != null && e.Shiny != pkm.IsShiny)
            // continue;

            // Defer ball check to later
            // if (e.Gift && pkm.Ball != 4) // PokéBall
            // continue;

            return(true);
        }
Ejemplo n.º 14
0
 public override bool IsMatch(PKM pkm, DexLevel evo)
 {
     // Let it get picked up as regular EncounterEgg under other conditions.
     if (pkm.Format > 2)
     {
         return(false);
     }
     if (pkm.Move1 != Dizzy && pkm.Move2 != Dizzy && pkm.Move3 != Dizzy && pkm.Move4 != Dizzy)
     {
         return(false);
     }
     if (pkm.IsEgg && pkm.EXP != 125)
     {
         return(false);
     }
     return(base.IsMatch(pkm, evo));
 }
Ejemplo n.º 15
0
        public override bool IsMatch(PKM pkm, DexLevel evo)
        {
            if (!base.IsMatch(pkm, evo))
            {
                return(false);
            }

            if (Language != EncounterGBLanguage.Any && pkm.Japanese != (Language == EncounterGBLanguage.Japanese))
            {
                return(false);
            }

            if (CurrentLevel != -1 && CurrentLevel > pkm.CurrentLevel)
            {
                return(false);
            }

            if (EggEncounter && !pkm.IsEgg)
            {
                return(true);
            }

            // Check OT Details
            if (TID != -1 && pkm.TID != TID)
            {
                return(false);
            }

            if (OT_Name.Length != 0)
            {
                if (pkm.OT_Name != OT_Name)
                {
                    return(false);
                }
            }
            else if (OT_Names.Count != 0)
            {
                if (!OT_Names.Contains(pkm.OT_Name))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 16
0
        private bool ExistsPressureSlot(DexLevel evo, ref int level)
        {
            bool existsForm = false;

            foreach (var z in Slots)
            {
                if (z.Species != evo.Species)
                {
                    continue;
                }
                if (z.Form == evo.Form)
                {
                    continue;
                }
                if (z.LevelMax < level)
                {
                    continue;
                }
                level      = z.LevelMax;
                existsForm = true;
            }
            return(existsForm);
        }
Ejemplo n.º 17
0
 protected virtual bool IsMatchLevel(PKM pkm, DexLevel evo)
 {
     return(pkm.Met_Level == Level);
 }