Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions include/text_options_strings.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@
#define TEXT_OPT_CHEAT7 _("EXIT COURSE AT ANY TIME")
#define TEXT_OPT_CHEAT8 _("HUGE MARIO")
#define TEXT_OPT_CHEAT9 _("TINY MARIO")
#define TEXT_OPT_CHEAT10 _("BLJ ANYWHERE")

#define TEXT_OPT_BLJCHT1 _("DISABLED")
#define TEXT_OPT_BLJCHT2 _("ENABLED")
#define TEXT_OPT_BLJCHT3 _("ENABLED - BOOST: 1")
#define TEXT_OPT_BLJCHT4 _("ENABLED - BOOST: 2")
#define TEXT_OPT_BLJCHT5 _("ENABLED - BOOST: 3")
#define TEXT_OPT_BLJCHT6 _("ENABLED - BOOST: 4")
#define TEXT_OPT_BLJCHT7 _("ENABLED - BOOST: 5")
#define TEXT_OPT_BLJCHT8 _("RAPID FIRE")
#define TEXT_OPT_BLJCHT9 _("RAPID FIRE - BOOST: 1")
#define TEXT_OPT_BLJCHT10 _("RAPID FIRE - BOOST: 2")
#define TEXT_OPT_BLJCHT11 _("RAPID FIRE - BOOST: 3")
#define TEXT_OPT_BLJCHT12 _("RAPID FIRE - BOOST: 4")
#define TEXT_OPT_BLJCHT13 _("RAPID FIRE - BOOST: 5")

#else // VERSION

Expand Down Expand Up @@ -146,6 +161,21 @@
#define TEXT_OPT_CHEAT7 _("Exit course at any time")
#define TEXT_OPT_CHEAT8 _("Huge Mario")
#define TEXT_OPT_CHEAT9 _("Tiny Mario")
#define TEXT_OPT_CHEAT10 _("BLJ Anywhere")

#define TEXT_OPT_BLJCHT1 _("Disabled")
#define TEXT_OPT_BLJCHT2 _("Enabled")
#define TEXT_OPT_BLJCHT3 _("Enabled - Boost: 1")
#define TEXT_OPT_BLJCHT4 _("Enabled - Boost: 2")
#define TEXT_OPT_BLJCHT5 _("Enabled - Boost: 3")
#define TEXT_OPT_BLJCHT6 _("Enabled - Boost: 4")
#define TEXT_OPT_BLJCHT7 _("Enabled - Boost: 5")
#define TEXT_OPT_BLJCHT8 _("Rapid Fire")
#define TEXT_OPT_BLJCHT9 _("Rapid Fire - Boost: 1")
#define TEXT_OPT_BLJCHT10 _("Rapid Fire - Boost: 2")
#define TEXT_OPT_BLJCHT11 _("Rapid Fire - Boost: 3")
#define TEXT_OPT_BLJCHT12 _("Rapid Fire - Boost: 4")
#define TEXT_OPT_BLJCHT13 _("Rapid Fire - Boost: 5")

#endif // VERSION

Expand Down
14 changes: 14 additions & 0 deletions src/game/mario_actions_airborne.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifdef BETTERCAMERA
#include "bettercamera.h"
#endif
#include "pc/cheats.h"

void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3) {
s32 animFrame = m->marioObj->header.gfx.unk38.animFrame;
Expand Down Expand Up @@ -371,6 +372,19 @@ u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation,
stepResult = perform_air_step(m, stepArg);
switch (stepResult) {
case AIR_STEP_NONE:
// BLJ anywhere cheat
if (Cheats.BLJAnywhere > 0 && Cheats.EnableCheats == TRUE && m->action == ACT_LONG_JUMP
&& m->forwardVel < 1.0f && m->pos[1] - 50.0f < m->floorHeight) {
if (Cheats.BLJAnywhere < 7) {
if (m->controller->buttonPressed & A_BUTTON) {
m->forwardVel -= (Cheats.BLJAnywhere - 1) * 2.5f;
m->vel[1] = -50.0f;
}
} else if (m->controller->buttonDown & A_BUTTON) {
m->forwardVel -= (Cheats.BLJAnywhere - 7) * 2.5f;
m->vel[1] = -50.0f;
}
}
set_mario_animation(m, animation);
break;

Expand Down
10 changes: 9 additions & 1 deletion src/game/mario_actions_moving.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "engine/math_util.h"
#include "engine/surface_collision.h"
#include "mario_step.h"
#include "game_init.h"
#include "area.h"
#include "interaction.h"
#include "mario_actions_object.h"
Expand Down Expand Up @@ -1853,7 +1854,14 @@ s32 act_long_jump_land(struct MarioState *m) {
m->forwardVel = 0.0f;
}
#endif


// BLJ anywhere cheat
if (Cheats.BLJAnywhere >= 7 && Cheats.EnableCheats == TRUE && m->forwardVel < 1.0f
&& (m->controller->buttonDown & A_BUTTON)) {
set_jumping_action(m, ACT_LONG_JUMP, 0);
return FALSE;
}

if (!(m->input & INPUT_Z_DOWN)) {
m->input &= ~INPUT_A_PRESSED;
}
Expand Down
34 changes: 34 additions & 0 deletions src/game/options_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static const u8 optsCheatsStr[][64] = {
{ TEXT_OPT_CHEAT7 },
{ TEXT_OPT_CHEAT8 },
{ TEXT_OPT_CHEAT9 },
{ TEXT_OPT_CHEAT10 },
};

static const u8 bindStr[][32] = {
Expand All @@ -124,6 +125,22 @@ static const u8 bindStr[][32] = {
{ TEXT_OPT_RUMBLE }
};

static const u8 optsBLJCheatStr[][32] = {
{ TEXT_OPT_BLJCHT1 },
{ TEXT_OPT_BLJCHT2 },
{ TEXT_OPT_BLJCHT3 },
{ TEXT_OPT_BLJCHT4 },
{ TEXT_OPT_BLJCHT5 },
{ TEXT_OPT_BLJCHT6 },
{ TEXT_OPT_BLJCHT7 },
{ TEXT_OPT_BLJCHT8 },
{ TEXT_OPT_BLJCHT9 },
{ TEXT_OPT_BLJCHT10 },
{ TEXT_OPT_BLJCHT11 },
{ TEXT_OPT_BLJCHT12 },
{ TEXT_OPT_BLJCHT13 },
};

static const u8 *filterChoices[] = {
optsVideoStr[2],
optsVideoStr[3],
Expand All @@ -136,6 +153,22 @@ static const u8 *vsyncChoices[] = {
optsVideoStr[6],
};

static const u8 *bljCheatChoices[] = {
optsBLJCheatStr[0],
optsBLJCheatStr[1],
optsBLJCheatStr[2],
optsBLJCheatStr[3],
optsBLJCheatStr[4],
optsBLJCheatStr[5],
optsBLJCheatStr[6],
optsBLJCheatStr[7],
optsBLJCheatStr[8],
optsBLJCheatStr[9],
optsBLJCheatStr[10],
optsBLJCheatStr[11],
optsBLJCheatStr[12],
};

enum OptType {
OPT_INVALID = 0,
OPT_TOGGLE,
Expand Down Expand Up @@ -277,6 +310,7 @@ static struct Option optsCheats[] = {
DEF_OPT_TOGGLE( optsCheatsStr[6], &Cheats.ExitAnywhere ),
DEF_OPT_TOGGLE( optsCheatsStr[7], &Cheats.HugeMario ),
DEF_OPT_TOGGLE( optsCheatsStr[8], &Cheats.TinyMario ),
DEF_OPT_CHOICE( optsCheatsStr[9], &Cheats.BLJAnywhere, bljCheatChoices ),

};

Expand Down
1 change: 1 addition & 0 deletions src/pc/cheats.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct CheatList {
bool ExitAnywhere;
bool HugeMario;
bool TinyMario;
unsigned int BLJAnywhere;
};

extern struct CheatList Cheats;
Expand Down