246
edits
Icecream17 (talk | contribs) No edit summary |
Icecream17 (talk | contribs) (Quartersteps... are hidden inside stationary_ground_step... even _more_ information) |
||
Line 26: | Line 26: | ||
## 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 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. | # 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_ground_step | # [[Idle#stationary ground step|stationary_ground_step]] | ||
== Stationary cancels == | == 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> | 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> | ||
Line 69: | Line 69: | ||
# If B is pressed, Mario's action is set to [[punching]]. | # If B is pressed, Mario's action is set to [[punching]]. | ||
# If Z is pressed, Mario's action is set to [[start crouching]].<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_actions_stationary.c#L20-L60</ref> | # If Z is pressed, Mario's action is set to [[start crouching]].<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_actions_stationary.c#L20-L60</ref> | ||
==stationary_ground_step== | |||
https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_step.c#L236 | |||
#Set Mario's forward velocity, velocity[0], velocity[2], slideVelocityX, and slideVelocityZ to 0. | |||
#Let step_result = GROUND_STEP_NONE | |||
#Call mario_update_moving_sand:<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_step.c#L172</ref> | |||
##If Mario's floor type is {DEEP_MOVING, SHALLOW_MOVING, MOVING, or INSTANT_MOVING}_QUICKSAND: | |||
###Change Mario's velocity[0] and velocity[2] based on the floor's "force" data. | |||
###return TRUE | |||
##else return FALSE | |||
#Call mario_update_windy_ground:<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_step.c#L190</ref> | |||
##If Mario's floor type is SURFACE_HORIZONTAL_WIND (like on the ship in Rainbow Ride): | |||
###Change Mario's velocity[0] and velocity[2] as if the wind was pushing Mario, based on the floor's "force" data, the global timer, and Mario's facing angle. | |||
###return TRUE | |||
##else return FALSE | |||
#If either step 3 or step 4 returned true, step_result = perform_ground_step(): | |||
##Loop 4 times: ''Do a quarterstep''. The next intended position is Mario's position plus the de facto speed vector. Each time, set '''step_result''' to a '''(value)'''. | |||
###Let ''floor'' be the (first) floor at the next intended position (very complicated). It must be at least -78 units below Mario's y position. | |||
###If the next intended position is OOB, exit loop '''(WALL)''' | |||
###If Mario is riding a shell and the floor height is less than the water level (which is -11000 by default) | |||
####Set floor height to water level | |||
####Set ''floor'' to the global water surface pseudo floor (very slippery, flags: 0, room: 0, vertices: (0, 0, 0), (0, 0, 0), (0, 0, 0), normal vector: (0, 1, 0) i.e. up)<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_step.c#L14</ref> | |||
####<span style="color:gray;">Set the floor's originOffset to floor height (a comment says this has no effect)</span> | |||
###If the floor is more than 100 units below Mario | |||
####If Mario's height + 160 units is at least the ceiling height, exit loop '''(WALL)''' | |||
####Set Mario's position to the next intended position, Mario's floor to the floor, and Mario's floor height to the floor height; exit loop '''(LEFT GROUND)''' | |||
###If ''floor'' height + 160 units is at least the ceiling height, exit loop '''(WALL)''' | |||
###Set Mario's position to the next intended position, Mario's floor to the floor, and Mario's floor height to the floor height | |||
###Let upperWall be a wall within 60 units of (50 units above the next intended position). (This looks even more complicated than finding the floor). | |||
###If the upperWall exists AND not(abs(atan2s(upperWall normal z, upperWall normal x) - Mario facing angle[1]) is between 0x2AAA and 0x5555), exit loop '''(WALL)''', else '''(WALL_CONTINUE)''' | |||
###'''(NONE)''' | |||
## Update Mario's "terrain sound addend", graphics position, and graphics angle. | |||
## If step_result is (WALL_CONTINUE), set step_result to (WALL) | |||
## Return step_result | |||
# Else: | |||
## Set Mario's y position to the floor height. '''This is the cause of many [[Downwarp|downwarps]]'''. | |||
## Update Mario's graphics position and graphics angle. | |||
# Return step_result | |||
# | |||
{{actions}} | {{actions}} | ||
<references /> |
edits