Skip to content

Conversation

@tmck-code
Copy link
Owner

@tmck-code tmck-code commented Apr 4, 2024

Context

When using pokesay, it's possible to select a Pokemon's name and category, and then the final choice is made by randomly selecting between those.

This change gives each pokemon avatar a distinct ID so that an exact pokemon avatar can be selected

Command Line args

operation screenshot
list IDs for a Pokémon (or all Pokémon with just -l Screenshot_20240405-095516
Get specific Pokémon via ID Screenshot_20240405-095711
display the ID in the info bar with -I Screenshot_20240405-095741

Notes

This change isn't perfect, but it's been sitting here for over a year so I figured that I should just merge it. Thoughts for the future:

  • The ID is made up of a sequential ID for the pokemon, and a n ID for the variant. The variant IDs are not sorted which makes them a little unintuitive to use. A better version might increment them for each pokemon from 001 onwards
    • example of current ID: "0904.0834"
  • This PR initially included a change to greatly increase the number of categories. While this is pretty cool, a large amount of categories only apply to a single pokemon, there's some tidy up/extra logic required before this could become a thing

tmck-code added 16 commits April 4, 2024 18:33
- print JSON of id -> name
- allow selection via id with -i
this saves complexity when reading/selecting
- sort the metadata entries by the name tokens before writing
- add an Idx field to the metadata struct
there are additional categories for each pokemon that I haven't dealt
with until now.

each cowfile has a path like
- gen7x/regular/charizard.cow
- gen7x/regular/charizard-mega-y.cow
- gen7x/regular/charizard-mega-y.cow

Everything after the first - in the basename is now parsed out into an
extra category

This makes the -l mode more transparent, and allows selection of cool
stuff like shiny/mega etc.
TODO: clean and implement properly
@tmck-code tmck-code merged commit d2c5d65 into master Sep 18, 2025
1 check passed
@tmck-code tmck-code deleted the print-pokemon-by-id branch September 18, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants