Skip to content

Commit

Permalink
add groundhog day cheat
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Jul 8, 2024
1 parent 7696498 commit 2f99a16
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@ std::unordered_map<std::string_view, AddressRule> g_address_rules{
.at_exe()
.function_start(),
},
{
"groundhog_day"sv,
PatternCommandBuffer{}
.set_optional(true)
.find_inst(".. 81 .. 00 00 02 02"_gh)
.offset(12)
.at_exe(),
},
/*{
"load_asset"sv, PatternCommandBuffer{}.from_exe_base(0x74450), // TODO
},
Expand Down
10 changes: 10 additions & 0 deletions ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,16 @@ void UI::Cheats() {
if (options["cheat_noclip"].value) {
*Max::get().player_state() = 18;
}

if (options["cheat_groundhog"].value && get_address("groundhog_day")) {
write_mem_recoverable("groundhog_day", get_address("groundhog_day"),
get_nop(2), true);
write_mem_recoverable("groundhog_day2", get_address("groundhog_day") + 26,
get_nop(2), true);
} else {
recover_mem("groundhog_day");
recover_mem("groundhog_day2");
}
}

void UI::Windows() {
Expand Down
4 changes: 4 additions & 0 deletions ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ class UI {
"Party like it's 1989! Enable the B&W death screen shader all the "
"time.",
"toggle_gameboy"}},
{"cheat_groundhog",
{false, "Remove Groundhog Day check",
"Patches out the Groundhog Day checks,\nso you can always get up to 4 "
"extra hearts."}},
{"cheat_hud",
{false, "Hide ingame HUD",
"Removes all HUD elements, including the menus.", "toggle_hud"}},
Expand Down

0 comments on commit 2f99a16

Please sign in to comment.