mirror of
https://github.com/risingPhil/PokeMe64.git
synced 2026-03-21 18:04:15 -05:00
Add an "Unlock Egg Ticket" option for Pokémon Crystal
This commit is contained in:
parent
d106863b50
commit
efda9abed7
|
|
@ -92,6 +92,15 @@ void gen1MoveDeleterApply(void* context, const void* param);
|
|||
* @param param a nullpointer (dummy param)
|
||||
*/
|
||||
void gen2ReceiveGSBall(void* context, const void* param);
|
||||
|
||||
/**
|
||||
* This function will unlock the Egg Ticket event in a Pokémon Crystal save
|
||||
*
|
||||
* @param context a MenuScene*
|
||||
* @param param a nullpointer (dummy param)
|
||||
*/
|
||||
void gen2ReceiveEggTicket(void* context, const void* param);
|
||||
|
||||
/**
|
||||
* This function will set a gen II event flag
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit aedb58832c188d3c7ce28da6bc1c453c128ec1be
|
||||
Subproject commit bb3fbd621b692cee07f978850507b0bf39cc65dc
|
||||
|
|
@ -712,6 +712,39 @@ void gen2ReceiveGSBall(void* context, const void* param)
|
|||
scene->showDialog(messageData);
|
||||
}
|
||||
|
||||
void gen2ReceiveEggTicket(void* context, const void* param)
|
||||
{
|
||||
MenuScene* scene = static_cast<MenuScene*>(context);
|
||||
TransferPakManager& tpakManager = scene->getDependencies().tpakManager;
|
||||
TransferPakRomReader romReader(tpakManager);
|
||||
TransferPakSaveManager saveManager(tpakManager);
|
||||
const Gen2LocalizationLanguage language = static_cast<Gen2LocalizationLanguage>(scene->getDependencies().localization);
|
||||
Gen2GameReader gameReader(romReader, saveManager, Gen2GameType::CRYSTAL, language);
|
||||
|
||||
DialogData* messageData = new DialogData{
|
||||
.shouldDeleteWhenDone = true
|
||||
};
|
||||
|
||||
if(scene->getDependencies().localization != (uint8_t)Gen2LocalizationLanguage::JAPANESE)
|
||||
{
|
||||
setDialogDataText(*messageData, "Sorry! This can only be unlocked Japanese version!");
|
||||
scene->showDialog(messageData);
|
||||
return;
|
||||
}
|
||||
|
||||
tpakManager.setRAMEnabled(true);
|
||||
|
||||
// the unlockEggTicketEvent() function does all the work.
|
||||
gameReader.unlockEggTicketEvent();
|
||||
gameReader.finishSave();
|
||||
tpakManager.finishWrites();
|
||||
tpakManager.setRAMEnabled(false);
|
||||
|
||||
setDialogDataText(*messageData, "Egg Ticket unlocked! Please go talk to the day-care man on route 34!");
|
||||
|
||||
scene->showDialog(messageData);
|
||||
}
|
||||
|
||||
void gen2SetEventFlag(void* context, const void* param)
|
||||
{
|
||||
MenuScene* scene = static_cast<MenuScene*>(context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user