Skip to content

Commit

Permalink
Add size names
Browse files Browse the repository at this point in the history
  • Loading branch information
wraythex authored Sep 13, 2023
1 parent e21978d commit 9eaae78
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion static/js/utils/utils.pokemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ getMoveName, getMoveType, getMoveTypeNoI8ln, getPokemonGen, getPokemonIds,
getPokemonLevel, getPokemonNameWithForm, getPokemonRarity,
getPokemonRarityName, getLocationNearStop, getLocationInCell,
getPokemonRawIconUrl, getPokemonTypes, initMoveData, initPokemonData,
searchPokemon, createPokemonMarker, updatePokemonRarities
searchPokemon, createPokemonMarker, updatePokemonRarities,
getSizeDisplay
*/

var pokemonData = {}
var moveData = {}
var pokemonRarities = {}
const rarityNames = ['Common', 'Uncommon', 'Rare', 'Very Rare', 'Ultra Rare', 'New Spawn']
const pokemonSizes = ['Unknown', 'XXS', 'XS', 'M', 'XL', 'XXL']
// FontAwesome gender classes.
const genderClasses = ['fa-mars', 'fa-venus', 'fa-neuter']
var pokemonSearchList = []
Expand Down Expand Up @@ -219,6 +221,10 @@ function getPokemonMapIconUrl(pokemon, generateImages) {
return `pkm_img?pkm=${pokemon.pokemon_id}${genderParam}${formParam}${costumeParam}${evolutionParam}${weatherParam}${perfectParam}`
}

function getSizeDisplay(size) {
return pokemonSizes[size] ?? i18n('Unknown Size')
}

function getIvsPercentage(atk, def, sta) {
// Round to 1 decimal place.
return Math.round(1000 * (atk + def + sta) / 45) / 10
Expand Down

0 comments on commit 9eaae78

Please sign in to comment.