コード例 #1
0
 public void GotNewPokemon(ulong uid, PokemonId pokemonId, int cp, double iv, PokemonFamilyId family, int candy, bool fav, bool inGym, double level, PokemonMove move1, PokemonMove move2, PokemonType type1, PokemonType type2, int maxCp, int stamina, int maxStamina, int possibleCp, int candyToEvolve)
 {
     PokemonList.Add(new PokemonUiData(
                         this,
                         uid,
                         pokemonId,
                         //pokemonId.ToInventorySource(),
                         pokemonId.ToString(),
                         cp,
                         iv,
                         family,
                         candy,
                         (ulong)DateTime.UtcNow.ToUnixTime(),
                         fav,
                         inGym,
                         level,
                         move1,
                         move2,
                         type1,
                         type2,
                         maxCp,
                         PokemonInfo.GetBaseStats(pokemonId),
                         stamina,
                         maxStamina,
                         possibleCp,
                         candyToEvolve));
     foreach (var pokemon in PokemonList.Where(x => x.Family == family))
     {
         pokemon.Candy = candy;
         pokemon.UpdateTags(Logic);
     }
 }
コード例 #2
0
 internal static void SeedPokemons(BotWindowData bot)
 {
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Mew, "Mew the awesome!", 1337, 99.9,
                                           PokemonFamilyId.FamilyMew, 4200, 9001, true, true, 97, PokemonMove.Moonblast, PokemonMove.Thunder,
                                           PokemonType.Psychic, PokemonType.Flying, 9000, PokemonInfo.GetBaseStats(PokemonId.Mew), 90, 15, 100000,
                                           42, 15, 7, 0.732f, 101, 100, new[] { PokemonId.Mewtwo, }, true));
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Mewtwo, "Mr.Kickass", 9001, 100,
                                           PokemonFamilyId.FamilyMewtwo, 47, 9001, true, true, 97, PokemonMove.HyperBeam, PokemonMove.PsychoCutFast,
                                           PokemonType.Psychic, PokemonType.Flying, 10000, PokemonInfo.GetBaseStats(PokemonId.Mewtwo), 90, 0,
                                           100000, 42, 13, 15, 0.732f, 101, 100, new[] { PokemonId.Mewtwo, }, false)); //PokemonId.Mew.ToInventorySource(),
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Zapdos, "Thunder", 1337, 100,
                                           PokemonFamilyId.FamilyZapdos, 47, 9001, true, true, 97, PokemonMove.HyperBeam, PokemonMove.PsychoCutFast,
                                           PokemonType.Psychic, PokemonType.Flying, 3000, PokemonInfo.GetBaseStats(PokemonId.Zapdos), 90, 4, 100000,
                                           42, 10, 15, 0.732f, 101, 100, new[] { PokemonId.Mewtwo, }, false));
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Articuno, "Ice-ice-baby", 4048, 100,
                                           PokemonFamilyId.FamilyArticuno, 47, 9001, true, true, 97, PokemonMove.HyperBeam,
                                           PokemonMove.PsychoCutFast, PokemonType.Psychic, PokemonType.Flying, 5000,
                                           PokemonInfo.GetBaseStats(PokemonId.Articuno), 90, 5, 100000, 42, 7, 9, 0.732f, 101, 100,
                                           new[] { PokemonId.Mewtwo, PokemonId.Articuno }, false));
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Moltres, "Popcorn machine", 4269, 100,
                                           PokemonFamilyId.FamilyMoltres, 47, 9001, true, true, 97, PokemonMove.HyperBeam,
                                           PokemonMove.PsychoCutFast, PokemonType.Psychic, PokemonType.Flying, 5000,
                                           PokemonInfo.GetBaseStats(PokemonId.Moltres), 90, 13, 100000, 42, 14, 15, 0.732f, 101, 100,
                                           new[] { PokemonId.Mewtwo, }, false));
 }
コード例 #3
0
 public void GotNewPokemon(BaseNewPokemonEvent evt, string captureType)
 {
     if (PokemonList.Any(x => x.Id == evt.Uid))
     {
         return;
     }
     PokemonList.Add(new PokemonUiData(
                         this,
                         evt.Uid,
                         evt.Id,
                         Session.Translation.GetPokemonName(evt.Id),
                         evt.Cp,
                         evt.Perfection,
                         evt.Family,
                         evt.Candy,
                         (ulong)DateTime.UtcNow.ToUnixTime(),
                         false,
                         false,
                         evt.Level,
                         evt.Move1,
                         evt.Move2,
                         evt.Type1,
                         evt.Type2,
                         evt.MaxCp,
                         PokemonInfo.GetBaseStats(evt.Id),
                         evt.Stamina,
                         evt.IvSta,
                         evt.PossibleCp,
                         evt.CandyToEvolve,
                         evt.IvAtk,
                         evt.IvDef,
                         evt.Cpm,
                         evt.Weight,
                         evt.StaminaMax,
                         evt.Evolutions,
                         false));
     foreach (var pokemon in PokemonList.Where(x => x.Family == evt.Family))
     {
         pokemon.Candy = evt.Candy;
         pokemon.UpdateTags(Logic);
     }
 }
コード例 #4
0
        public async void BuildPokemonList(List <Tuple <PokemonData, double, int> > receivedList)
        {
            PokemonList.Clear();
            var pokemonFamilies = await Session.Inventory.GetPokemonFamilies();

            var pokemonSettings = (await Session.Inventory.GetPokemonSettings()).ToList();

            foreach (var pokemon in receivedList)
            {
                var setting = pokemonSettings.Single(q => q.PokemonId == pokemon.Item1.PokemonId);
                var family  = pokemonFamilies.First(q => q.FamilyId == setting.FamilyId);
                var mon     = new PokemonUiData(
                    this,
                    pokemon.Item1.Id,
                    pokemon.Item1.PokemonId,
                    //pokemon.Item1.PokemonId.ToInventorySource(),
                    pokemon.Item1.Nickname == "" ? Session.Translation.GetPokemonName(pokemon.Item1.PokemonId) : pokemon.Item1.Nickname,
                    pokemon.Item1.Cp,
                    pokemon.Item2,
                    family.FamilyId,
                    family.Candy_,
                    pokemon.Item1.CreationTimeMs,
                    pokemon.Item1.Favorite == 1,
                    !string.IsNullOrEmpty(pokemon.Item1.DeployedFortId),
                    PokemonInfo.GetLevel(pokemon.Item1),
                    pokemon.Item1.Move1,
                    pokemon.Item1.Move2,
                    setting.Type,
                    setting.Type2,
                    (int)PokemonInfo.GetMaxCpAtTrainerLevel(pokemon.Item1, Level),
                    PokemonInfo.GetBaseStats(pokemon.Item1.PokemonId),
                    pokemon.Item1.Stamina,
                    pokemon.Item1.StaminaMax,
                    (int)PokemonInfo.GetMaxCpAtTrainerLevel(pokemon.Item1, 40),
                    setting.CandyToEvolve);
                PokemonList.Add(mon);
                mon.UpdateTags(Logic);
            }
        }
コード例 #5
0
        public async void BuildPokemonList(List <PokemonData> receivedList)
        {
            var pokeInAction = PokemonList.Where(x => x != null && x.InAction).ToList();

            PokemonList.Clear();
            var pokemonFamilies = await Session.Inventory.GetPokemonFamilies();

            var pokemonSettings = (await Session.Inventory.GetPokemonSettings()).ToList();

            foreach (var pokemonGroup in receivedList.GroupBy(x => x.PokemonId))
            {
                var setting = pokemonSettings.Single(q => q.PokemonId == pokemonGroup.Key);
                var family  = pokemonFamilies.First(q => q.FamilyId == setting.FamilyId);
                foreach (var pokemon in pokemonGroup)
                {
                    if (PokemonList.Any(x => x.Id == pokemon.Id))
                    {
                        continue;
                    }

                    var mon = new PokemonUiData(
                        this,
                        pokemon.Id,
                        pokemon.PokemonId,
                        //pokemon.Item1.PokemonId.ToInventorySource(),
                        IsNullOrEmpty(pokemon.Nickname)
                            ? Session.Translation.GetPokemonName(pokemon.PokemonId)
                            : pokemon.Nickname,
                        pokemon.Cp,
                        pokemon.CalculatePokemonPerfection(),
                        family.FamilyId,
                        family.Candy_,
                        pokemon.CreationTimeMs,
                        pokemon.Favorite == 1,
                        !IsNullOrEmpty(pokemon.DeployedFortId),
                        pokemon.GetLevel(),
                        pokemon.Move1,
                        pokemon.Move2,
                        setting.Type,
                        setting.Type2,
                        (int)PokemonInfo.GetMaxCpAtTrainerLevel(pokemon, Level),
                        PokemonInfo.GetBaseStats(pokemon.PokemonId),
                        pokemon.Stamina,
                        pokemon.IndividualStamina,
                        (int)PokemonInfo.GetMaxCpAtTrainerLevel(pokemon, 40),
                        setting.CandyToEvolve,
                        pokemon.IndividualAttack,
                        pokemon.IndividualDefense,
                        pokemon.CpMultiplier + pokemon.AdditionalCpMultiplier,
                        pokemon.WeightKg,
                        pokemon.StaminaMax,
                        setting.EvolutionIds.ToArray(),
                        Session.Profile?.PlayerData?.BuddyPokemon?.Id == pokemon.Id);
                    if (pokeInAction.Any(x => x.Id == mon.Id))
                    {
                        mon.InAction = true;
                    }
                    PokemonList.Add(mon);
                    mon.UpdateTags(Logic);
                }
            }
        }
コード例 #6
0
 public static BaseStats GetBaseStats(this PokemonData pokemon)
 {
     return(PokemonInfo.GetBaseStats(pokemon.PokemonId));
 }