コード例 #1
0
ファイル: Checker.cs プロジェクト: noobjoker/PokemonTycoon
 public override bool Check(ScriptCore script, Pokebox.SummaryPage page)
 {
     if (_Result.IsKnown)
     {
         return(false);
     }
     if (page != Pokebox.SummaryPage.IV && page != Pokebox.SummaryPage.Status)
     {
         return(false);
     }
     _Result = script.Module <Pokebox>().GetGender() == _gender;
     if (_Operator == CompareOperator.NotEqual)
     {
         _Result = !_Result;
     }
     return(true);
 }
コード例 #2
0
ファイル: Checker.cs プロジェクト: noobjoker/PokemonTycoon
 public override bool Check(ScriptCore script, Pokebox.SummaryPage page)
 {
     if (_Result.IsKnown)
     {
         return(false);
     }
     if (page != Pokebox.SummaryPage.Status)
     {
         return(false);
     }
     _Result = script.Module <Pokebox>().CheckAbility(_abilityImage);
     if (_Operator == CompareOperator.NotEqual)
     {
         _Result = !_Result;
     }
     return(true);
 }
コード例 #3
0
ファイル: Checker.cs プロジェクト: noobjoker/PokemonTycoon
            public override bool Check(ScriptCore script, Pokebox.SummaryPage page)
            {
                if (_Result.IsKnown)
                {
                    return(false);
                }
                if (page != Pokebox.SummaryPage.IV)
                {
                    return(false);
                }
                var ivs = _cache ?? script.Module <Pokebox>().GetIVs();

                _cache = ivs;
                bool good   = true;
                bool better = false;
                int  vc     = 0;

                for (int i = 0; i < 6; i++)
                {
                    if (_pattern[i] != -2 && ivs[i] == 31)
                    {
                        vc++;
                    }
                    if (_pattern[i] == -2)
                    {
                        better = better || ivs[i] >= 0;
                    }
                    else if (_pattern[i] >= 0)
                    {
                        good = good && (ivs[i] == _pattern[i]);
                    }
                }
                good   = good && vc >= _vcount;
                better = better || vc > _vcount;
                int r = good ? better ? 1 : 0 : -1;

                _Result = Compare(_Operator, r, 0);
                return(true);
            }