mirror of
https://github.com/AloUltraExt/sm64ex-alo.git
synced 2025-01-23 16:15:36 -05:00
3 new qol fixes
This commit is contained in:
parent
6e73642542
commit
0da86d5afb
6 changed files with 47 additions and 0 deletions
|
@ -105,5 +105,11 @@
|
||||||
#define QOL_FIX_MENU_SCROLLING (0 || QOL_FIXES)
|
#define QOL_FIX_MENU_SCROLLING (0 || QOL_FIXES)
|
||||||
/// Fixes missing surface wind in obj_check_floor_death
|
/// Fixes missing surface wind in obj_check_floor_death
|
||||||
#define QOL_FIX_OBJ_FLOOR_WIND_DEATH (0 || QOL_FIXES)
|
#define QOL_FIX_OBJ_FLOOR_WIND_DEATH (0 || QOL_FIXES)
|
||||||
|
/// Fixes hardcoded snow tree leaf particles
|
||||||
|
#define QOL_FIX_HARDCODED_TREE_PARTICLES (0 || QOL_FIXES)
|
||||||
|
/// Fixes red coin star marker floor position if more than 2000 units
|
||||||
|
#define QOL_FIX_RED_COIN_STAR_MARKER_POSITION (0 || QOL_FIXES)
|
||||||
|
/// Fixes monty mole hide in hole check
|
||||||
|
#define QOL_FIX_HIDE_IN_HOLE_NULL_CHECK (0 || QOL_FIXES)
|
||||||
|
|
||||||
#endif // QOL_DEFINES_H
|
#endif // QOL_DEFINES_H
|
||||||
|
|
|
@ -266,10 +266,18 @@ static void monty_mole_act_jump_into_hole(void) {
|
||||||
* Become intangible and enter the select hole action.
|
* Become intangible and enter the select hole action.
|
||||||
*/
|
*/
|
||||||
static void monty_mole_hide_in_hole(void) {
|
static void monty_mole_hide_in_hole(void) {
|
||||||
|
#if QOL_FIX_HIDE_IN_HOLE_NULL_CHECK
|
||||||
|
if (o->oMontyMoleCurrentHole != NULL) {
|
||||||
|
o->oMontyMoleCurrentHole->oMontyMoleHoleCooldown = 30;
|
||||||
|
}
|
||||||
|
#else
|
||||||
o->oMontyMoleCurrentHole->oMontyMoleHoleCooldown = 30;
|
o->oMontyMoleCurrentHole->oMontyMoleHoleCooldown = 30;
|
||||||
|
#endif
|
||||||
|
|
||||||
o->oAction = MONTY_MOLE_ACT_SELECT_HOLE;
|
o->oAction = MONTY_MOLE_ACT_SELECT_HOLE;
|
||||||
o->oVelY = 0.0f;
|
o->oVelY = 0.0f;
|
||||||
|
|
||||||
|
#if !QOL_FIX_HIDE_IN_HOLE_NULL_CHECK
|
||||||
//! Even though the object becomes intangible here, it is still possible
|
//! Even though the object becomes intangible here, it is still possible
|
||||||
// for a bob-omb to interact with it later in the frame (since bob-ombs
|
// for a bob-omb to interact with it later in the frame (since bob-ombs
|
||||||
// come after monty moles in processing order).
|
// come after monty moles in processing order).
|
||||||
|
@ -277,6 +285,7 @@ static void monty_mole_hide_in_hole(void) {
|
||||||
// action. If no hole is available (e.g. because mario is too far away),
|
// action. If no hole is available (e.g. because mario is too far away),
|
||||||
// the game will crash because of the line above that accesses
|
// the game will crash because of the line above that accesses
|
||||||
// oMontyMoleCurrentHole.
|
// oMontyMoleCurrentHole.
|
||||||
|
#endif
|
||||||
cur_obj_become_intangible();
|
cur_obj_become_intangible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,12 @@ void bhv_hidden_red_coin_star_init(void) {
|
||||||
s16 sp36;
|
s16 sp36;
|
||||||
struct Object *sp30;
|
struct Object *sp30;
|
||||||
|
|
||||||
|
#if !QOL_FIX_RED_COIN_STAR_MARKER_POSITION
|
||||||
if (gCurrCourseNum != COURSE_JRB)
|
if (gCurrCourseNum != COURSE_JRB)
|
||||||
spawn_object(o, MODEL_TRANSPARENT_STAR, bhvRedCoinStarMarker);
|
spawn_object(o, MODEL_TRANSPARENT_STAR, bhvRedCoinStarMarker);
|
||||||
|
#else
|
||||||
|
spawn_object(o, MODEL_TRANSPARENT_STAR, bhvRedCoinStarMarker);
|
||||||
|
#endif
|
||||||
|
|
||||||
sp36 = count_objects_with_behavior(bhvRedCoin);
|
sp36 = count_objects_with_behavior(bhvRedCoin);
|
||||||
if (sp36 == 0) {
|
if (sp36 == 0) {
|
||||||
|
@ -159,6 +163,13 @@ void bhv_hidden_red_coin_star_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void bhv_hidden_red_coin_star_loop(void) {
|
void bhv_hidden_red_coin_star_loop(void) {
|
||||||
|
#if QOL_FIX_RED_COIN_STAR_MARKER_POSITION
|
||||||
|
struct Object *starMarker = cur_obj_nearest_object_with_behavior(bhvRedCoinStarMarker);
|
||||||
|
if (starMarker != NULL && ((o->oPosY - starMarker->oPosY) > 2000.0f)) {
|
||||||
|
obj_mark_for_deletion(starMarker);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gRedCoinsCollected = o->oHiddenStarTriggerCounter;
|
gRedCoinsCollected = o->oHiddenStarTriggerCounter;
|
||||||
switch (o->oAction) {
|
switch (o->oAction) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -33,15 +33,23 @@ void bhv_tree_snow_or_leaf_loop(void) {
|
||||||
|
|
||||||
void bhv_snow_leaf_particle_spawn_init(void) {
|
void bhv_snow_leaf_particle_spawn_init(void) {
|
||||||
struct Object *obj; // Either snow or leaf
|
struct Object *obj; // Either snow or leaf
|
||||||
|
#ifdef QOL_FIX_HARDCODED_TREE_PARTICLES
|
||||||
|
struct Object *nearestTree = NULL;
|
||||||
|
#endif
|
||||||
UNUSED s32 unused;
|
UNUSED s32 unused;
|
||||||
s32 isSnow;
|
s32 isSnow;
|
||||||
f32 scale;
|
f32 scale;
|
||||||
UNUSED s32 unused2;
|
UNUSED s32 unused2;
|
||||||
gMarioObject->oActiveParticleFlags &= ~0x2000;
|
gMarioObject->oActiveParticleFlags &= ~0x2000;
|
||||||
|
#if QOL_FIX_HARDCODED_TREE_PARTICLES
|
||||||
|
nearestTree = cur_obj_nearest_object_with_behavior(bhvTree);
|
||||||
|
isSnow = (obj_has_model(nearestTree, MODEL_CCM_SNOW_TREE) || obj_has_model(nearestTree, MODEL_SL_SNOW_TREE));
|
||||||
|
#else
|
||||||
if (gCurrLevelNum == LEVEL_CCM || gCurrLevelNum == LEVEL_SL)
|
if (gCurrLevelNum == LEVEL_CCM || gCurrLevelNum == LEVEL_SL)
|
||||||
isSnow = 1;
|
isSnow = 1;
|
||||||
else
|
else
|
||||||
isSnow = 0;
|
isSnow = 0;
|
||||||
|
#endif
|
||||||
if (isSnow) {
|
if (isSnow) {
|
||||||
if (random_float() < 0.5) {
|
if (random_float() < 0.5) {
|
||||||
obj = spawn_object(o, MODEL_WHITE_PARTICLE_DL, bhvTreeSnow);
|
obj = spawn_object(o, MODEL_WHITE_PARTICLE_DL, bhvTreeSnow);
|
||||||
|
|
|
@ -2907,3 +2907,12 @@ void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 o
|
||||||
o->oPosY = objectPosY;
|
o->oPosY = objectPosY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Extra functions
|
||||||
|
void obj_set_model(struct Object *obj, s32 modelID) {
|
||||||
|
obj->header.gfx.sharedChild = gLoadedGraphNodes[modelID];
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 obj_has_model(struct Object *obj, u16 modelID) {
|
||||||
|
return (obj->header.gfx.sharedChild == gLoadedGraphNodes[modelID]);
|
||||||
|
}
|
||||||
|
|
|
@ -298,4 +298,8 @@ void cur_obj_spawn_loot_blue_coin(void);
|
||||||
void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY);
|
void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Extra functions
|
||||||
|
void obj_set_model(struct Object *obj, s32 modelID);
|
||||||
|
s32 obj_has_model(struct Object *obj, u16 modelID);
|
||||||
|
|
||||||
#endif // OBJECT_HELPERS_H
|
#endif // OBJECT_HELPERS_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue