Action: Difference between revisions

808 bytes added ,  2 June 2023
Expand on interactions
(→‎Frame: Note another place where actions can change)
(Expand on interactions)
Line 89: Line 89:
## Damage if not wearing metal cap, and set action to [[Lava Boost]].
## Damage if not wearing metal cap, and set action to [[Lava Boost]].
# <code>mario_process_interactions</code> '''This can change mario's action'''.
# <code>mario_process_interactions</code> '''This can change mario's action'''.
## First, loop over every object's interaction handlers.
### If the interactType of the handler is one of the types Mario can currently collide with...
#### Unset that type. ''(Basically Mario cannot interact with two objects of the same interaction type.)''
#### If the object's interaction status is not INT_STATUS_INTERACTED, ''call the handler''
## Decrement the invincibility timer
## Call <code>check_kick_or_punch_wall</code>. ''(Basically, Mario still gets speed from kicking, punching, or "tripping" (idk what this flag name means) a wall, even if the action changes.)''
## Remove the punching, kicking, and tripping flags from Mario.
## If (not interacting with door) sDisplayingDoorText = FALSE
## If (not interacting with warp) sJustTeleported = FALSE
# '''Loop: Call the function that executes Mario's current action'''. Each action has associated code as stated above. Whenever the function is called, it can return <code>TRUE</code>, continuing the loop. Actions often call <code>set_mario_action</code>, which returns TRUE and processes yet another action. Theoretically, this could cause an infinite loop, however such a subframe transition sequence has not been found.<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario.c#L1717-L1747</ref>
# '''Loop: Call the function that executes Mario's current action'''. Each action has associated code as stated above. Whenever the function is called, it can return <code>TRUE</code>, continuing the loop. Actions often call <code>set_mario_action</code>, which returns TRUE and processes yet another action. Theoretically, this could cause an infinite loop, however such a subframe transition sequence has not been found.<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario.c#L1717-L1747</ref>
# Adjust Mario's model for quicksand and squishing, adjust the camera, when submerged adjust the camera and spawn bubbles, update health, update cap hitbox and model, process wind and infinite stairs music.
# Adjust Mario's model for quicksand and squishing, adjust the camera, when submerged adjust the camera and spawn bubbles, update health, update cap hitbox and model, process wind and infinite stairs music.
# Set <code>oInteractionStatus</code> to 0.
== References ==
== References ==
<references/>
<references/>
{{actions}}
{{actions}}
[[Category:Action Mechanics]]
[[Category:Action Mechanics]]
188

edits