Skip to content

Add pokemon form trigger conditions#1578

Open
dyp1109 wants to merge 4 commits into
PokeAPI:masterfrom
dyp1109:feat/link-form-changes-methods
Open

Add pokemon form trigger conditions#1578
dyp1109 wants to merge 4 commits into
PokeAPI:masterfrom
dyp1109:feat/link-form-changes-methods

Conversation

@dyp1109

@dyp1109 dyp1109 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Change description

Addressing issues #1549 by adding new form triggers fields in /api/v2/pokemon-form/ endpoints.

Changes included:

  • New PokemonFormMethod and PokemonFormCondition models to store how a form is activated,
  • New pokemon_form_methods.csv to define trigger types, and pokemon_form_conditions.csv to link forms to their trigger methods.
  • New za mega-stones in items.csv

AI coding assistance disclosure

I use AI assistant for formatting.

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.

@Naramsim Naramsim left a comment

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.

Hi, can you merge the migrations into a single one?

Can you address the failing tests?

Comment thread data/v2/csv/items.csv Outdated
2231,peat-block,10,0,,
2232,metal-alloy,10,0,, No newline at end of file
2232,metal-alloy,10,0,,
2559,clefablite,44,0,80,

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.

Why start at 2559 instead of 2233?

Comment thread data/v2/csv/pokemon_form_conditions.csv Outdated
@@ -0,0 +1,224 @@
pokemon_form_id,form_method_id,item_id,ability_id,move_id

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.

Maybe some more descriptive names like trigger_item_id and so on?

Comment thread data/v2/csv/pokemon_form_triggers.csv
Comment thread pokemon_v2/serializers.py Outdated
model = PokemonFormName
fields = ("name", "pokemon_name", "language")

class PokemonFormTriggerSerializer(serializers.ModelSerializer):

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.

I do like form trigger as the name rather than form method, but whatever you choose we should make it consistent between these classes and the file.

@dyp1109

dyp1109 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

The new update addresses the comments to fix the ID and naming issues. Migrations is merged into single file and prose csv file is added

@jemarq04

jemarq04 commented Jul 2, 2026

Copy link
Copy Markdown
Member

I'm loving the format and after checking a few pokemon things are looking good! This next part is a bit out of my expertise so I'll tag @Naramsim - would it be good to have this as a separate endpoint (like at pokeapi.co/api/v2/pokemon-form-trigger)? Maybe we could even have it list the pokemon forms that use that trigger (similar to a location area listing the encounters that linked it)?

These suggestions may very well be something we handle in a separate PR and merge this one for now, but I thought I'd bring it up in case it was easy enough to work into this one.

Comment thread data/v2/csv/pokemon_form_triggers.csv
@Naramsim

Naramsim commented Jul 5, 2026

Copy link
Copy Markdown
Member

If @jemarq04 approves we can merge and have the endpoint added later on.

@FallenDeity

Copy link
Copy Markdown
Contributor

what about some of the cosplay or stat based forms like pikachu https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_with_form_differences or minior core when hp below certain percent etc or weather like castform because iirc for these pokemon we do have dedicated entries after 10000

@jemarq04 jemarq04 left a comment

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.

For a starting point this is great - we can work on the endpoint later.

As far as missing Pokemon forms, I think this is a good starting point and we'll add in missing data later.

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.

4 participants