From ecf090f5aee8d67823e691d09ace21f50f929549 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 4 Oct 2020 14:48:13 -0700 Subject: [PATCH] Enabled/improved free movement for development purposes --- src/game/mario.c | 11 +++++++++++ src/game/mario_actions_cutscene.c | 15 ++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/game/mario.c b/src/game/mario.c index 7be59f0c..99de9350 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1467,6 +1467,17 @@ void update_mario_inputs(struct MarioState *m) { } /*End of moonjump cheat */ + /* Developer stuff */ +#ifdef DEVELOPMENT + if (m->playerIndex == 0) { + if (m->action != ACT_DEBUG_FREE_MOVE && m->controller->buttonPressed & L_TRIG) { + set_mario_action(m, ACT_DEBUG_FREE_MOVE, 0); + m->marioObj->oTimer = 0; + } + } +#endif + /* End of developer stuff */ + if (m->playerIndex == 0) { if (!localIsPaused && gCameraMovementFlags & CAM_MOVE_C_UP_MODE) { if (m->action & ACT_FLAG_ALLOW_FIRST_PERSON) { diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 1bedc279..f95f9923 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -601,24 +601,21 @@ s32 act_debug_free_move(struct MarioState *m) { u32 action; // integer immediates, generates convert instructions for some reason - speed = gPlayer1Controller->buttonDown & B_BUTTON ? 4 : 1; - if (gPlayer1Controller->buttonDown & L_TRIG) { - speed = 0.01f; - } + speed = gPlayer1Controller->buttonDown & B_BUTTON ? 1 : 4; set_mario_animation(m, MARIO_ANIM_A_POSE); vec3f_copy(pos, m->pos); - if (gPlayer1Controller->buttonDown & U_JPAD) { + if (gPlayer1Controller->buttonDown & A_BUTTON) { pos[1] += 16.0f * speed; } - if (gPlayer1Controller->buttonDown & D_JPAD) { + if (gPlayer1Controller->buttonDown & Z_TRIG) { pos[1] -= 16.0f * speed; } if (m->intendedMag > 0) { - pos[0] += 32.0f * speed * sins(m->intendedYaw); - pos[2] += 32.0f * speed * coss(m->intendedYaw); + pos[0] += 26.0f * speed * sins(m->intendedYaw); + pos[2] += 26.0f * speed * coss(m->intendedYaw); } resolve_and_return_wall_collisions(pos, 60.0f, 50.0f); @@ -635,7 +632,7 @@ s32 act_debug_free_move(struct MarioState *m) { vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); - if (gPlayer1Controller->buttonPressed == A_BUTTON) { + if (gPlayer1Controller->buttonPressed == L_TRIG && m->marioObj->oTimer > 10) { if (m->pos[1] <= m->waterLevel - 100) { action = ACT_WATER_IDLE; } else {