added defines for better hanging

This commit is contained in:
Reonu
2021-07-13 23:57:00 +01:00
parent b460464d86
commit c80c99c817
3 changed files with 13 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- Nonstop stars * - Nonstop stars *
- Removed course-specific camera processing * - Removed course-specific camera processing *
- You can increase the number of frames that you have to perform a firsty * - 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:** **Hacker QOL:**
- Global, non-level based, star IDs (off by default) * - Global, non-level based, star IDs (off by default) *

View File

@@ -64,6 +64,10 @@
#define CASTLE_MUSIC_FIX #define CASTLE_MUSIC_FIX
// Remove course specific camera processing // Remove course specific camera processing
#define CAMERA_FIX #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 // Disables fall damage
#define NO_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) // Disables the scream that mario makes when falling off a great height (this is separate from actual fall damage)

View File

@@ -17,6 +17,8 @@
#include "level_table.h" #include "level_table.h"
#include "rumble_init.h" #include "rumble_init.h"
#include "config.h"
#define POLE_NONE 0 #define POLE_NONE 0
#define POLE_TOUCHED_FLOOR 1 #define POLE_TOUCHED_FLOOR 1
#define POLE_FELL_OFF 2 #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 update_hang_moving(struct MarioState *m) {
s32 stepResult; s32 stepResult;
Vec3f nextPos; Vec3f nextPos;
f32 maxSpeed = 4.0f; f32 maxSpeed = HANGING_SPEED;
m->forwardVel += 1.0f; m->forwardVel += 1.0f;
if (m->forwardVel > maxSpeed) { if (m->forwardVel > maxSpeed) {
@@ -353,7 +355,11 @@ s32 update_hang_moving(struct MarioState *m) {
} }
m->faceAngle[1] = m->faceAngle[1] =
#ifdef TIGHTER_HANGING_CONTROLS
m->intendedYaw;
#else
m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800);
#endif
m->slideYaw = m->faceAngle[1]; m->slideYaw = m->faceAngle[1];
m->slideVelX = m->forwardVel * sins(m->faceAngle[1]); m->slideVelX = m->forwardVel * sins(m->faceAngle[1]);