Reference
PoGOBase.dex_unavilable — ConstantPoGOBase.dex_unavailableA set of Pokémon IDs that are not available in the game.
PoGOBase.BossFT — MethodBossFT(boss::Species, tier::Int; attack_multiplier=1, defense_multiplier=1, cpm=maxbattles.cpm[tier], hp=maxbattles.hp[tier]) -> BossFTRepresent a max-battle boss with simplified parameters ferocity and tankiness.
PoGOBase.Pokemon — MethodPokemon(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)PoGOGamemaster.PvEMove — MethodPvEMove(name::AbstractString) → moveReturn the PvE move with the given name. For a fast move, append "_fast" to the name.
PoGOGamemaster.PvPMove — MethodPvPMove(name::AbstractString) → moveReturn the PvP move with the given name. For a fast move, append "_fast" to the name.
PoGOBase.baby — Methodbaby(poke::Pokemon) → baby_species
baby(species::Species) → baby_speciesReturn the baby species (base stage evolution) for poke or species.
PoGOBase.base_stats — Methodbase_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.
PoGOBase.best_for_league — Methodbest_for_league(pd::Species, league_cp; kwargs...) → pokeCreate the pokemon with highest statproduct given the league CP limit.
PoGOBase.binary_search — Methodbinary_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.
PoGOBase.bulk_best_league — Methodbulk_best_league(name, league_cp::Int; level_limit=50.0) → bulk
bulk_best_league(pd::Species, league_cp::Int; level_limit=50.0) → bulkReturn the pokemon's bulk for a specific CP limit, assuming the best IVs and fully powered-up.
PoGOBase.chargedmoves — Methodchargedmoves(species::Species; elite = true) → movesReturn a list of the names of the charged moves that species can learn. By default, include any elite charged moves.
PoGOBase.combat_power — Functioncombat_power(poke::Pokemon, level = poke.level) → cpReturn 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.
PoGOBase.damage — Methoddamage(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 1charge::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 numericweather=1.2directly)friendship: the friendship level, default is missing (alternatively supply a numericfriendshipbonus=1.0directly)dodged: a multiplier for the damage, default is 1mushroom::Bool: a flag for the mushroom effect, default is falsehelpericons: the number of helper icons, default is 0 (alternatively supply a numerichelperbonus=1.0directly)attack_multiplier: a multiplier for the attacker's attack, default is 1defense_multiplier: a multiplier for the defender's defense, default is 1
PoGOBase.eachpokemon — Methodeachpokemon(; include_shadow=true, include_mega=true, level=31, ivs=(15, 15, 15)) → pokesReturn a list of one of each species of Pokemon at the given level and IVs. By default, include shadows and megas.
PoGOBase.evolution_cost — Functionevolution_cost(poke::Pokemon, as::Species = Species(poke)) → costReturn the candy cost to evolve poke to as.
PoGOBase.fastmoves — Methodfastmoves(species::Species; elite = true) → movesReturn a list of the names of the fast moves that species can learn. By default, include any elite fast moves.
PoGOBase.hp — Functionhp(poke::Pokemon, level = poke.level) → hpReturn 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.
PoGOBase.isavailable — MethodPoGOBase.isavailable(species::Species) → BoolReturn true if the species is currently available in the game. To update this list, see the dex_unavailable constant in src/consts.jl.
PoGOBase.joinpath_and_register — Methodjoinpath_and_register(path, filename) → fullpathReturn the absolute path and also add it as an include dependency, so that the package gets recompiled if the file fullpath is updated.
PoGOBase.kmcost — Functionkmcost(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.
PoGOBase.league_catch_cp — Functionleague_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...) → cparrayReturn 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.
PoGOBase.league_max_level — Methodleague_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, cpReturn 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).
PoGOBase.lineage_ids — Methodlineage_ids(poke::Pokemon) → ids
lineage_ids(species::Species) → ids
lineage_ids(list) → idsReturn 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"PoGOBase.matching_pokemon — Methodmatching_pokemon(name::AbstractString, types::AbstractString; kwargs...) → speciesReturn 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"]PoGOBase.matching_pokemon — Methodmatching_pokemon(name::AbstractString; tol=0.0, complete=false) → speciesReturn 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"]PoGOBase.megaevolve — Functionmegaevolve(poke::Pokemon, mega::Union{Bool, Char} = true) → megapokeCreate 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.
PoGOBase.only_pokemon — Methodonly_pokemon(name::AbstractString; exact=false, equiv=false, kwargs...) → speciesReturn 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"]PoGOBase.purify — Methodpurify(poke::Pokemon) → purified_pokeCreate a new Pokemon object that is a purified form of poke.
PoGOBase.raid_power — Methodraid_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.
PoGOBase.split_kwargs — Methodsplit_kwargs(keep; kwargs...) → kwkeep, kwdiscSplit 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",))PoGOBase.statproduct — Methodstatproduct(poke) → sp
statproduct(stats) → spCompute the "stat product" for a specific Pokemon.
PoGOBase.statproduct_league — Methodstatproduct_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.
PoGOBase.statproducts_league — Methodstatproducts_league(pd, league_cp; level_limit=50.0, iv_floor=0) → statprodsCalculates 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.
PoGOBase.statranks_league — Methodstatranks_league(pd, league_cp; level_limit=50.0) → ranksranks[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.
PoGOBase.stats — Functionstats(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.