Skip to content

feat: Add new model and data for Encounter Pokemon Details#1621

Open
jemarq04 wants to merge 24 commits into
PokeAPI:masterfrom
jemarq04:feat/add-encounter-details
Open

feat: Add new model and data for Encounter Pokemon Details#1621
jemarq04 wants to merge 24 commits into
PokeAPI:masterfrom
jemarq04:feat/add-encounter-details

Conversation

@jemarq04

Copy link
Copy Markdown
Member

Change description

I've added a new EncounterPokemonDetail model along with encounter_pokemon_details.csv to 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.csv file. Checking local builds show that it seems to work and lists the pokemon_details field as a list of dict objects, just after encounter_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.csv file.

AI coding assistance disclosure

No AI was used.

Contributor check list

  • I have written a description of the contribution and explained its motivation.
  • I have written tests for my code changes (if applicable).
  • I have read and understood the AI Assisted Contribution guidelines.
  • I will own this change in production, and I am prepared to fix any bugs caused by my code change.

jemarq04 added 21 commits July 23, 2026 18:49
@jemarq04
jemarq04 marked this pull request as draft July 24, 2026 20:15
@jemarq04
jemarq04 marked this pull request as ready for review July 24, 2026 23:03
@@ -0,0 +1,146 @@
encounter_id,min_perfect_ivs,always_shiny,never_shiny,is_alpha

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@@ -0,0 +1,146 @@
encounter_id,min_perfect_ivs,always_shiny,never_shiny,is_alpha

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants