Originally Posted by
yebakaka
How can i check the %% of perfect of my all pokemons? is there any script or program?
PokemonInfo.cs Line 25
Code:
public static class PokemonInfo
{
public static double CalculatePokemonPerfection(PokemonData poke)
{
if (poke.CpMultiplier + poke.AdditionalCpMultiplier == 0)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0 * 15.0) * 100.0;
BaseStats baseStats = GetBaseStats(poke.PokemonId);
var max_cp = CalculateMaxCPMultiplier(poke);
var min_cp = CalculateMinCPMultiplier(poke);
var cur_cp = CalculateCPMultiplier(poke);
return ((cur_cp - min_cp) / (max_cp - min_cp)) * 100.0;
}
public static double CalculateMaxCPMultiplier(PokemonData poke)
{
BaseStats baseStats = GetBaseStats(poke.PokemonId);
return (baseStats.BaseAttack + 15) * Math.Sqrt(baseStats.BaseDefense + 15) * Math.Sqrt(baseStats.BaseStamina + 15);
}
public static double CalculateMinCPMultiplier(PokemonData poke)
{
BaseStats baseStats = GetBaseStats(poke.PokemonId);
return (baseStats.BaseAttack) * Math.Sqrt(baseStats.BaseDefense) * Math.Sqrt(baseStats.BaseStamina);
}
public static double CalculateCPMultiplier(PokemonData poke)
{
BaseStats baseStats = GetBaseStats(poke.PokemonId);
return (baseStats.BaseAttack + poke.IndividualAttack) * Math.Sqrt(baseStats.BaseDefense + poke.IndividualDefense) * Math.Sqrt(baseStats.BaseStamina + poke.IndividualStamina);
}
public static int CalculateMaxCP(PokemonData poke)
{
return Math.Max((int)Math.Floor(0.1 * CalculateMaxCPMultiplier(poke) * Math.Pow(poke.CpMultiplier + poke.AdditionalCpMultiplier, 2)), 10);
}
public static int CalculateMinCP(PokemonData poke)
{
return Math.Max((int)Math.Floor(0.1 * CalculateMinCPMultiplier(poke) * Math.Pow(poke.CpMultiplier + poke.AdditionalCpMultiplier, 2)), 10);
}
public static int CalculateCP(PokemonData poke)
{
return Math.Max((int)Math.Floor(0.1 * CalculateCPMultiplier(poke) * Math.Pow(poke.CpMultiplier + poke.AdditionalCpMultiplier, 2)), 10);
}
Mostly:
Code:
return ((cur_cp - min_cp) / (max_cp - min_cp)) * 100.0;