use of POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes in project PokeGOAPI-Java by Grover-c13.
the class PokemonCpUtils method getAbsoluteMaxCp.
/**
* Get the absolute maximum CP for pokemons with their PokemonId.
*
* @param api the current api
* @param id The {@link PokemonId} of the Pokemon to get CP for.
* @return The absolute maximum CP
* @throws NoSuchItemException If the PokemonId value cannot be found in the {@link ItemTemplates}.
*/
public static int getAbsoluteMaxCp(PokemonGo api, PokemonId id) throws NoSuchItemException {
PokemonSettings settings = api.itemTemplates.getPokemonSettings(id);
if (settings == null) {
throw new NoSuchItemException("Cannot find meta data for " + id);
}
StatsAttributes stats = settings.getStats();
int attack = 15 + stats.getBaseAttack();
int defense = 15 + stats.getBaseDefense();
int stamina = 15 + stats.getBaseStamina();
return getMaxCpForPlayer(api, attack, defense, stamina, 40);
}
use of POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes in project PokeGOAPI-Java by Grover-c13.
the class PokemonDetails method getCpAfterFullEvolve.
/**
* Calculate the CP after fully evolving this Pokemon
*
* @param highestEvolution the pokemon at the top of the evolution chain being evolved into
* @return New CP after evolve
*/
public int getCpAfterFullEvolve(PokemonId highestEvolution) {
PokemonSettings settings = api.itemTemplates.getPokemonSettings(highestEvolution);
StatsAttributes stats = settings.getStats();
int attack = getIndividualAttack() + stats.getBaseAttack();
int defense = getIndividualDefense() + stats.getBaseDefense();
int stamina = getIndividualStamina() + stats.getBaseStamina();
return PokemonCpUtils.getCp(attack, defense, stamina, getCombinedCpMultiplier());
}
use of POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes in project PokeGOAPI-Java by Grover-c13.
the class PokemonDetails method getMaxCpFullEvolveAndPowerup.
/**
* Calculated the max cp of this pokemon, if you upgrade it fully with your current player level
*
* @param playerLevel the current player level
* @param highestEvolution the full evolution path
* @return Max cp of this pokemon
*/
private int getMaxCpFullEvolveAndPowerup(int playerLevel, PokemonId highestEvolution) {
PokemonSettings settings = api.itemTemplates.getPokemonSettings(highestEvolution);
StatsAttributes stats = settings.getStats();
int attack = getIndividualAttack() + stats.getBaseAttack();
int defense = getIndividualDefense() + stats.getBaseDefense();
int stamina = getIndividualStamina() + stats.getBaseStamina();
return PokemonCpUtils.getMaxCpForPlayer(api, attack, defense, stamina, playerLevel);
}
use of POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes in project PokeGOAPI-Java by Grover-c13.
the class PokemonDetails method getCpAfterEvolve.
/**
* Calculate the CP after evolving this Pokemon
*
* @param evolution the pokemon evolving into
* @return New CP after evolve
*/
public int getCpAfterEvolve(PokemonId evolution) {
PokemonSettings settings = api.itemTemplates.getPokemonSettings(evolution);
StatsAttributes stats = settings.getStats();
int attack = getIndividualAttack() + stats.getBaseAttack();
int defense = getIndividualDefense() + stats.getBaseDefense();
int stamina = getIndividualStamina() + stats.getBaseStamina();
return PokemonCpUtils.getCp(attack, defense, stamina, getCombinedCpMultiplier());
}
Aggregations