Idle: Difference between revisions

1,741 bytes added ,  7 March 2023
way too much detail
(→‎check_common_idle_cancels: fix Into transitions. All stationary: water plunge, squished, standing death, quicksand death. All check_common_idle_cancels: freefall, shockwave bounce, single jump, begin sliding, first person, walking, punching, start crouching)
(way too much detail)
Line 16: Line 16:
''Certain things here are more explained on their individual pages. If something lacks detail, check the link for more information.''
''Certain things here are more explained on their individual pages. If something lacks detail, check the link for more information.''


As with all stationary actions, a variety of "cancels" are checked prior to actually performing the idle action. These checks are as follows:<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_actions_stationary.c#L1083-L1115</ref>
Before performing the action, [[Idle#Stationary cancels|stationary cancels]] are checked.
 
When performing the Idle action, the following happens:
# If Mario has sunk more than 30 units into quicksand, his action is set to [[In Quicksand|in quicksand]].
# If Mario is in poison gas, his action is set to [[coughing]].
# If Mario is not against a wall and has low health, his action is set to the [[panting action]].
# [[Idle#Check%20common%20idle%20cancels|check_common_idle_cancels]]
# If Mario's animation has just ended, his head has turned 10 times, and there is ground behind him (that is not an object)
## If Mario is in a cold environment, he starts to [[Shivering|shiver]], else he goes into the [[Start Sleeping|start sleeping]] action.
# If Mario is against a wall, Mario has his animation changed to be standing against the wall. Otherwise, Mario's animation is set depending on which way he is turning his head.
 
== Stationary cancels ==
A variety of "cancels" are checked prior to actually performing any stationary action. These checks are as follows:<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_actions_stationary.c#L1083-L1115</ref>
 
# Water - If Mario's height is lower than 100 units below the water height:
# Water - If Mario's height is lower than 100 units below the water height:
#* The camera preset is updated.
#* The camera preset is updated.
#* Mario's forward velocity is divided by 4.
#* Mario's y velocity is divided by 2.
#* Mario's height is set to 100 units below the water height.
#* Mario's action is set to [[Water Plunge|water plunge]].
#* Mario's action is set to [[Water Plunge|water plunge]].
# Squish - If Mario is supposed to be squished:
# Squish - If Mario is supposed to be squished:
Line 25: Line 41:
# If the action is not the unused [[0x0E action]] (always true) and Mario has less than 0x100 health:
# If the action is not the unused [[0x0E action]] (always true) and Mario has less than 0x100 health:
#* The camera preset is updated.
#* The camera preset is updated.
#* Mario's action is changed to the [[Standing Death|standing death]] action.
#* Mario's action is changed to [[Standing Death|standing death]].
# Lastly, Mario interacts with [[quicksand]] if his floor is a quicksand floor.
# Lastly, Mario can interact with quicksand on a quicksand floor. '''This only cancels if Mario's action is set to quicksand death'''.
With the Idle action occurring, the following happens:
#* Nothing happens if Mario is riding on a shell (though of course, riding a shell isn't a stationary action).
# If Mario has sunk more than 30 units into quicksand, his action is set to [[In Quicksand|in quicksand]].
#* If Mario's floor isn't quicksand, the quicksand depth is set to 0, and nothing happens.
# If Mario is in poison gas, his action is set to [[coughing]].
#* Else:
# If Mario is not against a wall and has low health, his action is set to the [[panting action]].
#** If Mario's quicksand depth is less than 1.1, it is set to 1.1
# [[Idle#Check%20common%20idle%20cancels|check_common_idle_cancels]]
#** Mario's quicksand depth is increased by 0.5
# If Mario's animation has just ended, his head has turned 10 times, and there is ground behind him (that is not an object)
#** If Mario's floor type is SURFACE_SHALLOW_QUICKSAND, SURFACE_SHALLOW_MOVING_QUICKSAND, or (SURFACE_QUICKSAND or SURFACE_MOVING_QUICKSAND), then his quicksand depth is capped to at most 10, 25, and 60 units respectively.
## If Mario is in a cold environment, he starts to [[Shivering|shiver]], else he goes into the [[Start Sleeping|start sleeping]] action.
#** If (Mario's floor type is SURFACE_DEEP_QUICKSAND or SURFACE_DEEP_MOVING_QUICKSAND, and his quicksand depth is at least 160) '''or''' (Mario's floor type is SURFACE_INSTANT_QUICKSAND or SURFACE_INSTANT_MOVING_QUICKSAND):
# If Mario is against a wall, Mario has his animation changed to be standing against the wall. Otherwise, Mario's animation is set depending on which way he is turning his head.
#*** The camera preset is updated.
#*** Mario's action is set to [[Quicksand Death]].
 
The processing goes:
 
# Somehow, m->action is set to a stationary action.
# Right before executing the action, stationary cancels are checked.
# The action is executed.
 
Technically, m->action was set to the stationary action. So although the action doesn't really do anything, there is still a "transition" between such stationary action and [[Water Plunge]], [[Squished]], [[Standing Death]], or [[Quicksand Death]]. So invariably, for all stationary actions, the infobox contains those 4 actions under "Transitions > Into" first (see top right of page if you don't know what I'm talking about).
 
== check_common_idle_cancels ==
== check_common_idle_cancels ==
Note: This is used only in Idle, [[Start Sleeping]], [[Coughing]], [[In Quicksand]], and [[Panting]].
Note: This is used only in Idle, [[Start Sleeping]], [[Coughing]], [[In Quicksand]], and [[Panting]].
188

edits