Sleeping
Sleeping is something Mario can do.
Sleeping | |
Properties | |
Hex | 0x0C000203 |
Action Flags | STATIONARY |
Action Group | Stationary |
ID | 0x003 |
Transitions | |
Into | stationary cancels: Water Plunge, Squished, Standing Death (theoretically), Quicksand Death, non cancel: Waking Up |
Out of | Start Sleeping |
Other | |
Animation | 0x85 (sleep idle), 0x86 (sleep start lying), (sleep lying) |
Interactions
Interestingly, while sleeping, Klepto cannot steal your hat.[1]
Behavior
The only way to enter the action is through Start Sleeping.
update_mario_sound_and_camera
will increase background noise.[2]
Before performing the action, stationary cancels are checked.
- When INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE | INPUT_FIRST_PERSON | INPUT_STOMPED | INPUT_B_PRESSED | INPUT_Z_PRESSED, transition to Waking Up
- When quicksandDepth > 30, transition to Waking Up
- Take Mario's facing angle and subtract
0x8000
, and consider the point 60 units in that direction (from Mario). If the floor there is more than 24 units below Mario, transition to Waking Up. (Note that finding a floor starts at the position 100 units above Mario's y position.) - Set Mario's eyeState to closed.
- stationary ground step.
- This action has three states:
- State 0
- Set Mario's animation to MARIO_ANIM_SLEEP_IDLE
if (animFrame == -1 && !m->actionTimer) lower_background_noise(2);
if (animFrame == 2) play_sound(SOUND_MARIO_SNORING1 ...
if (animFrame == 20) play_sound(SOUND_MARIO_SNORING2 ...
- When the animation has ended, increment the action timer until it becomes greater than 45, at which point set actionState to 1
- State 1
- Set Mario's animation to MARIO_ANIM_SLEEP_START_LYING
- Once Mario's animation frame is 18, play SOUND_ACTION_TERRAIN_BODY_HIT_GROUND
- When the animation has ended, set actionState to 2
- State 2
- Set Mario's animation to MARIO_ANIM_SLEEP_LYING
- (JP only) Play SOUND_MARIO_SNORING2 on animation frame 2, then SOUND_MARIO_SNORING1 on animation frame 25
- (Non JP) Play SOUND_MARIO_SNORING3 if there's no sound flag already playing
- State 0
- Return FALSE (exit action loop)