Ejemplo n.º 1
0
        private int GetFactorAgainst(POGOProtos.Enums.PokemonType type)
        {
            if (typeFactor.Keys.Contains(type))
                return typeFactor[type];

            int factor = 0;
            if (UseGymBattleTask.GetBestTypes(type).Any(a => a == attack.PokemonType))
            {
                factor += 2;
                if (mainType == attack.PokemonType || extraType == attack.PokemonType)
                    factor += 1;
            }
            if (UseGymBattleTask.GetWorstTypes(type).Any(a => a == attack.PokemonType)) factor -= 2;

            if (UseGymBattleTask.GetBestTypes(type).Any(a => a == specialAttack.PokemonType))
            {
                factor += 2;
                if (mainType == specialAttack.PokemonType || extraType == specialAttack.PokemonType)
                    factor += 1;
            }
            if (UseGymBattleTask.GetWorstTypes(type).Any(a => a == specialAttack.PokemonType)) factor -= 2;

            typeFactor.Add(type, factor);

            return factor;
        }
Ejemplo n.º 2
0
        public AnyPokemonStat(ISession session, PokemonData pokemon)
        {
            Data = pokemon;

            var pokemonsSetting = session.Inventory.GetPokemonSettings().Result;

            MainType  = pokemonsSetting.Where(f => f.PokemonId == Data.PokemonId).Select(s => s.Type).FirstOrDefault();
            ExtraType = pokemonsSetting.Where(f => f.PokemonId == Data.PokemonId).Select(s => s.Type2).FirstOrDefault();

            Attack        = session.Inventory.GetMoveSetting(Data.Move1).Result;
            SpecialAttack = session.Inventory.GetMoveSetting(Data.Move2).Result;
        }
Ejemplo n.º 3
0
        public AnyPokemonStat(ISession session, PokemonData pokemon)
        {
            data = pokemon;

            var pokemonsSetting = session.Inventory.GetPokemonSettings();
            pokemonsSetting.Wait();
            mainType = pokemonsSetting.Result.Where(f => f.PokemonId == data.PokemonId).Select(s => s.Type).FirstOrDefault();
            extraType = pokemonsSetting.Result.Where(f => f.PokemonId == data.PokemonId).Select(s => s.Type2).FirstOrDefault();

            var attack = session.Inventory.GetMoveSetting(data.Move1);
            attack.Wait();
            this.attack = attack.Result;

            var specialMove = session.Inventory.GetMoveSetting(data.Move2);
            specialMove.Wait();
            specialAttack = specialMove.Result;
        }
Ejemplo n.º 4
0
        private int GetFactorAgainst(POGOProtos.Enums.PokemonType type)
        {
            if (TypeFactor.Keys.Contains(type))
            {
                return(TypeFactor[type]);
            }

            int factor = 0;

            if (UseGymBattleTask.GetBestTypes(type).Any(a => a == Attack.PokemonType))
            {
                factor += 2;
                if (MainType == Attack.PokemonType || ExtraType == Attack.PokemonType)
                {
                    factor += 1;
                }
            }
            if (UseGymBattleTask.GetWorstTypes(type).Any(a => a == Attack.PokemonType))
            {
                factor -= 2;
            }

            if (UseGymBattleTask.GetBestTypes(type).Any(a => a == SpecialAttack.PokemonType))
            {
                factor += 2;
                if (MainType == SpecialAttack.PokemonType || ExtraType == SpecialAttack.PokemonType)
                {
                    factor += 1;
                }
            }
            if (UseGymBattleTask.GetWorstTypes(type).Any(a => a == SpecialAttack.PokemonType))
            {
                factor -= 2;
            }

            TypeFactor.Add(type, factor);

            return(factor);
        }