fix + feat: Model Ultra Necrozma's transformation, and let form conditions name their base form - #1616
Conversation
c74520c to
6641ec2
Compare
|
By the way, the |
|
It should probably just be |
Done in #1619.
Fine by me, let's think how to do it. Probably a new column in some place. Any suggestion? |
6641ec2 to
1b79fac
Compare
|
Following up on the base-form question
I'd like to propose a minimal way to cover this now, since it's the missing piece for Ultra Necrozma (and several other in-battle form changes). The problem. Proposal. Add a nullable For Ultra Necrozma this becomes two rows (same held-item trigger, one per base form): pokemon_form_id,form_trigger_id,trigger_item_id,trigger_ability_id,trigger_move_id,base_form_id
10316,1,969,,,10155 # necrozma-ultra ← necrozma-dusk-mane
10316,1,969,,,10156 # necrozma-ultra ← necrozma-dawn-wingsThe API would surface it under the existing Why a column rather than a new table. It's the same pattern Broader value. This isn't just Necrozma; it lets consumers stop heuristically guessing the base form for other in-battle changes, e.g.:
One open question: If this direction sounds good, I'll add the column, migration, loader, serializer field, and the Necrozma rows in this PR. |
9d707b3 to
7386fda
Compare
Use the existing held-item trigger with ultranecrozium-z--held (like Mega/Primal held-item transformations).
Add a nullable base_form FK to PokemonFormCondition so a battle-only form change can name the sibling form(s) it transforms from. Ultra Necrozma uses it to record that it comes from Dusk Mane or Dawn Wing (two rows sharing the held Ultranecrozium Z trigger). Exposed on a form's trigger_conditions in the REST API and as a base_form relationship in GraphQL. The column is nullable, so existing conditions (Mega, Gigantamax, Primal…) are unaffected.
Populate the base_form column (added in the previous commit) for every battle-only form change whose base is a specific sibling rather than the default form, so consumers no longer have to infer it: - Ash Greninja ← Battle Bond - Complete Zygarde ← 10% / 50% Power Construct - (Galarian) Zen Darmanitan ← (Galarian) Standard - Meowstic megas ← Male / Female - Tatsugiri megas ← Curly / Droopy / Stretchy - Toxtricity Gmax ← Amped / Low-Key - Urshifu Gmax ← Single Strike / Rapid Strike - Mimikyu Busted ← Disguised / Totem Disguised - Magearna megas ← Magearna / Original
7386fda to
cbd02ef
Compare
|
Hello, this PR is ready. I implemented the per review proposal. It contains a migration script.
I pointed it to PokemonForm, it was making more sense. Also I populate base_form wherever the base is a specific, unambiguous sibling rather than the default form, except the Minior case. Minior's forms are modelled inconsistently (is_battle_only flags + condition placement) and need a separate cleanup PR after this one. |
Change description
Ultra Necrozma couldn't be represented properly: it's a battle-only form that can only be reached from Dusk Mane or Dawn Wings, but pokemon_form_conditions had no way to say which form a transformation starts from.
This PR:
Battle forms that transform from their default/any form (Mega Charizard, most Gigantamax, Alcremie, Pyroar, Floette…) are intentionally left null.
Out of scope: Minior's forms are modelled inconsistently (is_battle_only flags + condition placement) and need a separate cleanup PR; not touched here.
AI coding assistance disclosure
I used AI to determine which files needed to be touched, and to check if new code is coherent.
Contributor check list