Skip to content

Commit

Permalink
MERGE PR 283
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin452 committed May 2, 2024
1 parent 53297f8 commit 85bb03c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
15 changes: 12 additions & 3 deletions levels/ending/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "make_const_nonconst.h"
#include "levels/ending/header.h"

#include "levels/intro/header.h"

const LevelScript level_ending_entry[] = {
/*0*/ INIT_LEVEL(),
/*1*/ LOAD_MIO0(/*seg*/ 0x07, _ending_segment_7SegmentRomStart, _ending_segment_7SegmentRomEnd),
Expand All @@ -28,10 +30,17 @@ const LevelScript level_ending_entry[] = {
/*9*/ SLEEP(/*frames*/ 60),
/*10*/ BLACKOUT(/*active*/ FALSE),
/*11*/ LOAD_AREA(/*area*/ 1),
/*12*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00),
/*12*/
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00),
/*14*/ SLEEP(/*frames*/ 120),
/*15*/ CALL(/*arg*/ 0, /*func*/ lvl_play_the_end_screen_sound),
// L1:
/*17*/ SLEEP(/*frames*/ 1),
/*18*/ JUMP(level_ending_entry + 17),
// The following lines were added/altered to allow the player to reset
/*17*/ CALL_LOOP(/*arg*/ 1, /*func*/ credits_end_wait_for_reset),
/*18*/
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00),
/*19*/ SLEEP(/*frames*/ 120),
/*20*/
EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd,
/*entry*/ level_intro_entry_2),
};
8 changes: 8 additions & 0 deletions src/game/level_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,3 +1327,11 @@ s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1) {
play_sound(SOUND_MENU_THANK_YOU_PLAYING_MY_GAME, gDefaultSoundArgs);
return 1;
}

// Added so the player can reset the game at the end screen
s32 credits_end_wait_for_reset() {
if (gPlayer1Controller->buttonPressed & START_BUTTON) {
return 1;
}
return 0;
}
1 change: 1 addition & 0 deletions src/game/level_update.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused);
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum);
s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum);
s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1);
s32 credits_end_wait_for_reset();
void basic_update(UNUSED s16 *arg);

#endif // LEVEL_UPDATE_H
2 changes: 1 addition & 1 deletion src/game/mario_actions_stationary.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ s32 check_common_hold_idle_cancels(struct MarioState *m) {
return 0;
}

s32 act_idle(struct MarioState *m) {
s32 act_idle(struct MarioState *m) {
if (m->quicksandDepth > 30.0f) {
return set_mario_action(m, ACT_IN_QUICKSAND, 0);
}
Expand Down

0 comments on commit 85bb03c

Please sign in to comment.