Reference

PoGOBase.BossFT — Method
BossFT(boss::Species, tier::Int; attack_multiplier=1, defense_multiplier=1, cpm=maxbattles.cpm[tier], hp=maxbattles.hp[tier]) -> BossFT

Represent a max-battle boss with simplified parameters ferocity and tankiness.

source
PoGOBase.Pokemon — Method
Pokemon(id, level, ivs; name=display_name(id), islucky=false, mutation='N', isshiny=false, mega=false, max='N', maxlevel=nothing, raid_tier=nothing, max_tier=nothing)
Pokemon(id, ivs; cp, kwargs...)

Construct a Pokemon. id is either a Species or a valid argument for only_pokemon(id; exact=true). If level is not supplied, cp is an obligate keyword argument. mega is typically true or false, except in cases (like Charizard) where one should supply a Char to disambiguate the mega (e.g., 'X' or 'Y').

Examples

julia> Pokemon("Ralts", (8, 12, 10); cp=204)
Ralts; CP: 204; level: 15.0; IVs: (8, 12, 10)

julia> Pokemon("LUCARIO", 20.0, (15, 12, 13); name="Wiley")
Wiley (Lucario); CP: 1521; level: 20.0; IVs: (15, 12, 13)
source
PoGOGamemaster.PvEMove — Method
PvEMove(name::AbstractString) → move

Return the PvE move with the given name. For a fast move, append "_fast" to the name.

source
PoGOGamemaster.PvPMove — Method
PvPMove(name::AbstractString) → move

Return the PvP move with the given name. For a fast move, append "_fast" to the name.

source
PoGOBase.baby — Method
baby(poke::Pokemon) → baby_species
baby(species::Species) → baby_species

Return the baby species (base stage evolution) for poke or species.

source
PoGOBase.base_stats — Method
base_stats(poke::Pokemon) → (a, d, h)
base_stats(species::Species; mega::Union{Bool, Char} = false) → (a, d, h)

Return the base attack (a), defense (d), and stamina (h) stats for a Pokemon or Species. If poke is a mega-evolution or mega != false, the base stats for the mega-evolution are returned.

source
PoGOBase.best_for_league — Method
best_for_league(pd::Species, league_cp; kwargs...) → poke

Create the pokemon with highest statproduct given the league CP limit.

source
PoGOBase.binary_search — Method
binary_search(f, flim, xmin, xmax, Δx) → x => f(x)

Return the largest value of x, starting with xmin and incrementing by Δx as long as x <= xmax, such that f(x) <= flim.

source
PoGOBase.bulk_best_league — Method
bulk_best_league(name, league_cp::Int; level_limit=50.0) → bulk
bulk_best_league(pd::Species, league_cp::Int; level_limit=50.0) → bulk

Return the pokemon's bulk for a specific CP limit, assuming the best IVs and fully powered-up.

source
PoGOBase.chargedmoves — Method
chargedmoves(species::Species; elite = true) → moves

Return a list of the names of the charged moves that species can learn. By default, include any elite charged moves.

source
PoGOBase.combat_power — Function
combat_power(poke::Pokemon, level = poke.level) → cp

Return the combat power of poke. Optionally you can override the level, for example to see how the CP changes when you power up the Pokemon.

source
PoGOBase.damage — Method
damage(move::AbstractMove, attacker, defender; kwargs...)

Calculate the damage caused by a move from attacker against defender. If defender is a Pokemon, the damage is an integer number of HP. If defender is a BossFT, the damage is a percentage of the boss's HP.

Allowed kwargs depend on whether move is a PvP or PvE move.

For PvP moves, the following kwargs are allowed:

  • buffs::Real: a multiplier for the damage, default is 1
  • charge::Real: a multiplier for the damage, default is 1

For PvE moves, the following kwargs are allowed:

  • current_weather: the current weather, default is missing (alternatively supply a numeric weather=1.2 directly)
  • friendship: the friendship level, default is missing (alternatively supply a numeric friendshipbonus=1.0 directly)
  • dodged: a multiplier for the damage, default is 1
  • mushroom::Bool: a flag for the mushroom effect, default is false
  • helpericons: the number of helper icons, default is 0 (alternatively supply a numeric helperbonus=1.0 directly)
  • attack_multiplier: a multiplier for the attacker's attack, default is 1
  • defense_multiplier: a multiplier for the defender's defense, default is 1
source
PoGOBase.eachpokemon — Method
eachpokemon(; include_shadow=true, include_mega=true, level=31, ivs=(15, 15, 15)) → pokes

Return a list of one of each species of Pokemon at the given level and IVs. By default, include shadows and megas.

source
PoGOBase.evolution_cost — Function
evolution_cost(poke::Pokemon, as::Species = Species(poke)) → cost

Return the candy cost to evolve poke to as.

source
PoGOBase.fastmoves — Method
fastmoves(species::Species; elite = true) → moves

Return a list of the names of the fast moves that species can learn. By default, include any elite fast moves.

source
PoGOBase.hp — Function
hp(poke::Pokemon, level = poke.level) → hp

Return the hit points of poke. Optionally you can override the level, for example to see how the HP changes when you power up the Pokemon.

source
PoGOBase.isavailable — Method
PoGOBase.isavailable(species::Species) → Bool

Return true if the species is currently available in the game. To update this list, see the dex_unavailable constant in src/consts.jl.

source
PoGOBase.joinpath_and_register — Method
joinpath_and_register(path, filename) → fullpath

Return the absolute path and also add it as an include dependency, so that the package gets recompiled if the file fullpath is updated.

source
PoGOBase.kmcost — Function
kmcost(poke::Pokemon, target_level_or_cplimit, candy=0, candyxl=0; add_move=true, as=Species(poke))

Estimate the buddy walk distance needed to get enough candy to power up poke to target_level. candy and candyxl are the amounts of candy you own and can devote to powering up. target_level_or_cplimit is interpreted as a battle league CP limit if it is 500 or larger, otherwise it it interpreted as a target level. Set add_move=false if you don't need to purchase a third move.

Note that for XL candy the distance is probabilistic, and the XL rate for walking increases with buddy level, maxing out at level 31: see https://thesilphroad.com/science/quick-discovery/early-look-buddy-candy-xl-rates. If you need to walk to earn XL candy, the calculation assumes that you power up at least to level 31 as quickly as you can (e.g., powering up as you earn regular candy, and waiting to evolve and/or purchase a 3rd move until you reach level 31). Failing to follow this strategy may increase your distance requirement. Alternatively, your distance requirement may decrease if you walk a different pokemon of the same species that is already level 31 or higher.

source
PoGOBase.league_catch_cp — Function
league_catch_cp(catch_name::AbstractString, league_cp::Int, as_name::AbstractString = catch_name; kwargs...) → cparray
league_catch_cp(pd::Species, league_cp::Int, as::Species = pd; kwargs...) → cparray

Return a 3d cparray indexed by the IVs that returns the maximum cp to wild-catch a CP to be just at or below league_cp when evolved to as_uid.

source
PoGOBase.league_max_level — Method
league_max_level(poke::Pokemon, league_cp::Int; level_limit=50.0) → level, cp
league_max_level(poke::Pokemon, level::Real, league_cp::Int; level_limit=50.0) → level, cp
league_max_level(name::AbstractString, ivs, level, league_cp::Int; level_limit=50.0) → level, cp

Return the maximum level and corresponding cp to stay at or below league_cp. This errors if poke.level is already too high, although you can manually supply an alternate level if you wish (1.0 is a good choice as it enables the most opportunities).

source
PoGOBase.lineage_ids — Method
lineage_ids(poke::Pokemon) → ids
lineage_ids(species::Species) → ids
lineage_ids(list) → ids

Return the further evolutions of poke or species as a list of IDs.

Examples

julia> PoGOBase.lineage_ids(only_pokemon("ivysaur"))
2-element Vector{String}:
 "IVYSAUR"
 "VENUSAUR"

julia> PoGOBase.lineage_ids(only_pokemon("ralts"))
4-element Vector{String}:
 "GALLADE"
 "GARDEVOIR"
 "KIRLIA"
 "RALTS"
source
PoGOBase.matching_pokemon — Method
matching_pokemon(name::AbstractString, types::AbstractString; kwargs...) → species

Return a list of Species objects that match the given name and types.

Examples

julia> matching_pokemon("rattata", "dark/normal")
1-element Vector{Species}:
 RATTATA_ALOLA (DARK/NORMAL): (103, 70, 102); Fast: ["TACKLE_FAST", "QUICK_ATTACK_FAST"]; Charged: ["CRUNCH", "HYPER_FANG", "SHADOW_BALL"]
source
PoGOBase.matching_pokemon — Method
matching_pokemon(name::AbstractString; tol=0.0, complete=false) → species

Return a list of Species objects that match the given name. If complete is true, the name must match exactly.

tol represents a tolerance on the Levenshtein distance between the name and the species name.

Examples

julia> matching_pokemon("rattata")
2-element Vector{Species}:
 RATTATA (NORMAL): (103, 70, 102); Fast: ["TACKLE_FAST", "QUICK_ATTACK_FAST"]; Charged: ["DIG", "HYPER_FANG", "BODY_SLAM"]
 RATTATA_ALOLA (DARK/NORMAL): (103, 70, 102); Fast: ["TACKLE_FAST", "QUICK_ATTACK_FAST"]; Charged: ["CRUNCH", "HYPER_FANG", "SHADOW_BALL"]

julia> matching_pokemon("rattata"; complete=true)
1-element Vector{Species}:
 RATTATA (NORMAL): (103, 70, 102); Fast: ["TACKLE_FAST", "QUICK_ATTACK_FAST"]; Charged: ["DIG", "HYPER_FANG", "BODY_SLAM"]

julia> matching_pokemon("rattatta")      # misspelled
Species[]

julia> matching_pokemon("rattatta"; tol=0.25)
2-element Vector{Species}:
 RATTATA (NORMAL): (103, 70, 102); Fast: ["TACKLE_FAST", "QUICK_ATTACK_FAST"]; Charged: ["DIG", "HYPER_FANG", "BODY_SLAM"]
 RATTATA_ALOLA (DARK/NORMAL): (103, 70, 102); Fast: ["TACKLE_FAST", "QUICK_ATTACK_FAST"]; Charged: ["CRUNCH", "HYPER_FANG", "SHADOW_BALL"]
source
PoGOBase.megaevolve — Function
megaevolve(poke::Pokemon, mega::Union{Bool, Char} = true) → megapoke

Create a new Pokemon object that is a mega-evolution of poke. If mega is true, the default mega-evolution is used. If mega is a Char, the mega-evolution with that name is used. If mega is false, the normal form is returned.

source
PoGOBase.only_pokemon — Method
only_pokemon(name::AbstractString; exact=false, equiv=false, kwargs...) → species

Return the Species object that matches the given name, and throw an error if more than one matches.

If exact is true, only exact matches of the name are considered. If equiv is true, an error is not thrown if all matches are equivalent in their types, base stats, and moves.

Examples

julia> only_pokemon("scatterbug")
ERROR: multiple matching pokemon were found: ["SCATTERBUG", "SCATTERBUG_ARCHIPELAGO", "SCATTERBUG_CONTINENTAL", "SCATTERBUG_ELEGANT", "SCATTERBUG_FANCY", "SCATTERBUG_GARDEN", "SCATTERBUG_HIGH_PLAINS", "SCATTERBUG_ICY_SNOW", "SCATTERBUG_JUNGLE", "SCATTERBUG_MARINE", "SCATTERBUG_MEADOW", "SCATTERBUG_MODERN", "SCATTERBUG_MONSOON", "SCATTERBUG_OCEAN", "SCATTERBUG_POKEBALL", "SCATTERBUG_POLAR", "SCATTERBUG_RIVER", "SCATTERBUG_SANDSTORM", "SCATTERBUG_SAVANNA", "SCATTERBUG_SUN", "SCATTERBUG_TUNDRA"]

julia> only_pokemon("scatterbug"; equiv=true)
SCATTERBUG (BUG): (63, 63, 116); Fast: ["BUG_BITE_FAST", "TACKLE_FAST"]; Charged: ["STRUGGLE"]
source
PoGOBase.purify — Method
purify(poke::Pokemon) → purified_poke

Create a new Pokemon object that is a purified form of poke.

source
PoGOBase.raid_power — Method
raid_power(pd::Species, ivs::IVsType, level::Real)
raid_power(poke::Pokemon; as::Species=Species(poke), level=scalarlevel(poke))

Calculate the "abstract raid power," based on the standard DPS^3*TDO. Since DPS ∝ a (attack stat), and TDO ∝ a*d*h, (the full stat product), this simply returns (a^4 * d * h)^(1/6). (The 1/6th power returns a value scaled like individual stats.)

This is most useful for comparing within-species, where all the move options are (in principle) identical. "Full" raid power also depends on the raid boss and specific moves of all combatants. If used to compare across species, "abstract raid power" may overrate pokemon with good stats but poor move options.

source
PoGOBase.split_kwargs — Method
split_kwargs(keep; kwargs...) → kwkeep, kwdisc

Split kwargs by name into two groups, with the first group containing those names appearing in keep.

Examples

julia> PoGOBase.split_kwargs((:a, :z); a=5, b="hello", z=nothing)
((a = 5, z = nothing), (b = "hello",))
source
PoGOBase.statproduct — Method
statproduct(poke) → sp
statproduct(stats) → sp

Compute the "stat product" for a specific Pokemon.

source
PoGOBase.statproduct_league — Method
statproduct_league(pd::Species, ivs, league_cp::Int; kwargs...) → level => (cp, statprod)
statproduct_league(name::AbstractString, ivs, league_cp::Int; kwargs...) → level => (cp, statprod)

Compute the level, cp, and "stat product" for a pokemon with the given ivs when powered up as high as allowed by league_cp. The same kwargs as league_max_level are supported.

source
PoGOBase.statproducts_league — Method
statproducts_league(pd, league_cp; level_limit=50.0, iv_floor=0) → statprods

Calculates the stat product associated with each possible IV combination. statprods[a, d, h] returns the stat-product for pd with IVs (a, d, h). Note indexing of statprods starts at 0.

level_limit sets the power-up limit, and iv_floor sets the minimum IV in all three categories. The following floors apply:

  • raids, egg hatches, and research: 10
  • weather boosted: 4
  • trades:
    • good friends: 1
    • great friends: 2
    • ultra friends: 3
    • best friends: 5
    • lucky: 12

statprods[a, d, h] is zero for any IV combination not meeting these requirements.

source
PoGOBase.statranks_league — Method
statranks_league(pd, league_cp; level_limit=50.0) → ranks

ranks[a, d, h] returns the statproduct rank for a poke with IVs (a, d, h). Note indexing of ranks starts at 0; the top statproduct is rank 1.

source
PoGOBase.stats — Function
stats(poke::Pokemon, level = poke.level; mega = false) → (a, d, h)

Return the attack, defense, and stamina stats for poke. Optionally you can override the level and whether to use the mega-evolution stats, for example to see how the stats change when you mega-evolve this Pokemon.

source