diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2019-12-21 20:49:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-21 20:49:32 -0500 |
commit | ba553271d7ad2b25520ecb02d743d3d6387007ff (patch) | |
tree | 171a6c4385710e55633abdd5fd3d5d28d7b0124b /src | |
parent | 213b4124bdc73125c2bfefde40d5345e869ad625 (diff) | |
parent | 6dfcec1181e2aee01d3a5c0c6c16d0bdd426d21e (diff) |
Merge pull request #200 from PikalaxALT/post_battle_event_funcs
Decompile post_battle_event_funcs
Diffstat (limited to 'src')
-rw-r--r-- | src/post_battle_event_funcs.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/post_battle_event_funcs.c b/src/post_battle_event_funcs.c new file mode 100644 index 000000000..6d4652f35 --- /dev/null +++ b/src/post_battle_event_funcs.c @@ -0,0 +1,59 @@ +#include "global.h" +#include "script_pokemon_util_80A0058.h" +#include "event_data.h" +#include "credits.h" +#include "overworld.h" +#include "hall_of_fame.h" +#include "load_save.h" +#include "constants/flags.h" +#include "constants/spawn_points.h" + +bool8 Special_HallOfFame(void) +{ + bool8 ribbonState; + bool8 *r7; + int i; + bool8 gaveAtLeastOneRibbon; + sp000_heal_pokemon(); + if (FlagGet(FLAG_SYS_GAME_CLEAR) == TRUE) + { + gHasHallOfFameRecords = TRUE; + } + else + { + gHasHallOfFameRecords = FALSE; + FlagSet(FLAG_SYS_GAME_CLEAR); + } + if (GetGameStat(GAME_STAT_FIRST_HOF_PLAY_TIME) == 0) + { + SetGameStat(GAME_STAT_FIRST_HOF_PLAY_TIME, (gSaveBlock2Ptr->playTimeHours << 16) | (gSaveBlock2Ptr->playTimeMinutes << 8) | gSaveBlock2Ptr->playTimeSeconds); + } + sub_804C1AC(); + sub_8055738(SPAWN_PALLET_TOWN); + gaveAtLeastOneRibbon = FALSE; + for (i = 0, r7 = &ribbonState; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES) && !GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG)) + { + if (!GetMonData(&gPlayerParty[i], MON_DATA_CHAMPION_RIBBON)) + { + *r7 = TRUE; + SetMonData(&gPlayerParty[i], MON_DATA_CHAMPION_RIBBON, &ribbonState); + gaveAtLeastOneRibbon = TRUE; + } + } + } + if (gaveAtLeastOneRibbon == TRUE) + { + IncrementGameStat(GAME_STAT_RECEIVED_RIBBONS); + FlagSet(FLAG_SYS_RIBBON_GET); + } + SetMainCallback2(CB2_DoHallOfFameScreen); + return FALSE; +} + +bool8 sp0C8_whiteout_maybe(void) +{ + SetMainCallback2(CB2_WhiteOut); + return FALSE; +} |