Skip to content

Commit

Permalink
fixed death effect
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Oct 1, 2024
1 parent 30b86f9 commit 10953fe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ void gui::RenderMain() {
else if (hck.name == "RGB Icons") { hacks::rgb_icons = hck.enabled; }
else if (hck.name == "Wave Trail Size") { hacks::wave_trail = hck.enabled; }
else if (hck.name == "Random Seed") { hacks::random_seed_enabled = hck.enabled; }
else if (hck.name == "No Death Effect") { hacks::no_death_effect = hck.enabled; }
else if (hck.name == "Show Hitboxes") {
hacks::show_hitboxes = hck.enabled;
auto pl = PlayLayer::get();
Expand Down Expand Up @@ -519,6 +520,7 @@ void gui::toggleKeybinds(int key) {
else if (hck.name == "RGB Icons") { hacks::rgb_icons = hck.enabled; }
else if (hck.name == "Wave Trail Size") { hacks::wave_trail = hck.enabled; }
else if (hck.name == "Random Seed") { hacks::random_seed_enabled = hck.enabled; }
else if (hck.name == "No Death Effect") { hacks::no_death_effect = hck.enabled; }
else if (hck.name == "Show Hitboxes") {
hacks::show_hitboxes = hck.enabled;
auto pl = PlayLayer::get();
Expand Down
9 changes: 4 additions & 5 deletions src/hacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ bool hacks::reset_maket = false;

bool hacks::disable_render = false;

bool hacks::no_death_effect = false;

std::vector<window> hacks::windows = {
{"Core", 10, 10, 200, 200,
{
Expand All @@ -80,11 +82,7 @@ std::vector<window> hacks::windows = {
{"0f 85 ? ? ? ? ba ? ? ? ? ff 15 ? ? ? ? ba", "E9 F3 00"}
}
},
{"No Death Effect", "Upon death, the cube will not emit an exploding effect",
{
{"e8 ? ? ? ? 80 bf ? ? ? ? ? 74 ? 48 8b 9f ? ? ? ? 8b 83", "90 90 90 90 90"}
}
},
{"No Death Effect", "Upon death, the cube will not emit an exploding effect"},
{"Safe Mode", "Disables progress on levels",
{
{"0f 85 ? ? ? ? 40 38 b7 ? ? ? ? 0f 85 ? ? ? ? 0f b6 97", "E9 B4 01 00 00 90"},
Expand Down Expand Up @@ -420,6 +418,7 @@ void hacks::init() {
else if (hck.name == "Wave Trail Size") { hacks::wave_trail = hck.enabled; }
else if (hck.name == "Show Hitboxes") { hacks::show_hitboxes = hck.enabled; }
else if (hck.name == "Random Seed") { hacks::random_seed_enabled = hck.enabled; }
else if (hck.name == "No Death Effect") { hacks::no_death_effect = hck.enabled; }
else {
for (auto& opc : hck.opcodes) {
std::string bytesStr = hck.enabled ? opc.on : opc.off;
Expand Down
2 changes: 2 additions & 0 deletions src/hacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ namespace hacks {

extern bool disable_render;

extern bool no_death_effect;

void update_framerate(float value);

void save(const std::vector<window>& windows, const std::filesystem::path &filename);
Expand Down
8 changes: 8 additions & 0 deletions src/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <Geode/modify/LevelInfoLayer.hpp>
#include <Geode/modify/EndLevelLayer.hpp>
#include <Geode/modify/AchievementNotifier.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include "speedhackAudio.hpp"
#include "labels.hpp"
#include "replayEngine.hpp"
Expand Down Expand Up @@ -662,6 +663,13 @@ class $modify(GameManager) {
}
};

class $modify(PlayerObject) {
void playDeathEffect() {
if (hacks::no_death_effect) return;
PlayerObject::playDeathEffect();
}
};

class $modify(GameStatsManager) {
bool isItemUnlocked(UnlockType p0, int p1) {
if (GameStatsManager::isItemUnlocked(p0, p1))
Expand Down

0 comments on commit 10953fe

Please sign in to comment.