Add exit castle warp params to Lua

This commit is contained in:
MysterD 2022-04-10 02:29:44 -07:00
parent 15d6dc3a9c
commit 958b04378c
7 changed files with 22 additions and 7 deletions

View file

@ -572,6 +572,9 @@
--- @class LevelValues
--- @field public entryLevel LevelNum
--- @field public exitCastleArea integer
--- @field public exitCastleLevel LevelNum
--- @field public exitCastleWarpNode integer
--- @field public starPositions StarPositions
--- @class LinearTransitionPoint

View file

@ -834,6 +834,9 @@
| Field | Type | Access |
| ----- | ---- | ------ |
| entryLevel | [enum LevelNum](constants.md#enum-LevelNum) | |
| exitCastleArea | `integer` | |
| exitCastleLevel | [enum LevelNum](constants.md#enum-LevelNum) | |
| exitCastleWarpNode | `integer` | |
| starPositions | [StarPositions](structs.md#StarPositions) | read-only |
[:arrow_up_small:](#)

View file

@ -39,6 +39,9 @@
struct LevelValues gLevelValues = {
.entryLevel = LEVEL_CASTLE_GROUNDS,
.exitCastleLevel = LEVEL_CASTLE,
.exitCastleArea = 1,
.exitCastleWarpNode = 0x1F,
.starPositions = {
.KoopaBobStarPos = { 3030.0f, 4500.0f, -4600.0f },
.KoopaThiStarPos = { 7100.0f, -1300.0f, -6000.0f },

View file

@ -38,6 +38,9 @@ struct StarPositions {
struct LevelValues {
enum LevelNum entryLevel;
enum LevelNum exitCastleLevel;
s16 exitCastleArea;
u8 exitCastleWarpNode;
struct StarPositions starPositions;
};

View file

@ -1167,7 +1167,7 @@ s32 play_mode_paused(void) {
if (gDebugLevelSelect) {
fade_into_special_warp(-9, 1);
} else {
initiate_warp(LEVEL_CASTLE, 1, 0x1F, 0);
initiate_warp(gLevelValues.exitCastleLevel, gLevelValues.exitCastleArea, gLevelValues.exitCastleWarpNode, 0);
fade_into_special_warp(0, 0);
gSavedCourseNum = COURSE_NONE;
}

View file

@ -666,10 +666,13 @@ static struct LuaObjectField sLakituStateFields[LUA_LAKITU_STATE_FIELD_COUNT] =
{ "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE },
};
#define LUA_LEVEL_VALUES_FIELD_COUNT 2
#define LUA_LEVEL_VALUES_FIELD_COUNT 5
static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = {
{ "entryLevel", LVT_S32, offsetof(struct LevelValues, entryLevel), false, LOT_NONE },
{ "starPositions", LVT_COBJECT, offsetof(struct LevelValues, starPositions), true, LOT_STARPOSITIONS },
{ "entryLevel", LVT_S32, offsetof(struct LevelValues, entryLevel), false, LOT_NONE },
{ "exitCastleArea", LVT_S16, offsetof(struct LevelValues, exitCastleArea), false, LOT_NONE },
{ "exitCastleLevel", LVT_S32, offsetof(struct LevelValues, exitCastleLevel), false, LOT_NONE },
{ "exitCastleWarpNode", LVT_U8, offsetof(struct LevelValues, exitCastleWarpNode), false, LOT_NONE },
{ "starPositions", LVT_COBJECT, offsetof(struct LevelValues, starPositions), true, LOT_STARPOSITIONS },
};
#define LUA_LINEAR_TRANSITION_POINT_FIELD_COUNT 5

View file

@ -30,8 +30,8 @@ static void mod_activate_bin(struct Mod* mod, struct ModFile* file) {
}
// Add to custom actors
dynos_add_actor_custom(dynosPath, geoName);
LOG_INFO("Activating DynOS bin: '%s', '%s'", dynosPath, geoName);
dynos_add_actor_custom(dynosPath, geoName);
}
static void mod_activate_col(struct Mod* mod, struct ModFile* file) {
@ -59,8 +59,8 @@ static void mod_activate_col(struct Mod* mod, struct ModFile* file) {
}
// Add to custom actors
dynos_add_collision(dynosPath, colName);
LOG_INFO("Activating DynOS col: '%s', '%s'", dynosPath, colName);
dynos_add_collision(dynosPath, colName);
}
static void mod_activate_lvl(struct Mod* mod, struct ModFile* file) {
@ -88,8 +88,8 @@ static void mod_activate_lvl(struct Mod* mod, struct ModFile* file) {
}
// Add to levels
dynos_add_level(mod->index, dynosPath, lvlName);
LOG_INFO("Activating DynOS lvl: '%s', '%s'", dynosPath, lvlName);
dynos_add_level(mod->index, dynosPath, lvlName);
}
void mod_activate(struct Mod* mod) {