Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Gen 4 Pokémon Mystery Gift Overhaul #518
I've gone in and "overhauled" the way Gen 4 Mystery Gifts are distributed to connected clients. Here's an overview of what I've changed:
I have tested this new method on my own devices, and it works great. I am very happy with these changes.
I appreciate your consideration into this pull request. If there is anything unsatisfactory about my code changes, please let me know, and I will do my best to address your concerns.
sepalani left a comment •
This PR can be a bit improved, IMO.
It doesn't seem PEP8 compliant and I'm also not fond of these if-else-if forests, a (named) tuple, a dictionary or another data structure can be used instead and you can loop through it. I'll think about it and add some details regarding that later this week.
Then, The first and last commit can be squashed together.
Otherwise, I'm not against the idea. If you need some help on how to squash these commits or use git in general, feel free to ask.
Very fair points. This can absolutely be improved to be more dynamic. It would be much better to have some sort of "event registry" that has all of the needed information on an event, and then have the code generate the needed Game IDs and filenames on the fly, rather than being manually specified. Perhaps all of this could even be read from a .json file.
I have a few ideas on how to tackle this, so I'll take a crack at it later today.
I've moved the event definitions out of the code and into a json file. Here's how it works:
The benefit of moving this to a .json file is that anyone can add their own events rather easily, so long as the .myg filename matches what the server expects for that event. Care will have to be taken to ensure the start and end dates for each event do not overlap with any others, and I have done so for the events in my submitted
Additionally, the file
Please let me know what you think!