mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
3869 lines
131 KiB
C
3869 lines
131 KiB
C
/* THIS FILE IS AUTOGENERATED */
|
|
/* SHOULD NOT BE MANUALLY CHANGED */
|
|
|
|
#include "smlua.h"
|
|
|
|
#include "src/audio/external.h"
|
|
#include "src/engine/surface_collision.h"
|
|
#include "src/game/camera.h"
|
|
#include "src/game/characters.h"
|
|
#include "src/game/mario_step.h"
|
|
#include "src/game/mario.h"
|
|
#include "src/pc/djui/djui_popup.h"
|
|
#include "src/pc/network/network_utils.h"
|
|
#include "src/pc/djui/djui_chat_message.h"
|
|
#include "src/game/interaction.h"
|
|
#include "src/game/level_info.h"
|
|
#include "src/game/save_file.h"
|
|
#include "src/game/sound_init.h"
|
|
#include "src/pc/djui/djui_hud_utils.h"
|
|
#include "src/pc/network/network_player.h"
|
|
|
|
|
|
//////////////
|
|
// camera.h //
|
|
//////////////
|
|
|
|
int smlua_func_set_camera_pitch_shake(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_camera_pitch_shake(mag, decay, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_roll_shake(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_camera_roll_shake(mag, decay, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_shake_from_hit(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s16 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_camera_shake_from_hit(shake);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_shake_from_point(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
s16 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 posX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 posY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 posZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_camera_shake_from_point(shake, posX, posY, posZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_yaw_shake(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_camera_yaw_shake(mag, decay, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_environmental_camera_shake(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s16 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_environmental_camera_shake(shake);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// characters.h //
|
|
//////////////////
|
|
|
|
int smlua_func_get_character(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
smlua_push_object(L, LOT_CHARACTER, get_character(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_character_anim_offset(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, get_character_anim_offset(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_character_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
int characterSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_character_sound(m, characterSound);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_character_sound_if_no_flag(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
int characterSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 flags = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_character_sound_if_no_flag(m, characterSound, flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_character_sound_offset(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
int characterSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 offset = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_character_sound_offset(m, characterSound, offset);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_character_anim_offset(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
update_character_anim_offset(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// djui_chat_message.h //
|
|
/////////////////////////
|
|
|
|
int smlua_func_djui_chat_message_create(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_chat_message_create(message);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////
|
|
// djui_hud_utils.h //
|
|
//////////////////////
|
|
|
|
int smlua_func_djui_hud_get_screen_height(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_screen_height());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_screen_width(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_screen_width());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_measure_text(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, djui_hud_measure_text(message));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_print_text(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
float x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
float y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
float scale = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_hud_print_text(message, x, y, scale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_rect(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 width = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 height = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_hud_render_rect(x, y, width, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_texture(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 5)) { return 0; }
|
|
|
|
struct TextureInfo* texInfo = (struct TextureInfo*)smlua_to_cobject(L, 1, LOT_TEXTUREINFO);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 scaleW = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 scaleH = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_hud_render_texture(texInfo, x, y, scaleW, scaleH);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_color(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
u8 r = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 g = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 b = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 a = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_hud_set_color(r, g, b, a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_font(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
int fontType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_hud_set_font(fontType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_resolution(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
int resolutionType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_hud_set_resolution(resolutionType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// djui_popup.h //
|
|
//////////////////
|
|
|
|
int smlua_func_djui_popup_create(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
int lines = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
djui_popup_create(message, lines);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////
|
|
// external.h //
|
|
////////////////
|
|
|
|
int smlua_func_fade_volume_scale(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 targetScale = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
fade_volume_scale(player, targetScale, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_background_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
u16 arg0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 fadeOut = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
fadeout_background_music(arg0, fadeOut);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_course_clear(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_course_clear();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_dialog_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u8 dialogID = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_dialog_sound(dialogID);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 seqArgs = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_music(player, seqArgs, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_peachs_jingle(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_peachs_jingle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_power_star_jingle(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u8 arg0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_power_star_jingle(arg0);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_puzzle_jingle(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_puzzle_jingle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_race_fanfare(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_race_fanfare();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_secondary_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
u8 seqId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 bgMusicVolume = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 volume = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_secondary_music(seqId, bgMusicVolume, volume, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
s32 soundBits = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* pos = smlua_get_vec3f_from_buffer();
|
|
pos[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_sound(soundBits, pos);
|
|
|
|
smlua_push_number_field(2, "x", pos[0]);
|
|
smlua_push_number_field(2, "y", pos[1]);
|
|
smlua_push_number_field(2, "z", pos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_with_freq_scale(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s32 soundBits = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* pos = smlua_get_vec3f_from_buffer();
|
|
pos[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 freqScale = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_sound_with_freq_scale(soundBits, pos, freqScale);
|
|
|
|
smlua_push_number_field(2, "x", pos[0]);
|
|
smlua_push_number_field(2, "y", pos[1]);
|
|
smlua_push_number_field(2, "z", pos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_star_fanfare(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_star_fanfare();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_toads_jingle(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_toads_jingle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_fade_out(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
sequence_player_fade_out(player, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_unlower(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
sequence_player_unlower(player, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// interaction.h //
|
|
///////////////////
|
|
|
|
int smlua_func_does_mario_have_normal_cap_on_head(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, does_mario_have_normal_cap_on_head(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_door_save_file_flag(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct Object* door = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, get_door_save_file_flag(door));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_blow_off_cap(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 capSpeed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_blow_off_cap(m, capSpeed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_check_object_grab(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_check_object_grab(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_drop_held_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_drop_held_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_get_collided_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 interactType = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, mario_get_collided_object(m, interactType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_grab_used_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_grab_used_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_lose_cap_to_enemy(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 arg = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_lose_cap_to_enemy(m, arg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_obj_angle_to_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_obj_angle_to_object(m, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_retrieve_cap(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_retrieve_cap(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_stop_riding_and_holding(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_stop_riding_and_holding(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_stop_riding_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_stop_riding_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_throw_held_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_throw_held_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// level_info.h //
|
|
//////////////////
|
|
|
|
int smlua_func_get_level_name(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 areaIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushstring(L, get_level_name(courseNum, levelNum, areaIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////
|
|
// mario.h //
|
|
/////////////
|
|
|
|
int smlua_func_adjust_sound_for_speed(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
adjust_sound_for_speed(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_action_exits(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, check_common_action_exits(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_hold_action_exits(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, check_common_hold_action_exits(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_drop_and_set_mario_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, drop_and_set_mario_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_execute_mario_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, execute_mario_action(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_floor_height_relative_polar(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 angleFromMario = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 distFromMario = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_floor_height_relative_polar(m, angleFromMario, distFromMario));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_floor_slope(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 yawOffset = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, find_floor_slope(m, yawOffset));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_mario_anim_flags_and_translation(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 yaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
s16* translation = smlua_get_vec3s_from_buffer();
|
|
translation[0] = smlua_get_integer_field(3, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
translation[1] = smlua_get_integer_field(3, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
translation[2] = smlua_get_integer_field(3, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, find_mario_anim_flags_and_translation(o, yaw, translation));
|
|
|
|
smlua_push_integer_field(3, "x", translation[0]);
|
|
smlua_push_integer_field(3, "y", translation[1]);
|
|
smlua_push_integer_field(3, "z", translation[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_force_idle_state(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, force_idle_state(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hurt_and_set_mario_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 hurtCounter = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, hurt_and_set_mario_action(m, action, actionArg, hurtCounter));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_anim_at_end(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, is_anim_at_end(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_anim_past_end(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, is_anim_past_end(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_anim_past_frame(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 animFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, is_anim_past_frame(m, animFrame));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_facing_downhill(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 turnYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_facing_downhill(m, turnYaw));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_floor_is_slippery(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_floor_is_slippery(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_floor_is_slope(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_floor_is_slope(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_floor_is_steep(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_floor_is_steep(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_get_floor_class(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_get_floor_class(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_get_terrain_sound_addend(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_get_terrain_sound_addend(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_set_bubbled(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_set_bubbled(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_set_forward_vel(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 speed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_set_forward_vel(m, speed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_action_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 waveParticleType = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_action_sound(m, soundBits, waveParticleType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_heavy_landing_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_heavy_landing_sound(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_heavy_landing_sound_once(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_heavy_landing_sound_once(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_jump_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_jump_sound(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_landing_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_landing_sound(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_landing_sound_once(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_landing_sound_once(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 primarySoundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 scondarySoundBits = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_mario_sound(m, primarySoundBits, scondarySoundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_and_spawn_particles(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 waveParticleType = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_sound_and_spawn_particles(m, soundBits, waveParticleType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_if_no_flag(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 flags = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_sound_if_no_flag(m, soundBits, flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_resolve_and_return_wall_collisions(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
|
|
f32* pos = smlua_get_vec3f_from_buffer();
|
|
pos[0] = smlua_get_number_field(1, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[1] = smlua_get_number_field(1, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[2] = smlua_get_number_field(1, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 offset = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 radius = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
smlua_push_object(L, LOT_SURFACE, resolve_and_return_wall_collisions(pos, offset, radius));
|
|
|
|
smlua_push_number_field(1, "x", pos[0]);
|
|
smlua_push_number_field(1, "y", pos[1]);
|
|
smlua_push_number_field(1, "z", pos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_return_mario_anim_y_translation(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, return_mario_anim_y_translation(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_anim_to_frame(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 animFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_anim_to_frame(m, animFrame);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_jump_from_landing(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, set_jump_from_landing(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_jumping_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, set_jumping_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, set_mario_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_anim_with_accel(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 targetAnimID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 accel = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, set_mario_anim_with_accel(m, targetAnimID, accel));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_animation(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 targetAnimID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, set_mario_animation(m, targetAnimID));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_steep_jump_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_steep_jump_action(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_water_plunge_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, set_water_plunge_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_transition_submerged_to_walking(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, transition_submerged_to_walking(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_mario_pos_for_anim(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
update_mario_pos_for_anim(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_mario_sound_and_camera(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
update_mario_sound_and_camera(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_vec3f_find_ceil(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
|
|
f32* pos = smlua_get_vec3f_from_buffer();
|
|
pos[0] = smlua_get_number_field(1, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[1] = smlua_get_number_field(1, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
pos[2] = smlua_get_number_field(1, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 height = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// struct Surface** ceil = (struct Surface**)smlua_to_cobject(L, 3, LVT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_find_ceil(pos, height, ceil));
|
|
|
|
smlua_push_number_field(1, "x", pos[0]);
|
|
smlua_push_number_field(1, "y", pos[1]);
|
|
smlua_push_number_field(1, "z", pos[2]);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
//////////////////////////////
|
|
// mario_actions_airborne.c //
|
|
//////////////////////////////
|
|
|
|
int smlua_func_check_common_airborne_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_airborne_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_airborne_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_fall_damage(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 hardFallAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_fall_damage(struct MarioState *m, u32 hardFallAction);
|
|
lua_pushinteger(L, check_fall_damage(m, hardFallAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_fall_damage_or_get_stuck(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 hardFallAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction);
|
|
lua_pushinteger(L, check_fall_damage_or_get_stuck(m, hardFallAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_horizontal_wind(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_horizontal_wind(struct MarioState *m);
|
|
lua_pushinteger(L, check_horizontal_wind(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_kick_or_dive_in_air(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_kick_or_dive_in_air(struct MarioState *m);
|
|
lua_pushinteger(L, check_kick_or_dive_in_air(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_wall_kick(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_wall_kick(struct MarioState *m);
|
|
lua_pushinteger(L, check_wall_kick(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_air_action_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 landAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 stepArg = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, u32 stepArg);
|
|
lua_pushinteger(L, common_air_action_step(m, landAction, animation, stepArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_air_knockback_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 5)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 landAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 hardFallAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 speed = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFallAction, s32 animation, f32 speed);
|
|
lua_pushinteger(L, common_air_knockback_step(m, landAction, hardFallAction, animation, speed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lava_boost_on_wall(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 lava_boost_on_wall(struct MarioState *m);
|
|
lua_pushinteger(L, lava_boost_on_wall(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_airborne_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_airborne_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_airborne_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_far_fall_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void play_far_fall_sound(struct MarioState *m);
|
|
play_far_fall_sound(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_flip_sounds(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 frame1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 frame2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 frame3 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3);
|
|
play_flip_sounds(m, frame1, frame2, frame3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_knockback_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void play_knockback_sound(struct MarioState *m);
|
|
play_knockback_sound(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_get_stuck_in_ground(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 should_get_stuck_in_ground(struct MarioState *m);
|
|
lua_pushinteger(L, should_get_stuck_in_ground(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_air_with_turn(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_air_with_turn(struct MarioState *m);
|
|
update_air_with_turn(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_air_without_turn(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_air_without_turn(struct MarioState *m);
|
|
update_air_without_turn(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_flying(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_flying(struct MarioState *m);
|
|
update_flying(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_flying_pitch(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_flying_pitch(struct MarioState *m);
|
|
update_flying_pitch(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_flying_yaw(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_flying_yaw(struct MarioState *m);
|
|
update_flying_yaw(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_lava_boost_or_twirling(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_lava_boost_or_twirling(struct MarioState *m);
|
|
update_lava_boost_or_twirling(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////////////
|
|
// mario_actions_automatic.c //
|
|
///////////////////////////////
|
|
|
|
int smlua_func_add_tree_leaf_particles(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void add_tree_leaf_particles(struct MarioState *m);
|
|
add_tree_leaf_particles(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_automatic_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_automatic_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_automatic_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_climb_up_ledge(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void climb_up_ledge(struct MarioState *m);
|
|
climb_up_ledge(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_let_go_of_ledge(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 let_go_of_ledge(struct MarioState *m);
|
|
lua_pushinteger(L, let_go_of_ledge(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_automatic_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_automatic_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_automatic_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_hanging_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* nextPos = smlua_get_vec3f_from_buffer();
|
|
nextPos[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
nextPos[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
nextPos[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos);
|
|
lua_pushinteger(L, perform_hanging_step(m, nextPos));
|
|
|
|
smlua_push_number_field(2, "x", nextPos[0]);
|
|
smlua_push_number_field(2, "y", nextPos[1]);
|
|
smlua_push_number_field(2, "z", nextPos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_climbing_sounds(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 b = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void play_climbing_sounds(struct MarioState *m, s32 b);
|
|
play_climbing_sounds(m, b);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_pole_position(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 offsetY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 set_pole_position(struct MarioState *m, f32 offsetY);
|
|
lua_pushinteger(L, set_pole_position(m, offsetY));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_hang_moving(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 update_hang_moving(struct MarioState *m);
|
|
lua_pushinteger(L, update_hang_moving(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_hang_stationary(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_hang_stationary(struct MarioState *m);
|
|
update_hang_stationary(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_ledge_climb(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 endAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_ledge_climb(struct MarioState *m, s32 animation, u32 endAction);
|
|
update_ledge_climb(m, animation, endAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_ledge_climb_camera(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_ledge_climb_camera(struct MarioState *m);
|
|
update_ledge_climb_camera(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////////////
|
|
// mario_actions_cutscene.c //
|
|
//////////////////////////////
|
|
|
|
int smlua_func_bhv_end_peach_loop(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
extern void bhv_end_peach_loop(void);
|
|
bhv_end_peach_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_end_toad_loop(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
extern void bhv_end_toad_loop(void);
|
|
bhv_end_toad_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_death_handler(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 frameToDeathWarp = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 common_death_handler(struct MarioState *m, s32 animation, s32 frameToDeathWarp);
|
|
lua_pushinteger(L, common_death_handler(m, animation, frameToDeathWarp));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_put_cap_on(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void cutscene_put_cap_on(struct MarioState *m);
|
|
cutscene_put_cap_on(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_take_cap_off(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void cutscene_take_cap_off(struct MarioState *m);
|
|
cutscene_take_cap_off(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_general_star_dance_handler(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 isInWater = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void general_star_dance_handler(struct MarioState *m, s32 isInWater);
|
|
general_star_dance_handler(m, isInWater);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_generate_yellow_sparkles(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
s16 x = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 y = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 z = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 radius = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius);
|
|
generate_yellow_sparkles(x, y, z, radius);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_get_credits_str_width(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
// char * str = (char *)smlua_to_cobject(L, 1, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 get_credits_str_width(char *str);
|
|
lua_pushinteger(L, get_credits_str_width(str));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_get_star_collection_dialog(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 get_star_collection_dialog(struct MarioState *m);
|
|
lua_pushinteger(L, get_star_collection_dialog(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_handle_save_menu(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void handle_save_menu(struct MarioState *m);
|
|
handle_save_menu(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_launch_mario_until_land(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 endAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 forwardVel = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 launch_mario_until_land(struct MarioState *m, s32 endAction, s32 animation, f32 forwardVel);
|
|
lua_pushinteger(L, launch_mario_until_land(m, endAction, animation, forwardVel));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_cutscene_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_cutscene_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_cutscene_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_ready_to_speak(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_ready_to_speak(struct MarioState* m);
|
|
lua_pushinteger(L, mario_ready_to_speak(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_print_displaying_credits_entry(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
extern void print_displaying_credits_entry(void);
|
|
print_displaying_credits_entry();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_start_or_continue_dialog(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
struct Object* object = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern u8 should_start_or_continue_dialog(struct MarioState* m, struct Object* object);
|
|
lua_pushinteger(L, should_start_or_continue_dialog(m, object));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_spawn_obj_at_mario_rel_yaw(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 model = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// const BehaviorScript* behavior = (const BehaviorScript*)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 relYaw = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern struct Object *spawn_obj_at_mario_rel_yaw(struct MarioState *m, s32 model, const BehaviorScript *behavior, s16 relYaw);
|
|
smlua_push_object(L, LOT_OBJECT, spawn_obj_at_mario_rel_yaw(m, model, behavior, relYaw));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_stuck_in_ground_handler(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 6)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 unstuckFrame = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 target2 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 target3 = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 endAction = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFrame, s32 target2, s32 target3, s32 endAction);
|
|
stuck_in_ground_handler(m, animation, unstuckFrame, target2, target3, endAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////////
|
|
// mario_actions_moving.c //
|
|
////////////////////////////
|
|
|
|
int smlua_func_align_with_floor(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void align_with_floor(struct MarioState *m);
|
|
align_with_floor(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_analog_stick_held_back(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 analog_stick_held_back(struct MarioState *m);
|
|
lua_pushinteger(L, analog_stick_held_back(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_and_audio_for_heavy_walk(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void anim_and_audio_for_heavy_walk(struct MarioState *m);
|
|
anim_and_audio_for_heavy_walk(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_and_audio_for_hold_walk(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void anim_and_audio_for_hold_walk(struct MarioState *m);
|
|
anim_and_audio_for_hold_walk(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_and_audio_for_walk(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void anim_and_audio_for_walk(struct MarioState *m);
|
|
anim_and_audio_for_walk(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_landing_accel(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 frictionFactor = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 apply_landing_accel(struct MarioState *m, f32 frictionFactor);
|
|
lua_pushinteger(L, apply_landing_accel(m, frictionFactor));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_slope_accel(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void apply_slope_accel(struct MarioState *m);
|
|
apply_slope_accel(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_slope_decel(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 decelCoef = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 apply_slope_decel(struct MarioState *m, f32 decelCoef);
|
|
lua_pushinteger(L, apply_slope_decel(m, decelCoef));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_begin_braking_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 begin_braking_action(struct MarioState *m);
|
|
lua_pushinteger(L, begin_braking_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_begin_walking_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 forwardVel = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 begin_walking_action(struct MarioState *m, f32 forwardVel, u32 action, u32 actionArg);
|
|
lua_pushinteger(L, begin_walking_action(m, forwardVel, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_moving_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_moving_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_moving_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_ground_dive_or_punch(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_ground_dive_or_punch(struct MarioState *m);
|
|
lua_pushinteger(L, check_ground_dive_or_punch(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_ledge_climb_down(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void check_ledge_climb_down(struct MarioState *m);
|
|
check_ledge_climb_down(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_ground_knockback_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 5)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 arg2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 arg3 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 arg4 = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 arg2, s32 arg3, s32 arg4);
|
|
lua_pushinteger(L, common_ground_knockback_action(m, animation, arg2, arg3, arg4));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_landing_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 airAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern u32 common_landing_action(struct MarioState *m, s16 animation, u32 airAction);
|
|
lua_pushinteger(L, common_landing_action(m, animation, airAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_common_landing_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 5)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
struct LandingAction* landingAction = (struct LandingAction*)smlua_to_cobject(L, 2, LOT_LANDINGACTION);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// s32 (*setAPressAction)(structMarioState* arg2 = (s32 (*setAPressAction)(structMarioState*)smlua_to_cobject(L, 3, LVT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 arg3 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// u32) arg4 = (u32))smlua_to_cobject(L, 5, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 common_landing_cancels(struct MarioState *m, struct LandingAction *landingAction, s32 (*setAPressAction)(struct MarioState *, u32, u32));
|
|
lua_pushinteger(L, common_landing_cancels(m, landingAction, arg2, arg3, arg4));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_common_slide_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 endAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 airAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 animation);
|
|
common_slide_action(m, endAction, airAction, animation);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_slide_action_with_jump(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 5)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 stopAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 jumpAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 airAction = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, s32 animation);
|
|
lua_pushinteger(L, common_slide_action_with_jump(m, stopAction, jumpAction, airAction, animation));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_moving_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_moving_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_moving_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_step_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 frame1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 frame2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void play_step_sound(struct MarioState *m, s16 frame1, s16 frame2);
|
|
play_step_sound(m, frame1, frame2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_push_or_sidle_wall(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* startPos = smlua_get_vec3f_from_buffer();
|
|
startPos[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
startPos[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
startPos[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void push_or_sidle_wall(struct MarioState *m, Vec3f startPos);
|
|
push_or_sidle_wall(m, startPos);
|
|
|
|
smlua_push_number_field(2, "x", startPos[0]);
|
|
smlua_push_number_field(2, "y", startPos[1]);
|
|
smlua_push_number_field(2, "z", startPos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_quicksand_jump_land_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 5)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 endAction = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 airAction = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, u32 airAction);
|
|
lua_pushinteger(L, quicksand_jump_land_action(m, animation1, animation2, endAction, airAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_triple_jump_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 set_triple_jump_action(struct MarioState *m, UNUSED u32 action, UNUSED u32 actionArg);
|
|
lua_pushinteger(L, set_triple_jump_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_begin_sliding(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 should_begin_sliding(struct MarioState *m);
|
|
lua_pushinteger(L, should_begin_sliding(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_slide_bonk(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 fastAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 slowAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void slide_bonk(struct MarioState *m, u32 fastAction, u32 slowAction);
|
|
slide_bonk(m, fastAction, slowAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stomach_slide_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 stopAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 airAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s32 animation);
|
|
lua_pushinteger(L, stomach_slide_action(m, stopAction, airAction, animation));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_butt_slide(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void tilt_body_butt_slide(struct MarioState *m);
|
|
tilt_body_butt_slide(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_ground_shell(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 startYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void tilt_body_ground_shell(struct MarioState *m, s16 startYaw);
|
|
tilt_body_ground_shell(m, startYaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_running(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s16 tilt_body_running(struct MarioState *m);
|
|
lua_pushinteger(L, tilt_body_running(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_walking(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 startYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void tilt_body_walking(struct MarioState *m, s16 startYaw);
|
|
tilt_body_walking(m, startYaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_decelerating_speed(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 update_decelerating_speed(struct MarioState *m);
|
|
lua_pushinteger(L, update_decelerating_speed(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_shell_speed(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_shell_speed(struct MarioState *m);
|
|
update_shell_speed(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_sliding(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 stopSpeed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 update_sliding(struct MarioState *m, f32 stopSpeed);
|
|
lua_pushinteger(L, update_sliding(m, stopSpeed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_sliding_angle(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 accel = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 lossFactor = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_sliding_angle(struct MarioState *m, f32 accel, f32 lossFactor);
|
|
update_sliding_angle(m, accel, lossFactor);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_walking_speed(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void update_walking_speed(struct MarioState *m);
|
|
update_walking_speed(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////////
|
|
// mario_actions_object.c //
|
|
////////////////////////////
|
|
|
|
int smlua_func_animated_stationary_ground_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 endAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 endAction);
|
|
animated_stationary_ground_step(m, animation, endAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_object_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_object_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_object_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_object_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_object_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_object_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_punch_sequence(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_update_punch_sequence(struct MarioState *m);
|
|
lua_pushinteger(L, mario_update_punch_sequence(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////////////
|
|
// mario_actions_stationary.c //
|
|
////////////////////////////////
|
|
|
|
int smlua_func_check_common_hold_idle_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_hold_idle_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_hold_idle_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_idle_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_idle_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_idle_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_landing_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_landing_cancels(struct MarioState *m, u32 action);
|
|
lua_pushinteger(L, check_common_landing_cancels(m, action));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_stationary_cancels(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 check_common_stationary_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_stationary_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_landing_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 arg1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 landing_step(struct MarioState *m, s32 arg1, u32 action);
|
|
lua_pushinteger(L, landing_step(m, arg1, action));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_stationary_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_stationary_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_stationary_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_anim_sound(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 actionState = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animFrame = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 sound = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound);
|
|
play_anim_sound(m, actionState, animFrame, sound);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stopping_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 animID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 action = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void stopping_step(struct MarioState *m, s32 animID, u32 action);
|
|
stopping_step(m, animID, action);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////////////
|
|
// mario_actions_submerged.c //
|
|
///////////////////////////////
|
|
|
|
int smlua_func_apply_water_current(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* step = smlua_get_vec3f_from_buffer();
|
|
step[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
step[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
step[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void apply_water_current(struct MarioState *m, Vec3f step);
|
|
apply_water_current(m, step);
|
|
|
|
smlua_push_number_field(2, "x", step[0]);
|
|
smlua_push_number_field(2, "y", step[1]);
|
|
smlua_push_number_field(2, "z", step[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_float_surface_gfx(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void float_surface_gfx(struct MarioState *m);
|
|
float_surface_gfx(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_submerged_action(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern s32 mario_execute_submerged_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_submerged_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_water_full_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* nextPos = smlua_get_vec3f_from_buffer();
|
|
nextPos[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
nextPos[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
nextPos[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern u32 perform_water_full_step(struct MarioState *m, Vec3f nextPos);
|
|
lua_pushinteger(L, perform_water_full_step(m, nextPos));
|
|
|
|
smlua_push_number_field(2, "x", nextPos[0]);
|
|
smlua_push_number_field(2, "y", nextPos[1]);
|
|
smlua_push_number_field(2, "z", nextPos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_water_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern u32 perform_water_step(struct MarioState *m);
|
|
lua_pushinteger(L, perform_water_step(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_swimming_at_surface_particles(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 particleFlag = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void set_swimming_at_surface_particles(struct MarioState *m, u32 particleFlag);
|
|
set_swimming_at_surface_particles(m, particleFlag);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// mario_step.h //
|
|
//////////////////
|
|
|
|
int smlua_func_get_additive_y_vel_for_jumps(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushnumber(L, get_additive_y_vel_for_jumps());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_bonk_reflection(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 arg1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
mario_bonk_reflection(arg0, arg1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_push_off_steep_floor(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 arg1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 arg2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_push_off_steep_floor(arg0, arg1, arg2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_moving_sand(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_update_moving_sand(arg0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_quicksand(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 arg1 = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_update_quicksand(arg0, arg1));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_windy_ground(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, mario_update_windy_ground(arg0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_air_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u32 arg1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, perform_air_step(arg0, arg1));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_ground_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, perform_ground_step(arg0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_vel_from_pitch_and_yaw(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_vel_from_pitch_and_yaw(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stationary_ground_step(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, stationary_ground_step(arg0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_and_set_height_to_floor(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
stop_and_set_height_to_floor(arg0);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////
|
|
// network_player.h //
|
|
//////////////////////
|
|
|
|
int smlua_func_get_network_player_from_area(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 areaIndex = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, get_network_player_from_area(courseNum, actNum, levelNum, areaIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_network_player_from_level(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, get_network_player_from_level(courseNum, actNum, levelNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_network_player_smallest_global(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, get_network_player_smallest_global());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_connected_count(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushinteger(L, network_player_connected_count());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_from_global_index(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u8 globalIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, network_player_from_global_index(globalIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_set_description(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 6)) { return 0; }
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
const char* description = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 r = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 g = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 b = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u8 a = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
network_player_set_description(np, description, r, g, b, a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////
|
|
// network_utils.h //
|
|
/////////////////////
|
|
|
|
int smlua_func_network_get_player_text_color_string(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u8 localIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushstring(L, network_get_player_text_color_string(localIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_global_index_from_local(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u8 localIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, network_global_index_from_local(localIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_is_server(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushboolean(L, network_is_server());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_local_index_from_global(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u8 globalIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, network_local_index_from_global(globalIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////
|
|
// save_file.h //
|
|
/////////////////
|
|
|
|
int smlua_func_save_file_get_cap_pos(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
|
|
s16* capPos = smlua_get_vec3s_from_buffer();
|
|
capPos[0] = smlua_get_integer_field(1, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
capPos[1] = smlua_get_integer_field(1, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
capPos[2] = smlua_get_integer_field(1, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_cap_pos(capPos));
|
|
|
|
smlua_push_integer_field(1, "x", capPos[0]);
|
|
smlua_push_integer_field(1, "y", capPos[1]);
|
|
smlua_push_integer_field(1, "z", capPos[2]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_course_coin_score(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_course_coin_score(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_course_star_count(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_course_star_count(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_flags(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushinteger(L, save_file_get_flags());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_max_coin_score(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s32 courseIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_max_coin_score(courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_sound_mode(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
lua_pushinteger(L, save_file_get_sound_mode());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_star_flags(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_star_flags(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_total_star_count(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 minCourse = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s32 maxCourse = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_total_star_count(fileIndex, minCourse, maxCourse));
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// sound_init.h //
|
|
//////////////////
|
|
|
|
int smlua_func_disable_background_sound(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
disable_background_sound();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_enable_background_sound(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
enable_background_sound();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_cap_music(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
fadeout_cap_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_level_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s16 fadeTimer = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
fadeout_level_music(fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s16 fadeOutTime = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
fadeout_music(fadeOutTime);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lower_background_noise(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s32 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lower_background_noise(a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_cap_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u16 seqArgs = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_cap_music(seqArgs);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_cutscene_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
u16 seqArgs = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_cutscene_music(seqArgs);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_infinite_stairs_music(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_infinite_stairs_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_menu_sounds(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s16 soundMenuFlags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
play_menu_sounds(soundMenuFlags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_painting_eject_sound(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_painting_eject_sound();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_shell_music(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
play_shell_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_raise_background_noise(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
s32 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
raise_background_noise(a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_volume(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
reset_volume();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_background_music(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
u16 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
u16 seqArgs = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 fadeTimer = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
set_background_music(a, seqArgs, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_cap_music(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
stop_cap_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_shell_music(UNUSED lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 0)) { return 0; }
|
|
|
|
|
|
stop_shell_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// surface_collision.h //
|
|
/////////////////////////
|
|
|
|
/*
|
|
int smlua_func_find_ceil(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
f32 posX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 posY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 posZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// struct Surface** pceil = (struct Surface**)smlua_to_cobject(L, 4, LVT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_ceil(posX, posY, posZ, pceil));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_find_floor(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
f32 xPos = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 yPos = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 zPos = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// struct Surface** pfloor = (struct Surface**)smlua_to_cobject(L, 4, LVT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_floor(xPos, yPos, zPos, pfloor));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_find_floor_height(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_floor_height(x, y, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_find_floor_height_and_data(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
f32 xPos = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 yPos = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 zPos = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// struct FloorGeometry** floorGeo = (struct FloorGeometry**)smlua_to_cobject(L, 4, LVT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_floor_height_and_data(xPos, yPos, zPos, floorGeo));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_find_poison_gas_level(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 z = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_poison_gas_level(x, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_find_surface_on_ray(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
|
|
f32* orig = smlua_get_vec3f_from_buffer();
|
|
orig[0] = smlua_get_number_field(1, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
orig[1] = smlua_get_number_field(1, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
orig[2] = smlua_get_number_field(1, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* dir = smlua_get_vec3f_from_buffer();
|
|
dir[0] = smlua_get_number_field(2, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
dir[1] = smlua_get_number_field(2, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
dir[2] = smlua_get_number_field(2, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
// struct Surface** hit_surface = (struct Surface**)smlua_to_cobject(L, 3, LVT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
f32* hit_pos = smlua_get_vec3f_from_buffer();
|
|
hit_pos[0] = smlua_get_number_field(4, "x");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
hit_pos[1] = smlua_get_number_field(4, "y");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
hit_pos[2] = smlua_get_number_field(4, "z");
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
find_surface_on_ray(orig, dir, hit_surface, hit_pos);
|
|
|
|
smlua_push_number_field(1, "x", orig[0]);
|
|
smlua_push_number_field(1, "y", orig[1]);
|
|
smlua_push_number_field(1, "z", orig[2]);
|
|
|
|
smlua_push_number_field(2, "x", dir[0]);
|
|
smlua_push_number_field(2, "y", dir[1]);
|
|
smlua_push_number_field(2, "z", dir[2]);
|
|
|
|
smlua_push_number_field(4, "x", hit_pos[0]);
|
|
smlua_push_number_field(4, "y", hit_pos[1]);
|
|
smlua_push_number_field(4, "z", hit_pos[2]);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_find_wall_collisions(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
struct WallCollisionData* colData = (struct WallCollisionData*)smlua_to_cobject(L, 1, LOT_WALLCOLLISIONDATA);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushinteger(L, find_wall_collisions(colData));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_water_level(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
f32 z = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
lua_pushnumber(L, find_water_level(x, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////
|
|
// thread6.c //
|
|
///////////////
|
|
|
|
int smlua_func_queue_rumble_data(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
s16 a0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 a1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void queue_rumble_data(s16 a0, s16 a1);
|
|
queue_rumble_data(a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_queue_rumble_data_mario(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 a0 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 a1 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void queue_rumble_data_mario(struct MarioState* m, s16 a0, s16 a1);
|
|
queue_rumble_data_mario(m, a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_queue_rumble_data_object(lua_State* L) {
|
|
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
struct Object* object = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 a0 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
s16 a1 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { return 0; }
|
|
|
|
extern void queue_rumble_data_object(struct Object* object, s16 a0, s16 a1);
|
|
queue_rumble_data_object(object, a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
void smlua_bind_functions_autogen(void) {
|
|
lua_State* L = gLuaState;
|
|
|
|
// camera.h
|
|
smlua_bind_function(L, "set_camera_pitch_shake", smlua_func_set_camera_pitch_shake);
|
|
smlua_bind_function(L, "set_camera_roll_shake", smlua_func_set_camera_roll_shake);
|
|
smlua_bind_function(L, "set_camera_shake_from_hit", smlua_func_set_camera_shake_from_hit);
|
|
smlua_bind_function(L, "set_camera_shake_from_point", smlua_func_set_camera_shake_from_point);
|
|
smlua_bind_function(L, "set_camera_yaw_shake", smlua_func_set_camera_yaw_shake);
|
|
smlua_bind_function(L, "set_environmental_camera_shake", smlua_func_set_environmental_camera_shake);
|
|
|
|
// characters.h
|
|
smlua_bind_function(L, "get_character", smlua_func_get_character);
|
|
smlua_bind_function(L, "get_character_anim_offset", smlua_func_get_character_anim_offset);
|
|
smlua_bind_function(L, "play_character_sound", smlua_func_play_character_sound);
|
|
smlua_bind_function(L, "play_character_sound_if_no_flag", smlua_func_play_character_sound_if_no_flag);
|
|
smlua_bind_function(L, "play_character_sound_offset", smlua_func_play_character_sound_offset);
|
|
smlua_bind_function(L, "update_character_anim_offset", smlua_func_update_character_anim_offset);
|
|
|
|
// djui_chat_message.h
|
|
smlua_bind_function(L, "djui_chat_message_create", smlua_func_djui_chat_message_create);
|
|
|
|
// djui_hud_utils.h
|
|
smlua_bind_function(L, "djui_hud_get_screen_height", smlua_func_djui_hud_get_screen_height);
|
|
smlua_bind_function(L, "djui_hud_get_screen_width", smlua_func_djui_hud_get_screen_width);
|
|
smlua_bind_function(L, "djui_hud_measure_text", smlua_func_djui_hud_measure_text);
|
|
smlua_bind_function(L, "djui_hud_print_text", smlua_func_djui_hud_print_text);
|
|
smlua_bind_function(L, "djui_hud_render_rect", smlua_func_djui_hud_render_rect);
|
|
smlua_bind_function(L, "djui_hud_render_texture", smlua_func_djui_hud_render_texture);
|
|
smlua_bind_function(L, "djui_hud_set_color", smlua_func_djui_hud_set_color);
|
|
smlua_bind_function(L, "djui_hud_set_font", smlua_func_djui_hud_set_font);
|
|
smlua_bind_function(L, "djui_hud_set_resolution", smlua_func_djui_hud_set_resolution);
|
|
|
|
// djui_popup.h
|
|
smlua_bind_function(L, "djui_popup_create", smlua_func_djui_popup_create);
|
|
|
|
// external.h
|
|
smlua_bind_function(L, "fade_volume_scale", smlua_func_fade_volume_scale);
|
|
smlua_bind_function(L, "fadeout_background_music", smlua_func_fadeout_background_music);
|
|
smlua_bind_function(L, "play_course_clear", smlua_func_play_course_clear);
|
|
smlua_bind_function(L, "play_dialog_sound", smlua_func_play_dialog_sound);
|
|
smlua_bind_function(L, "play_music", smlua_func_play_music);
|
|
smlua_bind_function(L, "play_peachs_jingle", smlua_func_play_peachs_jingle);
|
|
smlua_bind_function(L, "play_power_star_jingle", smlua_func_play_power_star_jingle);
|
|
smlua_bind_function(L, "play_puzzle_jingle", smlua_func_play_puzzle_jingle);
|
|
smlua_bind_function(L, "play_race_fanfare", smlua_func_play_race_fanfare);
|
|
smlua_bind_function(L, "play_secondary_music", smlua_func_play_secondary_music);
|
|
smlua_bind_function(L, "play_sound", smlua_func_play_sound);
|
|
smlua_bind_function(L, "play_sound_with_freq_scale", smlua_func_play_sound_with_freq_scale);
|
|
smlua_bind_function(L, "play_star_fanfare", smlua_func_play_star_fanfare);
|
|
smlua_bind_function(L, "play_toads_jingle", smlua_func_play_toads_jingle);
|
|
smlua_bind_function(L, "sequence_player_fade_out", smlua_func_sequence_player_fade_out);
|
|
smlua_bind_function(L, "sequence_player_unlower", smlua_func_sequence_player_unlower);
|
|
|
|
// interaction.h
|
|
smlua_bind_function(L, "does_mario_have_normal_cap_on_head", smlua_func_does_mario_have_normal_cap_on_head);
|
|
smlua_bind_function(L, "get_door_save_file_flag", smlua_func_get_door_save_file_flag);
|
|
smlua_bind_function(L, "mario_blow_off_cap", smlua_func_mario_blow_off_cap);
|
|
smlua_bind_function(L, "mario_check_object_grab", smlua_func_mario_check_object_grab);
|
|
smlua_bind_function(L, "mario_drop_held_object", smlua_func_mario_drop_held_object);
|
|
smlua_bind_function(L, "mario_get_collided_object", smlua_func_mario_get_collided_object);
|
|
smlua_bind_function(L, "mario_grab_used_object", smlua_func_mario_grab_used_object);
|
|
smlua_bind_function(L, "mario_lose_cap_to_enemy", smlua_func_mario_lose_cap_to_enemy);
|
|
smlua_bind_function(L, "mario_obj_angle_to_object", smlua_func_mario_obj_angle_to_object);
|
|
smlua_bind_function(L, "mario_retrieve_cap", smlua_func_mario_retrieve_cap);
|
|
smlua_bind_function(L, "mario_stop_riding_and_holding", smlua_func_mario_stop_riding_and_holding);
|
|
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);
|
|
|
|
// level_info.h
|
|
smlua_bind_function(L, "get_level_name", smlua_func_get_level_name);
|
|
|
|
// mario.h
|
|
smlua_bind_function(L, "adjust_sound_for_speed", smlua_func_adjust_sound_for_speed);
|
|
smlua_bind_function(L, "check_common_action_exits", smlua_func_check_common_action_exits);
|
|
smlua_bind_function(L, "check_common_hold_action_exits", smlua_func_check_common_hold_action_exits);
|
|
smlua_bind_function(L, "drop_and_set_mario_action", smlua_func_drop_and_set_mario_action);
|
|
smlua_bind_function(L, "execute_mario_action", smlua_func_execute_mario_action);
|
|
smlua_bind_function(L, "find_floor_height_relative_polar", smlua_func_find_floor_height_relative_polar);
|
|
smlua_bind_function(L, "find_floor_slope", smlua_func_find_floor_slope);
|
|
smlua_bind_function(L, "find_mario_anim_flags_and_translation", smlua_func_find_mario_anim_flags_and_translation);
|
|
smlua_bind_function(L, "force_idle_state", smlua_func_force_idle_state);
|
|
smlua_bind_function(L, "hurt_and_set_mario_action", smlua_func_hurt_and_set_mario_action);
|
|
smlua_bind_function(L, "is_anim_at_end", smlua_func_is_anim_at_end);
|
|
smlua_bind_function(L, "is_anim_past_end", smlua_func_is_anim_past_end);
|
|
smlua_bind_function(L, "is_anim_past_frame", smlua_func_is_anim_past_frame);
|
|
smlua_bind_function(L, "mario_facing_downhill", smlua_func_mario_facing_downhill);
|
|
smlua_bind_function(L, "mario_floor_is_slippery", smlua_func_mario_floor_is_slippery);
|
|
smlua_bind_function(L, "mario_floor_is_slope", smlua_func_mario_floor_is_slope);
|
|
smlua_bind_function(L, "mario_floor_is_steep", smlua_func_mario_floor_is_steep);
|
|
smlua_bind_function(L, "mario_get_floor_class", smlua_func_mario_get_floor_class);
|
|
smlua_bind_function(L, "mario_get_terrain_sound_addend", smlua_func_mario_get_terrain_sound_addend);
|
|
smlua_bind_function(L, "mario_set_bubbled", smlua_func_mario_set_bubbled);
|
|
smlua_bind_function(L, "mario_set_forward_vel", smlua_func_mario_set_forward_vel);
|
|
smlua_bind_function(L, "play_mario_action_sound", smlua_func_play_mario_action_sound);
|
|
smlua_bind_function(L, "play_mario_heavy_landing_sound", smlua_func_play_mario_heavy_landing_sound);
|
|
smlua_bind_function(L, "play_mario_heavy_landing_sound_once", smlua_func_play_mario_heavy_landing_sound_once);
|
|
smlua_bind_function(L, "play_mario_jump_sound", smlua_func_play_mario_jump_sound);
|
|
smlua_bind_function(L, "play_mario_landing_sound", smlua_func_play_mario_landing_sound);
|
|
smlua_bind_function(L, "play_mario_landing_sound_once", smlua_func_play_mario_landing_sound_once);
|
|
smlua_bind_function(L, "play_mario_sound", smlua_func_play_mario_sound);
|
|
smlua_bind_function(L, "play_sound_and_spawn_particles", smlua_func_play_sound_and_spawn_particles);
|
|
smlua_bind_function(L, "play_sound_if_no_flag", smlua_func_play_sound_if_no_flag);
|
|
smlua_bind_function(L, "resolve_and_return_wall_collisions", smlua_func_resolve_and_return_wall_collisions);
|
|
smlua_bind_function(L, "return_mario_anim_y_translation", smlua_func_return_mario_anim_y_translation);
|
|
smlua_bind_function(L, "set_anim_to_frame", smlua_func_set_anim_to_frame);
|
|
smlua_bind_function(L, "set_jump_from_landing", smlua_func_set_jump_from_landing);
|
|
smlua_bind_function(L, "set_jumping_action", smlua_func_set_jumping_action);
|
|
smlua_bind_function(L, "set_mario_action", smlua_func_set_mario_action);
|
|
smlua_bind_function(L, "set_mario_anim_with_accel", smlua_func_set_mario_anim_with_accel);
|
|
smlua_bind_function(L, "set_mario_animation", smlua_func_set_mario_animation);
|
|
smlua_bind_function(L, "set_steep_jump_action", smlua_func_set_steep_jump_action);
|
|
smlua_bind_function(L, "set_water_plunge_action", smlua_func_set_water_plunge_action);
|
|
smlua_bind_function(L, "transition_submerged_to_walking", smlua_func_transition_submerged_to_walking);
|
|
smlua_bind_function(L, "update_mario_pos_for_anim", smlua_func_update_mario_pos_for_anim);
|
|
smlua_bind_function(L, "update_mario_sound_and_camera", smlua_func_update_mario_sound_and_camera);
|
|
//smlua_bind_function(L, "vec3f_find_ceil", smlua_func_vec3f_find_ceil); <--- UNIMPLEMENTED
|
|
|
|
// mario_actions_airborne.c
|
|
smlua_bind_function(L, "check_common_airborne_cancels", smlua_func_check_common_airborne_cancels);
|
|
smlua_bind_function(L, "check_fall_damage", smlua_func_check_fall_damage);
|
|
smlua_bind_function(L, "check_fall_damage_or_get_stuck", smlua_func_check_fall_damage_or_get_stuck);
|
|
smlua_bind_function(L, "check_horizontal_wind", smlua_func_check_horizontal_wind);
|
|
smlua_bind_function(L, "check_kick_or_dive_in_air", smlua_func_check_kick_or_dive_in_air);
|
|
smlua_bind_function(L, "check_wall_kick", smlua_func_check_wall_kick);
|
|
smlua_bind_function(L, "common_air_action_step", smlua_func_common_air_action_step);
|
|
smlua_bind_function(L, "common_air_knockback_step", smlua_func_common_air_knockback_step);
|
|
smlua_bind_function(L, "lava_boost_on_wall", smlua_func_lava_boost_on_wall);
|
|
smlua_bind_function(L, "mario_execute_airborne_action", smlua_func_mario_execute_airborne_action);
|
|
smlua_bind_function(L, "play_far_fall_sound", smlua_func_play_far_fall_sound);
|
|
smlua_bind_function(L, "play_flip_sounds", smlua_func_play_flip_sounds);
|
|
smlua_bind_function(L, "play_knockback_sound", smlua_func_play_knockback_sound);
|
|
smlua_bind_function(L, "should_get_stuck_in_ground", smlua_func_should_get_stuck_in_ground);
|
|
smlua_bind_function(L, "update_air_with_turn", smlua_func_update_air_with_turn);
|
|
smlua_bind_function(L, "update_air_without_turn", smlua_func_update_air_without_turn);
|
|
smlua_bind_function(L, "update_flying", smlua_func_update_flying);
|
|
smlua_bind_function(L, "update_flying_pitch", smlua_func_update_flying_pitch);
|
|
smlua_bind_function(L, "update_flying_yaw", smlua_func_update_flying_yaw);
|
|
smlua_bind_function(L, "update_lava_boost_or_twirling", smlua_func_update_lava_boost_or_twirling);
|
|
|
|
// mario_actions_automatic.c
|
|
smlua_bind_function(L, "add_tree_leaf_particles", smlua_func_add_tree_leaf_particles);
|
|
smlua_bind_function(L, "check_common_automatic_cancels", smlua_func_check_common_automatic_cancels);
|
|
smlua_bind_function(L, "climb_up_ledge", smlua_func_climb_up_ledge);
|
|
smlua_bind_function(L, "let_go_of_ledge", smlua_func_let_go_of_ledge);
|
|
smlua_bind_function(L, "mario_execute_automatic_action", smlua_func_mario_execute_automatic_action);
|
|
smlua_bind_function(L, "perform_hanging_step", smlua_func_perform_hanging_step);
|
|
smlua_bind_function(L, "play_climbing_sounds", smlua_func_play_climbing_sounds);
|
|
smlua_bind_function(L, "set_pole_position", smlua_func_set_pole_position);
|
|
smlua_bind_function(L, "update_hang_moving", smlua_func_update_hang_moving);
|
|
smlua_bind_function(L, "update_hang_stationary", smlua_func_update_hang_stationary);
|
|
smlua_bind_function(L, "update_ledge_climb", smlua_func_update_ledge_climb);
|
|
smlua_bind_function(L, "update_ledge_climb_camera", smlua_func_update_ledge_climb_camera);
|
|
|
|
// mario_actions_cutscene.c
|
|
smlua_bind_function(L, "bhv_end_peach_loop", smlua_func_bhv_end_peach_loop);
|
|
smlua_bind_function(L, "bhv_end_toad_loop", smlua_func_bhv_end_toad_loop);
|
|
smlua_bind_function(L, "common_death_handler", smlua_func_common_death_handler);
|
|
smlua_bind_function(L, "cutscene_put_cap_on", smlua_func_cutscene_put_cap_on);
|
|
smlua_bind_function(L, "cutscene_take_cap_off", smlua_func_cutscene_take_cap_off);
|
|
smlua_bind_function(L, "general_star_dance_handler", smlua_func_general_star_dance_handler);
|
|
smlua_bind_function(L, "generate_yellow_sparkles", smlua_func_generate_yellow_sparkles);
|
|
//smlua_bind_function(L, "get_credits_str_width", smlua_func_get_credits_str_width); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "get_star_collection_dialog", smlua_func_get_star_collection_dialog);
|
|
smlua_bind_function(L, "handle_save_menu", smlua_func_handle_save_menu);
|
|
smlua_bind_function(L, "launch_mario_until_land", smlua_func_launch_mario_until_land);
|
|
smlua_bind_function(L, "mario_execute_cutscene_action", smlua_func_mario_execute_cutscene_action);
|
|
smlua_bind_function(L, "mario_ready_to_speak", smlua_func_mario_ready_to_speak);
|
|
smlua_bind_function(L, "print_displaying_credits_entry", smlua_func_print_displaying_credits_entry);
|
|
smlua_bind_function(L, "should_start_or_continue_dialog", smlua_func_should_start_or_continue_dialog);
|
|
//smlua_bind_function(L, "spawn_obj_at_mario_rel_yaw", smlua_func_spawn_obj_at_mario_rel_yaw); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "stuck_in_ground_handler", smlua_func_stuck_in_ground_handler);
|
|
|
|
// mario_actions_moving.c
|
|
smlua_bind_function(L, "align_with_floor", smlua_func_align_with_floor);
|
|
smlua_bind_function(L, "analog_stick_held_back", smlua_func_analog_stick_held_back);
|
|
smlua_bind_function(L, "anim_and_audio_for_heavy_walk", smlua_func_anim_and_audio_for_heavy_walk);
|
|
smlua_bind_function(L, "anim_and_audio_for_hold_walk", smlua_func_anim_and_audio_for_hold_walk);
|
|
smlua_bind_function(L, "anim_and_audio_for_walk", smlua_func_anim_and_audio_for_walk);
|
|
smlua_bind_function(L, "apply_landing_accel", smlua_func_apply_landing_accel);
|
|
smlua_bind_function(L, "apply_slope_accel", smlua_func_apply_slope_accel);
|
|
smlua_bind_function(L, "apply_slope_decel", smlua_func_apply_slope_decel);
|
|
smlua_bind_function(L, "begin_braking_action", smlua_func_begin_braking_action);
|
|
smlua_bind_function(L, "begin_walking_action", smlua_func_begin_walking_action);
|
|
smlua_bind_function(L, "check_common_moving_cancels", smlua_func_check_common_moving_cancels);
|
|
smlua_bind_function(L, "check_ground_dive_or_punch", smlua_func_check_ground_dive_or_punch);
|
|
smlua_bind_function(L, "check_ledge_climb_down", smlua_func_check_ledge_climb_down);
|
|
smlua_bind_function(L, "common_ground_knockback_action", smlua_func_common_ground_knockback_action);
|
|
smlua_bind_function(L, "common_landing_action", smlua_func_common_landing_action);
|
|
//smlua_bind_function(L, "common_landing_cancels", smlua_func_common_landing_cancels); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "common_slide_action", smlua_func_common_slide_action);
|
|
smlua_bind_function(L, "common_slide_action_with_jump", smlua_func_common_slide_action_with_jump);
|
|
smlua_bind_function(L, "mario_execute_moving_action", smlua_func_mario_execute_moving_action);
|
|
smlua_bind_function(L, "play_step_sound", smlua_func_play_step_sound);
|
|
smlua_bind_function(L, "push_or_sidle_wall", smlua_func_push_or_sidle_wall);
|
|
smlua_bind_function(L, "quicksand_jump_land_action", smlua_func_quicksand_jump_land_action);
|
|
smlua_bind_function(L, "set_triple_jump_action", smlua_func_set_triple_jump_action);
|
|
smlua_bind_function(L, "should_begin_sliding", smlua_func_should_begin_sliding);
|
|
smlua_bind_function(L, "slide_bonk", smlua_func_slide_bonk);
|
|
smlua_bind_function(L, "stomach_slide_action", smlua_func_stomach_slide_action);
|
|
smlua_bind_function(L, "tilt_body_butt_slide", smlua_func_tilt_body_butt_slide);
|
|
smlua_bind_function(L, "tilt_body_ground_shell", smlua_func_tilt_body_ground_shell);
|
|
smlua_bind_function(L, "tilt_body_running", smlua_func_tilt_body_running);
|
|
smlua_bind_function(L, "tilt_body_walking", smlua_func_tilt_body_walking);
|
|
smlua_bind_function(L, "update_decelerating_speed", smlua_func_update_decelerating_speed);
|
|
smlua_bind_function(L, "update_shell_speed", smlua_func_update_shell_speed);
|
|
smlua_bind_function(L, "update_sliding", smlua_func_update_sliding);
|
|
smlua_bind_function(L, "update_sliding_angle", smlua_func_update_sliding_angle);
|
|
smlua_bind_function(L, "update_walking_speed", smlua_func_update_walking_speed);
|
|
|
|
// mario_actions_object.c
|
|
smlua_bind_function(L, "animated_stationary_ground_step", smlua_func_animated_stationary_ground_step);
|
|
smlua_bind_function(L, "check_common_object_cancels", smlua_func_check_common_object_cancels);
|
|
smlua_bind_function(L, "mario_execute_object_action", smlua_func_mario_execute_object_action);
|
|
smlua_bind_function(L, "mario_update_punch_sequence", smlua_func_mario_update_punch_sequence);
|
|
|
|
// mario_actions_stationary.c
|
|
smlua_bind_function(L, "check_common_hold_idle_cancels", smlua_func_check_common_hold_idle_cancels);
|
|
smlua_bind_function(L, "check_common_idle_cancels", smlua_func_check_common_idle_cancels);
|
|
smlua_bind_function(L, "check_common_landing_cancels", smlua_func_check_common_landing_cancels);
|
|
smlua_bind_function(L, "check_common_stationary_cancels", smlua_func_check_common_stationary_cancels);
|
|
smlua_bind_function(L, "landing_step", smlua_func_landing_step);
|
|
smlua_bind_function(L, "mario_execute_stationary_action", smlua_func_mario_execute_stationary_action);
|
|
smlua_bind_function(L, "play_anim_sound", smlua_func_play_anim_sound);
|
|
smlua_bind_function(L, "stopping_step", smlua_func_stopping_step);
|
|
|
|
// mario_actions_submerged.c
|
|
smlua_bind_function(L, "apply_water_current", smlua_func_apply_water_current);
|
|
smlua_bind_function(L, "float_surface_gfx", smlua_func_float_surface_gfx);
|
|
smlua_bind_function(L, "mario_execute_submerged_action", smlua_func_mario_execute_submerged_action);
|
|
smlua_bind_function(L, "perform_water_full_step", smlua_func_perform_water_full_step);
|
|
smlua_bind_function(L, "perform_water_step", smlua_func_perform_water_step);
|
|
smlua_bind_function(L, "set_swimming_at_surface_particles", smlua_func_set_swimming_at_surface_particles);
|
|
|
|
// mario_step.h
|
|
smlua_bind_function(L, "get_additive_y_vel_for_jumps", smlua_func_get_additive_y_vel_for_jumps);
|
|
smlua_bind_function(L, "mario_bonk_reflection", smlua_func_mario_bonk_reflection);
|
|
smlua_bind_function(L, "mario_push_off_steep_floor", smlua_func_mario_push_off_steep_floor);
|
|
smlua_bind_function(L, "mario_update_moving_sand", smlua_func_mario_update_moving_sand);
|
|
smlua_bind_function(L, "mario_update_quicksand", smlua_func_mario_update_quicksand);
|
|
smlua_bind_function(L, "mario_update_windy_ground", smlua_func_mario_update_windy_ground);
|
|
smlua_bind_function(L, "perform_air_step", smlua_func_perform_air_step);
|
|
smlua_bind_function(L, "perform_ground_step", smlua_func_perform_ground_step);
|
|
smlua_bind_function(L, "set_vel_from_pitch_and_yaw", smlua_func_set_vel_from_pitch_and_yaw);
|
|
smlua_bind_function(L, "stationary_ground_step", smlua_func_stationary_ground_step);
|
|
smlua_bind_function(L, "stop_and_set_height_to_floor", smlua_func_stop_and_set_height_to_floor);
|
|
|
|
// network_player.h
|
|
smlua_bind_function(L, "get_network_player_from_area", smlua_func_get_network_player_from_area);
|
|
smlua_bind_function(L, "get_network_player_from_level", smlua_func_get_network_player_from_level);
|
|
smlua_bind_function(L, "get_network_player_smallest_global", smlua_func_get_network_player_smallest_global);
|
|
smlua_bind_function(L, "network_player_connected_count", smlua_func_network_player_connected_count);
|
|
smlua_bind_function(L, "network_player_from_global_index", smlua_func_network_player_from_global_index);
|
|
smlua_bind_function(L, "network_player_set_description", smlua_func_network_player_set_description);
|
|
|
|
// network_utils.h
|
|
smlua_bind_function(L, "network_get_player_text_color_string", smlua_func_network_get_player_text_color_string);
|
|
smlua_bind_function(L, "network_global_index_from_local", smlua_func_network_global_index_from_local);
|
|
smlua_bind_function(L, "network_is_server", smlua_func_network_is_server);
|
|
smlua_bind_function(L, "network_local_index_from_global", smlua_func_network_local_index_from_global);
|
|
|
|
// save_file.h
|
|
smlua_bind_function(L, "save_file_get_cap_pos", smlua_func_save_file_get_cap_pos);
|
|
smlua_bind_function(L, "save_file_get_course_coin_score", smlua_func_save_file_get_course_coin_score);
|
|
smlua_bind_function(L, "save_file_get_course_star_count", smlua_func_save_file_get_course_star_count);
|
|
smlua_bind_function(L, "save_file_get_flags", smlua_func_save_file_get_flags);
|
|
smlua_bind_function(L, "save_file_get_max_coin_score", smlua_func_save_file_get_max_coin_score);
|
|
smlua_bind_function(L, "save_file_get_sound_mode", smlua_func_save_file_get_sound_mode);
|
|
smlua_bind_function(L, "save_file_get_star_flags", smlua_func_save_file_get_star_flags);
|
|
smlua_bind_function(L, "save_file_get_total_star_count", smlua_func_save_file_get_total_star_count);
|
|
|
|
// sound_init.h
|
|
smlua_bind_function(L, "disable_background_sound", smlua_func_disable_background_sound);
|
|
smlua_bind_function(L, "enable_background_sound", smlua_func_enable_background_sound);
|
|
smlua_bind_function(L, "fadeout_cap_music", smlua_func_fadeout_cap_music);
|
|
smlua_bind_function(L, "fadeout_level_music", smlua_func_fadeout_level_music);
|
|
smlua_bind_function(L, "fadeout_music", smlua_func_fadeout_music);
|
|
smlua_bind_function(L, "lower_background_noise", smlua_func_lower_background_noise);
|
|
smlua_bind_function(L, "play_cap_music", smlua_func_play_cap_music);
|
|
smlua_bind_function(L, "play_cutscene_music", smlua_func_play_cutscene_music);
|
|
smlua_bind_function(L, "play_infinite_stairs_music", smlua_func_play_infinite_stairs_music);
|
|
smlua_bind_function(L, "play_menu_sounds", smlua_func_play_menu_sounds);
|
|
smlua_bind_function(L, "play_painting_eject_sound", smlua_func_play_painting_eject_sound);
|
|
smlua_bind_function(L, "play_shell_music", smlua_func_play_shell_music);
|
|
smlua_bind_function(L, "raise_background_noise", smlua_func_raise_background_noise);
|
|
smlua_bind_function(L, "reset_volume", smlua_func_reset_volume);
|
|
smlua_bind_function(L, "set_background_music", smlua_func_set_background_music);
|
|
smlua_bind_function(L, "stop_cap_music", smlua_func_stop_cap_music);
|
|
smlua_bind_function(L, "stop_shell_music", smlua_func_stop_shell_music);
|
|
|
|
// surface_collision.h
|
|
//smlua_bind_function(L, "find_ceil", smlua_func_find_ceil); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "find_floor", smlua_func_find_floor); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "find_floor_height", smlua_func_find_floor_height);
|
|
//smlua_bind_function(L, "find_floor_height_and_data", smlua_func_find_floor_height_and_data); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "find_poison_gas_level", smlua_func_find_poison_gas_level);
|
|
//smlua_bind_function(L, "find_surface_on_ray", smlua_func_find_surface_on_ray); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "find_wall_collisions", smlua_func_find_wall_collisions);
|
|
smlua_bind_function(L, "find_water_level", smlua_func_find_water_level);
|
|
|
|
// thread6.c
|
|
smlua_bind_function(L, "queue_rumble_data", smlua_func_queue_rumble_data);
|
|
smlua_bind_function(L, "queue_rumble_data_mario", smlua_func_queue_rumble_data_mario);
|
|
smlua_bind_function(L, "queue_rumble_data_object", smlua_func_queue_rumble_data_object);
|
|
|
|
}
|