FireMario211 / Prism-Menu

A mod menu made in Geode for Geometry Dash
GNU General Public License v3.0
33 stars 14 forks source link

Add "Suicide" cheat in Player menu #48

Closed tulpenkiste closed 4 months ago

tulpenkiste commented 4 months ago

Adds a boolean option to the player menu to repeatedly kill the player. This works in the main menu where it kills the "player" every frame.

tulpenkiste commented 4 months ago

Just tested your changes, the hack seems to have broken inside the level again due to playLayer->destroyPlayer not working for some reason (playLayer->PlayLayer::destroyPlayer works). Also noticed that I put the code for the suicide hack too late in the update function so heres a diff to fix it:

diff --git a/src/Hacks/Player.cpp b/src/Hacks/Player.cpp
index dfe0bbd..e7ed4e8 100644
--- a/src/Hacks/Player.cpp
+++ b/src/Hacks/Player.cpp
@@ -46,13 +46,14 @@ class $modify(PlayerObject) {
         }

         if (Hacks::isHackEnabled("Instant Complete")) return;
-        if (Hacks::isHackEnabled("Enable Patching") || !Hacks::isHackEnabled("Freeze Player")) return PlayerObject::update(dt);

         // This is here because $modify doesn't want to work
         if (Hacks::isHackEnabled("Suicide") && PlayLayer::get() != nullptr) {
-           auto playLayer = PlayLayer::get(); //shut!
-            playLayer->destroyPlayer(playLayer->m_player1, nullptr);
+            auto playLayer = PlayLayer::get(); //shut!
+            playLayer->PlayLayer::destroyPlayer(playLayer->m_player1, nullptr);
         }
+
+        if (Hacks::isHackEnabled("Enable Patching") || !Hacks::isHackEnabled("Freeze Player")) return PlayerObject::update(dt);
     }
     bool init(int p0, int p1, GJBaseGameLayer *p2, cocos2d::CCLayer *p3, bool p4) {
         if (!PlayerObject::init(p0,p1,p2,p3,p4)) return false;