veekun / pokedex

more than you ever wanted to know about Pokémon
MIT License
1.44k stars 637 forks source link

Weird entries in *_prose tables? #272

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hey!

I've noticed that at least some of the tables ending in "_prose" (ability_prose and move_effect_prose) have these entries that seem like they're supposed to be referring to a value but something odd happened when importing the tables. I'm not sure if that is the case or if it's supposed to be like this as of now, but to to give an example of what I'm referring to:

SELECT * FROM move_effect_prose WHERE move_effect_id IN (3, 4, 5, 6, 37, 70) AND local_language_id = 9;

returns entries like:

id: 5
short_effect: Has a $effect_chance% chance to [burn]{mechanic:burn} the target.
effect: Inflicts [regular damage]{mechanic:regular-damage}.  Has a $effect_chance% chance to [burn]{mechanic:burn} the target.

Are those $effect_chance and [regular damage]{mechanic:regular-damage} etc. supposed to be numbers/regular text instead, or is this just the way it is right now? Do I need to edit each record manually to fix these entries (there are many) or is there some other way to do it?

I also noticed that PokeAPI that used veekun for some of its data also has these kind of entries for moves, so maybe I'm not the only one.

Thank you so much for any help! :)

magical commented 5 years ago

Veekun replaces $effect_chance with the actual effect chance of the move. The placeholder is necessary because moves can have the same effect but different effect chances. For example, lick and thunder punch https://github.com/veekun/pokedex/blob/57915f656b5e5148f4694402d32cfa39a9050dae/pokedex/db/markdown.py#L98-L101

The [regular damage]{mechanic:regular-damage} things are links. They're usually used to link to pokemon, move, item, or ability pages, e.g. in mirror move's effect. (mechanic: links are intended to go to a page that explains how the mechanic works, but we never actually wrote any of those, so they just get replaced with regular text.)

https://veekun.com/dex/moves/mirror%20move#effect. https://github.com/veekun/pokedex/blob/57915f656b5e5148f4694402d32cfa39a9050dae/pokedex/db/markdown.py#L8-L10

ghost commented 5 years ago

Oh, that makes sense! Thank you very much for clarifying :)