diff --git a/CMakeLists.txt b/CMakeLists.txt index d1d7233..915b7ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,3 +34,8 @@ message("SRC: ${SRC}") include_directories(src) setup_geode_mod(${PROJECT_NAME}) + +#ImGui lol + +CPMAddPackage("gh:matcool/gd-imgui-cocos#fbd4103") +target_link_libraries(${PROJECT_NAME} imgui-cocos) \ No newline at end of file diff --git a/mod.json b/mod.json index 3d678d6..2b99380 100644 --- a/mod.json +++ b/mod.json @@ -89,12 +89,6 @@ "type": "bool", "default": false }, - "Add Objects in Menu Game": { - "name": "Add Objects in Menu Game", - "description": "spikes and pad....", - "type": "bool", - "default": true - }, "Freese Menu Game BG when Platformered": { "name": "Freese Menu Game BG when Platformered", "description": "Freese Menu Game BG when PlatformeredFreese Menu Game BG when PlatformeredFreese Menu Game BG when PlatformeredFreese Menu Game BG when Platformered....", @@ -136,6 +130,12 @@ "type": "bool", "default": true }, + "Boost Rotation Thing": { + "name": "Boost Rotation Thing", + "description": "Boost Rotation ThingBoost Rotation ThingBoost Rotation ThingBoost Rotation ThingBoost Rotation Thing.", + "type": "bool", + "default": true + }, "jelly cube": { "name": "jelly cube", "description": "jelly cube.", diff --git a/resources/sounds/menuLoops/menuLoop_rand Puhf - Forlorn.mp3 b/resources/sounds/menuLoops/menuLoop_rand Puhf - Forlorn.mp3 new file mode 100644 index 0000000..c002db8 Binary files /dev/null and b/resources/sounds/menuLoops/menuLoop_rand Puhf - Forlorn.mp3 differ diff --git a/resources/sounds/menuLoops/menuLoop_rand(asd3).mp3 b/resources/sounds/menuLoops/menuLoop_rand(asd3).mp3 deleted file mode 100644 index cb1cdb1..0000000 Binary files a/resources/sounds/menuLoops/menuLoop_rand(asd3).mp3 and /dev/null differ diff --git a/resources/spritesheets/GJ_GameSheet03/GJ_bigGoldKey_001.png b/resources/spritesheets/GJ_GameSheet03/GJ_bigGoldKey_001.png new file mode 100644 index 0000000..ef5a031 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/GJ_bigGoldKey_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/GJ_bigGoldKey_glow_001.png b/resources/spritesheets/GJ_GameSheet03/GJ_bigGoldKey_glow_001.png new file mode 100644 index 0000000..fb7ac7c Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/GJ_bigGoldKey_glow_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/GJ_sStarsIcon_001.png b/resources/spritesheets/GJ_GameSheet03/GJ_sStarsIcon_001.png index e56e430..776fdf4 100644 Binary files a/resources/spritesheets/GJ_GameSheet03/GJ_sStarsIcon_001.png and b/resources/spritesheets/GJ_GameSheet03/GJ_sStarsIcon_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/GJ_secretLock4_small_001.png b/resources/spritesheets/GJ_GameSheet03/GJ_secretLock4_small_001.png new file mode 100644 index 0000000..bcf9e31 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/GJ_secretLock4_small_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/GJ_starsIcon_001.png b/resources/spritesheets/GJ_GameSheet03/GJ_starsIcon_001.png index 2124a54..c1808da 100644 Binary files a/resources/spritesheets/GJ_GameSheet03/GJ_starsIcon_001.png and b/resources/spritesheets/GJ_GameSheet03/GJ_starsIcon_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_00_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_00_btn_001.png new file mode 100644 index 0000000..1333c1f Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_00_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_01_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_01_btn_001.png new file mode 100644 index 0000000..9e34190 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_01_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_02_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_02_btn_001.png new file mode 100644 index 0000000..bbb6be4 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_02_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_03_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_03_btn_001.png new file mode 100644 index 0000000..e7c3697 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_03_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_04_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_04_btn_001.png new file mode 100644 index 0000000..bfb3c92 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_04_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_05_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_05_btn_001.png new file mode 100644 index 0000000..f2996c0 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_05_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_06_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_06_btn_001.png new file mode 100644 index 0000000..fbd1a1e Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_06_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_07_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_07_btn_001.png new file mode 100644 index 0000000..cc90955 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_07_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_08_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_08_btn_001.png new file mode 100644 index 0000000..834a003 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_08_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_09_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_09_btn_001.png new file mode 100644 index 0000000..b33e9d9 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_09_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_10_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_10_btn_001.png new file mode 100644 index 0000000..a9ed1f2 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_10_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/diffIcon_auto_btn_001.png b/resources/spritesheets/GJ_GameSheet03/diffIcon_auto_btn_001.png new file mode 100644 index 0000000..17e59e0 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/diffIcon_auto_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_00_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_00_btn_001.png new file mode 100644 index 0000000..a1e3dd5 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_00_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_01_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_01_btn_001.png new file mode 100644 index 0000000..3eba24a Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_01_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_02_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_02_btn_001.png new file mode 100644 index 0000000..d0f8d10 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_02_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_03_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_03_btn_001.png new file mode 100644 index 0000000..cf95fc7 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_03_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_04_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_04_btn_001.png new file mode 100644 index 0000000..ce6a7e0 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_04_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_05_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_05_btn_001.png new file mode 100644 index 0000000..f82ef29 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_05_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_06_btn2_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_06_btn2_001.png new file mode 100644 index 0000000..061f59a Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_06_btn2_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_06_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_06_btn_001.png new file mode 100644 index 0000000..a07b1bd Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_06_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_07_btn2_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_07_btn2_001.png new file mode 100644 index 0000000..ef7329c Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_07_btn2_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_07_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_07_btn_001.png new file mode 100644 index 0000000..dc3062d Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_07_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_08_btn2_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_08_btn2_001.png new file mode 100644 index 0000000..92436a0 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_08_btn2_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_08_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_08_btn_001.png new file mode 100644 index 0000000..6130cdf Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_08_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_09_btn2_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_09_btn2_001.png new file mode 100644 index 0000000..a13ee37 Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_09_btn2_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_09_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_09_btn_001.png new file mode 100644 index 0000000..369f9df Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_09_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_10_btn2_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_10_btn2_001.png new file mode 100644 index 0000000..8a71e9c Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_10_btn2_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_10_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_10_btn_001.png new file mode 100644 index 0000000..27c92af Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_10_btn_001.png differ diff --git a/resources/spritesheets/GJ_GameSheet03/difficulty_auto_btn_001.png b/resources/spritesheets/GJ_GameSheet03/difficulty_auto_btn_001.png new file mode 100644 index 0000000..7174deb Binary files /dev/null and b/resources/spritesheets/GJ_GameSheet03/difficulty_auto_btn_001.png differ diff --git a/resources/spritesheets/SecretSheet/GJ_secretLock4_001.png b/resources/spritesheets/SecretSheet/GJ_secretLock4_001.png new file mode 100644 index 0000000..bd2fc82 Binary files /dev/null and b/resources/spritesheets/SecretSheet/GJ_secretLock4_001.png differ diff --git a/resources/spritesheets/SecretSheet/GJ_secretLock4_eyes_001.png b/resources/spritesheets/SecretSheet/GJ_secretLock4_eyes_001.png new file mode 100644 index 0000000..a5df97c Binary files /dev/null and b/resources/spritesheets/SecretSheet/GJ_secretLock4_eyes_001.png differ diff --git a/src/_ImGui.hpp b/src/_ImGui.hpp new file mode 100644 index 0000000..8915215 --- /dev/null +++ b/src/_ImGui.hpp @@ -0,0 +1,103 @@ +#pragma once + +#include +#include + +using namespace cocos2d; + +static std::ostream& operator<<(std::ostream& stream, ImVec2 const& vec) { + return stream << vec.x << ", " << vec.y; +} + +static std::ostream& operator<<(std::ostream& stream, ImVec4 const& vec) { + return stream << vec.x << ", " << vec.y << ", " << vec.z << ", " << vec.w; +} + +static ImVec2 operator+(ImVec2 const& a, ImVec2 const& b) { + return { + a.x + b.x, + a.y + b.y + }; +} + +static ImVec2 operator-(ImVec2 const& a, ImVec2 const& b) { + return { + a.x - b.x, + a.y - b.y + }; +} + +static ImVec2 operator-(ImVec2 const& a) { + return { -a.x, -a.y }; +} + +static ImVec2& operator-=(ImVec2& a, ImVec2 const& b) { + a.x -= b.x; + a.y -= b.y; + return a; +} + +static ImVec2 operator/(ImVec2 const& a, ImVec2 const& b) { + return { + a.x / b.x, + a.y / b.y + }; +} + +static ImVec2 operator/(ImVec2 const& a, int b) { + return { + a.x / b, + a.y / b + }; +} + +static ImVec2 operator/(ImVec2 const& a, float b) { + return { + a.x / b, + a.y / b + }; +} + +static bool operator!=(ImVec2 const& a, ImVec2 const& b) { + return a.x != b.x || a.y != b.y; +} + +static ImVec2 operator*(ImVec2 const& v1, float multi) { + return { v1.x * multi, v1.y * multi }; +} + +static ImVec2 toVec2(CCPoint const& a) { + const auto size = ImGui::GetMainViewport()->Size; + const auto winSize = CCDirector::get()->getWinSize(); + return { + a.x / winSize.width * size.x, + (1.f - a.y / winSize.height) * size.y + }; +} + +static ImVec2 toVec2(CCSize const& a) { + const auto size = ImGui::GetMainViewport()->Size; + const auto winSize = CCDirector::get()->getWinSize(); + return { + a.width / winSize.width * size.x, + -a.height / winSize.height * size.y + }; +} + +static CCPoint toCocos(const ImVec2& pos) { + const auto winSize = CCDirector::sharedDirector()->getWinSize(); + const auto size = ImGui::GetMainViewport()->Size; + return CCPointMake( + pos.x / size.x * winSize.width, + (1.f - pos.y / size.y) * winSize.height + ); +}; + +#include +#include +class $modify(ImGuiInit, CCDirector) { + $override void runWithScene(CCScene * pScene) { + CCDirector::runWithScene(pScene); + ImGuiCocos::get().setup([] {}).draw([] {}); + }; +}; \ No newline at end of file diff --git a/src/_main.cpp b/src/_main.cpp index b1b6e95..6a9a6e8 100644 --- a/src/_main.cpp +++ b/src/_main.cpp @@ -1,7 +1,5 @@ #include "_main.hpp" -#ifdef GEODE_IS_WINDOWS - #include class $modify(UpdateSceneScaleByScreenView, CCNode) { $override void visit() { @@ -24,13 +22,22 @@ class $modify(FLAlertLayerShowupStartPointExt, CCNode) { if (auto casted = typeinfo_cast(this)) { if (casted->m_mainLayer) { if (casted->m_mainLayer->getContentSize().equals(CCDirector::get()->getWinSize())) { - casted->m_mainLayer->setAnchorPoint(getMousePos() / casted->m_mainLayer->getContentSize()); + casted->m_mainLayer->setAnchorPoint(toCocos(ImGui::GetMousePos()) / casted->m_mainLayer->getContentSize()); } }; }; + if (auto casted = typeinfo_cast(this)) { + if (casted->getContentSize().equals(CCDirector::get()->getWinSize())) { + casted->setAnchorPoint(toCocos(ImGui::GetMousePos()) / casted->getContentSize()); + if (SETTING(bool, "Animate Menu Game")) void(); + casted->setScale(1.005f); + } + }; } }; +#ifdef GEODE_IS_WINDOWS + #include class $modify(WindowNameExt, AppDelegate) { $override void applicationWillEnterForeground() { diff --git a/src/_main.hpp b/src/_main.hpp index fd4cb61..015f0ba 100644 --- a/src/_main.hpp +++ b/src/_main.hpp @@ -8,6 +8,7 @@ using namespace geode::prelude; #include #include <_fs.hpp> +#include <_ImGui.hpp> //lol #define SETTING(type, key_name) Mod::get()->getSettingValue(key_name) @@ -29,6 +30,8 @@ template constexpr size_t OFFSET_BY_MEMBER(U T::* member return c.get(reinterpret_cast(v)); \ }(value) +#define LOG_THIS_FILE $execute { log::debug("LOG_THIS_FILE: \n\n{}\n", fs::path(__FILE__).filename().string()); } + namespace geode::cocos { inline std::string frameName(CCNode* node) { if (node == nullptr) return "NIL_NODE"; @@ -103,14 +106,12 @@ namespace geode::utils { static std::mt19937 gen(rd()); return select_randomly(start, end, gen); } - bool rndb(int variants = 2) { + bool rndb(int rarity = 1) { auto varsVec = std::vector(); - auto tempb = true; - auto tempvariants = variants; - while (tempvariants > 0) { - tempb = !tempb; - tempvariants = tempvariants - 1; - varsVec.push_back(tempb); + varsVec.push_back(true); + while (rarity > 0) { + rarity = rarity - 1; + varsVec.push_back(false); } auto rtn = *select_randomly(varsVec.begin(), varsVec.end()); //log::debug("{}({}) = {} of {}", __func__, variants, rtn, varsVec); diff --git a/src/download_mods.hpp b/src/download_mods.hpp index 2b95cca..81157a6 100644 --- a/src/download_mods.hpp +++ b/src/download_mods.hpp @@ -32,7 +32,7 @@ inline void downloadModsFromList(int id = 0, int attempts = 0, bool failed = 0) if (web::WebResponse* res = e->getValue()) { std::string data = res->string().unwrapOr("no res"); if ((res->code() < 399) and (res->code() > 10)) { - res->into(dirs::getModsDir() / filename); + auto save_result = res->into(dirs::getModsDir() / filename); auto msg = fmt::format("{}\n installed! id: {}", filename, id); AchievementNotifier::sharedState()->notifyAchievement( "", msg.data(), "GJ_infoIcon_001.png", 1); diff --git a/src/random_shit/PopupRandomMeme.hpp b/src/random_shit/PopupRandomMeme.hpp index bb0799d..f42314d 100644 --- a/src/random_shit/PopupRandomMeme.hpp +++ b/src/random_shit/PopupRandomMeme.hpp @@ -21,7 +21,7 @@ class $modify(PopupRandomMeme, CCScene) { if (string::contains(res->header("content-type").value_or("asd"), "image")) { //log::info("image"); auto path = getMod()->getTempDir() / ".rand_meme_image"; - res->into(path); + auto save_result = res->into(path); auto sprite = CCSprite::create(path.string().c_str()); CCTextureCache::get()->removeTextureForKey(path.string().c_str()); fs::remove(path, fs::last_err_code); diff --git a/src/random_shit/SoggyPop.hpp b/src/random_shit/SoggyPop.hpp index 6537f97..828ac1b 100644 --- a/src/random_shit/SoggyPop.hpp +++ b/src/random_shit/SoggyPop.hpp @@ -25,7 +25,7 @@ class $modify(PopupSoggyCat, CCMenuItem) { if (SETTING(bool, "soggy cat?")) { if (string::containsAny(this->getID(), { "play-button", "level-button" })) { srand(time(0)); - if ((rand() % 10 < 3)) { + if (rndb(6)) { auto pop = createPopup(); pop->show(); PopupSoggyCat::onClick = [this]() diff --git a/src/random_shit/game_ruinify.hpp b/src/random_shit/game_ruinify.hpp index 78ce639..5634de6 100644 --- a/src/random_shit/game_ruinify.hpp +++ b/src/random_shit/game_ruinify.hpp @@ -19,8 +19,27 @@ class $modify(GJBaseGameLayerExt, GJBaseGameLayer) { if (p2 == 1) player = m_player1;//a if (p2 == 2) player = m_player2;//a - if (p0 == GJGameEvent::NormalJump) //jump - if (SETTING(bool, "jelly cube")) player->animatePlatformerJump(0.9f); + if (SETTING(bool, "jelly cube")) { + + if (p0 == GJGameEvent::NormalJump) player->animatePlatformerJump(1.0f); + + if (p0 == GJGameEvent::PinkOrb) player->animatePlatformerJump(0.950f); + if (p0 == GJGameEvent::YellowOrb) player->animatePlatformerJump(1.0f); + if (p0 == GJGameEvent::RedOrb) player->animatePlatformerJump(1.1f); + if (p0 == GJGameEvent::DropOrb) player->animatePlatformerJump(1.25f); + + if (p0 == GJGameEvent::HitHead) player->animatePlatformerJump(0.7f); + + } + + if (SETTING(bool, "Boost Rotation Thing")) { + + if (p0 == GJGameEvent::PinkOrb) player->addChild(createDataNode("rotate_multiplier_while_flying"), 0, -20); + if (p0 == GJGameEvent::YellowOrb) player->addChild(createDataNode("rotate_multiplier_while_flying"), 0, -20); + if (p0 == GJGameEvent::RedOrb) player->addChild(createDataNode("rotate_multiplier_while_flying"), 0, -20); + if (p0 == GJGameEvent::DropOrb) player->addChild(createDataNode("rotate_multiplier_while_flying"), 0, -20); + + }; } }; @@ -29,20 +48,31 @@ class $modify(GJBaseGameLayerExt, GJBaseGameLayer) { class $modify(PlayerObjectExt, PlayerObject) { $override void switchedToMode(GameObjectType p0) { //log::debug("{}->{}({})", this, __FUNCTION__, (int)p0); + if (p0 == GameObjectType::ShipPortal or p0 == GameObjectType::UfoPortal) { + //if animatePlatformerJump still runnig and sets scale after setup for related mode: + //13 and 14 is action tags i found in animatePlatformerJump this->m_iconSprite->stopActionByTag(13); this->m_iconSprite->stopActionByTag(14); this->m_iconGlow->stopActionByTag(13); this->m_iconGlow->stopActionByTag(14); } + return PlayerObject::switchedToMode(p0); } $override void bumpPlayer(float p0, int p1, bool p2, GameObject * p3) { + if (SETTING(bool, "jelly cube")) this->animatePlatformerJump(p0); + + if (SETTING(bool, "Boost Rotation Thing")) this->addChild( + createDataNode("rotate_multiplier_while_flying"), 0, (p0 + 1.0f) * -10 + ); + PlayerObject::bumpPlayer(p0, p1, p2, p3); } $override void updateRotation(float p0) { - if ((m_isRobot or m_isSpider) and not m_isOnGround) { + + if ((m_isRobot or m_isSpider) and !m_isOnGround) { auto plat = m_isPlatformer; m_isPlatformer = 0; @@ -58,6 +88,7 @@ class $modify(PlayerObjectExt, PlayerObject) { return; }; + if (SETTING(bool, "Break Player Rotations At Plat")) if (m_isPlatformer) { m_isPlatformer = 0; @@ -66,6 +97,13 @@ class $modify(PlayerObjectExt, PlayerObject) { return; }; + + if (auto rotate_multiplier_while_flying = this->getChildByID("rotate_multiplier_while_flying")) { + if ((m_isUpsideDown ? m_yVelocity >= 0 : m_yVelocity <= 0) or m_isOnGround) rotate_multiplier_while_flying->removeFromParent(); + return PlayerObject::updateRotation(p0 * (rotate_multiplier_while_flying->getTag() / 10)); + } + PlayerObject::updateRotation(p0); + } }; diff --git a/src/random_shit/menuitems.hpp b/src/random_shit/menuitems.hpp index dbcfd0a..b2bc08e 100644 --- a/src/random_shit/menuitems.hpp +++ b/src/random_shit/menuitems.hpp @@ -21,7 +21,7 @@ class $modify(CCMenuItemDialogExt, CCMenuItem) { $override void activate() { if (SETTING(bool, "No Button UDare Dialog")) return CCMenuItem::activate(); srand(time(0)); - if ((rand() % 100 > 3) or findDataNode(this, "hasDialog")) { + if (!rndb(12) or findDataNode(this, "hasDialog")) { return CCMenuItem::activate(); } if (auto spriteitem = typeinfo_cast(this)) { diff --git a/src/random_shit/menulayer_ruinify.hpp b/src/random_shit/menulayer_ruinify.hpp index cfe9cf0..84dc768 100644 --- a/src/random_shit/menulayer_ruinify.hpp +++ b/src/random_shit/menulayer_ruinify.hpp @@ -44,7 +44,7 @@ class $modify(MenuGameLayerExt, MenuGameLayer) { //scale this->runAction(CCRepeatForever::create(CCSequence::create( CCEaseSineInOut::create(CCScaleTo::create(10, 1.005)),// o - CCEaseSineInOut::create(CCScaleTo::create(10, 1.000)),// 0 + CCEaseSineInOut::create(CCScaleTo::create(10, 1.010)),// 0 nullptr ))); } diff --git a/src/special_sprites.hpp b/src/special_sprites.hpp index 9bad3e0..f31430a 100644 --- a/src/special_sprites.hpp +++ b/src/special_sprites.hpp @@ -1,8 +1,20 @@ #pragma once #include <_main.hpp> +//LOG_THIS_FILE; #include class $modify(SpecialSprites, CCSprite) { + static void onModify(auto & self) { + auto names = { + "cocos2d::CCSprite::initWithSpriteFrameName", + "cocos2d::CCSprite::initWithFile", + "cocos2d::CCSprite::create", + "cocos2d::CCSprite::createWithSpriteFrameName", + }; + for (auto name : names) if (!self.setHookPriorityPost(name, Priority::First)) { + log::error("Failed to set hook priority for {}.", name); + } + } void pulseOpacitySch(float) { if (auto sprite = typeinfo_cast(this)) { auto fmod = FMODAudioEngine::sharedEngine();