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

Refactored incense baby checks into table and added Gen 9 config. #2531

Merged

Conversation

AsparagusEduardo
Copy link
Collaborator

Description

Title.

Discord contact info

AsparagusEduardo#6051

@mrgriffin
Copy link
Collaborator

mrgriffin commented Dec 21, 2022

It might be nice to use a struct for this, e.g.:

static const struct {
  u16 parentSpecies;
  u16 item;
  u16 babySpecies;
} sIncenseBabyTable[] =
{
    ... // As before.

Then the loop can become:

    for (i = 0; i < ARRAY_COUNT(IncenseBabyTable); i++)
    {
        if (sIncenseBabyTable[i].babySpecies == *species && motherItem != sIncenseBabyTable[i].item && fatherItem != sIncenseBabyTable[i].item)
            *species = sIncenseBabyTable[i].parentSpecies;
    }

(Even if not, probably a good idea to make your array static const)

Also, I'm not sure about my choice of parentSpecies as a name, because that sounds like it would be what the mother or father are, but e.g., mother and father could both be Raichu and yet parentSpecies is Pikachu 🤷

@AsparagusEduardo
Copy link
Collaborator Author

Fixed compile and applied suggestions

@Jaizu
Copy link

Jaizu commented Dec 22, 2022

I think you might need some ifdefs to make sure the game compiles without having all Pokémon from other gens enabled.

@AsparagusEduardo
Copy link
Collaborator Author

I think you might need some ifdefs to make sure the game compiles without having all Pokémon from other gens enabled.

The species defines are still present when the generation toggles are disabled, so it should compile. However, you are right that getting a gen 4 species shouldn't happen when those are scrubbed. Will fix that.

Copy link
Collaborator

@ghoulslash ghoulslash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix conflicts and suggestions and looks good

src/daycare.c Outdated Show resolved Hide resolved
src/daycare.c Outdated Show resolved Hide resolved
src/daycare.c Outdated Show resolved Hide resolved
@AsparagusEduardo
Copy link
Collaborator Author

fix conflicts and suggestions and looks good

Can I take the chance to add a table for the Pichu/Volt Tackle interaction? Or should I leave that for a separate PR?

@ghoulslash
Copy link
Collaborator

fix conflicts and suggestions and looks good

Can I take the chance to add a table for the Pichu/Volt Tackle interaction? Or should I leave that for a separate PR?

seems fine to me

@AsparagusEduardo
Copy link
Collaborator Author

Ready for re-review

@AsparagusEduardo
Copy link
Collaborator Author

Now properly ready ^^;

@ghoulslash ghoulslash merged commit 05e9bfe into rh-hideout:upcoming Jan 9, 2023
@AsparagusEduardo AsparagusEduardo deleted the RHH/pr/feature/IncenseBaby branch January 9, 2023 00:17
@AsparagusEduardo AsparagusEduardo mentioned this pull request Feb 19, 2023
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.

5 participants