feat: Add new model and data for Encounter Pokemon Details#1621
feat: Add new model and data for Encounter Pokemon Details#1621jemarq04 wants to merge 27 commits into
Conversation
…/add-encounter-details
…r encounter_pokemon_details
| @@ -0,0 +1,146 @@ | |||
| encounter_id,min_perfect_ivs,always_shiny,never_shiny,is_alpha | |||
There was a problem hiding this comment.
Instead of always shiny/never shiny we could use a percentage number? like shiny and then a value ranging from 0 to 100 or from 0 to 1?
There was a problem hiding this comment.
I think that may be confusing, since this field would need to convey three things: (1) it is always shiny, (2) it's never shiny, or (3) it has the default shiny odds based on the generation/shiny charm/shiny powers and so on. I worry that having something like shiny or shiny_rate could be confusing if it was None, 0, or 1. That's why I figured two boolean fields would make it clearer - if both are false, then it's just the usual shiny calculation.
What do you think?
| @@ -0,0 +1,146 @@ | |||
| encounter_id,min_perfect_ivs,always_shiny,never_shiny,is_alpha | |||
There was a problem hiding this comment.
It's the first time we explicity add IVs in our API. I heard about them but not sure how they are calculated, I think there's a difficult formula.
questions, can these IVs be calculated with our API? Second, how did you calculate the values you added in the CSV?
There was a problem hiding this comment.
IVs aren't calculated, they're used in a calculation for a Pokemon's current stats. Each IV can be 0-31 (with "perfect" being 31). At some point, certain encounters (mostly legendaries) started having guaranteed perfect IVs. I don't know exactly which ones do or how many, but I figured this would be the location to add them.
All I did was go through https://www.serebii.net/games/shiny.shtml to see what Pokemon were guaranteed to be shiny and which were shiny-locked, and then checked each location area in the API to see if we had it already. If we did, I added the enconuter ID and marked it as either always or never shiny.
Change description
I've added a new
EncounterPokemonDetailmodel along withencounter_pokemon_details.csvto add in additional (optional) fields to describe the Pokemon in certain encounters. For now, this includes information like guaranteed perfect IVs, whether or not it is always shiny/non-shiny, and whether or not the Pokemon is an Alpha (helpful as I begin PLA encounters).In the future, this could maybe help specify natures or movesets from gift encounters if we want to expand to include that, so I think this file can help with those additional details.
When doing this, I encountered errors making the new migration file due to some problems with the changes to the berry models in #1572, so I just marked some fields as nullable in the model.
So far, I've just added details for Pokemon that are always/never shiny to the new
encounter_pokemon_details.csvfile. Checking local builds show that it seems to work and lists thepokemon_detailsfield as a list ofdictobjects, just afterencounter_conditions. If there are any suggestions on the structure otherwise, let me know.In adding these details, I found some duplicate encounters in SM/USUM and an unexpected Xerneas/Yveltal encounter in the wrong game, so I removed those from the
encounters.csvfile.AI coding assistance disclosure
No AI was used.
Contributor check list