Add ability to not show star collection dialogs

This commit is contained in:
Agent X 2024-02-21 10:50:08 -05:00
parent 5fffa9e9d9
commit 64ebb88906
6 changed files with 15 additions and 6 deletions

View File

@ -198,6 +198,7 @@
--- @field public RacingPenguinHeight number
--- @field public RacingPenguinRadius number
--- @field public RespawnShellBoxes integer
--- @field public ShowStarDialog integer
--- @field public ShowStarMilestones integer
--- @field public ToadStar1Requirement integer
--- @field public ToadStar2Requirement integer

View File

@ -336,6 +336,7 @@
| RacingPenguinHeight | `number` | |
| RacingPenguinRadius | `number` | |
| RespawnShellBoxes | `integer` | |
| ShowStarDialog | `integer` | |
| ShowStarMilestones | `integer` | |
| ToadStar1Requirement | `integer` | |
| ToadStar2Requirement | `integer` | |

View File

@ -156,6 +156,7 @@ struct BehaviorValues gDefaultBehaviorValues = {
.GrateStarRequirement = 120,
.ChillBullyDeathPosY = 1030.0f,
.ShowStarMilestones = TRUE,
.ShowStarDialog = TRUE,
.RespawnShellBoxes = TRUE,
.MultipleCapCollection = FALSE,
.InfiniteRenderDistance = TRUE,

View File

@ -251,6 +251,7 @@ struct BehaviorValues {
u16 GrateStarRequirement;
f32 ChillBullyDeathPosY;
u8 ShowStarMilestones;
u8 ShowStarDialog;
u8 RespawnShellBoxes;
u8 MultipleCapCollection;
u8 InfiniteRenderDistance;

View File

@ -725,11 +725,15 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
if ((m->actionArg & 1) == 0) {
level_trigger_warp(m, WARP_OP_STAR_EXIT);
} else if (m->playerIndex == 0) {
enable_time_stop_if_alone();
create_dialog_box_with_response((gLastCompletedStarNum == 7)
? gBehaviorValues.dialogs.HundredCoinsDialog
: gBehaviorValues.dialogs.CollectedStarDialog);
m->actionState = 1;
if (gBehaviorValues.ShowStarDialog) {
enable_time_stop_if_alone();
create_dialog_box_with_response((gLastCompletedStarNum == 7)
? gBehaviorValues.dialogs.HundredCoinsDialog
: gBehaviorValues.dialogs.CollectedStarDialog);
m->actionState = 1;
} else {
m->actionState = 2;
}
} else {
set_mario_action(m, isInWater ? ACT_WATER_IDLE : (m->pos[1] <= m->floorHeight ? ACT_IDLE : ACT_FREEFALL), 0);
}

View File

@ -218,7 +218,7 @@ static struct LuaObjectField sBehaviorTrajectoriesFields[LUA_BEHAVIOR_TRAJECTORI
{ "UnagiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, UnagiTrajectory), false, LOT_POINTER },
};
#define LUA_BEHAVIOR_VALUES_FIELD_COUNT 30
#define LUA_BEHAVIOR_VALUES_FIELD_COUNT 31
static struct LuaObjectField sBehaviorValuesFields[LUA_BEHAVIOR_VALUES_FIELD_COUNT] = {
{ "BowlingBallBob2Speed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallBob2Speed), false, LOT_NONE },
{ "BowlingBallBobSpeed", LVT_F32, offsetof(struct BehaviorValues, BowlingBallBobSpeed), false, LOT_NONE },
@ -243,6 +243,7 @@ static struct LuaObjectField sBehaviorValuesFields[LUA_BEHAVIOR_VALUES_FIELD_COU
{ "RacingPenguinHeight", LVT_F32, offsetof(struct BehaviorValues, RacingPenguinHeight), false, LOT_NONE },
{ "RacingPenguinRadius", LVT_F32, offsetof(struct BehaviorValues, RacingPenguinRadius), false, LOT_NONE },
{ "RespawnShellBoxes", LVT_U8, offsetof(struct BehaviorValues, RespawnShellBoxes), false, LOT_NONE },
{ "ShowStarDialog", LVT_U8, offsetof(struct BehaviorValues, ShowStarDialog), false, LOT_NONE },
{ "ShowStarMilestones", LVT_U8, offsetof(struct BehaviorValues, ShowStarMilestones), false, LOT_NONE },
{ "ToadStar1Requirement", LVT_U16, offsetof(struct BehaviorValues, ToadStar1Requirement), false, LOT_NONE },
{ "ToadStar2Requirement", LVT_U16, offsetof(struct BehaviorValues, ToadStar2Requirement), false, LOT_NONE },