Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate non-contiguous ITEM_TM_MOVE/ITEM_HM_MOVE constants via R_ZIP_WITH #7

Conversation

mrgriffin
Copy link

The trick here is RECURSIVELY(R_ZIP_WITH(ENUM_TM, TMHM_NUMBERS, (FOREACH_TM(APPEND_COMMA)))) which first expands to:

RECURSIVELY(R_ZIP_WITH(ENUM_TM, (01, 02, 03, ...), (FOCUS_PUNCH, DRAGON_CLAW, CALM_MIND, ...)))

And then R_ZIP_WITH turns that into:

ENUM_TM(01, FOCUS_PUNCH) ENUM_TM(02, DRAGON_CLAW) ENUM_TM(03, CALM_MIND) ...

Which finally expands to:

ITEM_TM_FOCUS_PUNCH = ITEM_TM01, ITEM_TM_DRAGON_CLAW = ITEM_TM02, ITEM_TM_CALM_MIND = ITEM_TM03,

@mrgriffin
Copy link
Author

I only counted up to 100, which means that TMs/HMs numbered more than 100 won't have an alias defined for them. We (or a user) can fill in TMHM_NUMBERS to cover a larger range if necessary.

@AlexOn1ine AlexOn1ine merged commit b1e8319 into AlexOn1ine:decoupleTMHMsFromIds Feb 12, 2025
1 check passed
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