mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Expose should_push_or_pull_door()
This commit is contained in:
parent
360fd9fb8e
commit
1bde63d3d8
5 changed files with 50 additions and 0 deletions
|
@ -3797,6 +3797,13 @@ function passes_pvp_interaction_checks(attacker, victim)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param m MarioState
|
||||||
|
--- @param o Object
|
||||||
|
--- @return integer
|
||||||
|
function should_push_or_pull_door(m, o)
|
||||||
|
-- ...
|
||||||
|
end
|
||||||
|
|
||||||
--- @param m MarioState
|
--- @param m MarioState
|
||||||
--- @param o Object
|
--- @param o Object
|
||||||
--- @return integer
|
--- @return integer
|
||||||
|
|
|
@ -4581,6 +4581,27 @@
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
## [should_push_or_pull_door](#should_push_or_pull_door)
|
||||||
|
|
||||||
|
### Lua Example
|
||||||
|
`local integerValue = should_push_or_pull_door(m, o)`
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
| Field | Type |
|
||||||
|
| ----- | ---- |
|
||||||
|
| m | [MarioState](structs.md#MarioState) |
|
||||||
|
| o | [Object](structs.md#Object) |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
- `integer`
|
||||||
|
|
||||||
|
### C Prototype
|
||||||
|
`u32 should_push_or_pull_door(struct MarioState *m, struct Object *o);`
|
||||||
|
|
||||||
|
[:arrow_up_small:](#)
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
## [take_damage_and_knock_back](#take_damage_and_knock_back)
|
## [take_damage_and_knock_back](#take_damage_and_knock_back)
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
|
|
|
@ -884,6 +884,7 @@
|
||||||
- [mario_stop_riding_object](functions-3.md#mario_stop_riding_object)
|
- [mario_stop_riding_object](functions-3.md#mario_stop_riding_object)
|
||||||
- [mario_throw_held_object](functions-3.md#mario_throw_held_object)
|
- [mario_throw_held_object](functions-3.md#mario_throw_held_object)
|
||||||
- [passes_pvp_interaction_checks](functions-3.md#passes_pvp_interaction_checks)
|
- [passes_pvp_interaction_checks](functions-3.md#passes_pvp_interaction_checks)
|
||||||
|
- [should_push_or_pull_door](functions-3.md#should_push_or_pull_door)
|
||||||
- [take_damage_and_knock_back](functions-3.md#take_damage_and_knock_back)
|
- [take_damage_and_knock_back](functions-3.md#take_damage_and_knock_back)
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -168,6 +168,7 @@ u32 get_door_save_file_flag(struct Object *door);
|
||||||
void mario_process_interactions(struct MarioState *m);
|
void mario_process_interactions(struct MarioState *m);
|
||||||
void mario_handle_special_floors(struct MarioState *m);
|
void mario_handle_special_floors(struct MarioState *m);
|
||||||
u8 passes_pvp_interaction_checks(struct MarioState* attacker, struct MarioState* victim);
|
u8 passes_pvp_interaction_checks(struct MarioState* attacker, struct MarioState* victim);
|
||||||
|
u32 should_push_or_pull_door(struct MarioState *m, struct Object *o);
|
||||||
u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o);
|
u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o);
|
||||||
u32 determine_interaction(struct MarioState *m, struct Object *o);
|
u32 determine_interaction(struct MarioState *m, struct Object *o);
|
||||||
u32 process_interaction(struct MarioState *m, u32 interactType, struct Object *o, u32 (*interact_function)(struct MarioState *, u32 interactType, struct Object *));
|
u32 process_interaction(struct MarioState *m, u32 interactType, struct Object *o, u32 (*interact_function)(struct MarioState *, u32 interactType, struct Object *));
|
||||||
|
|
|
@ -14484,6 +14484,25 @@ int smlua_func_passes_pvp_interaction_checks(lua_State* L) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int smlua_func_should_push_or_pull_door(lua_State* L) {
|
||||||
|
if (L == NULL) { return 0; }
|
||||||
|
|
||||||
|
int top = lua_gettop(L);
|
||||||
|
if (top != 2) {
|
||||||
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "should_push_or_pull_door", 2, top);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
||||||
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "should_push_or_pull_door"); return 0; }
|
||||||
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
||||||
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "should_push_or_pull_door"); return 0; }
|
||||||
|
|
||||||
|
lua_pushinteger(L, should_push_or_pull_door(m, o));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int smlua_func_take_damage_and_knock_back(lua_State* L) {
|
int smlua_func_take_damage_and_knock_back(lua_State* L) {
|
||||||
if (L == NULL) { return 0; }
|
if (L == NULL) { return 0; }
|
||||||
|
|
||||||
|
@ -33703,6 +33722,7 @@ void smlua_bind_functions_autogen(void) {
|
||||||
smlua_bind_function(L, "mario_stop_riding_object", smlua_func_mario_stop_riding_object);
|
smlua_bind_function(L, "mario_stop_riding_object", smlua_func_mario_stop_riding_object);
|
||||||
smlua_bind_function(L, "mario_throw_held_object", smlua_func_mario_throw_held_object);
|
smlua_bind_function(L, "mario_throw_held_object", smlua_func_mario_throw_held_object);
|
||||||
smlua_bind_function(L, "passes_pvp_interaction_checks", smlua_func_passes_pvp_interaction_checks);
|
smlua_bind_function(L, "passes_pvp_interaction_checks", smlua_func_passes_pvp_interaction_checks);
|
||||||
|
smlua_bind_function(L, "should_push_or_pull_door", smlua_func_should_push_or_pull_door);
|
||||||
smlua_bind_function(L, "take_damage_and_knock_back", smlua_func_take_damage_and_knock_back);
|
smlua_bind_function(L, "take_damage_and_knock_back", smlua_func_take_damage_and_knock_back);
|
||||||
|
|
||||||
// lag_compensation.h
|
// lag_compensation.h
|
||||||
|
|
Loading…
Reference in a new issue