pokeapi icon indicating copy to clipboard operation
pokeapi copied to clipboard

Replace $effect_chance% with actual value

Open Naramsim opened this issue 1 year ago • 2 comments

Part of our API serves text fields containing $effect_chance%.

Rendered field: https://pokeapi.co/api/v2/move/fire-punch .effect_entries[0].effect

Raw data: https://github.com/PokeAPI/pokeapi/blob/master/data/v2/csv/move_effect_prose.csv#L6

It would be awesome if we could replace the $effect_chance% with the actual chance of the move.

An example for fire-punch would be to use the value found in moves.csv for the column effect_chance (which is 10) and replace it in the effect description.

An even-more-interesting thing would be to create a function that we could use to substitute any $xxx% with the relative xxx attribute.

Naramsim avatar Jan 29 '24 18:01 Naramsim

Hi @simonorono , I'm pinging you since you already helped us in the past and modified the build.py file. If you have time and are willing to help us, could you review the issue and tell me what you think?

Many many thanks!

Naramsim avatar Jan 29 '24 18:01 Naramsim

I got pinged in this cause i raised #1020 , and my description makes it seem like its a fault of purely numbers.

Truly, its an issue because what the data csv call here "prose" just never get updated or in the case for the proses of Scarlet and Violet, never even get added. Libero (and protean) got an update in Scarlet and Violet that their effect only happens once per switch-in, a thing that is not reflected in their "prose"

For single source of truth numbers, i would recommend to make a list of strings that are like $effect_chance, maybe two lists, global for like 1/16th to 1/8th bufff and local to the move (to more easily sync the short and long effect).

I am not an API designer though, and dont know how or if this is feasible.

GreatNovaDragon avatar Jan 30 '24 00:01 GreatNovaDragon