diff --git a/docs/lua/constants.md b/docs/lua/constants.md
index 0a10b2ecf..9dc02b82e 100644
--- a/docs/lua/constants.md
+++ b/docs/lua/constants.md
@@ -796,13 +796,13 @@
- INT_STATUS_ATTACKED_MARIO
- INT_STATUS_ATTACK_MASK
- INT_STATUS_GRABBED_MARIO
+- INT_STATUS_HIT_BY_SHOCKWAVE
- INT_STATUS_HIT_MINE
- INT_STATUS_HOOT_GRABBED_BY_MARIO
- INT_STATUS_INTERACTED
- INT_STATUS_MARIO_DROP_OBJECT
- INT_STATUS_MARIO_UNK1
- INT_STATUS_MARIO_UNK2
-- INT_STATUS_MARIO_UNK4
- INT_STATUS_MARIO_UNK5
- INT_STATUS_MARIO_UNK6
- INT_STATUS_MARIO_UNK7
@@ -1394,6 +1394,7 @@
- ACT_TWIRLING
- ACT_TWIRL_LAND
- ACT_UNINITIALIZED
+- ACT_UNKNOWN_0002020E
- ACT_UNLOCKING_KEY_DOOR
- ACT_UNLOCKING_STAR_DOOR
- ACT_UNUSED_DEATH_EXIT
@@ -1452,7 +1453,7 @@
- LAYER_TRANSPARENT_DECAL
- LAYER_TRANSPARENT_INTER
- MARIO_ACTION_SOUND_PLAYED
-- MARIO_CAP_FLAGS
+- MARIO_CAPS
- MARIO_CAP_IN_HAND
- MARIO_CAP_ON_HEAD
- MARIO_KICKING
@@ -1461,6 +1462,7 @@
- MARIO_METAL_SHOCK
- MARIO_NORMAL_CAP
- MARIO_PUNCHING
+- MARIO_SPECIAL_CAPS
- MARIO_TELEPORTING
- MARIO_TRIPPING
- MARIO_UNKNOWN_08
diff --git a/docs/lua/functions.md b/docs/lua/functions.md
index 4a6c71112..d828bcfc5 100644
--- a/docs/lua/functions.md
+++ b/docs/lua/functions.md
@@ -65,7 +65,7 @@
- interaction.h
- - [does_mario_have_hat](#does_mario_have_hat)
+ - [does_mario_have_normal_cap_on_head](#does_mario_have_normal_cap_on_head)
- [get_door_save_file_flag](#get_door_save_file_flag)
- [mario_blow_off_cap](#mario_blow_off_cap)
- [mario_check_object_grab](#mario_check_object_grab)
@@ -1189,10 +1189,10 @@
-## [does_mario_have_hat](#does_mario_have_hat)
+## [does_mario_have_normal_cap_on_head](#does_mario_have_normal_cap_on_head)
### Lua Example
-`local integerValue = does_mario_have_hat(m)`
+`local integerValue = does_mario_have_normal_cap_on_head(m)`
### Parameters
| Field | Type |
@@ -1203,7 +1203,7 @@
- integer
### C Prototype
-`u32 does_mario_have_hat(struct MarioState *m);`
+`u32 does_mario_have_normal_cap_on_head(struct MarioState *m);`
[:arrow_up_small:](#)
diff --git a/docs/lua/structs.md b/docs/lua/structs.md
index cde8c6541..3a9d1bf54 100644
--- a/docs/lua/structs.md
+++ b/docs/lua/structs.md
@@ -1,6 +1,7 @@
## [:rewind: Lua Reference](lua.md)
# Supported Structs
+- [AnimInfo](#AnimInfo)
- [Animation](#Animation)
- [Area](#Area)
- [Camera](#Camera)
@@ -16,7 +17,6 @@
- [GlobalTextures](#GlobalTextures)
- [GraphNode](#GraphNode)
- [GraphNodeObject](#GraphNodeObject)
-- [GraphNodeObject_sub](#GraphNodeObject_sub)
- [HandheldShakePoint](#HandheldShakePoint)
- [InstantWarp](#InstantWarp)
- [LakituState](#LakituState)
@@ -53,17 +53,37 @@
+## [AnimInfo](#AnimInfo)
+
+| Field | Type | Access |
+| ----- | ---- | ------ |
+| animAccel | integer | |
+| animFrame | integer | |
+| animFrameAccelAssist | integer | |
+| animID | integer | |
+| animTimer | integer | |
+| animYTrans | integer | |
+| curAnim | [Animation](#Animation) | read-only |
+| prevAnimFrame | integer | |
+| prevAnimFrameTimestamp | integer | |
+| prevAnimID | integer | |
+| prevAnimPtr | [Animation](#Animation) | read-only |
+
+[:arrow_up_small:](#)
+
+
+
## [Animation](#Animation)
| Field | Type | Access |
| ----- | ---- | ------ |
+| animYTransDivisor | integer | |
| flags | integer | |
| index | Pointer | read-only |
| length | integer | |
-| animYTransDivisor | integer | |
-| startFrame | integer | |
-| loopStart | integer | |
| loopEnd | integer | |
+| loopStart | integer | |
+| startFrame | integer | |
| unusedBoneCount | integer | |
| values | Pointer | read-only |
@@ -332,7 +352,10 @@
| Field | Type | Access |
| ----- | ---- | ------ |
+| activeAreaIndex | integer | |
| angle | [Vec3s](#Vec3s) | read-only |
+| animInfo | [AnimInfo](#AnimInfo) | read-only |
+| areaIndex | integer | |
| cameraToObject | [Vec3f](#Vec3f) | read-only |
| node | [GraphNode](#GraphNode) | read-only |
| pos | [Vec3f](#Vec3f) | read-only |
@@ -347,35 +370,12 @@
| scale | [Vec3f](#Vec3f) | read-only |
| sharedChild | [GraphNode](#GraphNode) | read-only |
| skipInterpolationTimestamp | integer | |
-| unk18 | integer | |
-| unk19 | integer | |
-| animInfo | [GraphNodeObject_sub](#GraphNodeObject_sub) | read-only |
| unk4C | [SpawnInfo](#SpawnInfo) | read-only |
[:arrow_up_small:](#)
-## [GraphNodeObject_sub](#GraphNodeObject_sub)
-
-| Field | Type | Access |
-| ----- | ---- | ------ |
-| animAccel | integer | |
-| animFrame | integer | |
-| animFrameAccelAssist | integer | |
-| animID | integer | |
-| animTimer | integer | |
-| animYTrans | integer | |
-| curAnim | [Animation](#Animation) | read-only |
-| prevAnimFrame | integer | |
-| prevAnimFrameTimestamp | integer | |
-| prevAnimID | integer | |
-| prevAnimPtr | [Animation](#Animation) | read-only |
-
-[:arrow_up_small:](#)
-
-
-
## [HandheldShakePoint](#HandheldShakePoint)
| Field | Type | Access |
diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c
index 0e14a0a41..e584a7457 100644
--- a/src/pc/lua/smlua_cobject_autogen.c
+++ b/src/pc/lua/smlua_cobject_autogen.c
@@ -9,17 +9,32 @@
#include "src/pc/network/network_player.h"
#include "src/pc/djui/djui_hud_utils.h"
+#define LUA_ANIM_INFO_FIELD_COUNT 11
+static struct LuaObjectField sAnimInfoFields[LUA_ANIM_INFO_FIELD_COUNT] = {
+ { "animAccel", LVT_S32, offsetof(struct AnimInfo, animAccel), false, LOT_NONE },
+ { "animFrame", LVT_S16, offsetof(struct AnimInfo, animFrame), false, LOT_NONE },
+ { "animFrameAccelAssist", LVT_S32, offsetof(struct AnimInfo, animFrameAccelAssist), false, LOT_NONE },
+ { "animID", LVT_S16, offsetof(struct AnimInfo, animID), false, LOT_NONE },
+ { "animTimer", LVT_U16, offsetof(struct AnimInfo, animTimer), false, LOT_NONE },
+ { "animYTrans", LVT_S16, offsetof(struct AnimInfo, animYTrans), false, LOT_NONE },
+ { "curAnim", LVT_COBJECT_P, offsetof(struct AnimInfo, curAnim), true, LOT_ANIMATION },
+ { "prevAnimFrame", LVT_S16, offsetof(struct AnimInfo, prevAnimFrame), false, LOT_NONE },
+ { "prevAnimFrameTimestamp", LVT_U32, offsetof(struct AnimInfo, prevAnimFrameTimestamp), false, LOT_NONE },
+ { "prevAnimID", LVT_S16, offsetof(struct AnimInfo, prevAnimID), false, LOT_NONE },
+ { "prevAnimPtr", LVT_COBJECT_P, offsetof(struct AnimInfo, prevAnimPtr), true, LOT_ANIMATION },
+};
+
#define LUA_ANIMATION_FIELD_COUNT 9
static struct LuaObjectField sAnimationFields[LUA_ANIMATION_FIELD_COUNT] = {
- { "flags", LVT_S16, offsetof(struct Animation, flags), false, LOT_NONE },
- { "index", LVT_U16_P, offsetof(struct Animation, index), true, LOT_POINTER },
- { "length", LVT_U32, offsetof(struct Animation, length), false, LOT_NONE },
- { "animYTransDivisor", LVT_S16, offsetof(struct Animation, animYTransDivisor), false, LOT_NONE },
- { "startFrame", LVT_S16, offsetof(struct Animation, startFrame), false, LOT_NONE },
- { "loopStart", LVT_S16, offsetof(struct Animation, loopStart), false, LOT_NONE },
- { "loopEnd", LVT_S16, offsetof(struct Animation, loopEnd), false, LOT_NONE },
- { "unusedBoneCount", LVT_S16, offsetof(struct Animation, unusedBoneCount), false, LOT_NONE },
- { "values", LVT_S16_P, offsetof(struct Animation, values), true, LOT_POINTER },
+ { "animYTransDivisor", LVT_S16, offsetof(struct Animation, animYTransDivisor), false, LOT_NONE },
+ { "flags", LVT_S16, offsetof(struct Animation, flags), false, LOT_NONE },
+ { "index", LVT_U16_P, offsetof(struct Animation, index), true, LOT_POINTER },
+ { "length", LVT_U32, offsetof(struct Animation, length), false, LOT_NONE },
+ { "loopEnd", LVT_S16, offsetof(struct Animation, loopEnd), false, LOT_NONE },
+ { "loopStart", LVT_S16, offsetof(struct Animation, loopStart), false, LOT_NONE },
+ { "startFrame", LVT_S16, offsetof(struct Animation, startFrame), false, LOT_NONE },
+ { "unusedBoneCount", LVT_S16, offsetof(struct Animation, unusedBoneCount), false, LOT_NONE },
+ { "values", LVT_S16_P, offsetof(struct Animation, values), true, LOT_POINTER },
};
#define LUA_AREA_FIELD_COUNT 13
@@ -231,43 +246,28 @@ static struct LuaObjectField sGraphNodeFields[LUA_GRAPH_NODE_FIELD_COUNT] = {
#define LUA_GRAPH_NODE_OBJECT_FIELD_COUNT 19
static struct LuaObjectField sGraphNodeObjectFields[LUA_GRAPH_NODE_OBJECT_FIELD_COUNT] = {
- { "angle", LVT_COBJECT, offsetof(struct GraphNodeObject, angle), true, LOT_VEC3S },
- { "cameraToObject", LVT_COBJECT, offsetof(struct GraphNodeObject, cameraToObject), true, LOT_VEC3F },
- { "node", LVT_COBJECT, offsetof(struct GraphNodeObject, node), true, LOT_GRAPHNODE },
- { "pos", LVT_COBJECT, offsetof(struct GraphNodeObject, pos), true, LOT_VEC3F },
- { "prevAngle", LVT_COBJECT, offsetof(struct GraphNodeObject, prevAngle), true, LOT_VEC3S },
- { "prevPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevPos), true, LOT_VEC3F },
- { "prevScale", LVT_COBJECT, offsetof(struct GraphNodeObject, prevScale), true, LOT_VEC3F },
- { "prevScaleTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevScaleTimestamp), false, LOT_NONE },
- { "prevShadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevShadowPos), true, LOT_VEC3F },
- { "prevShadowPosTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevShadowPosTimestamp), false, LOT_NONE },
-// { "prevThrowMatrix", LVT_???, offsetof(struct GraphNodeObject, prevThrowMatrix), false, LOT_??? }, <--- UNIMPLEMENTED
- { "prevThrowMatrixTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevThrowMatrixTimestamp), false, LOT_NONE },
- { "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), false, LOT_NONE },
- { "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), true, LOT_VEC3F },
- { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), true, LOT_GRAPHNODE },
- { "skipInterpolationTimestamp", LVT_U32, offsetof(struct GraphNodeObject, skipInterpolationTimestamp), false, LOT_NONE },
-// { "throwMatrix", LVT_???, offsetof(struct GraphNodeObject, throwMatrix), false, LOT_??? }, <--- UNIMPLEMENTED
-// { "throwMatrixInterpolated", LVT_???, offsetof(struct GraphNodeObject, throwMatrixInterpolated), false, LOT_??? }, <--- UNIMPLEMENTED
- { "animInfo", LVT_S8, offsetof(struct GraphNodeObject, animInfo), false, LOT_NONE },
- { "activeAreaIndex", LVT_S8, offsetof(struct GraphNodeObject, activeAreaIndex), false, LOT_NONE },
- { "animInfo", LVT_COBJECT, offsetof(struct GraphNodeObject, animInfo), true, LOT_GRAPHNODEOBJECT_SUB },
- { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), true, LOT_SPAWNINFO },
-};
-
-#define LUA_GRAPH_NODE_OBJECT_SUB_FIELD_COUNT 11
-static struct LuaObjectField sAnimInfoFields[LUA_GRAPH_NODE_OBJECT_SUB_FIELD_COUNT] = {
- { "animAccel", LVT_S32, offsetof(struct AnimInfo, animAccel), false, LOT_NONE },
- { "animFrame", LVT_S16, offsetof(struct AnimInfo, animFrame), false, LOT_NONE },
- { "animFrameAccelAssist", LVT_S32, offsetof(struct AnimInfo, animFrameAccelAssist), false, LOT_NONE },
- { "animID", LVT_S16, offsetof(struct AnimInfo, animID), false, LOT_NONE },
- { "animTimer", LVT_U16, offsetof(struct AnimInfo, animTimer), false, LOT_NONE },
- { "animYTrans", LVT_S16, offsetof(struct AnimInfo, animYTrans), false, LOT_NONE },
- { "curAnim", LVT_COBJECT_P, offsetof(struct AnimInfo, curAnim), true, LOT_ANIMATION },
- { "prevAnimFrame", LVT_S16, offsetof(struct AnimInfo, prevAnimFrame), false, LOT_NONE },
- { "prevAnimFrameTimestamp", LVT_U32, offsetof(struct AnimInfo, prevAnimFrameTimestamp), false, LOT_NONE },
- { "prevAnimID", LVT_S16, offsetof(struct AnimInfo, prevAnimID), false, LOT_NONE },
- { "prevAnimPtr", LVT_COBJECT_P, offsetof(struct AnimInfo, prevAnimPtr), true, LOT_ANIMATION },
+ { "activeAreaIndex", LVT_S8, offsetof(struct GraphNodeObject, activeAreaIndex), false, LOT_NONE },
+ { "angle", LVT_COBJECT, offsetof(struct GraphNodeObject, angle), true, LOT_VEC3S },
+ { "animInfo", LVT_COBJECT, offsetof(struct GraphNodeObject, animInfo), true, LOT_ANIMINFO },
+ { "areaIndex", LVT_S8, offsetof(struct GraphNodeObject, areaIndex), false, LOT_NONE },
+ { "cameraToObject", LVT_COBJECT, offsetof(struct GraphNodeObject, cameraToObject), true, LOT_VEC3F },
+ { "node", LVT_COBJECT, offsetof(struct GraphNodeObject, node), true, LOT_GRAPHNODE },
+ { "pos", LVT_COBJECT, offsetof(struct GraphNodeObject, pos), true, LOT_VEC3F },
+ { "prevAngle", LVT_COBJECT, offsetof(struct GraphNodeObject, prevAngle), true, LOT_VEC3S },
+ { "prevPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevPos), true, LOT_VEC3F },
+ { "prevScale", LVT_COBJECT, offsetof(struct GraphNodeObject, prevScale), true, LOT_VEC3F },
+ { "prevScaleTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevScaleTimestamp), false, LOT_NONE },
+ { "prevShadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevShadowPos), true, LOT_VEC3F },
+ { "prevShadowPosTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevShadowPosTimestamp), false, LOT_NONE },
+// { "prevThrowMatrix", LVT_???, offsetof(struct GraphNodeObject, prevThrowMatrix), false, LOT_??? }, <--- UNIMPLEMENTED
+ { "prevThrowMatrixTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevThrowMatrixTimestamp), false, LOT_NONE },
+ { "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), false, LOT_NONE },
+ { "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), true, LOT_VEC3F },
+ { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), true, LOT_GRAPHNODE },
+ { "skipInterpolationTimestamp", LVT_U32, offsetof(struct GraphNodeObject, skipInterpolationTimestamp), false, LOT_NONE },
+// { "throwMatrix", LVT_???, offsetof(struct GraphNodeObject, throwMatrix), false, LOT_??? }, <--- UNIMPLEMENTED
+// { "throwMatrixInterpolated", LVT_???, offsetof(struct GraphNodeObject, throwMatrixInterpolated), false, LOT_??? }, <--- UNIMPLEMENTED
+ { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), true, LOT_SPAWNINFO },
};
#define LUA_HANDHELD_SHAKE_POINT_FIELD_COUNT 3
@@ -688,6 +688,7 @@ static struct LuaObjectField sWhirlpoolFields[LUA_WHIRLPOOL_FIELD_COUNT] = {
};
struct LuaObjectTable sLuaObjectAutogenTable[LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN] = {
+ { LOT_ANIMINFO, sAnimInfoFields, LUA_ANIM_INFO_FIELD_COUNT },
{ LOT_ANIMATION, sAnimationFields, LUA_ANIMATION_FIELD_COUNT },
{ LOT_AREA, sAreaFields, LUA_AREA_FIELD_COUNT },
{ LOT_CAMERA, sCameraFields, LUA_CAMERA_FIELD_COUNT },
@@ -703,7 +704,6 @@ struct LuaObjectTable sLuaObjectAutogenTable[LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN]
{ LOT_GLOBALTEXTURES, sGlobalTexturesFields, LUA_GLOBAL_TEXTURES_FIELD_COUNT },
{ LOT_GRAPHNODE, sGraphNodeFields, LUA_GRAPH_NODE_FIELD_COUNT },
{ LOT_GRAPHNODEOBJECT, sGraphNodeObjectFields, LUA_GRAPH_NODE_OBJECT_FIELD_COUNT },
- { LOT_GRAPHNODEOBJECT_SUB, sAnimInfoFields, LUA_GRAPH_NODE_OBJECT_SUB_FIELD_COUNT },
{ LOT_HANDHELDSHAKEPOINT, sHandheldShakePointFields, LUA_HANDHELD_SHAKE_POINT_FIELD_COUNT },
{ LOT_INSTANTWARP, sInstantWarpFields, LUA_INSTANT_WARP_FIELD_COUNT },
{ LOT_LAKITUSTATE, sLakituStateFields, LUA_LAKITU_STATE_FIELD_COUNT },
diff --git a/src/pc/lua/smlua_cobject_autogen.h b/src/pc/lua/smlua_cobject_autogen.h
index d5b1e22ed..4d58296b0 100644
--- a/src/pc/lua/smlua_cobject_autogen.h
+++ b/src/pc/lua/smlua_cobject_autogen.h
@@ -5,6 +5,7 @@
enum LuaObjectAutogenType {
LOT_AUTOGEN_MIN = 1000,
+ LOT_ANIMINFO,
LOT_ANIMATION,
LOT_AREA,
LOT_CAMERA,
@@ -20,7 +21,6 @@ enum LuaObjectAutogenType {
LOT_GLOBALTEXTURES,
LOT_GRAPHNODE,
LOT_GRAPHNODEOBJECT,
- LOT_GRAPHNODEOBJECT_SUB,
LOT_HANDHELDSHAKEPOINT,
LOT_INSTANTWARP,
LOT_LAKITUSTATE,
diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c
index 889f4dbdc..40a8b32d3 100644
--- a/src/pc/lua/smlua_constants_autogen.c
+++ b/src/pc/lua/smlua_constants_autogen.c
@@ -922,7 +922,7 @@ char gSmluaConstants[] = ""
"INT_STATUS_MARIO_UNK1 = (1 << 1)\n"
"INT_STATUS_MARIO_UNK2 = (1 << 2)\n"
"INT_STATUS_MARIO_DROP_OBJECT = (1 << 3)\n"
-"INT_STATUS_MARIO_UNK4 = (1 << 4)\n"
+"INT_STATUS_HIT_BY_SHOCKWAVE = (1 << 4)\n"
"INT_STATUS_MARIO_UNK5 = (1 << 5)\n"
"INT_STATUS_MARIO_UNK6 = (1 << 6)\n"
"INT_STATUS_MARIO_UNK7 = (1 << 7)\n"
@@ -1280,7 +1280,8 @@ char gSmluaConstants[] = ""
"MARIO_UNKNOWN_25 = 0x02000000\n"
"MARIO_UNKNOWN_30 = 0x40000000\n"
"MARIO_UNKNOWN_31 = 0x80000000\n"
-"MARIO_CAP_FLAGS = 0x0000001F\n"
+"MARIO_SPECIAL_CAPS = (MARIO_VANISH_CAP | MARIO_METAL_CAP | MARIO_WING_CAP)\n"
+"MARIO_CAPS = (MARIO_NORMAL_CAP | MARIO_SPECIAL_CAPS)\n"
"ACT_ID_MASK = 0x000001FF\n"
"ACT_GROUP_MASK = 0x000001C0\n"
"ACT_GROUP_STATIONARY = (0 << 6)\n"
@@ -1325,6 +1326,7 @@ char gSmluaConstants[] = ""
"ACT_COUGHING = 0x0C40020A\n"
"ACT_SHIVERING = 0x0C40020B\n"
"ACT_IN_QUICKSAND = 0x0002020D\n"
+"ACT_UNKNOWN_0002020E = 0x0002020E\n"
"ACT_CROUCHING = 0x0C008220\n"
"ACT_START_CROUCHING = 0x0C008221\n"
"ACT_STOP_CROUCHING = 0x0C008222\n"