Search in sources :

Example 1 with StatsAttributes

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);
}
Also used : PokemonSettings(POGOProtos.Settings.Master.PokemonSettingsOuterClass.PokemonSettings) StatsAttributes(POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes) NoSuchItemException(com.pokegoapi.exceptions.NoSuchItemException)

Example 2 with StatsAttributes

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());
}
Also used : PokemonSettings(POGOProtos.Settings.Master.PokemonSettingsOuterClass.PokemonSettings) StatsAttributes(POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes)

Example 3 with StatsAttributes

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);
}
Also used : PokemonSettings(POGOProtos.Settings.Master.PokemonSettingsOuterClass.PokemonSettings) StatsAttributes(POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes)

Example 4 with StatsAttributes

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());
}
Also used : PokemonSettings(POGOProtos.Settings.Master.PokemonSettingsOuterClass.PokemonSettings) StatsAttributes(POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes)

Aggregations

StatsAttributes (POGOProtos.Settings.Master.Pokemon.StatsAttributesOuterClass.StatsAttributes)4 PokemonSettings (POGOProtos.Settings.Master.PokemonSettingsOuterClass.PokemonSettings)4 NoSuchItemException (com.pokegoapi.exceptions.NoSuchItemException)1