Add ON_COLLIDE_LEVEL_BOUNDS hook

Called whenever Mario hits the level boundaries "wall"
This commit is contained in:
eros71-dev 2023-11-12 19:28:38 +01:00
parent caf2f3233c
commit ff17fa4a67
5 changed files with 14 additions and 3 deletions

View file

@ -9066,7 +9066,10 @@ HOOK_DIALOG_SOUND = 35
HOOK_ON_HUD_RENDER_BEHIND = 36
--- @type LuaHookedEventType
HOOK_MAX = 37
HOOK_ON_COLLIDE_LEVEL_BOUNDS = 37
--- @type LuaHookedEventType
HOOK_MAX = 38
--- @class HudDisplayFlags

View file

@ -3236,7 +3236,8 @@
| HOOK_ON_EXIT | 34 |
| HOOK_DIALOG_SOUND | 35 |
| HOOK_ON_HUD_RENDER_BEHIND | 36 |
| HOOK_MAX | 37 |
| HOOK_ON_COLLIDE_LEVEL_BOUNDS | 37 |
| HOOK_MAX | 38 |
[:arrow_up_small:](#)

View file

@ -294,6 +294,8 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
mario_update_wall(m, &upperWcd);
if (floor == NULL) {
//HOOK_ON_COLLIDE_LEVEL_BOUNDS, coopdx
smlua_call_event_hooks_mario_param(HOOK_ON_COLLIDE_LEVEL_BOUNDS, m);
return GROUND_STEP_HIT_WALL_STOP_QSTEPS;
}
@ -468,6 +470,8 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
}
m->pos[1] = nextPos[1];
//HOOK_ON_COLLIDE_LEVEL_BOUNDS, coopdx
smlua_call_event_hooks_mario_param(HOOK_ON_COLLIDE_LEVEL_BOUNDS, m);
return AIR_STEP_HIT_WALL;
}

View file

@ -3214,7 +3214,8 @@ char gSmluaConstants[] = ""
"HOOK_ON_EXIT = 34\n"
"HOOK_DIALOG_SOUND = 35\n"
"HOOK_ON_HUD_RENDER_BEHIND = 36\n"
"HOOK_MAX = 37\n"
"HOOK_ON_COLLIDE_LEVEL_BOUNDS = 37\n"
"HOOK_MAX = 38\n"
"ACTION_HOOK_EVERY_FRAME = 0\n"
"ACTION_HOOK_GRAVITY = 1\n"
"ACTION_HOOK_MAX = 2\n"

View file

@ -48,6 +48,7 @@ enum LuaHookedEventType {
HOOK_ON_EXIT,
HOOK_DIALOG_SOUND,
HOOK_ON_HUD_RENDER_BEHIND,
HOOK_ON_COLLIDE_LEVEL_BOUNDS,
HOOK_MAX,
};
@ -89,6 +90,7 @@ static const char* LuaHookedEventTypeName[] = {
"HOOK_ON_EXIT",
"HOOK_DIALOG_SOUND",
"HOOK_ON_HUD_RENDER_BEHIND",
"HOOK_ON_COLLIDE_LEVEL_BOUNDS",
"HOOK_MAX"
};