Add gLevelValues.infiniteStairsRequirement and gBehaviorValues.CourtyardBoosRequirement

Ported this PR from the sm64ex-coop dev repo.

Co-Authored-By: Emily♥ <77174187+emilyemmi@users.noreply.github.com>
This commit is contained in:
Agent X 2024-06-14 10:37:14 -04:00
parent b6ed10274b
commit 15c9602e11
8 changed files with 18 additions and 8 deletions

View File

@ -174,6 +174,7 @@
--- @field public BowlingBallThiSmallSpeed number --- @field public BowlingBallThiSmallSpeed number
--- @field public BowlingBallTtmSpeed number --- @field public BowlingBallTtmSpeed number
--- @field public ChillBullyDeathPosY number --- @field public ChillBullyDeathPosY number
--- @field public CourtyardBoosRequirement integer
--- @field public GrateStarRequirement integer --- @field public GrateStarRequirement integer
--- @field public InfiniteRenderDistance integer --- @field public InfiniteRenderDistance integer
--- @field public KingBobombFVel number --- @field public KingBobombFVel number
@ -902,6 +903,7 @@
--- @field public hudCapTimer integer --- @field public hudCapTimer integer
--- @field public hudRedCoinsRadar integer --- @field public hudRedCoinsRadar integer
--- @field public hudSecretsRadar integer --- @field public hudSecretsRadar integer
--- @field public infiniteStairsRequirement integer
--- @field public maxCoins integer --- @field public maxCoins integer
--- @field public maxLives integer --- @field public maxLives integer
--- @field public metalCapDuration integer --- @field public metalCapDuration integer

View File

@ -307,6 +307,7 @@
| BowlingBallThiSmallSpeed | `number` | | | BowlingBallThiSmallSpeed | `number` | |
| BowlingBallTtmSpeed | `number` | | | BowlingBallTtmSpeed | `number` | |
| ChillBullyDeathPosY | `number` | | | ChillBullyDeathPosY | `number` | |
| CourtyardBoosRequirement | `integer` | |
| GrateStarRequirement | `integer` | | | GrateStarRequirement | `integer` | |
| InfiniteRenderDistance | `integer` | | | InfiniteRenderDistance | `integer` | |
| KingBobombFVel | `number` | | | KingBobombFVel | `number` | |
@ -1243,6 +1244,7 @@
| hudCapTimer | `integer` | | | hudCapTimer | `integer` | |
| hudRedCoinsRadar | `integer` | | | hudRedCoinsRadar | `integer` | |
| hudSecretsRadar | `integer` | | | hudSecretsRadar | `integer` | |
| infiniteStairsRequirement | `integer` | |
| maxCoins | `integer` | | | maxCoins | `integer` | |
| maxLives | `integer` | | | maxLives | `integer` | |
| metalCapDuration | `integer` | | | metalCapDuration | `integer` | |

View File

@ -122,7 +122,7 @@ void bhv_courtyard_boo_triplet_init(void) {
s32 i; s32 i;
struct Object *boo; struct Object *boo;
if (gHudDisplay.stars < 12) { if (gHudDisplay.stars < gBehaviorValues.CourtyardBoosRequirement) {
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
} else { } else {
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
@ -848,7 +848,7 @@ static void boo_with_cage_act_3(void) {
void bhv_boo_with_cage_init(void) { void bhv_boo_with_cage_init(void) {
struct Object* cage; struct Object* cage;
if (gHudDisplay.stars < 12) { if (gHudDisplay.stars < gBehaviorValues.CourtyardBoosRequirement) {
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
} else { } else {
cage = spawn_object(o, MODEL_HAUNTED_CAGE, bhvBooCage); cage = spawn_object(o, MODEL_HAUNTED_CAGE, bhvBooCage);
@ -975,7 +975,7 @@ void bhv_boo_in_castle_loop(void) {
if (o->oAction == 0) { if (o->oAction == 0) {
cur_obj_hide(); cur_obj_hide();
if (gHudDisplay.stars < 12) { if (gHudDisplay.stars < gBehaviorValues.CourtyardBoosRequirement) {
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
} }

View File

@ -73,6 +73,7 @@ struct LevelValues gDefaultLevelValues = {
.pssSlideStarTime = 630, .pssSlideStarTime = 630,
.pssSlideStarIndex = 1, .pssSlideStarIndex = 1,
.coinsRequiredForCoinStar = 100, .coinsRequiredForCoinStar = 100,
.infiniteStairsRequirement = 70,
.wingCapDuration = 1800, .wingCapDuration = 1800,
.metalCapDuration = 600, .metalCapDuration = 600,
.vanishCapDuration = 600, .vanishCapDuration = 600,
@ -161,6 +162,7 @@ struct BehaviorValues gDefaultBehaviorValues = {
.RespawnShellBoxes = TRUE, .RespawnShellBoxes = TRUE,
.MultipleCapCollection = FALSE, .MultipleCapCollection = FALSE,
.InfiniteRenderDistance = TRUE, .InfiniteRenderDistance = TRUE,
.CourtyardBoosRequirement = 12,
.starsNeededForDialog = { 1, 3, 8, 30, 50, 70 }, .starsNeededForDialog = { 1, 3, 8, 30, 50, 70 },
.dialogs = { .dialogs = {
.BobombBuddyBob1Dialog = DIALOG_004, .BobombBuddyBob1Dialog = DIALOG_004,

View File

@ -69,6 +69,7 @@ struct LevelValues {
u16 pssSlideStarTime; u16 pssSlideStarTime;
u8 pssSlideStarIndex; u8 pssSlideStarIndex;
s16 coinsRequiredForCoinStar; s16 coinsRequiredForCoinStar;
s16 infiniteStairsRequirement;
u16 wingCapDuration; u16 wingCapDuration;
u16 metalCapDuration; u16 metalCapDuration;
u16 vanishCapDuration; u16 vanishCapDuration;
@ -256,6 +257,7 @@ struct BehaviorValues {
u8 RespawnShellBoxes; u8 RespawnShellBoxes;
u8 MultipleCapCollection; u8 MultipleCapCollection;
u8 InfiniteRenderDistance; u8 InfiniteRenderDistance;
s16 CourtyardBoosRequirement;
struct StarsNeededForDialog starsNeededForDialog; struct StarsNeededForDialog starsNeededForDialog;
struct BehaviorDialogs dialogs; struct BehaviorDialogs dialogs;
struct BehaviorTrajectories trajectories; struct BehaviorTrajectories trajectories;

View File

@ -641,7 +641,7 @@ void check_instant_warp(void) {
} }
if (gCurrLevelNum == LEVEL_CASTLE if (gCurrLevelNum == LEVEL_CASTLE
&& save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 70) { && save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= gLevelValues.infiniteStairsRequirement) {
return; return;
} }

View File

@ -4,6 +4,7 @@
#include "audio/external.h" #include "audio/external.h"
#include "engine/graph_node.h" #include "engine/graph_node.h"
#include "engine/math_util.h" #include "engine/math_util.h"
#include "hardcoded.h"
#include "level_table.h" #include "level_table.h"
#include "level_update.h" #include "level_update.h"
#include "main.h" #include "main.h"
@ -200,8 +201,7 @@ void play_painting_eject_sound(void) {
void play_infinite_stairs_music(void) { void play_infinite_stairs_music(void) {
u8 shouldPlay = FALSE; u8 shouldPlay = FALSE;
/* Infinite stairs? */ if (gCurrLevelNum == LEVEL_CASTLE && gCurrAreaIndex == 2 && gMarioState->numStars < gLevelValues.infiniteStairsRequirement) {
if (gCurrLevelNum == LEVEL_CASTLE && gCurrAreaIndex == 2 && gMarioState->numStars < 70) {
if (gMarioState->floor != NULL && gMarioState->floor->room == 6) { if (gMarioState->floor != NULL && gMarioState->floor->room == 6) {
if (gMarioState->pos[2] < 2540.0f) { if (gMarioState->pos[2] < 2540.0f) {
shouldPlay = TRUE; shouldPlay = TRUE;

View File

@ -210,7 +210,7 @@ static struct LuaObjectField sBehaviorTrajectoriesFields[LUA_BEHAVIOR_TRAJECTORI
{ "UnagiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, UnagiTrajectory), false, LOT_POINTER }, { "UnagiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, UnagiTrajectory), false, LOT_POINTER },
}; };
#define LUA_BEHAVIOR_VALUES_FIELD_COUNT 31 #define LUA_BEHAVIOR_VALUES_FIELD_COUNT 32
static struct LuaObjectField sBehaviorValuesFields[LUA_BEHAVIOR_VALUES_FIELD_COUNT] = { static struct LuaObjectField sBehaviorValuesFields[LUA_BEHAVIOR_VALUES_FIELD_COUNT] = {
{ "BowlingBallBob2Speed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallBob2Speed), false, LOT_NONE }, { "BowlingBallBob2Speed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallBob2Speed), false, LOT_NONE },
{ "BowlingBallBobSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallBobSpeed), false, LOT_NONE }, { "BowlingBallBobSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallBobSpeed), false, LOT_NONE },
@ -218,6 +218,7 @@ static struct LuaObjectField sBehaviorValuesFields[LUA_BEHAVIOR_VALUES_FIELD_COU
{ "BowlingBallThiSmallSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallThiSmallSpeed), false, LOT_NONE }, { "BowlingBallThiSmallSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallThiSmallSpeed), false, LOT_NONE },
{ "BowlingBallTtmSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallTtmSpeed), false, LOT_NONE }, { "BowlingBallTtmSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallTtmSpeed), false, LOT_NONE },
{ "ChillBullyDeathPosY", LVT_F32, offsetof(struct BehaviorValues, ChillBullyDeathPosY), false, LOT_NONE }, { "ChillBullyDeathPosY", LVT_F32, offsetof(struct BehaviorValues, ChillBullyDeathPosY), false, LOT_NONE },
{ "CourtyardBoosRequirement", LVT_S16, offsetof(struct BehaviorValues, CourtyardBoosRequirement), false, LOT_NONE },
{ "GrateStarRequirement", LVT_U16, offsetof(struct BehaviorValues, GrateStarRequirement), false, LOT_NONE }, { "GrateStarRequirement", LVT_U16, offsetof(struct BehaviorValues, GrateStarRequirement), false, LOT_NONE },
{ "InfiniteRenderDistance", LVT_U8, offsetof(struct BehaviorValues, InfiniteRenderDistance), false, LOT_NONE }, { "InfiniteRenderDistance", LVT_U8, offsetof(struct BehaviorValues, InfiniteRenderDistance), false, LOT_NONE },
{ "KingBobombFVel", LVT_F32, offsetof(struct BehaviorValues, KingBobombFVel), false, LOT_NONE }, { "KingBobombFVel", LVT_F32, offsetof(struct BehaviorValues, KingBobombFVel), false, LOT_NONE },
@ -995,7 +996,7 @@ static struct LuaObjectField sLakituStateFields[LUA_LAKITU_STATE_FIELD_COUNT] =
{ "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE }, { "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE },
}; };
#define LUA_LEVEL_VALUES_FIELD_COUNT 49 #define LUA_LEVEL_VALUES_FIELD_COUNT 50
static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = { static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = {
{ "bubbleOnDeathBarrierInCapStages", LVT_U8, offsetof(struct LevelValues, bubbleOnDeathBarrierInCapStages), false, LOT_NONE }, { "bubbleOnDeathBarrierInCapStages", LVT_U8, offsetof(struct LevelValues, bubbleOnDeathBarrierInCapStages), false, LOT_NONE },
{ "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE }, { "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE },
@ -1019,6 +1020,7 @@ static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] =
{ "hudCapTimer", LVT_U8, offsetof(struct LevelValues, hudCapTimer), false, LOT_NONE }, { "hudCapTimer", LVT_U8, offsetof(struct LevelValues, hudCapTimer), false, LOT_NONE },
{ "hudRedCoinsRadar", LVT_U8, offsetof(struct LevelValues, hudRedCoinsRadar), false, LOT_NONE }, { "hudRedCoinsRadar", LVT_U8, offsetof(struct LevelValues, hudRedCoinsRadar), false, LOT_NONE },
{ "hudSecretsRadar", LVT_U8, offsetof(struct LevelValues, hudSecretsRadar), false, LOT_NONE }, { "hudSecretsRadar", LVT_U8, offsetof(struct LevelValues, hudSecretsRadar), false, LOT_NONE },
{ "infiniteStairsRequirement", LVT_S16, offsetof(struct LevelValues, infiniteStairsRequirement), false, LOT_NONE },
{ "maxCoins", LVT_U16, offsetof(struct LevelValues, maxCoins), false, LOT_NONE }, { "maxCoins", LVT_U16, offsetof(struct LevelValues, maxCoins), false, LOT_NONE },
{ "maxLives", LVT_U16, offsetof(struct LevelValues, maxLives), false, LOT_NONE }, { "maxLives", LVT_U16, offsetof(struct LevelValues, maxLives), false, LOT_NONE },
{ "metalCapDuration", LVT_U16, offsetof(struct LevelValues, metalCapDuration), false, LOT_NONE }, { "metalCapDuration", LVT_U16, offsetof(struct LevelValues, metalCapDuration), false, LOT_NONE },