diff --git a/README.md b/README.md index 362f26da..9183dd44 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin - Nonstop stars * - Removed course-specific camera processing * - You can increase the number of frames that you have to perform a firsty * +- Ability to set Mario's movement speed when hanging from a ceiling * +- Tighter hanging controls (mario will face the direction of the analog stick directly while hanging from a ceiling) * **Hacker QOL:** - Global, non-level based, star IDs (off by default) * diff --git a/include/config.h b/include/config.h index a206b1a5..be703060 100644 --- a/include/config.h +++ b/include/config.h @@ -64,6 +64,10 @@ #define CASTLE_MUSIC_FIX // Remove course specific camera processing #define CAMERA_FIX +// Change the movement speed when hanging from a ceiling +#define HANGING_SPEED 4.f +// Makes Mario face the direction of the analog stick directly while hanging from a ceiling, without doing "semicircles" +#define TIGHTER_HANGING_CONTROLS // Disables fall damage #define NO_FALL_DAMAGE // Disables the scream that mario makes when falling off a great height (this is separate from actual fall damage) diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index fa8e2a0d..cb7574ae 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -17,6 +17,8 @@ #include "level_table.h" #include "rumble_init.h" +#include "config.h" + #define POLE_NONE 0 #define POLE_TOUCHED_FLOOR 1 #define POLE_FELL_OFF 2 @@ -345,7 +347,7 @@ s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos) { s32 update_hang_moving(struct MarioState *m) { s32 stepResult; Vec3f nextPos; - f32 maxSpeed = 4.0f; + f32 maxSpeed = HANGING_SPEED; m->forwardVel += 1.0f; if (m->forwardVel > maxSpeed) { @@ -353,7 +355,11 @@ s32 update_hang_moving(struct MarioState *m) { } m->faceAngle[1] = + #ifdef TIGHTER_HANGING_CONTROLS + m->intendedYaw; + #else m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + #endif m->slideYaw = m->faceAngle[1]; m->slideVelX = m->forwardVel * sins(m->faceAngle[1]);