Пример #1
0
        public async Task <IEnumerable <PokemonData> > GetPokemonToPowerUp(IEnumerable <PokemonId> filter = null)
        {
            List <PokemonData> lstReturn = new List <PokemonData>();

            if (GlobalSettings.dblStarDust < 10000)
            {
                return(lstReturn);
            }
            var myPokemon = await GetPokemons();

            var pokemons = myPokemon.ToList();

            pokemons = pokemons.OrderByDescending(PokemonInfo.CalculatePokemonPerfection).ToList();

            //return pokemons;//returns all instead of iv
            var myPokemonSettings = await GetPokemonSettings();

            var pokemonSettings = myPokemonSettings.ToList();

            var myPokemonFamilies = await GetPokemonFamilies();

            var pokemonFamilies = myPokemonFamilies.ToArray();

            foreach (var vrPokemon in pokemons)
            {
                if (PokemonInfo.CalculatePokemonPerfection(vrPokemon) >= _logicSettings.irPowerUpPerfectionIV)
                {
                    var settings    = pokemonSettings.Single(x => x.PokemonId == vrPokemon.PokemonId);
                    var familyCandy = pokemonFamilies.Single(x => settings.FamilyId == x.FamilyId);
                    if (familyCandy.Candy_ < funcReturnCandyAmount(PokemonInfo.GetPowerUpLevel(vrPokemon)))
                    {
                        continue;
                    }
                    double dblLevel = PokemonInfo.GetLevel(vrPokemon);
                    if (GlobalSettings.dblUserLevel + 1.5 <= dblLevel)
                    {
                        continue;
                    }
                    lstReturn.Add(vrPokemon);
                }
            }

            return(lstReturn);
        }
Пример #2
0
 public static int GetPowerUpLevel(this PokemonData pokemon)
 {
     return(PokemonInfo.GetPowerUpLevel(pokemon));
 }