Skip to content

Commit

Permalink
add tingle balloon cheat (zsrtww#127)
Browse files Browse the repository at this point in the history
* add tingle balloon cheat

* clang-format

* Changing to unused button combo

* update menu to reflect new button combo

---------

Co-authored-by: EJ125 <[email protected]>
  • Loading branch information
Luzagar and EJ125 authored Oct 28, 2024
1 parent a517ca0 commit 253c92d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion modules/boot/include/cheats.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "settings.h"

#define CHEAT_AMNT 16
#define CHEAT_AMNT 17

enum CheatId {
InfiniteAir,
Expand All @@ -22,6 +22,7 @@ enum CheatId {
QuarterHeart,
FastMovement,
Upcharge,
Hoverboots,
};

struct Cheat {
Expand Down
3 changes: 2 additions & 1 deletion modules/boot/include/commands.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "libtww/include/dolphin/gctypes.h"

#define COMMANDS_AMNT 16
#define COMMANDS_AMNT 17
#define DEFAULT_WATER_SPEED 1500.0f
#define DEFAULT_LAND_SPEED 150.0f

Expand All @@ -28,6 +28,7 @@ enum Commands {
CMD_TOGGLE_TIMER,
CMD_RESET_TIMER,
CMD_VOID,
CMD_HOVER_BOOTS,
};

struct Command {
Expand Down
2 changes: 2 additions & 0 deletions modules/boot/include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum GZSettingID : uint32_t {
STNG_CHEATS_QUARTER_HEART,
STNG_CHEATS_FAST_MOVEMENT,
STNG_CHEATS_UPCHARGE,
STNG_CHEATS_HOVERBOOTS,
// Item Equips
STNG_ITEM_EQUIP_TELESCOPE,
STNG_ITEM_EQUIP_SAIL,
Expand Down Expand Up @@ -92,6 +93,7 @@ enum GZSettingID : uint32_t {
STNG_CMD_QUARTER_HEART,
STNG_CMD_FAST_MOVEMENT,
STNG_CMD_UPCHARGE,
STNG_CMD_HOVERBOOTS,
STNG_CMD_AREA_RELOAD,
STNG_CMD_REFILL_HEALTH,
STNG_CMD_REFILL_MAGIC,
Expand Down
5 changes: 5 additions & 0 deletions modules/boot/src/cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,9 @@ void GZ_applyCheats() {
} else {
GZCmd_disable(CMD_REFILL_MAGIC);
}
if (GZ_checkCheat(STNG_CHEATS_HOVERBOOTS)) {
GZCmd_enable(CMD_HOVER_BOOTS);
} else {
GZCmd_disable(CMD_HOVER_BOOTS);
}
}
6 changes: 6 additions & 0 deletions modules/boot/src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ void GZCmd_quarterHeart() {
dComIfGs_setLife(2);
dComIfGp_setItemLifeCount(-1);
}
void GZCmd_hoverBoots() {
if (dComIfGp_getPlayer(0)) {
daPy_getPlayerLinkActorClass()->setHoverBoots(5 * 30);
}
}

/*Temporary functions to fix bug with collision codes from inline function*/
void GZCmd_normalCollision() {
Expand Down Expand Up @@ -177,6 +182,7 @@ static Command sCommands[COMMANDS_AMNT] = {
{g_commandStates[CMD_TOGGLE_TIMER], (CButton::DPAD_RIGHT | CButton::R | CButton::L), GZCmd_toggleTimer},
{g_commandStates[CMD_RESET_TIMER], (CButton::DPAD_LEFT | CButton::R | CButton::L), GZCmd_resetTimer},
{g_commandStates[CMD_VOID], (CButton::L | CButton::R | CButton::B | CButton::START), GZCmd_void},
{g_commandStates[CMD_HOVER_BOOTS], (CButton::DPAD_DOWN), GZCmd_hoverBoots}

};

Expand Down
7 changes: 5 additions & 2 deletions modules/menus/menu_cheats/src/cheat_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ KEEP_FUNC CheatsMenu::CheatsMenu(Cursor& cursor)
{"fast movement", FastMovement, "Hold D-pad left to get super speed. Modify the speed in settings.", true,
ACTIVE_FUNC(STNG_CHEATS_FAST_MOVEMENT)},
{"upcharge", Upcharge, "Hold X + Z to get negative speed for upcharge", true,
ACTIVE_FUNC(STNG_CHEATS_UPCHARGE)}} {}
ACTIVE_FUNC(STNG_CHEATS_UPCHARGE)},
{"tingle balloon", Hoverboots, "Hold D-pad down to get tingle balloon.", true,
ACTIVE_FUNC(STNG_CHEATS_HOVERBOOTS)}} {}

CheatsMenu::~CheatsMenu() {}

Expand All @@ -44,6 +46,7 @@ GZSettingID l_mapping[] = {
STNG_CHEATS_REFILL_HEALTH, STNG_CHEATS_INFINITE_MAGIC, STNG_CHEATS_REFILL_MAGIC, STNG_CHEATS_INFINITE_RUPEES,
STNG_CHEATS_MOON_JUMP, STNG_CHEATS_STORAGE, STNG_CHEATS_NORMAL_COLLISION, STNG_CHEATS_CHEST_STORAGE,
STNG_CHEATS_DOOR_CANCEL, STNG_CHEATS_QUARTER_HEART, STNG_CHEATS_FAST_MOVEMENT, STNG_CHEATS_UPCHARGE,
STNG_CHEATS_HOVERBOOTS,
};
static_assert(ARRAY_COUNT(l_mapping) == CHEAT_AMNT, "l_mapping size does not match CHEAT_AMNT");

Expand All @@ -65,4 +68,4 @@ void CheatsMenu::draw() {
}

GZ_drawMenuLines(lines, cursor.y, MENU_LINE_NUM);
}
}

0 comments on commit 253c92d

Please sign in to comment.