/// <summary> /// Calculates the best PvP IVs of a Pokémon. Calculated for /// Little, Great, and Ultra Leagues for both levels 41 and 51 max. /// </summary> /// <param name="pokemon">Reference to a Pokémon.</param> public void GetPokemonPvP(ref Pokemon pokemon) { if (pokemon != null) { pokemon.GreatIVs = CPCalculator.CalcPvPIVsPerLeague( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_GREAT_CP, Global.MAX_REG_LEVEL + Global.BUDDY_BOOST); pokemon.UltraIVs = CPCalculator.CalcPvPIVsPerLeague( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_ULTRA_CP, Global.MAX_REG_LEVEL + Global.BUDDY_BOOST); pokemon.GreatXLIVs = CPCalculator.CalcPvPIVsPerLeague( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_GREAT_CP, Global.MAX_XL_LEVEL + Global.BUDDY_BOOST); pokemon.UltraXLIVs = CPCalculator.CalcPvPIVsPerLeague( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_ULTRA_CP, Global.MAX_XL_LEVEL + Global.BUDDY_BOOST); pokemon.CanBeLittleLeague = CanBeLittleLeague(ReformatName(pokemon.Name)); if (pokemon.CanBeLittleLeague) { pokemon.LittleIVs = CPCalculator.CalcPvPIVsPerLeague( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_LITTLE_CP, Global.MAX_REG_LEVEL + Global.BUDDY_BOOST); pokemon.LittleXLIVs = CPCalculator.CalcPvPIVsPerLeague( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_LITTLE_CP, Global.MAX_XL_LEVEL + Global.BUDDY_BOOST); } } }
/// <summary> /// Calculates all of the relevant Stats of a Pokémon. This /// includes the Forms, Moves, League IVs, Type interactions, and weather boosts. /// </summary> /// <param name="pokemon">Reference to a Pokémon.</param> public void GetPokemonStats(ref Pokemon pokemon) { if (pokemon != null) { TypeRelation typeRelations = GetTypeDefenseRelations(pokemon.Type); pokemon.Weakness = typeRelations.Weak.Keys.ToList(); pokemon.Resistance = typeRelations.Strong.Keys.ToList(); pokemon.Weather = GetWeather(pokemon.Type); pokemon.FastMove = POGODBConnector.GetPokemonMoves(ReformatName(pokemon.Name), Global.FAST_MOVE_CATEGORY); pokemon.ChargeMove = POGODBConnector.GetPokemonMoves(ReformatName(pokemon.Name), Global.CHARGE_MOVE_CATEGORY, pokemon.Shadow); pokemon.CPMax = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.MAX_XL_LEVEL); } }
/// <summary> /// Calculates all of the relevant CP valus of a Pokémon. This /// includes the raid, quest, hatch, shadow, and wild perfect IV values. /// </summary> /// <param name="pokemon">Reference to a Pokémon.</param> public static void GetPokemonCP(ref Pokemon pokemon) { if (pokemon != null) { pokemon.CPMaxHalf = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.MAX_REG_LEVEL); pokemon.CPMax = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.MAX_XL_LEVEL); pokemon.CPBestBuddy = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.MAX_XL_LEVEL + Global.BUDDY_BOOST); pokemon.CPRaidMin = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.RAID_LEVEL); pokemon.CPRaidMax = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.RAID_LEVEL); pokemon.CPRaidBoostedMin = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.RAID_LEVEL + Global.WEATHER_BOOST); pokemon.CPRaidBoostedMax = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.RAID_LEVEL + Global.WEATHER_BOOST); pokemon.CPQuestMin = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.QUEST_LEVEL); pokemon.CPQuestMax = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.QUEST_LEVEL); pokemon.CPHatchMin = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.MIN_SPECIAL_IV, Global.HATCH_LEVEL); pokemon.CPHatchMax = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.HATCH_LEVEL); pokemon.CPShadow = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.SHADOW_LEVEL); pokemon.CPShadowBoosted = CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, Global.SHADOW_LEVEL + Global.WEATHER_BOOST); for (int level = Global.MIN_WILD_LEVEL; level <= Global.MAX_WILD_LEVEL; level++) { pokemon.CPWild.Add(CPCalculator.CalcCPPerLevel( pokemon.Attack, pokemon.Defense, pokemon.Stamina, Global.MAX_IV, Global.MAX_IV, Global.MAX_IV, level)); } } }