Add per-condition encounter rates to seed data
Some checks failed
CI / backend-lint (pull_request) Successful in 9s
CI / actions-lint (pull_request) Failing after 6s
CI / frontend-lint (pull_request) Successful in 21s

Add a `condition` column to RouteEncounter so encounters can store
per-condition rates (time of day, season, weather) instead of flattening
to max(). Update the seed loader, API schemas, and frontend to support
the new `conditions` dict format in seed JSON.

Port the PoC branch's condition-aware EncounterModal UI with filter
tabs that let players see encounter rates for specific conditions.
Add horde/SOS as distinct encounter methods with their own badges.

Update the import tool to extract per-condition rates instead of
flattening, and add a merge script (tools/merge-conditions.py) that
enriches existing curated seed files with condition data from PokeDB.

Seed data updated for 22 games (5,684 encounters):
- Gen 2: Gold, Silver, Crystal (morning/day/night)
- Gen 4: HG, SS, Diamond, Pearl, Platinum, BD, SP (morning/day/night)
- Gen 5: Black, White, Black 2, White 2 (spring/summer/autumn/winter)
- Gen 7: Sun, Moon, Ultra Sun, Ultra Moon (day/night)
- Gen 8: Sword, Shield (weather)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 18:52:20 +01:00
parent d0fff248fe
commit 5240236759
36 changed files with 36715 additions and 11587 deletions

View File

@@ -35,7 +35,7 @@
"encounters": [],
"children": [
{
"name": "Alola Route 1 (First two fields east of the player\u2019s house)",
"name": "Alola Route 1 (First two fields east of the players house)",
"order": 3,
"encounters": [
{
@@ -368,7 +368,7 @@
]
},
{
"name": "Trainer\u2019s School (Alola)",
"name": "Trainers School (Alola)",
"order": 8,
"encounters": [
{
@@ -709,17 +709,23 @@
"pokeapi_id": 425,
"pokemon_name": "Drifloon",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 7,
"max_level": 10
"max_level": 10,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 200,
"pokemon_name": "Misdreavus",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 7,
"max_level": 10
"max_level": 10,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 41,
@@ -1089,17 +1095,23 @@
"pokeapi_id": 10091,
"pokemon_name": "Rattata (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 15,
"max_level": 18
"max_level": 18,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 734,
"pokemon_name": "Yungoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 15,
"max_level": 18
"max_level": 18,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 79,
@@ -1686,9 +1698,12 @@
"pokeapi_id": 751,
"pokemon_name": "Dewpider",
"method": "surf",
"encounter_rate": 40,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"day": 40
}
},
{
"pokeapi_id": 60,
@@ -1702,9 +1717,12 @@
"pokeapi_id": 283,
"pokemon_name": "Surskit",
"method": "surf",
"encounter_rate": 40,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"night": 40
}
},
{
"pokeapi_id": 54,
@@ -1740,25 +1758,34 @@
"pokeapi_id": 755,
"pokemon_name": "Morelull",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"night": 20
}
},
{
"pokeapi_id": 46,
"pokemon_name": "Paras",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"day": 20
}
},
{
"pokeapi_id": 751,
"pokemon_name": "Dewpider",
"method": "walk",
"encounter_rate": 10,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"day": 10
}
},
{
"pokeapi_id": 60,
@@ -1772,9 +1799,12 @@
"pokeapi_id": 283,
"pokemon_name": "Surskit",
"method": "walk",
"encounter_rate": 10,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"night": 10
}
},
{
"pokeapi_id": 278,
@@ -1810,9 +1840,12 @@
"pokeapi_id": 751,
"pokemon_name": "Dewpider",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"day": 20
}
},
{
"pokeapi_id": 60,
@@ -1826,9 +1859,12 @@
"pokeapi_id": 283,
"pokemon_name": "Surskit",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 14,
"max_level": 17
"max_level": 17,
"conditions": {
"night": 20
}
}
]
},
@@ -2742,17 +2778,23 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 20,
"max_level": 23
"max_level": 23,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 20,
"max_level": 23
"max_level": 23,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 299,
@@ -2920,33 +2962,45 @@
"pokeapi_id": 752,
"pokemon_name": "Araquanid",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 24,
"max_level": 27
"max_level": 27,
"conditions": {
"day": 20
}
},
{
"pokeapi_id": 168,
"pokemon_name": "Ariados",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 24,
"max_level": 27
"max_level": 27,
"conditions": {
"night": 20
}
},
{
"pokeapi_id": 166,
"pokemon_name": "Ledian",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 24,
"max_level": 27
"max_level": 27,
"conditions": {
"day": 20
}
},
{
"pokeapi_id": 284,
"pokemon_name": "Masquerain",
"method": "walk",
"encounter_rate": 20,
"encounter_rate": null,
"min_level": 24,
"max_level": 27
"max_level": 27,
"conditions": {
"night": 20
}
},
{
"pokeapi_id": 10107,
@@ -3076,9 +3130,13 @@
"pokeapi_id": 22,
"pokemon_name": "Fearow",
"method": "walk",
"encounter_rate": 40,
"encounter_rate": null,
"min_level": 25,
"max_level": 28
"max_level": 28,
"conditions": {
"day": 40,
"night": 30
}
},
{
"pokeapi_id": 10136,
@@ -3100,9 +3158,12 @@
"pokeapi_id": 173,
"pokemon_name": "Cleffa",
"method": "walk",
"encounter_rate": 10,
"encounter_rate": null,
"min_level": 25,
"max_level": 28
"max_level": 28,
"conditions": {
"night": 10
}
},
{
"pokeapi_id": 132,
@@ -3531,9 +3592,12 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 28,
"max_level": 31
"max_level": 31,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 279,
@@ -3547,9 +3611,12 @@
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 28,
"max_level": 31
"max_level": 31,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 361,
@@ -3871,17 +3938,23 @@
"pokeapi_id": 168,
"pokemon_name": "Ariados",
"method": "walk",
"encounter_rate": 40,
"encounter_rate": null,
"min_level": 31,
"max_level": 34
"max_level": 34,
"conditions": {
"night": 40
}
},
{
"pokeapi_id": 166,
"pokemon_name": "Ledian",
"method": "walk",
"encounter_rate": 40,
"encounter_rate": null,
"min_level": 31,
"max_level": 34
"max_level": 34,
"conditions": {
"day": 40
}
},
{
"pokeapi_id": 741,
@@ -4103,9 +4176,12 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 40,
"max_level": 43
"max_level": 43,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 279,
@@ -4119,9 +4195,12 @@
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 40,
"max_level": 43
"max_level": 43,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 73,
@@ -4213,9 +4292,12 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 40,
"max_level": 43
"max_level": 43,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 279,
@@ -4229,9 +4311,12 @@
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 40,
"max_level": 43
"max_level": 43,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 210,
@@ -4706,17 +4791,23 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 52,
"max_level": 55
"max_level": 55,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 52,
"max_level": 55
"max_level": 55,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 732,
@@ -4792,9 +4883,12 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 70,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"day": 70
}
},
{
"pokeapi_id": 548,
@@ -4808,9 +4902,12 @@
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 70,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"night": 70
}
},
{
"pokeapi_id": 297,
@@ -4854,17 +4951,23 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 732,
@@ -4908,17 +5011,23 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 97,
@@ -4994,9 +5103,12 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 10,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"day": 10
}
},
{
"pokeapi_id": 241,
@@ -5010,9 +5122,12 @@
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 10,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"night": 10
}
},
{
"pokeapi_id": 128,
@@ -5040,17 +5155,23 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 54,
"max_level": 57
"max_level": 57,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 279,
@@ -5220,9 +5341,12 @@
"pokeapi_id": 735,
"pokemon_name": "Gumshoos",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 56,
"max_level": 59
"max_level": 59,
"conditions": {
"day": 30
}
},
{
"pokeapi_id": 279,
@@ -5236,9 +5360,12 @@
"pokeapi_id": 10092,
"pokemon_name": "Raticate (Alola)",
"method": "walk",
"encounter_rate": 30,
"encounter_rate": null,
"min_level": 56,
"max_level": 59
"max_level": 59,
"conditions": {
"night": 30
}
},
{
"pokeapi_id": 210,