diff --git a/data/v2/build.py b/data/v2/build.py index dae646a22..07fd22e06 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -1585,6 +1585,7 @@ def csv_record_to_objects(info): symbol=info[2], data_type=info[3], version_group_id=int(info[4]), + source=info[5], ) build_generic((EvolutionVariable,), "evolution_variables.csv", csv_record_to_objects) diff --git a/data/v2/csv/evolution_variable_prose.csv b/data/v2/csv/evolution_variable_prose.csv index aa8c0df61..bb6e9c534 100644 --- a/data/v2/csv/evolution_variable_prose.csv +++ b/data/v2/csv/evolution_variable_prose.csv @@ -3,3 +3,7 @@ evolution_variable_id,local_language_id,name,description 1,9,Encryption Constant,"An unsigned 32-bit integer introduced in Generation VI that is generated alongside a Pokémon's personality value. It is used to calculate internal form variations (such as Dudunsparce, Maushold, and Wurmple), determine Spinda spot patterns, break ties in characteristic calculations, and structure Pokémon data." 2,5,Valeur de Personnalité,"Un entier non signé de 32 bits généré lors de la création d'un Pokémon. Introduite en 3e génération, cette valeur détermine plusieurs attributs intrinsèques, tels que la Nature (en 3G et 4G), le sexe, le talent, le caractère chromatique (Shiny), les motifs de Spinda ou encore la branche d'évolution de certains Pokémon (comme Chenipotte)." 2,9,Personality Value,"An unsigned 32-bit integer generated when a Pokémon is first created by the game. Introduced in Generation III, it dictates various internal characteristics of a Pokémon, including its Nature (in Gens III–IV), gender, ability, shininess, Unown letter, Spinda spots, and evolution branch (such as Wurmple)." +3,5,Sens de Rotation,"Le sens dans lequel Crèmy est tourné pour le faire évoluer, introduit dans Pokémon Épée et Bouclier : 0 pour le sens horaire, 1 pour le sens antihoraire. Avec la durée de rotation et le moment de la journée, il détermine la Crème que reçoit le Charmilly obtenu." +3,9,Spin Direction,"The direction in which Milcery is spun to evolve it, introduced in Pokémon Sword and Shield: 0 for clockwise, 1 for counter-clockwise. Together with the spin duration and the time of day, it determines which Cream the resulting Alcremie receives." +4,5,Durée de Rotation,"La durée en secondes de la rotation effectuée pour faire évoluer Crèmy, introduite dans Pokémon Épée et Bouclier. Avec le sens de rotation et le moment de la journée, elle détermine la Crème que reçoit le Charmilly obtenu." +4,9,Spin Duration,"The length in seconds of the spin performed to evolve Milcery, introduced in Pokémon Sword and Shield. Together with the spin direction and the time of day, it determines which Cream the resulting Alcremie receives." diff --git a/data/v2/csv/evolution_variables.csv b/data/v2/csv/evolution_variables.csv index cfcd03f94..5483ed25d 100644 --- a/data/v2/csv/evolution_variables.csv +++ b/data/v2/csv/evolution_variables.csv @@ -1,3 +1,5 @@ -id,identifier,symbol,data_type,version_group_id -1,encryption-constant,EC,uint32,15 -2,personality-value,PID,uint32,5 +id,identifier,symbol,data_type,version_group_id,source +1,encryption-constant,EC,uint32,15,pokemon +2,personality-value,PID,uint32,5,pokemon +3,spin-direction,SPIN_DIR,uint8,20,player-input +4,spin-duration,SPIN_SEC,uint8,20,player-input diff --git a/data/v2/csv/pokemon_evolution.csv b/data/v2/csv/pokemon_evolution.csv index da1590bfc..97f3126df 100644 --- a/data/v2/csv/pokemon_evolution.csv +++ b/data/v2/csv/pokemon_evolution.csv @@ -437,7 +437,7 @@ id,evolved_species_id,evolution_trigger_id,version_group_id,is_default,trigger_i 438,858,1,20,1,,42,,,,,,,,,,,,,,0,0,0,0,,,,,,,,,, 439,860,1,20,1,,32,,,,,,,,,,,,,,0,0,0,0,,,,,,,,,, 440,861,1,20,1,,42,,,,,,,,,,,,,,0,0,0,0,,,,,,,,,, -441,869,5,20,1,,,,,,,,,,,,,,,,0,0,0,0,,,,,,,,,, +441,869,5,20,1,,,,,1167,day,,,,,,,,,,0,0,0,0,,,869,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, 442,873,1,20,1,,,,,,night,,,160,,,,,,,0,0,0,0,,,,,,,,,, 443,879,1,20,1,,34,,,,,,,,,,,,,,0,0,0,0,,,,,,,,,, 444,886,1,20,1,,50,,,,,,,,,,,,,,0,0,0,0,,,,,,,,,, @@ -613,3 +613,65 @@ id,evolved_species_id,evolution_trigger_id,version_group_id,is_default,trigger_i 617,666,1,15,1,,12,,,,,,,,,,,,,,0,0,0,0,,10306,10102,,,,,,, 618,666,1,15,1,,12,,,,,,,,,,,,,,0,0,0,0,,10307,10161,,,,,,, 619,666,1,15,1,,12,,,,,,,,,,,,,,0,0,0,0,,10308,10162,,,,,,, +620,869,5,20,1,,,,,1167,day,,,,,,,,,,0,0,0,0,,,10346,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +621,869,5,20,1,,,,,1167,night,,,,,,,,,,0,0,0,0,,,10347,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +622,869,5,20,1,,,,,1167,night,,,,,,,,,,0,0,0,0,,,10348,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +623,869,5,20,1,,,,,1167,night,,,,,,,,,,0,0,0,0,,,10349,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +624,869,5,20,1,,,,,1167,night,,,,,,,,,,0,0,0,0,,,10350,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +625,869,5,20,1,,,,,1167,day,,,,,,,,,,0,0,0,0,,,10351,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +626,869,5,20,1,,,,,1167,day,,,,,,,,,,0,0,0,0,,,10352,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +627,869,5,20,1,,,,,1167,dusk,,,,,,,,,,0,0,0,0,,,10353,,,,,,SPIN_SEC 10 >=, +628,869,5,20,1,,,,,1169,day,,,,,,,,,,0,0,0,0,,,10449,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +629,869,5,20,1,,,,,1169,day,,,,,,,,,,0,0,0,0,,,10450,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +630,869,5,20,1,,,,,1169,night,,,,,,,,,,0,0,0,0,,,10451,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +631,869,5,20,1,,,,,1169,night,,,,,,,,,,0,0,0,0,,,10452,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +632,869,5,20,1,,,,,1169,night,,,,,,,,,,0,0,0,0,,,10453,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +633,869,5,20,1,,,,,1169,night,,,,,,,,,,0,0,0,0,,,10454,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +634,869,5,20,1,,,,,1169,day,,,,,,,,,,0,0,0,0,,,10455,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +635,869,5,20,1,,,,,1169,day,,,,,,,,,,0,0,0,0,,,10456,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +636,869,5,20,1,,,,,1169,dusk,,,,,,,,,,0,0,0,0,,,10457,,,,,,SPIN_SEC 10 >=, +637,869,5,20,1,,,,,1168,day,,,,,,,,,,0,0,0,0,,,10458,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +638,869,5,20,1,,,,,1168,day,,,,,,,,,,0,0,0,0,,,10459,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +639,869,5,20,1,,,,,1168,night,,,,,,,,,,0,0,0,0,,,10460,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +640,869,5,20,1,,,,,1168,night,,,,,,,,,,0,0,0,0,,,10461,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +641,869,5,20,1,,,,,1168,night,,,,,,,,,,0,0,0,0,,,10462,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +642,869,5,20,1,,,,,1168,night,,,,,,,,,,0,0,0,0,,,10463,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +643,869,5,20,1,,,,,1168,day,,,,,,,,,,0,0,0,0,,,10464,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +644,869,5,20,1,,,,,1168,day,,,,,,,,,,0,0,0,0,,,10465,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +645,869,5,20,1,,,,,1168,dusk,,,,,,,,,,0,0,0,0,,,10466,,,,,,SPIN_SEC 10 >=, +646,869,5,20,1,,,,,1172,day,,,,,,,,,,0,0,0,0,,,10467,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +647,869,5,20,1,,,,,1172,day,,,,,,,,,,0,0,0,0,,,10468,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +648,869,5,20,1,,,,,1172,night,,,,,,,,,,0,0,0,0,,,10469,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +649,869,5,20,1,,,,,1172,night,,,,,,,,,,0,0,0,0,,,10470,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +650,869,5,20,1,,,,,1172,night,,,,,,,,,,0,0,0,0,,,10471,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +651,869,5,20,1,,,,,1172,night,,,,,,,,,,0,0,0,0,,,10472,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +652,869,5,20,1,,,,,1172,day,,,,,,,,,,0,0,0,0,,,10473,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +653,869,5,20,1,,,,,1172,day,,,,,,,,,,0,0,0,0,,,10474,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +654,869,5,20,1,,,,,1172,dusk,,,,,,,,,,0,0,0,0,,,10475,,,,,,SPIN_SEC 10 >=, +655,869,5,20,1,,,,,1170,day,,,,,,,,,,0,0,0,0,,,10476,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +656,869,5,20,1,,,,,1170,day,,,,,,,,,,0,0,0,0,,,10477,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +657,869,5,20,1,,,,,1170,night,,,,,,,,,,0,0,0,0,,,10478,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +658,869,5,20,1,,,,,1170,night,,,,,,,,,,0,0,0,0,,,10479,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +659,869,5,20,1,,,,,1170,night,,,,,,,,,,0,0,0,0,,,10480,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +660,869,5,20,1,,,,,1170,night,,,,,,,,,,0,0,0,0,,,10481,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +661,869,5,20,1,,,,,1170,day,,,,,,,,,,0,0,0,0,,,10482,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +662,869,5,20,1,,,,,1170,day,,,,,,,,,,0,0,0,0,,,10483,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +663,869,5,20,1,,,,,1170,dusk,,,,,,,,,,0,0,0,0,,,10484,,,,,,SPIN_SEC 10 >=, +664,869,5,20,1,,,,,1171,day,,,,,,,,,,0,0,0,0,,,10485,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +665,869,5,20,1,,,,,1171,day,,,,,,,,,,0,0,0,0,,,10486,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +666,869,5,20,1,,,,,1171,night,,,,,,,,,,0,0,0,0,,,10487,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +667,869,5,20,1,,,,,1171,night,,,,,,,,,,0,0,0,0,,,10488,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +668,869,5,20,1,,,,,1171,night,,,,,,,,,,0,0,0,0,,,10489,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +669,869,5,20,1,,,,,1171,night,,,,,,,,,,0,0,0,0,,,10490,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +670,869,5,20,1,,,,,1171,day,,,,,,,,,,0,0,0,0,,,10491,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +671,869,5,20,1,,,,,1171,day,,,,,,,,,,0,0,0,0,,,10492,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +672,869,5,20,1,,,,,1171,dusk,,,,,,,,,,0,0,0,0,,,10493,,,,,,SPIN_SEC 10 >=, +673,869,5,20,1,,,,,1173,day,,,,,,,,,,0,0,0,0,,,10494,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +674,869,5,20,1,,,,,1173,day,,,,,,,,,,0,0,0,0,,,10495,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +675,869,5,20,1,,,,,1173,night,,,,,,,,,,0,0,0,0,,,10496,,,,,,SPIN_DIR 0 == SPIN_SEC 5 < &&, +676,869,5,20,1,,,,,1173,night,,,,,,,,,,0,0,0,0,,,10497,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +677,869,5,20,1,,,,,1173,night,,,,,,,,,,0,0,0,0,,,10498,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +678,869,5,20,1,,,,,1173,night,,,,,,,,,,0,0,0,0,,,10499,,,,,,SPIN_DIR 1 == SPIN_SEC 5 < &&, +679,869,5,20,1,,,,,1173,day,,,,,,,,,,0,0,0,0,,,10500,,,,,,SPIN_DIR 1 == SPIN_SEC 5 >= &&, +680,869,5,20,1,,,,,1173,day,,,,,,,,,,0,0,0,0,,,10501,,,,,,SPIN_DIR 0 == SPIN_SEC 5 >= &&, +681,869,5,20,1,,,,,1173,dusk,,,,,,,,,,0,0,0,0,,,10502,,,,,,SPIN_SEC 10 >=, diff --git a/openapi.yml b/openapi.yml index 3031ba9a4..356f45b2a 100644 --- a/openapi.yml +++ b/openapi.yml @@ -4003,6 +4003,12 @@ components: data_type: type: string maxLength: 20 + source: + type: string + description: 'Where the value comes from: ''pokemon'' for data stored on + the Pokemon (e.g. EC, PID), ''player-input'' for an action taken by the + player while evolving (e.g. SPIN_DIR, SPIN_SEC)' + maxLength: 20 version_group: $ref: '#/components/schemas/VersionGroupSummary' names: diff --git a/pokemon_v2/migrations/0037_evolutionvariable_source.py b/pokemon_v2/migrations/0037_evolutionvariable_source.py new file mode 100644 index 000000000..1b78d4fa4 --- /dev/null +++ b/pokemon_v2/migrations/0037_evolutionvariable_source.py @@ -0,0 +1,21 @@ +# Generated by Django 5.2.10 on 2026-09-24 19:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("pokemon_v2", "0036_pokemonevolution_condition_expression_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="evolutionvariable", + name="source", + field=models.CharField( + default="pokemon", + help_text="Where the value comes from: 'pokemon' for data stored on the Pokemon (e.g. EC, PID), 'player-input' for an action taken by the player while evolving (e.g. SPIN_DIR, SPIN_SEC)", + max_length=20, + ), + ), + ] diff --git a/pokemon_v2/models.py b/pokemon_v2/models.py index 7f58dc3e6..3be7f36c1 100644 --- a/pokemon_v2/models.py +++ b/pokemon_v2/models.py @@ -1802,6 +1802,13 @@ class EvolutionVariable(HasName, HasVersionGroup): symbol = models.CharField(max_length=10) data_type = models.CharField(max_length=20, default="uint32") + source = models.CharField( + max_length=20, + default="pokemon", + help_text="Where the value comes from: 'pokemon' for data stored on the Pokemon (e.g. EC, PID), " + "'player-input' for an action taken by the player while evolving (e.g. SPIN_DIR, SPIN_SEC)", + ) + class EvolutionVariableName(HasEvolutionVariable, IsName): pass diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 7105c9d25..3306146ed 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -3238,7 +3238,7 @@ class EvolutionVariableDetailSerializer(serializers.HyperlinkedModelSerializer[E class Meta: model = EvolutionVariable - fields = ("id", "name", "symbol", "data_type", "version_group", "names", "descriptions") + fields = ("id", "name", "symbol", "data_type", "source", "version_group", "names", "descriptions") class PokemonSpeciesDescriptionSerializer(serializers.ModelSerializer[PokemonSpeciesDescription]):