Compare commits

...

3 Commits

Author SHA1 Message Date
TobyAdd
c692d400a5 changelog 2025-08-07 03:21:41 +03:00
TobyAdd
989b147a6c i am alive 2025-08-07 02:57:30 +03:00
TobyAdd
17caf328d4 general optimizations + additions 2025-08-06 01:55:49 +03:00
13 changed files with 329 additions and 1124 deletions

View File

@@ -1,3 +1,29 @@
# v5.0.0-beta.8
UI Changes:
- Replay Engine window title is now coloured based on the bot's stauts
- Allow scrolling outside window frame in the Android UI (for convenience in "Labels" tab)
Hacks changes:
- Added "Auto Safe Mode"
- Practice Fix is removed due to crashes (needs investigating)
- Fixed Text Length
- Improved Main Levels Bypass
Labels changes:
- Added CBF Status
- Added Rainbow label
- Fixed CPS Counter coloring
- More color tags
- Improved Startpos Switcher label (will be hidden if there are no startposes)
Replay Engine changes:
- Fixed 1 physic frame pre-recording
- Fixed erasing for second player
- Fixed inputs auto-releasing
Replay Engine Note:
- Engine v3 may be discontinued, as it uses outdated and non-optimized algorithms from the 2.1 era. It may be replaced by Engine Lite, which will be more modernized and potentially standalone (though that's still under consideration)
# v5.0.0-beta.7
- Layout Mode fix (breaks decor levels in the editor)
- Improved vertical flip algorithm for android recorder

View File

@@ -1,5 +1,5 @@
{
"geode": "4.4.0",
"geode": "4.6.3",
"gd": {
"win": "2.2074",
"android": "2.2074",
@@ -8,7 +8,7 @@
},
"id": "tobyadd.gdh",
"name": "GDH",
"version": "v5.0.0-beta.7",
"version": "v5.0.0-beta.8",
"developer": "TobyAdd",
"description": "GDH is an open-source Geometry Dash mod menu that aims to improve the game's performance and add new features",
"early-load": true,

View File

@@ -199,10 +199,28 @@ void Gui::Render() {
stretchedWindows.push_back(windowName);
}
auto& engine = ReplayEngine::get();
bool re_needRecolor = (windowName == "Replay Engine") && (engine.mode != state::disable);
if (re_needRecolor) {
ImGui::PushStyleColor(ImGuiCol_Text, ImColor(0, 0, 0).Value);
if (engine.mode == state::record) {
ImGui::PushStyleColor(ImGuiCol_TitleBg, ImColor(255, 128, 128).Value);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, ImColor(255, 128, 128).Value);
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, ImColor(255, 128, 128).Value);
}
else {
ImGui::PushStyleColor(ImGuiCol_TitleBg, ImColor(34, 177, 76).Value);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, ImColor(34, 177, 76).Value);
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, ImColor(34, 177, 76).Value);
}
}
ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[2]);
ImGui::Begin(windowName.c_str(), 0, ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_NoNavInputs);
ImGui::PopFont();
if (re_needRecolor) ImGui::PopStyleColor(4);
if (!ImGui::IsWindowCollapsed()) {
auto size = ImGui::GetWindowSize();
auto pos = ImGui::GetWindowPos();
@@ -216,7 +234,7 @@ void Gui::Render() {
ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[0]);
if (windowName == "GDH Settings") {
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::InputTextWithHint("##Search", "Search:", &search_text);
@@ -534,7 +552,6 @@ void Gui::Render() {
ImGui::PopStyleColor();
}
else {
auto& engine = ReplayEngine::get();
static std::vector<std::filesystem::path> replay_list;
if (ImGui::BeginPopupModal("Select Replay", 0, ImGuiWindowFlags_NoResize)) {
@@ -695,9 +712,9 @@ void Gui::Render() {
ImGuiH::Checkbox("Rotation Fix", &engine.rotation_fix, m_scale);
}
bool practice_fix = config.get<bool>("practice_fix", false);
if (ImGuiH::Checkbox("Practice Fix", &practice_fix, m_scale))
config.set<bool>("practice_fix", practice_fix);
// bool practice_fix = config.get<bool>("practice_fix", false);
// if (ImGuiH::Checkbox("Practice Fix", &practice_fix, m_scale))
// config.set<bool>("practice_fix", practice_fix);
ImGui::EndTabItem();
}
@@ -1613,7 +1630,9 @@ void Gui::Render() {
"Startpos Switcher",
"Testmode",
"Replay Engine State",
"Custom Text",
"CBF Status",
"Rainbow Text",
"Custom Text"
};
int label_types_count = sizeof(label_types)/sizeof(label_types[0]);
@@ -1639,9 +1658,11 @@ void Gui::Render() {
else if (selected_label_type == 8) text = "{levelName}{byLevelCreator} ({levelId})";
else if (selected_label_type == 9) text = "ColoredDeath({noclipAccuracy})";
else if (selected_label_type == 10) text = "ColoredDeath({deaths} Deaths)";
else if (selected_label_type == 11) text = "{startposCurrentIDX}/{startposAllIDX}";
else if (selected_label_type == 11) text = "showIfStartposesExist({startposCurrentIDX}/{startposAllIDX})";
else if (selected_label_type == 12) text = "{testmode}";
else if (selected_label_type == 13) text = "{re_state}";
else if (selected_label_type == 14) text = "CBF: {cbf_enabled}";
else if (selected_label_type == 15) text = "<rb>Rainbow text!!<rb/>";
Label l((LabelCorner) (selected_label_corner+1), text);
labels.add(l);

View File

@@ -129,7 +129,7 @@ bool HacksTab::init() {
setPosition({0, 0});
m_scrollLayer = ScrollLayer::create({325.f, 210.f});
m_scrollLayer = ScrollLayer::create({450.f, 210.f});
m_scrollLayer->m_contentLayer->setLayout(
geode::ColumnLayout::create()
->setAutoScale(false)

View File

@@ -33,7 +33,7 @@ void Hacks::Init() {
},
{"Bypass", 10, 250, 200, 250,
{
{"Text Length", "Removes the text input limit", "text_lenght"}, // +
{"Text Length", "Removes the text input limit", "text_length"}, // +
{"Slider Limit", "Removes the limit on sliding beyond set limits", "slider_limit"}, // +
{"Character Filter", "Lets you input any character in all text inputs", "char_filter"}, // +
{"Checkpoint Limit", "Removes the limit that deletes previous checkpoints after the 50th checkpoint", "checkpoint_limit"}, // +
@@ -48,6 +48,7 @@ void Hacks::Init() {
{"Accurate Percentage", "Shows decimals in level progress", "accurate_percentage", "0126"}, // +
{"Auto Pickup Coins", "Collects all coins in the level", "auto_pickup_coins"}, // +
{"Auto Practice Mode", "Auto-enables practice mode", "auto_practice_mode"}, // +
{"Auto Safe Mode", "Disables progression if cheating modules are detected", "auto_safe_mode"}, // +
{"Auto Song Download", "Automatic downloading of song when you enter an online level", "auto_song_download"}, // +
#ifdef GEODE_IS_WINDOWS
{"Auto Deafen", "Deafens user in Discord after a certain %", "auto_deafen"}, // +
@@ -95,7 +96,7 @@ void Hacks::Init() {
{"No Pulse", "Disables pulsation of falls, orbs, etc", "no_pulse"}, // +
{"Pause On Complete", "Lets you pause during the level complete animation", "pause_during_complete"}, // +
{"Pitch Shifter", "Shifts the pitch of background music", "pitch_shifter"}, // +
{"Practice Fix", "More accurate respawning in practice mode (used for botting)", "practice_fix"},
// {"Practice Fix", "More accurate respawning in practice mode (used for botting)", "practice_fix"},
{"Pulse Size", "Changes pulsation of falls, orbs, etc", "pulse_size"}, // +
#ifdef GEODE_IS_ANDROID
{"Uncomplete Level", "Resets level completion statistics (it's just a button, it doesn't depend on on/off switch)", "uncomplete_level"}, // +
@@ -952,8 +953,9 @@ void Hacks::loadKeybinds() {
cheat_state Hacks::cheatingCheck() {
auto& config = Config::get();
auto& engine = ReplayEngine::get();
if (config.get<bool>("safe_mode", false))
bool auto_safe_mode = (Config::get().get<bool>("auto_safe_mode", false) && preCheatState != cheat_state::legit);
if (config.get<bool>("safe_mode", false) || auto_safe_mode)
return cheat_state::safe_mode;
if (config.get<bool>("noclip", false) ||
@@ -974,15 +976,82 @@ cheat_state Hacks::cheatingCheck() {
{
return cheat_state::cheating;
}
else if (config.get<bool>("no_particles", false) ||
(config.get<bool>("wave_trail_size", false) && config.get<float>("wave_trail_size_value", 1.f) < 0.5f))
{
return cheat_state::unwanted;
}
// else if (config.get<bool>("no_particles", false) ||
// (config.get<bool>("wave_trail_size", false) && config.get<float>("wave_trail_size_value", 1.f) < 0.5f))
// {
// return cheat_state::unwanted;
// }
return cheat_state::legit;
}
std::string Hacks::getCheatModulesAndState() {
auto& config = Config::get();
auto& engine = ReplayEngine::get();
std::ostringstream result;
std::vector<std::string> enabledModules;
bool safeMode = config.get<bool>("safe_mode", false);
bool autoSafeMode = config.get<bool>("auto_safe_mode", false) && preCheatState == cheat_state::cheating;
bool isInSafeMode = safeMode || autoSafeMode;
if (safeMode) enabledModules.push_back("safe_mode");
if (autoSafeMode) enabledModules.push_back("auto_safe_mode");
if (config.get<bool>("noclip", false)) enabledModules.push_back("noclip");
if (config.get<bool>("auto_pickup_coins", false)) enabledModules.push_back("auto_pickup_coins");
if (config.get<bool>("instant_complete", false)) enabledModules.push_back("instant_complete");
if (config.get<bool>("jump_hack", false)) enabledModules.push_back("jump_hack");
if (config.get<bool>("layout_mode", false)) enabledModules.push_back("layout_mode");
if (config.get<bool>("spambot_enabled", false)) enabledModules.push_back("spambot_enabled");
if (config.get<bool>("show_hitboxes", false) && !config.get<bool>("show_hitboxes::on_death", false))
enabledModules.push_back("show_hitboxes");
if (config.get<bool>("straight_fly_bot", false)) enabledModules.push_back("straight_fly_bot");
if (config.get<bool>("no_camera_move", false)) enabledModules.push_back("no_camera_move");
if (config.get<bool>("no_camera_zoom", false)) enabledModules.push_back("no_camera_zoom");
if (config.get<bool>("no_shaders", false)) enabledModules.push_back("no_shaders");
if (config.get<bool>("no_mirror_portal", false)) enabledModules.push_back("no_mirror_portal");
if (config.get<bool>("tps_enabled", false)) enabledModules.push_back("tps_enabled");
if (config.get<bool>("speedhack_enabled", false) && config.get<float>("speedhack_value", 1.f) != 1.f)
enabledModules.push_back("speedhack_enabled");
if (engine.mode == state::record) enabledModules.push_back("replay_record");
if (engine.mode == state::play) enabledModules.push_back("replay_play");
if (!enabledModules.empty()) {
result << "Enabled Modules: ";
for (size_t i = 0; i < enabledModules.size(); ++i) {
result << enabledModules[i];
if (i != enabledModules.size() - 1)
result << ", ";
}
result << "\n";
} else {
result << "Enabled Modules: none\n";
}
cheat_state finalState = cheat_state::legit;
if (isInSafeMode) {
finalState = cheat_state::safe_mode;
} else if (!enabledModules.empty()) {
finalState = cheat_state::cheating;
}
if (!isInSafeMode && preCheatState == cheat_state::cheating && finalState == cheat_state::legit) {
finalState = cheat_state::cheating;
}
switch (finalState) {
case cheat_state::safe_mode: result << "Cheat Status: safe_mode"; break;
case cheat_state::cheating: result << "Cheat Status: cheating"; break;
case cheat_state::unwanted: result << "Cheat Status: unwanted"; break;
case cheat_state::legit: result << "Cheat Status: legit"; break;
}
return result.str();
}
void Hacks::toggleKeybinds(int key) {
#ifdef GEODE_IS_WINDOWS
auto& config = Config::get();

View File

@@ -57,6 +57,7 @@ public:
cheat_state preCheatState = cheat_state::legit;
cheat_state cheatState = cheat_state::legit;
cheat_state cheatingCheck();
std::string getCheatModulesAndState();
private:
Hacks() = default;

View File

@@ -2,6 +2,7 @@
#include <Geode/modify/CCScheduler.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/GameStatsManager.hpp>
#include <Geode/modify/GameLevelManager.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include <Geode/modify/CCTextInputNode.hpp>
#include <Geode/modify/LevelPage.hpp>
@@ -111,6 +112,11 @@ void hooksH::switchStartPos(int incBy, bool direction) {
}
}
bool hooksH::startposExist() {
auto& config = Config::get();
return !startPositions.empty() && config.get<bool>("startpos_switcher", false);
}
void setupStartPos(StartPosObject* startPos) {
LevelSettingsObject* startPosSettings = startPos->m_startSettings;
LevelSettingsObject* levelSettings = PlayLayer::get()->m_levelSettings;
@@ -190,7 +196,7 @@ void calculateFPS() {
Labels::get().fps = 1.f / avgTime;
}
float color_dt = 0.f;
float hooksH::color_dt = 0.f;
float left_over = 0.f;
class $modify(MyCCScheduler, cocos2d::CCScheduler) {
@@ -322,7 +328,7 @@ class $modify(MyPlayLayer, PlayLayer) {
hooksH::selectedStartpos = -1;
playerTrail1.clear();
playerTrail2.clear();
color_dt = 0.f;
hooksH::color_dt = 0.f;
}
};
@@ -610,7 +616,8 @@ class $modify(MyPlayLayer, PlayLayer) {
: true;
if (shouldDestroy) {
if (Config::get().get<bool>("safe_mode", false)) {
bool auto_safe_mode = (Config::get().get<bool>("auto_safe_mode", false) && Hacks::get().preCheatState != cheat_state::legit);
if (Config::get().get<bool>("safe_mode", false) || auto_safe_mode) {
m_isTestMode = true;
}
PlayLayer::destroyPlayer(player, obj);
@@ -655,6 +662,7 @@ class $modify(MyPlayLayer, PlayLayer) {
// m_replayRandSeed = config.get<int>("random_seed_value", 1337);
// }
Labels::get().push = false;
PlayLayer::resetLevel();
if (config.get<bool>("tps_enabled", false)) {
@@ -689,7 +697,8 @@ class $modify(MyPlayLayer, PlayLayer) {
if (config.get<bool>("show_total_attempts", false) && m_attemptLabel)
m_attemptLabel->setCString(fmt::format("Attempt {}", static_cast<int>(m_level->m_attempts)).c_str());
if (config.get<bool>("safe_mode", false))
bool auto_safe_mode = (Config::get().get<bool>("auto_safe_mode", false) && Hacks::get().preCheatState != cheat_state::legit);
if (config.get<bool>("safe_mode", false) || auto_safe_mode)
m_level->m_attempts = m_level->m_attempts - 1;
if (config.get<bool>("auto_pickup_coins", false)) {
@@ -719,7 +728,8 @@ class $modify(MyPlayLayer, PlayLayer) {
auto& config = Config::get();
bool testmode = m_isTestMode;
if (config.get<bool>("safe_mode", false))
bool auto_safe_mode = (Config::get().get<bool>("auto_safe_mode", false) && Hacks::get().preCheatState != cheat_state::legit);
if (config.get<bool>("safe_mode", false) || auto_safe_mode)
m_isTestMode = true;
PlayLayer::levelComplete();
@@ -934,6 +944,20 @@ class $modify(MyEndLevelLayer, EndLevelLayer) {
createIndicator(-164.f, hacks.cheatState);
createIndicator(-148.f, hacks.preCheatState);
auto menu = cocos2d::CCMenu::create();
menu->setID("cheat_indicator_button");
menu->setPosition({0, 0});
m_mainLayer->addChild(menu);
auto cheatInfo = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
cheatInfo->setScale(0.8f);
std::string cheatInfoState = hacks.getCheatModulesAndState();
auto cheatInfoClick = geode::cocos::CCMenuItemExt::createSpriteExtra(cheatInfo, [cheatInfoState](CCMenuItemSpriteExtra* sender) {
FLAlertLayer::create("Cheating info", cheatInfoState.c_str(), "OK")->show();
});
cheatInfoClick->setPosition(win_size.width / 2 + 181, win_size.height / 2 + 127);
menu->addChild(cheatInfoClick);
}
if (recorder.is_recording && recorder.fade_out) {
@@ -1035,12 +1059,11 @@ class $modify(MyGJBaseGameLayer, GJBaseGameLayer) {
if (!engine.engine_v2)
engine.handle_update(this);
hooksH::color_dt += dt * config.get<float>("rgb_icons::speed", 0.20f);
if (config.get<bool>("rgb_icons", false)) {
color_dt += dt * config.get<float>("rgb_icons::speed", 0.20f);
auto& rgb_colors = RGBIcons::get();
auto color1 = rgb_colors.interpolateColor(color_dt);
auto color2 = rgb_colors.interpolateColor(color_dt, true);
auto color1 = rgb_colors.interpolateColor(hooksH::color_dt);
auto color2 = rgb_colors.interpolateColor(hooksH::color_dt, true);
bool player_p1 = config.get<bool>("rgb_icons::player_p1", true);
bool player_p2 = config.get<bool>("rgb_icons::player_p2", true);
@@ -1311,7 +1334,8 @@ class $modify(MyPlayerObject, PlayerObject) {
}
void incrementJumps() {
if (Config::get().get<bool>("safe_mode", false)) return;
bool auto_safe_mode = (Config::get().get<bool>("auto_safe_mode", false) && Hacks::get().preCheatState != cheat_state::legit);
if (Config::get().get<bool>("safe_mode", false) || auto_safe_mode) return;
PlayerObject::incrementJumps();
}
@@ -1330,17 +1354,17 @@ class $modify(MyPlayerObject, PlayerObject) {
auto& config = Config::get();
auto gm = GameManager::get();
bool gv0096 = m_gv0096;
bool switchWaveTrailColor = m_switchWaveTrailColor;
auto playerColor = gm->m_playerColor;
if (config.get<bool>("solid_wave_trail", false)) {
gv0096 = false;
m_switchWaveTrailColor = false;
gm->m_playerColor = 15;
}
PlayerObject::setupStreak();
m_gv0096 = gv0096;
m_switchWaveTrailColor = switchWaveTrailColor;
gm->m_playerColor = playerColor;
}
};
@@ -1358,18 +1382,6 @@ class $modify(MyCCTextInputNode, CCTextInputNode){
}
};
class $modify(MyLevelPage, LevelPage) {
void onPlay(cocos2d::CCObject* sender) {
auto coins = m_level->m_requiredCoins;
if (Config::get().get<bool>("main_levels", false)) m_level->m_requiredCoins = 0;
LevelPage::onPlay(sender);
m_level->m_requiredCoins = coins;
}
};
class $modify(MyGameManager, GameManager) {
bool getUGV(char const* p0) {
if (GameManager::getUGV(p0))
@@ -1530,7 +1542,9 @@ class $modify(MyPauseLayer, PauseLayer) {
PlayLayer::get()->m_level->m_levelType = GJLevelType::Editor;
PauseLayer::customSetup();
engine.auto_button_release();
if (engine.mode == state::record)
engine.remove_actions(engine.get_frame());
PlayLayer::get()->m_level->m_levelType = levelType;
@@ -1974,6 +1988,17 @@ class $modify(MyRewardUnlockLayer, RewardUnlockLayer) {
}
};
class $modify(MyGameLevelManager, GameLevelManager) {
GJGameLevel* getMainLevel(int levelID, bool dontGetLevelString) {
auto& config = Config::get();
auto level = GameLevelManager::getMainLevel(levelID, dontGetLevelString);
if (level->m_requiredCoins > 0 && config.get<bool>("main_levels", false)) {
level->m_requiredCoins = 0;
}
return level;
}
};
class $modify(MyLevelAreaInnerLayer, LevelAreaInnerLayer) {
bool init(bool returning) {
auto& config = Config::get();

View File

@@ -1,7 +1,9 @@
#pragma once
namespace hooksH {
extern float color_dt;
extern int selectedStartpos;
extern std::vector<StartPosObject*> startPositions;
void switchStartPos(int incBy, bool direction = true);
bool startposExist();
}

View File

@@ -62,7 +62,11 @@ std::string Label::get_text() {
result = replace_all(result, "{cheat_indicator}", fmt::format("{}+{}",
(hacks.cheatState == legit) ? "<cg>" : (hacks.cheatState == unwanted) ? "<co>" : (hacks.cheatState == safe_mode) ? "<cy>" : (hacks.cheatState == cheating) ? "<cr>" : "",
(hacks.cheatState == legit) ? "<cg/>" : (hacks.cheatState == unwanted) ? "<co/>" : (hacks.cheatState == safe_mode) ? "<cy/>" : (hacks.cheatState == cheating) ? "<cr/>" : ""));
result = replace_all(result, "{re_state}", engine.mode == state::disable ? "Disable" : engine.mode == state::record ? "Record" : "Play");
result = replace_all(result, "{re_state}", engine.mode == state::disable ? "<co>Disable<co/>" : engine.mode == state::record ? "<cr>Record<cr/>" : "<cg>Play<cg/>");
static geode::Mod* cbfMod = geode::Loader::get()->getLoadedMod("syzzi.click_between_frames");
static bool hasCBF = cbfMod != nullptr && cbfMod->isEnabled();
result = replace_all(result, "{cbf_enabled}", hasCBF ? "<cg>Enabled<cg/>" : "<cr>Disabled<cr/>");
result = replace_all(result, "{\\n}", "\n");
return result;
@@ -180,13 +184,27 @@ void Labels::setStringColored(cocos2d::CCLabelBMFont* label, std::string format_
const cocos2d::ccColor3B defaultColor = {255, 255, 255};
cocos2d::ccColor3B currentColor = defaultColor;
size_t index = 0;
cocos2d::ccColor3B rainbowColor = RGBIcons::get().interpolateColor(hooksH::color_dt);
const std::unordered_map<std::string, cocos2d::ccColor3B> tagColors = {
{"cr", {255, 0, 128}},
{"cg", {0, 255, 0}},
{"co", {255, 106, 0}},
{"cy", {255, 242, 0}}
};
{"cr", {255, 0, 64}}, // Red
{"cg", {0, 255, 0}}, // Green
{"co", {255, 106, 0}}, // Orange
{"cy", {255, 242, 0}}, // Yellow
{"cb", {0, 128, 255}}, // Blue
{"cp", {170, 0, 255}}, // Purple
{"cw", {255, 255, 255}}, // White
{"ck", {0, 0, 0}}, // Black
{"cm", {255, 0, 255}}, // Magenta
{"cc", {0, 255, 255}}, // Cyan
{"cs", {192, 192, 192}}, // Silver
{"cl", {128, 0, 255}}, // Lavender
{"cn", {255, 192, 203}}, // Pink
{"ca", {255, 215, 0}}, // Amber/Gold
{"cd", {139, 69, 19}}, // Brown
{"rb", {rainbowColor.r, rainbowColor.g, rainbowColor.b}}
};
for (size_t i = 0; i < format_text.size(); i++) {
if (format_text[i] == '<' && i + 2 < format_text.size()) {
@@ -236,31 +254,46 @@ void Labels::setStringColored(cocos2d::CCLabelBMFont* label, std::string format_
std::string Labels::processSpecialText(std::string text) {
const std::string cpsTag = "ColoredCPS(";
size_t start = text.find(cpsTag);
if (start != std::string::npos) {
const std::string deathTag = "ColoredDeath(";
const std::string startposTag = "showIfStartposesExist(";
size_t start = 0;
while ((start = text.find(startposTag, start)) != std::string::npos) {
size_t contentStart = start + startposTag.length();
size_t end = text.find(')', contentStart);
if (end == std::string::npos) break;
std::string content = text.substr(contentStart, end - contentStart);
std::string replacement = hooksH::startposExist() ? content : "";
text.replace(start, end - start + 1, replacement);
start += replacement.length();
}
start = 0;
while ((start = text.find(cpsTag, start)) != std::string::npos) {
size_t contentStart = start + cpsTag.length();
size_t end = text.find(')', contentStart);
if (end != std::string::npos) {
std::string content = text.substr(contentStart, end - contentStart);
std::string replacement = push ? "<cg>" + content + "<cg/>" : content;
text.replace(start, end - start + 1, replacement);
}
if (end == std::string::npos) break;
std::string content = text.substr(contentStart, end - contentStart);
std::string replacement = push ? "<cg>" + content + "<cg/>" : content;
text.replace(start, end - start + 1, replacement);
start += replacement.length();
}
const std::string deathTag = "ColoredDeath(";
start = text.find(deathTag);
if (start != std::string::npos) {
start = 0;
while ((start = text.find(deathTag, start)) != std::string::npos) {
size_t contentStart = start + deathTag.length();
size_t end = text.find(')', contentStart);
if (end != std::string::npos) {
std::string content = text.substr(contentStart, end - contentStart);
std::string replacement = NoclipAccuracy::get().prevDied ? "<cr>" + content + "<cr/>" : content;
text.replace(start, end - start + 1, replacement);
}
if (end == std::string::npos) break;
std::string content = text.substr(contentStart, end - contentStart);
std::string replacement = NoclipAccuracy::get().prevDied ? "<cr>" + content + "<cr/>" : content;
text.replace(start, end - start + 1, replacement);
start += replacement.length();
}
return text;
}
@@ -416,7 +449,7 @@ LabelsCreateLayer* LabelsCreateLayer::create(geode::ScrollLayer* scrollLayer) {
bool LabelsCreateLayer::setup() {
std::array<std::string, 6> corners = {"Top Left", "Top Right", "Top", "Bottom Left", "Bottom Right", "Bottom"};
std::array<std::string, 14> label_types = {"Time (24H)", "Time (12H)", "Session Time", "Cheat Indicator", "FPS Counter", "Level Progress", "Attempt", "CPS Counter", "Level Info", "Noclip Accuracy", "Death Counter", "Testmode", "Replay Engine State", "Custom Text"};
std::array<std::string, 16> label_types = {"Time (24H)", "Time (12H)", "Session Time", "Cheat Indicator", "FPS Counter", "Level Progress", "Attempt", "CPS Counter", "Level Info", "Noclip Accuracy", "Death Counter", "Testmode", "Replay Engine State", "CBF Status", "Rainbow Text", "Custom Text"};
this->setTitle("Add Label");
@@ -465,7 +498,9 @@ bool LabelsCreateLayer::setup() {
else if (m_labelTypeIndex == 10) text = "ColoredDeath({deaths} Deaths)";
else if (m_labelTypeIndex == 11) text = "{testmode}";
else if (m_labelTypeIndex == 12) text = "{re_status}";
else if (m_labelTypeIndex == 12) text = "here your text";
else if (m_labelTypeIndex == 13) text = "CBF: {cbf_status}";
else if (m_labelTypeIndex == 14) text = "<rb>Rainbow text!!<rb/>";
else if (m_labelTypeIndex == 15) text = "here your text";
auto& labels = Labels::get();
Label l((LabelCorner) (m_toggleIndex), text);

View File

@@ -1,79 +0,0 @@
#include "practiceFix.hpp"
#include "replayEngine.hpp"
#include "config.hpp"
#include <Geode/modify/PlayLayer.hpp>
class $modify(PlayLayer) {
struct Fields {
std::unordered_map<CheckpointObject*, std::pair<checkpoint_data, checkpoint_data>> checkpoints; // checkpoint_p1, checkpoint_p2
};
void resetLevel() {
auto fields = m_fields.self();
if (!m_checkpointArray->count())
fields->checkpoints.clear();
PlayLayer::resetLevel();
}
void loadFromCheckpoint(CheckpointObject* checkpoint) {
auto& config = Config::get();
auto& engine = ReplayEngine::get();
bool practiceFixEnabled = config.get<bool>("practice_fix", false) || engine.mode == state::record;
if (practiceFixEnabled) {
auto fields = m_fields.self();
if (fields->checkpoints.contains(checkpoint)) {
PlayLayer::loadFromCheckpoint(checkpoint);
auto& [checkpoint_p1, checkpoint_p2] = fields->checkpoints[checkpoint];
checkpoint_p1.apply(m_player1);
if (m_gameState.m_isDualMode)
checkpoint_p2.apply(m_player2);
return;
}
}
PlayLayer::loadFromCheckpoint(checkpoint);
}
CheckpointObject* createCheckpoint() {
auto& config = Config::get();
auto& engine = ReplayEngine::get();
auto checkpoint = PlayLayer::createCheckpoint();
bool practiceFixEnabled = config.get<bool>("practice_fix", false) || engine.mode == state::record;
if (!checkpoint || !practiceFixEnabled)
return checkpoint;
if (m_gameState.m_currentProgress > 0) {
checkpoint_data checkpoint_p1(m_player1);
checkpoint_data checkpoint_p2;
if (m_gameState.m_isDualMode)
checkpoint_p2 = checkpoint_data(m_player2);
auto fields = m_fields.self();
auto pair = std::make_pair(std::move(checkpoint_p1), std::move(checkpoint_p2));
m_fields->checkpoints[checkpoint] = std::move(pair);
}
return checkpoint;
}
void removeCheckpoint(bool first) {
if (!m_checkpointArray->count()) {
PlayLayer::removeCheckpoint(first);
return;
}
auto* checkpoint = static_cast<CheckpointObject*>(
first ? m_checkpointArray->objectAtIndex(0) : m_checkpointArray->lastObject()
);
auto fields = m_fields.self();
m_fields->checkpoints.erase(checkpoint);
PlayLayer::removeCheckpoint(first);
}
};

View File

@@ -1,924 +0,0 @@
#include <Geode/Geode.hpp>
#include "labels.hpp"
class checkpoint_data {
public:
checkpoint_data() = default;
checkpoint_data(PlayerObject* player) {
// cocos2d::CCNode* m_mainLayer;
m_wasTeleported = player->m_wasTeleported;
m_fixGravityBug = player->m_fixGravityBug;
m_reverseSync = player->m_reverseSync;
m_yVelocityBeforeSlope = player->m_yVelocityBeforeSlope;
m_dashX = player->m_dashX;
m_dashY = player->m_dashY;
m_dashAngle = player->m_dashAngle;
m_dashStartTime = player->m_dashStartTime;
// m_dashRing = player->// m_dashRing;
m_slopeStartTime = player->m_slopeStartTime;
m_justPlacedStreak = player->m_justPlacedStreak;
m_maybeLastGroundObject = player->m_maybeLastGroundObject;
// m_collisionLogTop = player->// m_collisionLogTop;
// m_collisionLogBottom = player->// m_collisionLogBottom;
// m_collisionLogLeft = player->// m_collisionLogLeft;
// m_collisionLogRight = player->// m_collisionLogRight;
m_lastCollisionBottom = player->m_lastCollisionBottom;
m_lastCollisionTop = player->m_lastCollisionTop;
m_lastCollisionLeft = player->m_lastCollisionLeft;
m_lastCollisionRight = player->m_lastCollisionRight;
m_unk50C = player->m_unk50C;
m_unk510 = player->m_unk510;
m_currentSlope2 = player->m_currentSlope2;
m_preLastGroundObject = player->m_preLastGroundObject;
m_slopeAngle = player->m_slopeAngle;
m_slopeSlidingMaybeRotated = player->m_slopeSlidingMaybeRotated;
m_quickCheckpointMode = player->m_quickCheckpointMode;
m_collidedObject = player->m_collidedObject;
m_lastGroundObject = player->m_lastGroundObject;
m_collidingWithLeft = player->m_collidingWithLeft;
m_collidingWithRight = player->m_collidingWithRight;
m_maybeSavedPlayerFrame = player->m_maybeSavedPlayerFrame;
m_scaleXRelated2 = player->m_scaleXRelated2;
m_groundYVelocity = player->m_groundYVelocity;
m_yVelocityRelated = player->m_yVelocityRelated;
m_scaleXRelated3 = player->m_scaleXRelated3;
m_scaleXRelated4 = player->m_scaleXRelated4;
m_scaleXRelated5 = player->m_scaleXRelated5;
m_isCollidingWithSlope = player->m_isCollidingWithSlope;
// m_dashFireSprite = player->// m_dashFireSprite;
m_isBallRotating = player->m_isBallRotating;
m_unk669 = player->m_unk669;
m_currentSlope3 = player->m_currentSlope3;
m_currentSlope = player->m_currentSlope;
unk_584 = player->unk_584;
m_collidingWithSlopeId = player->m_collidingWithSlopeId;
// m_slopeFlipGravityRelated = player->// m_slopeFlipGravityRelated;
m_particleSystems = player->m_particleSystems;
m_slopeAngleRadians = player->m_slopeAngleRadians;
// m_rotateObjectsRelated = player->// m_rotateObjectsRelated;
// m_maybeRotatedObjectsMap = player->// m_maybeRotatedObjectsMap;
m_rotationSpeed = player->m_rotationSpeed;
m_rotateSpeed = player->m_rotateSpeed;
m_isRotating = player->m_isRotating;
m_isBallRotating2 = player->m_isBallRotating2;
m_hasGlow = player->m_hasGlow;
m_isHidden = player->m_isHidden;
m_ghostType = player->m_ghostType;
// m_ghostTrail = player->// m_ghostTrail;
// m_iconSprite = player->// m_iconSprite;
// m_iconSpriteSecondary = player->// m_iconSpriteSecondary;
// m_iconSpriteWhitener = player->// m_iconSpriteWhitener;
// m_iconGlow = player->// m_iconGlow;
// m_vehicleSprite = player->// m_vehicleSprite;
// m_vehicleSpriteSecondary = player->// m_vehicleSpriteSecondary;
// m_birdVehicle = player->// m_birdVehicle;
// m_vehicleSpriteWhitener = player->// m_vehicleSpriteWhitener;
// m_vehicleGlow = player->// m_vehicleGlow;
// m_swingFireMiddle = player->// m_swingFireMiddle;
// m_swingFireBottom = player->// m_swingFireBottom;
// m_swingFireTop = player->// m_swingFireTop;
// m_dashSpritesContainer = player->// m_dashSpritesContainer;
// m_regularTrail = player->// m_regularTrail;
// m_shipStreak = player->// m_shipStreak;
// m_waveTrail = player->// m_waveTrail;
m_speedMultiplier = player->m_speedMultiplier;
m_yStart = player->m_yStart;
m_gravity = player->m_gravity;
m_trailingParticleLife = player->m_trailingParticleLife;
m_unk648 = player->m_unk648;
m_gameModeChangedTime = player->m_gameModeChangedTime;
m_padRingRelated = player->m_padRingRelated;
m_maybeReducedEffects = player->m_maybeReducedEffects;
m_maybeIsFalling = player->m_maybeIsFalling;
m_shouldTryPlacingCheckpoint = player->m_shouldTryPlacingCheckpoint;
m_playEffects = player->m_playEffects;
m_maybeCanRunIntoBlocks = player->m_maybeCanRunIntoBlocks;
m_hasGroundParticles = player->m_hasGroundParticles;
m_hasShipParticles = player->m_hasShipParticles;
m_isOnGround3 = player->m_isOnGround3;
m_checkpointTimeout = player->m_checkpointTimeout;
m_lastCheckpointTime = player->m_lastCheckpointTime;
m_lastJumpTime = player->m_lastJumpTime;
m_lastFlipTime = player->m_lastFlipTime;
m_flashTime = player->m_flashTime;
m_flashRelated = player->m_flashRelated;
m_flashRelated1 = player->m_flashRelated1;
m_colorRelated2 = player->m_colorRelated2;
m_flashRelated3 = player->m_flashRelated3;
m_lastSpiderFlipTime = player->m_lastSpiderFlipTime;
m_unkBool5 = player->m_unkBool5;
m_maybeIsVehicleGlowing = player->m_maybeIsVehicleGlowing;
m_gv0096 = player->m_gv0096;
m_gv0100 = player->m_gv0100;
m_accelerationOrSpeed = player->m_accelerationOrSpeed;
m_snapDistance = player->m_snapDistance;
m_ringJumpRelated = player->m_ringJumpRelated;
// m_ringRelatedSet = player->// m_ringRelatedSet;
m_objectSnappedTo = player->m_objectSnappedTo;
m_pendingCheckpoint = player->m_pendingCheckpoint;
m_onFlyCheckpointTries = player->m_onFlyCheckpointTries;
// m_robotSprite = player->// m_robotSprite;
// m_spiderSprite = player->// m_spiderSprite;
m_maybeSpriteRelated = player->m_maybeSpriteRelated;
// m_playerGroundParticles = player->// m_playerGroundParticles;
// m_trailingParticles = player->// m_trailingParticles;
// m_shipClickParticles = player->// m_shipClickParticles;
// m_vehicleGroundParticles = player->// m_vehicleGroundParticles;
// m_ufoClickParticles = player->// m_ufoClickParticles;
// m_robotBurstParticles = player->// m_robotBurstParticles;
// m_dashParticles = player->// m_dashParticles;
// m_swingBurstParticles1 = player->// m_swingBurstParticles1;
// m_swingBurstParticles2 = player->// m_swingBurstParticles2;
m_useLandParticles0 = player->m_useLandParticles0;
// m_landParticles0 = player->// m_landParticles0;
// m_landParticles1 = player->// m_landParticles1;
m_landParticlesAngle = player->m_landParticlesAngle;
m_landParticleRelatedY = player->m_landParticleRelatedY;
m_playerStreak = player->m_playerStreak;
m_streakStrokeWidth = player->m_streakStrokeWidth;
m_disableStreakTint = player->m_disableStreakTint;
m_alwaysShowStreak = player->m_alwaysShowStreak;
m_shipStreakType = player->m_shipStreakType;
m_slopeRotation = player->m_slopeRotation;
m_currentSlopeYVelocity = player->m_currentSlopeYVelocity;
m_unk3d0 = player->m_unk3d0;
m_blackOrbRelated = player->m_blackOrbRelated;
m_unk3e0 = player->m_unk3e0;
m_unk3e1 = player->m_unk3e1;
m_isAccelerating = player->m_isAccelerating;
m_isCurrentSlopeTop = player->m_isCurrentSlopeTop;
m_collidedTopMinY = player->m_collidedTopMinY;
m_collidedBottomMaxY = player->m_collidedBottomMaxY;
m_collidedLeftMaxX = player->m_collidedLeftMaxX;
m_collidedRightMinX = player->m_collidedRightMinX;
m_fadeOutStreak = player->m_fadeOutStreak;
// m_canPlaceCheckpoint = player->m_canPlaceCheckpoint;
m_colorRelated = player->m_colorRelated;
m_secondColorRelated = player->m_secondColorRelated;
m_hasCustomGlowColor = player->m_hasCustomGlowColor;
m_glowColor = player->m_glowColor;
m_maybeIsColliding = player->m_maybeIsColliding;
// m_jumpBuffered = player->m_jumpBuffered;
m_stateRingJump = player->m_stateRingJump;
m_wasJumpBuffered = player->m_wasJumpBuffered;
m_wasRobotJump = player->m_wasRobotJump;
m_stateJumpBuffered = player->m_stateJumpBuffered;
m_stateRingJump2 = player->m_stateRingJump2;
m_touchedRing = player->m_touchedRing;
m_touchedCustomRing = player->m_touchedCustomRing;
m_touchedGravityPortal = player->m_touchedGravityPortal;
m_maybeTouchedBreakableBlock = player->m_maybeTouchedBreakableBlock;
m_jumpRelatedAC2 = player->m_jumpRelatedAC2;
m_touchedPad = player->m_touchedPad;
m_yVelocity = player->m_yVelocity;
m_fallSpeed = player->m_fallSpeed;
m_isOnSlope = player->m_isOnSlope;
m_wasOnSlope = player->m_wasOnSlope;
m_slopeVelocity = player->m_slopeVelocity;
m_maybeUpsideDownSlope = player->m_maybeUpsideDownSlope;
m_isShip = player->m_isShip;
m_isBird = player->m_isBird;
m_isBall = player->m_isBall;
m_isDart = player->m_isDart;
m_isRobot = player->m_isRobot;
m_isSpider = player->m_isSpider;
m_isUpsideDown = player->m_isUpsideDown;
m_isDead = player->m_isDead;
m_isOnGround = player->m_isOnGround;
m_isGoingLeft = player->m_isGoingLeft;
m_isSideways = player->m_isSideways;
m_isSwing = player->m_isSwing;
m_reverseRelated = player->m_reverseRelated;
m_maybeReverseSpeed = player->m_maybeReverseSpeed;
m_maybeReverseAcceleration = player->m_maybeReverseAcceleration;
m_xVelocityRelated2 = player->m_xVelocityRelated2;
// m_isDashing = player->m_isDashing;
m_unk9e8 = player->m_unk9e8;
m_groundObjectMaterial = player->m_groundObjectMaterial;
m_vehicleSize = player->m_vehicleSize;
m_playerSpeed = player->m_playerSpeed;
m_shipRotation = player->m_shipRotation;
m_lastPortalPos = player->m_lastPortalPos;
m_unkUnused3 = player->m_unkUnused3;
m_isOnGround2 = player->m_isOnGround2;
m_lastLandTime = player->m_lastLandTime;
m_platformerVelocityRelated = player->m_platformerVelocityRelated;
m_maybeIsBoosted = player->m_maybeIsBoosted;
m_scaleXRelatedTime = player->m_scaleXRelatedTime;
m_decreaseBoostSlide = player->m_decreaseBoostSlide;
m_unkA29 = player->m_unkA29;
m_isLocked = player->m_isLocked;
m_controlsDisabled = player->m_controlsDisabled;
m_lastGroundedPos = player->m_lastGroundedPos;
// m_touchingRings = player->// m_touchingRings;
// m_touchedRings = player->// m_touchedRings;
m_lastActivatedPortal = player->m_lastActivatedPortal;
m_hasEverJumped = player->m_hasEverJumped;
// m_ringOrStreakRelated = player->m_ringOrStreakRelated;
m_playerColor1 = player->m_playerColor1;
m_playerColor2 = player->m_playerColor2;
m_position = player->m_position;
m_isSecondPlayer = player->m_isSecondPlayer;
m_unkA99 = player->m_unkA99;
m_totalTime = player->m_totalTime;
m_isBeingSpawnedByDualPortal = player->m_isBeingSpawnedByDualPortal;
m_unkAAC = player->m_unkAAC;
m_unkAngle1 = player->m_unkAngle1;
m_yVelocityRelated3 = player->m_yVelocityRelated3;
m_gamevar0060 = player->m_gamevar0060;
m_swapColors = player->m_swapColors;
m_gamevar0062 = player->m_gamevar0062;
m_followRelated = player->m_followRelated;
// m_playerFollowFloats = player->// m_playerFollowFloats;
m_unk838 = player->m_unk838;
m_stateOnGround = player->m_stateOnGround;
m_stateUnk = player->m_stateUnk;
m_stateNoStickX = player->m_stateNoStickX;
m_stateNoStickY = player->m_stateNoStickY;
m_stateUnk2 = player->m_stateUnk2;
m_stateBoostX = player->m_stateBoostX;
m_stateBoostY = player->m_stateBoostY;
m_maybeStateForce2 = player->m_maybeStateForce2;
m_stateScale = player->m_stateScale;
m_platformerXVelocity = player->m_platformerXVelocity;
// m_holdingRight = player->m_holdingRight;
// m_holdingLeft = player->m_holdingLeft;
m_leftPressedFirst = player->m_leftPressedFirst;
m_scaleXRelated = player->m_scaleXRelated;
m_maybeHasStopped = player->m_maybeHasStopped;
m_xVelocityRelated = player->m_xVelocityRelated;
m_maybeGoingCorrectSlopeDirection = player->m_maybeGoingCorrectSlopeDirection;
m_isSliding = player->m_isSliding;
m_maybeSlopeForce = player->m_maybeSlopeForce;
m_isOnIce = player->m_isOnIce;
m_physDeltaRelated = player->m_physDeltaRelated;
m_isOnGround4 = player->m_isOnGround4;
m_maybeSlidingTime = player->m_maybeSlidingTime;
m_maybeSlidingStartTime = player->m_maybeSlidingStartTime;
m_changedDirectionsTime = player->m_changedDirectionsTime;
m_slopeEndTime = player->m_slopeEndTime;
m_isMoving = player->m_isMoving;
m_platformerMovingLeft = player->m_platformerMovingLeft;
m_platformerMovingRight = player->m_platformerMovingRight;
m_isSlidingRight = player->m_isSlidingRight;
m_maybeChangedDirectionAngle = player->m_maybeChangedDirectionAngle;
m_unkUnused2 = player->m_unkUnused2;
m_isPlatformer = player->m_isPlatformer;
m_stateNoAutoJump = player->m_stateNoAutoJump;
m_stateDartSlide = player->m_stateDartSlide;
m_stateHitHead = player->m_stateHitHead;
m_stateFlipGravity = player->m_stateFlipGravity;
m_gravityMod = player->m_gravityMod;
m_stateForce = player->m_stateForce;
m_stateForceVector = player->m_stateForceVector;
m_affectedByForces = player->m_affectedByForces;
// m_jumpPadRelated = player->// m_jumpPadRelated;
m_somethingPlayerSpeedTime = player->m_somethingPlayerSpeedTime;
m_playerSpeedAC = player->m_playerSpeedAC;
m_fixRobotJump = player->m_fixRobotJump;
// m_holdingButtons = player->// m_holdingButtons;
m_inputsLocked = player->m_inputsLocked;
// m_currentRobotAnimation = player->// m_currentRobotAnimation;
m_gv0123 = player->m_gv0123;
m_iconRequestID = player->m_iconRequestID;
// m_robotBatchNode = player->// m_robotBatchNode;
// m_spiderBatchNode = player->// m_spiderBatchNode;
// m_unk958 = player->// m_unk958;
// m_robotFire = player->// m_robotFire;
m_unkUnused = player->m_unkUnused;
// m_gameLayer = player->// m_gameLayer;
// m_parentLayer = player->// m_parentLayer;
// m_actionManager = player->// m_actionManager;
m_isOutOfBounds = player->m_isOutOfBounds;
m_fallStartY = player->m_fallStartY;
m_disablePlayerSqueeze = player->m_disablePlayerSqueeze;
m_robotHasRun3 = player->m_robotHasRun3;
m_robotHasRun2 = player->m_robotHasRun2;
m_item20 = player->m_item20;
m_ignoreDamage = player->m_ignoreDamage;
m_enable22Changes = player->m_enable22Changes;
auto& cps_counter = CpsCounter::get();
cps = cps_counter.cps;
highscore = cps_counter.highscore;
overall = cps_counter.overall;
auto& noclip_accuracy = NoclipAccuracy::get();
wouldDie = noclip_accuracy.wouldDie;
prevDied = noclip_accuracy.prevDied;
frames = noclip_accuracy.frames;
deaths = noclip_accuracy.deaths;
deaths_full = noclip_accuracy.deaths_full;
};
void apply(PlayerObject* player) {
// cocos2d::CCNode* m_mainLayer;
player->m_wasTeleported = m_wasTeleported;
player->m_fixGravityBug = m_fixGravityBug;
player->m_reverseSync = m_reverseSync;
player->m_yVelocityBeforeSlope = m_yVelocityBeforeSlope;
player->m_dashX = m_dashX;
player->m_dashY = m_dashY;
player->m_dashAngle = m_dashAngle;
player->m_dashStartTime = m_dashStartTime;
// player->m_dashRing = // m_dashRing;
player->m_slopeStartTime = m_slopeStartTime;
player->m_justPlacedStreak = m_justPlacedStreak;
player->m_maybeLastGroundObject = m_maybeLastGroundObject;
// player->m_collisionLogTop = // m_collisionLogTop;
// player->m_collisionLogBottom = // m_collisionLogBottom;
// player->m_collisionLogLeft = // m_collisionLogLeft;
// player->m_collisionLogRight = // m_collisionLogRight;
player->m_lastCollisionBottom = m_lastCollisionBottom;
player->m_lastCollisionTop = m_lastCollisionTop;
player->m_lastCollisionLeft = m_lastCollisionLeft;
player->m_lastCollisionRight = m_lastCollisionRight;
player->m_unk50C = m_unk50C;
player->m_unk510 = m_unk510;
player->m_currentSlope2 = m_currentSlope2;
player->m_preLastGroundObject = m_preLastGroundObject;
player->m_slopeAngle = m_slopeAngle;
player->m_slopeSlidingMaybeRotated = m_slopeSlidingMaybeRotated;
player->m_quickCheckpointMode = m_quickCheckpointMode;
player->m_collidedObject = m_collidedObject;
player->m_lastGroundObject = m_lastGroundObject;
player->m_collidingWithLeft = m_collidingWithLeft;
player->m_collidingWithRight = m_collidingWithRight;
player->m_maybeSavedPlayerFrame = m_maybeSavedPlayerFrame;
player->m_scaleXRelated2 = m_scaleXRelated2;
player->m_groundYVelocity = m_groundYVelocity;
player->m_yVelocityRelated = m_yVelocityRelated;
player->m_scaleXRelated3 = m_scaleXRelated3;
player->m_scaleXRelated4 = m_scaleXRelated4;
player->m_scaleXRelated5 = m_scaleXRelated5;
player->m_isCollidingWithSlope = m_isCollidingWithSlope;
// player->m_dashFireSprite = // m_dashFireSprite;
player->m_isBallRotating = m_isBallRotating;
player->m_unk669 = m_unk669;
player->m_currentSlope3 = m_currentSlope3;
player->m_currentSlope = m_currentSlope;
player->unk_584 = unk_584;
player->m_collidingWithSlopeId = m_collidingWithSlopeId;
// player->m_slopeFlipGravityRelated = // m_slopeFlipGravityRelated;
player->m_particleSystems = m_particleSystems;
player->m_slopeAngleRadians = m_slopeAngleRadians;
// player->m_rotateObjectsRelated = // m_rotateObjectsRelated;
// player->m_maybeRotatedObjectsMap = // m_maybeRotatedObjectsMap;
player->m_rotationSpeed = m_rotationSpeed;
player->m_rotateSpeed = m_rotateSpeed;
player->m_isRotating = m_isRotating;
player->m_isBallRotating2 = m_isBallRotating2;
player->m_hasGlow = m_hasGlow;
player->m_isHidden = m_isHidden;
player->m_ghostType = m_ghostType;
// player->m_ghostTrail = // m_ghostTrail;
// player->m_iconSprite = // m_iconSprite;
// player->m_iconSpriteSecondary = // m_iconSpriteSecondary;
// player->m_iconSpriteWhitener = // m_iconSpriteWhitener;
// player->m_iconGlow = // m_iconGlow;
// player->m_vehicleSprite = // m_vehicleSprite;
// player->m_vehicleSpriteSecondary = // m_vehicleSpriteSecondary;
// player->m_birdVehicle = // m_birdVehicle;
// player->m_vehicleSpriteWhitener = // m_vehicleSpriteWhitener;
// player->m_vehicleGlow = // m_vehicleGlow;
// player->m_swingFireMiddle = // m_swingFireMiddle;
// player->m_swingFireBottom = // m_swingFireBottom;
// player->m_swingFireTop = // m_swingFireTop;
// player->m_dashSpritesContainer = // m_dashSpritesContainer;
// player->m_regularTrail = // m_regularTrail;
// player->m_shipStreak = // m_shipStreak;
// player->m_waveTrail = // m_waveTrail;
player->m_speedMultiplier = m_speedMultiplier;
player->m_yStart = m_yStart;
player->m_gravity = m_gravity;
player->m_trailingParticleLife = m_trailingParticleLife;
player->m_unk648 = m_unk648;
player->m_gameModeChangedTime = m_gameModeChangedTime;
player->m_padRingRelated = m_padRingRelated;
player->m_maybeReducedEffects = m_maybeReducedEffects;
player->m_maybeIsFalling = m_maybeIsFalling;
player->m_shouldTryPlacingCheckpoint = m_shouldTryPlacingCheckpoint;
player->m_playEffects = m_playEffects;
player->m_maybeCanRunIntoBlocks = m_maybeCanRunIntoBlocks;
player->m_hasGroundParticles = m_hasGroundParticles;
player->m_hasShipParticles = m_hasShipParticles;
player->m_isOnGround3 = m_isOnGround3;
player->m_checkpointTimeout = m_checkpointTimeout;
player->m_lastCheckpointTime = m_lastCheckpointTime;
player->m_lastJumpTime = m_lastJumpTime;
player->m_lastFlipTime = m_lastFlipTime;
player->m_flashTime = m_flashTime;
player->m_flashRelated = m_flashRelated;
player->m_flashRelated1 = m_flashRelated1;
player->m_colorRelated2 = m_colorRelated2;
player->m_flashRelated3 = m_flashRelated3;
player->m_lastSpiderFlipTime = m_lastSpiderFlipTime;
player->m_unkBool5 = m_unkBool5;
player->m_maybeIsVehicleGlowing = m_maybeIsVehicleGlowing;
player->m_gv0096 = m_gv0096;
player->m_gv0100 = m_gv0100;
player->m_accelerationOrSpeed = m_accelerationOrSpeed;
player->m_snapDistance = m_snapDistance;
player->m_ringJumpRelated = m_ringJumpRelated;
// player->m_ringRelatedSet = // m_ringRelatedSet;
player->m_objectSnappedTo = m_objectSnappedTo;
player->m_pendingCheckpoint = m_pendingCheckpoint;
player->m_onFlyCheckpointTries = m_onFlyCheckpointTries;
// player->m_robotSprite = // m_robotSprite;
// player->m_spiderSprite = // m_spiderSprite;
player->m_maybeSpriteRelated = m_maybeSpriteRelated;
// player->m_playerGroundParticles = // m_playerGroundParticles;
// player->m_trailingParticles = // m_trailingParticles;
// player->m_shipClickParticles = // m_shipClickParticles;
// player->m_vehicleGroundParticles = // m_vehicleGroundParticles;
// player->m_ufoClickParticles = // m_ufoClickParticles;
// player->m_robotBurstParticles = // m_robotBurstParticles;
// player->m_dashParticles = // m_dashParticles;
// player->m_swingBurstParticles1 = // m_swingBurstParticles1;
// player->m_swingBurstParticles2 = // m_swingBurstParticles2;
player->m_useLandParticles0 = m_useLandParticles0;
// player->m_landParticles0 = // m_landParticles0;
// player->m_landParticles1 = // m_landParticles1;
player->m_landParticlesAngle = m_landParticlesAngle;
player->m_landParticleRelatedY = m_landParticleRelatedY;
player->m_playerStreak = m_playerStreak;
player->m_streakStrokeWidth = m_streakStrokeWidth;
player->m_disableStreakTint = m_disableStreakTint;
player->m_alwaysShowStreak = m_alwaysShowStreak;
player->m_shipStreakType = m_shipStreakType;
player->m_slopeRotation = m_slopeRotation;
player->m_currentSlopeYVelocity = m_currentSlopeYVelocity;
player->m_unk3d0 = m_unk3d0;
player->m_blackOrbRelated = m_blackOrbRelated;
player->m_unk3e0 = m_unk3e0;
player->m_unk3e1 = m_unk3e1;
player->m_isAccelerating = m_isAccelerating;
player->m_isCurrentSlopeTop = m_isCurrentSlopeTop;
player->m_collidedTopMinY = m_collidedTopMinY;
player->m_collidedBottomMaxY = m_collidedBottomMaxY;
player->m_collidedLeftMaxX = m_collidedLeftMaxX;
player->m_collidedRightMinX = m_collidedRightMinX;
player->m_fadeOutStreak = m_fadeOutStreak;
// player->m_canPlaceCheckpoint = m_canPlaceCheckpoint;
player->m_colorRelated = m_colorRelated;
player->m_secondColorRelated = m_secondColorRelated;
player->m_hasCustomGlowColor = m_hasCustomGlowColor;
player->m_glowColor = m_glowColor;
player->m_maybeIsColliding = m_maybeIsColliding;
// player->m_jumpBuffered = m_jumpBuffered;
player->m_stateRingJump = m_stateRingJump;
player->m_wasJumpBuffered = m_wasJumpBuffered;
player->m_wasRobotJump = m_wasRobotJump;
player->m_stateJumpBuffered = m_stateJumpBuffered;
player->m_stateRingJump2 = m_stateRingJump2;
player->m_touchedRing = m_touchedRing;
player->m_touchedCustomRing = m_touchedCustomRing;
player->m_touchedGravityPortal = m_touchedGravityPortal;
player->m_maybeTouchedBreakableBlock = m_maybeTouchedBreakableBlock;
player->m_jumpRelatedAC2 = m_jumpRelatedAC2;
player->m_touchedPad = m_touchedPad;
player->m_yVelocity = m_yVelocity;
player->m_fallSpeed = m_fallSpeed;
player->m_isOnSlope = m_isOnSlope;
player->m_wasOnSlope = m_wasOnSlope;
player->m_slopeVelocity = m_slopeVelocity;
player->m_maybeUpsideDownSlope = m_maybeUpsideDownSlope;
player->m_isShip = m_isShip;
player->m_isBird = m_isBird;
player->m_isBall = m_isBall;
player->m_isDart = m_isDart;
player->m_isRobot = m_isRobot;
player->m_isSpider = m_isSpider;
player->m_isUpsideDown = m_isUpsideDown;
player->m_isDead = m_isDead;
player->m_isOnGround = m_isOnGround;
player->m_isGoingLeft = m_isGoingLeft;
player->m_isSideways = m_isSideways;
player->m_isSwing = m_isSwing;
player->m_reverseRelated = m_reverseRelated;
player->m_maybeReverseSpeed = m_maybeReverseSpeed;
player->m_maybeReverseAcceleration = m_maybeReverseAcceleration;
player->m_xVelocityRelated2 = m_xVelocityRelated2;
// player->m_isDashing = m_isDashing;
player->m_unk9e8 = m_unk9e8;
player->m_groundObjectMaterial = m_groundObjectMaterial;
player->m_vehicleSize = m_vehicleSize;
player->m_playerSpeed = m_playerSpeed;
player->m_shipRotation = m_shipRotation;
player->m_lastPortalPos = m_lastPortalPos;
player->m_unkUnused3 = m_unkUnused3;
player->m_isOnGround2 = m_isOnGround2;
player->m_lastLandTime = m_lastLandTime;
player->m_platformerVelocityRelated = m_platformerVelocityRelated;
player->m_maybeIsBoosted = m_maybeIsBoosted;
player->m_scaleXRelatedTime = m_scaleXRelatedTime;
player->m_decreaseBoostSlide = m_decreaseBoostSlide;
player->m_unkA29 = m_unkA29;
player->m_isLocked = m_isLocked;
player->m_controlsDisabled = m_controlsDisabled;
player->m_lastGroundedPos = m_lastGroundedPos;
// player->m_touchingRings = // m_touchingRings;
// player->m_touchedRings = // m_touchedRings;
player->m_lastActivatedPortal = m_lastActivatedPortal;
player->m_hasEverJumped = m_hasEverJumped;
// player->m_ringOrStreakRelated = m_ringOrStreakRelated;
player->m_playerColor1 = m_playerColor1;
player->m_playerColor2 = m_playerColor2;
player->m_position = m_position;
player->m_isSecondPlayer = m_isSecondPlayer;
player->m_unkA99 = m_unkA99;
player->m_totalTime = m_totalTime;
player->m_isBeingSpawnedByDualPortal = m_isBeingSpawnedByDualPortal;
player->m_unkAAC = m_unkAAC;
player->m_unkAngle1 = m_unkAngle1;
player->m_yVelocityRelated3 = m_yVelocityRelated3;
player->m_gamevar0060 = m_gamevar0060;
player->m_swapColors = m_swapColors;
player->m_gamevar0062 = m_gamevar0062;
player->m_followRelated = m_followRelated;
// player->m_playerFollowFloats = // m_playerFollowFloats;
player->m_unk838 = m_unk838;
player->m_stateOnGround = m_stateOnGround;
player->m_stateUnk = m_stateUnk;
player->m_stateNoStickX = m_stateNoStickX;
player->m_stateNoStickY = m_stateNoStickY;
player->m_stateUnk2 = m_stateUnk2;
player->m_stateBoostX = m_stateBoostX;
player->m_stateBoostY = m_stateBoostY;
player->m_maybeStateForce2 = m_maybeStateForce2;
player->m_stateScale = m_stateScale;
player->m_platformerXVelocity = m_platformerXVelocity;
// player->m_holdingRight = m_holdingRight;
// player->m_holdingLeft = m_holdingLeft;
player->m_leftPressedFirst = m_leftPressedFirst;
player->m_scaleXRelated = m_scaleXRelated;
player->m_maybeHasStopped = m_maybeHasStopped;
player->m_xVelocityRelated = m_xVelocityRelated;
player->m_maybeGoingCorrectSlopeDirection = m_maybeGoingCorrectSlopeDirection;
player->m_isSliding = m_isSliding;
player->m_maybeSlopeForce = m_maybeSlopeForce;
player->m_isOnIce = m_isOnIce;
player->m_physDeltaRelated = m_physDeltaRelated;
player->m_isOnGround4 = m_isOnGround4;
player->m_maybeSlidingTime = m_maybeSlidingTime;
player->m_maybeSlidingStartTime = m_maybeSlidingStartTime;
player->m_changedDirectionsTime = m_changedDirectionsTime;
player->m_slopeEndTime = m_slopeEndTime;
player->m_isMoving = m_isMoving;
player->m_platformerMovingLeft = m_platformerMovingLeft;
player->m_platformerMovingRight = m_platformerMovingRight;
player->m_isSlidingRight = m_isSlidingRight;
player->m_maybeChangedDirectionAngle = m_maybeChangedDirectionAngle;
player->m_unkUnused2 = m_unkUnused2;
player->m_isPlatformer = m_isPlatformer;
player->m_stateNoAutoJump = m_stateNoAutoJump;
player->m_stateDartSlide = m_stateDartSlide;
player->m_stateHitHead = m_stateHitHead;
player->m_stateFlipGravity = m_stateFlipGravity;
player->m_gravityMod = m_gravityMod;
player->m_stateForce = m_stateForce;
player->m_stateForceVector = m_stateForceVector;
player->m_affectedByForces = m_affectedByForces;
// player->m_jumpPadRelated = // m_jumpPadRelated;
player->m_somethingPlayerSpeedTime = m_somethingPlayerSpeedTime;
player->m_playerSpeedAC = m_playerSpeedAC;
player->m_fixRobotJump = m_fixRobotJump;
// player->m_holdingButtons = // m_holdingButtons;
player->m_inputsLocked = m_inputsLocked;
// player->m_currentRobotAnimation = // m_currentRobotAnimation;
player->m_gv0123 = m_gv0123;
player->m_iconRequestID = m_iconRequestID;
// player->m_robotBatchNode = // m_robotBatchNode;
// player->m_spiderBatchNode = // m_spiderBatchNode;
// player->m_unk958 = // m_unk958;
// player->m_robotFire = // m_robotFire;
player->m_unkUnused = m_unkUnused;
// player->m_gameLayer = // m_gameLayer;
// player->m_parentLayer = // m_parentLayer;
// player->m_actionManager = // m_actionManager;
player->m_isOutOfBounds = m_isOutOfBounds;
player->m_fallStartY = m_fallStartY;
player->m_disablePlayerSqueeze = m_disablePlayerSqueeze;
player->m_robotHasRun3 = m_robotHasRun3;
player->m_robotHasRun2 = m_robotHasRun2;
player->m_item20 = m_item20;
player->m_ignoreDamage = m_ignoreDamage;
player->m_enable22Changes = m_enable22Changes;
geode::queueInMainThread([&] {
auto& cps_counter = CpsCounter::get();
cps_counter.cps = cps;
cps_counter.highscore = highscore;
cps_counter.overall = overall;
auto& noclip_accuracy = NoclipAccuracy::get();
noclip_accuracy.wouldDie = wouldDie;
noclip_accuracy.prevDied = prevDied;
noclip_accuracy.frames = frames;
noclip_accuracy.deaths = deaths;
noclip_accuracy.deaths_full = deaths_full;
});
};
private:
// cocos2d::CCNode* m_mainLayer;
bool m_wasTeleported;
bool m_fixGravityBug;
bool m_reverseSync;
double m_yVelocityBeforeSlope;
double m_dashX;
double m_dashY;
double m_dashAngle;
double m_dashStartTime;
// DashRingObject* m_dashRing;
double m_slopeStartTime;
bool m_justPlacedStreak;
GameObject* m_maybeLastGroundObject;
// cocos2d::CCDictionary* m_collisionLogTop;
// cocos2d::CCDictionary* m_collisionLogBottom;
// cocos2d::CCDictionary* m_collisionLogLeft;
// cocos2d::CCDictionary* m_collisionLogRight;
int m_lastCollisionBottom;
int m_lastCollisionTop;
int m_lastCollisionLeft;
int m_lastCollisionRight;
int m_unk50C;
int m_unk510;
GameObject* m_currentSlope2;
GameObject* m_preLastGroundObject;
float m_slopeAngle;
bool m_slopeSlidingMaybeRotated;
bool m_quickCheckpointMode;
GameObject* m_collidedObject;
GameObject* m_lastGroundObject;
GameObject* m_collidingWithLeft;
GameObject* m_collidingWithRight;
int m_maybeSavedPlayerFrame;
double m_scaleXRelated2;
double m_groundYVelocity;
double m_yVelocityRelated;
double m_scaleXRelated3;
double m_scaleXRelated4;
double m_scaleXRelated5;
bool m_isCollidingWithSlope;
// cocos2d::CCSprite* m_dashFireSprite;
bool m_isBallRotating;
bool m_unk669;
GameObject* m_currentSlope3;
GameObject* m_currentSlope;
double unk_584;
int m_collidingWithSlopeId;
// bool m_slopeFlipGravityRelated;
cocos2d::CCArray* m_particleSystems;
float m_slopeAngleRadians;
// gd::unordered_map<int, GJPointDouble> m_rotateObjectsRelated;
// gd::unordered_map<int, GameObject*> m_maybeRotatedObjectsMap;
float m_rotationSpeed;
float m_rotateSpeed;
bool m_isRotating;
bool m_isBallRotating2;
bool m_hasGlow;
bool m_isHidden;
GhostType m_ghostType;
// GhostTrailEffect* m_ghostTrail;
// cocos2d::CCSprite* m_iconSprite;
// cocos2d::CCSprite* m_iconSpriteSecondary;
// cocos2d::CCSprite* m_iconSpriteWhitener;
// cocos2d::CCSprite* m_iconGlow;
// cocos2d::CCSprite* m_vehicleSprite;
// cocos2d::CCSprite* m_vehicleSpriteSecondary;
// cocos2d::CCSprite* m_birdVehicle;
// cocos2d::CCSprite* m_vehicleSpriteWhitener;
// cocos2d::CCSprite* m_vehicleGlow;
// PlayerFireBoostSprite* m_swingFireMiddle;
// PlayerFireBoostSprite* m_swingFireBottom;
// PlayerFireBoostSprite* m_swingFireTop;
// cocos2d::CCSprite* m_dashSpritesContainer;
// cocos2d::CCMotionStreak* m_regularTrail;
// cocos2d::CCMotionStreak* m_shipStreak;
// HardStreak* m_waveTrail;
double m_speedMultiplier;
double m_yStart;
double m_gravity;
float m_trailingParticleLife;
float m_unk648;
double m_gameModeChangedTime;
bool m_padRingRelated;
bool m_maybeReducedEffects;
bool m_maybeIsFalling;
bool m_shouldTryPlacingCheckpoint;
bool m_playEffects;
bool m_maybeCanRunIntoBlocks;
bool m_hasGroundParticles;
bool m_hasShipParticles;
bool m_isOnGround3;
bool m_checkpointTimeout;
double m_lastCheckpointTime;
double m_lastJumpTime;
double m_lastFlipTime;
double m_flashTime;
float m_flashRelated;
float m_flashRelated1;
cocos2d::ccColor3B m_colorRelated2;
cocos2d::ccColor3B m_flashRelated3;
double m_lastSpiderFlipTime;
bool m_unkBool5;
bool m_maybeIsVehicleGlowing;
bool m_gv0096;
bool m_gv0100;
double m_accelerationOrSpeed;
double m_snapDistance;
bool m_ringJumpRelated;
// gd::unordered_set<int> m_ringRelatedSet;
GameObject* m_objectSnappedTo;
CheckpointObject* m_pendingCheckpoint;
int m_onFlyCheckpointTries;
// GJRobotSprite* m_robotSprite;
// GJSpiderSprite* m_spiderSprite;
bool m_maybeSpriteRelated;
// cocos2d::CCParticleSystemQuad* m_playerGroundParticles;
// cocos2d::CCParticleSystemQuad* m_trailingParticles;
// cocos2d::CCParticleSystemQuad* m_shipClickParticles;
// cocos2d::CCParticleSystemQuad* m_vehicleGroundParticles;
// cocos2d::CCParticleSystemQuad* m_ufoClickParticles;
// cocos2d::CCParticleSystemQuad* m_robotBurstParticles;
// cocos2d::CCParticleSystemQuad* m_dashParticles;
// cocos2d::CCParticleSystemQuad* m_swingBurstParticles1;
// cocos2d::CCParticleSystemQuad* m_swingBurstParticles2;
bool m_useLandParticles0;
// cocos2d::CCParticleSystemQuad* m_landParticles0;
// cocos2d::CCParticleSystemQuad* m_landParticles1;
float m_landParticlesAngle;
float m_landParticleRelatedY;
int m_playerStreak;
float m_streakStrokeWidth;
bool m_disableStreakTint;
bool m_alwaysShowStreak;
ShipStreak m_shipStreakType;
double m_slopeRotation;
double m_currentSlopeYVelocity;
double m_unk3d0;
double m_blackOrbRelated;
bool m_unk3e0;
bool m_unk3e1;
bool m_isAccelerating;
bool m_isCurrentSlopeTop;
double m_collidedTopMinY;
double m_collidedBottomMaxY;
double m_collidedLeftMaxX;
double m_collidedRightMinX;
bool m_fadeOutStreak;
// bool m_canPlaceCheckpoint;
cocos2d::ccColor3B m_colorRelated;
cocos2d::ccColor3B m_secondColorRelated;
bool m_hasCustomGlowColor;
cocos2d::ccColor3B m_glowColor;
bool m_maybeIsColliding;
// bool m_jumpBuffered;
bool m_stateRingJump;
bool m_wasJumpBuffered;
bool m_wasRobotJump;
unsigned char m_stateJumpBuffered;
bool m_stateRingJump2;
bool m_touchedRing;
bool m_touchedCustomRing;
bool m_touchedGravityPortal;
bool m_maybeTouchedBreakableBlock;
geode::SeedValueRSV m_jumpRelatedAC2;
bool m_touchedPad;
double m_yVelocity;
double m_fallSpeed;
bool m_isOnSlope;
bool m_wasOnSlope;
float m_slopeVelocity;
bool m_maybeUpsideDownSlope;
bool m_isShip;
bool m_isBird;
bool m_isBall;
bool m_isDart;
bool m_isRobot;
bool m_isSpider;
bool m_isUpsideDown;
bool m_isDead;
bool m_isOnGround;
bool m_isGoingLeft;
bool m_isSideways;
bool m_isSwing;
int m_reverseRelated;
double m_maybeReverseSpeed;
double m_maybeReverseAcceleration;
float m_xVelocityRelated2;
// bool m_isDashing;
int m_unk9e8;
int m_groundObjectMaterial;
float m_vehicleSize;
float m_playerSpeed;
cocos2d::CCPoint m_shipRotation;
cocos2d::CCPoint m_lastPortalPos;
float m_unkUnused3;
bool m_isOnGround2;
double m_lastLandTime;
float m_platformerVelocityRelated;
bool m_maybeIsBoosted;
double m_scaleXRelatedTime;
bool m_decreaseBoostSlide;
bool m_unkA29;
bool m_isLocked;
bool m_controlsDisabled;
cocos2d::CCPoint m_lastGroundedPos;
// cocos2d::CCArray* m_touchingRings;
// gd::unordered_set<int> m_touchedRings;
GameObject* m_lastActivatedPortal;
bool m_hasEverJumped;
// bool m_ringOrStreakRelated;
cocos2d::ccColor3B m_playerColor1;
cocos2d::ccColor3B m_playerColor2;
cocos2d::CCPoint m_position;
bool m_isSecondPlayer;
bool m_unkA99;
double m_totalTime;
bool m_isBeingSpawnedByDualPortal;
float m_unkAAC;
float m_unkAngle1;
float m_yVelocityRelated3;
bool m_gamevar0060;
bool m_swapColors;
bool m_gamevar0062;
int m_followRelated;
// gd::vector<float> m_playerFollowFloats;
float m_unk838;
int m_stateOnGround;
unsigned char m_stateUnk;
unsigned char m_stateNoStickX;
unsigned char m_stateNoStickY;
unsigned char m_stateUnk2;
int m_stateBoostX;
int m_stateBoostY;
int m_maybeStateForce2;
int m_stateScale;
double m_platformerXVelocity;
// bool m_holdingRight;
// bool m_holdingLeft;
bool m_leftPressedFirst;
double m_scaleXRelated;
bool m_maybeHasStopped;
float m_xVelocityRelated;
bool m_maybeGoingCorrectSlopeDirection;
bool m_isSliding;
double m_maybeSlopeForce;
bool m_isOnIce;
double m_physDeltaRelated;
bool m_isOnGround4;
int m_maybeSlidingTime;
double m_maybeSlidingStartTime;
double m_changedDirectionsTime;
double m_slopeEndTime;
bool m_isMoving;
bool m_platformerMovingLeft;
bool m_platformerMovingRight;
bool m_isSlidingRight;
double m_maybeChangedDirectionAngle;
double m_unkUnused2;
bool m_isPlatformer;
int m_stateNoAutoJump;
int m_stateDartSlide;
int m_stateHitHead;
int m_stateFlipGravity;
float m_gravityMod;
int m_stateForce;
cocos2d::CCPoint m_stateForceVector;
bool m_affectedByForces;
// gd::map<int, bool> m_jumpPadRelated;
float m_somethingPlayerSpeedTime;
float m_playerSpeedAC;
bool m_fixRobotJump;
// gd::map<int, bool> m_holdingButtons;
bool m_inputsLocked;
// gd::string m_currentRobotAnimation;
bool m_gv0123;
int m_iconRequestID;
// cocos2d::CCSpriteBatchNode* m_robotBatchNode;
// cocos2d::CCSpriteBatchNode* m_spiderBatchNode;
// cocos2d::CCArray* m_unk958;
// PlayerFireBoostSprite* m_robotFire;
int m_unkUnused;
// GJBaseGameLayer* m_gameLayer;
// cocos2d::CCLayer* m_parentLayer;
// GJActionManager* m_actionManager;
bool m_isOutOfBounds;
float m_fallStartY;
bool m_disablePlayerSqueeze;
bool m_robotHasRun3;
bool m_robotHasRun2;
bool m_item20;
bool m_ignoreDamage;
bool m_enable22Changes;
// for cps counter
int cps = 0, highscore = 0, overall = 0;
//noclip accuracy
bool wouldDie = false, prevDied = false;
int frames = 0, deaths = 0, deaths_full = 0;
};

View File

@@ -11,21 +11,54 @@ unsigned ReplayEngine::get_frame() {
return 0;
}
void ReplayEngine::remove_actions(unsigned frame) {
auto check_inputs = [&](replay_data2 &action) -> bool { return action.frame >= frame; };
m_inputFrames_p1.erase(remove_if(m_inputFrames_p1.begin(), m_inputFrames_p1.end(), check_inputs), m_inputFrames_p1.end());
m_inputFrames_p2.erase(remove_if(m_inputFrames_p2.begin(), m_inputFrames_p2.end(), check_inputs), m_inputFrames_p2.end());
void ReplayEngine::remove_actions(unsigned currentFrame) {
// clearing physic frames
std::erase_if(m_physicFrames_p1, [currentFrame](const replay_data &action) {
return action.frame >= currentFrame;
});
std::erase_if(m_physicFrames_p2, [currentFrame](const replay_data &action) {
return action.frame >= currentFrame;
});
if (engine_v2) return;
// clearing inputs and auto-releasing it (future fix implementation for re lite!!)
std::erase_if(m_inputFrames_p1, [currentFrame](const replay_data2 &action) {
return action.frame >= currentFrame;
});
std::erase_if(m_inputFrames_p2, [currentFrame](const replay_data2 &action) {
return action.frame >= currentFrame;
});
auto check_physics = [&](replay_data &action) -> bool
{
return action.frame > frame;
std::array<bool, 6> released = {true, true, true, true, true, true};
std::array<bool, 6> checked = {false, false, false, false, false, false};
auto scan_input = [&](const std::vector<replay_data2>& inputs) {
for (auto it = inputs.rbegin(); it != inputs.rend(); ++it) {
int button_index = it->button - 1 + (it->isPlayer1 ? 0 : 3);
if (!checked[button_index]) {
checked[button_index] = true;
released[button_index] = !it->down;
if (std::all_of(checked.begin(), checked.end(), [](bool v) { return v; }))
break;
}
}
};
m_physicFrames_p1.erase(remove_if(m_physicFrames_p1.begin(), m_physicFrames_p1.end(), check_physics), m_physicFrames_p1.end());
m_physicFrames_p2.erase(remove_if(m_physicFrames_p1.begin(), m_physicFrames_p1.end(), check_physics), m_physicFrames_p1.end());
scan_input(m_inputFrames_p1);
scan_input(m_inputFrames_p2);
for (int i = 0; i < 3; ++i) {
if (!released[i]) {
handle_button(false, i + 1, true);
}
if (!released[i + 3]) {
handle_button(false, i + 1, false);
}
}
}
size_t ReplayEngine::get_actions_size() {
return m_inputFrames_p1.size() + m_inputFrames_p2.size();
}
@@ -322,8 +355,7 @@ void ReplayEngine::handle_update(GJBaseGameLayer* self) {
if (mode == state::record) {
if (!engine_v2) {
bool frameExist_p1 = std::find_if(m_physicFrames_p1.begin(), m_physicFrames_p1.end(), [&](const auto &data)
{ return data.frame == frame; }) != m_physicFrames_p1.end();
bool frameExist_p1 = !m_physicFrames_p1.empty() && m_physicFrames_p1.back().frame == frame;
if (!frameExist_p1)
m_physicFrames_p1.push_back({
@@ -338,18 +370,17 @@ void ReplayEngine::handle_update(GJBaseGameLayer* self) {
if (!self->m_gameState.m_isDualMode)
return;
// bool frameExist_p2 = std::find_if(m_physicFrames_p2.begin(), m_physicFrames_p2.end(), [&](const auto &data)
// { return data.frame == frame; }) != m_physicFrames_p2.end();
bool frameExist_p2 = !m_physicFrames_p2.empty() && m_physicFrames_p2.back().frame == frame;
// if (!frameExist_p2)
// m_physicFrames_p2.push_back({
// frame,
// self->m_player2->m_position.x,
// self->m_player2->m_position.y,
// self->m_player2->getRotation(),
// self->m_player2->m_yVelocity,
// false //second player
// });
if (!frameExist_p2)
m_physicFrames_p2.push_back({
frame,
self->m_player2->m_position.x,
self->m_player2->m_position.y,
self->m_player2->getRotation(),
self->m_player2->m_yVelocity,
false //second player
});
}
}
else if (mode == state::play) {
@@ -364,26 +395,34 @@ void ReplayEngine::handle_update(GJBaseGameLayer* self) {
m_physicIndex_p1++;
}
// while (m_physicIndex_p2 < m_physicFrames_p2.size() && frame >= m_physicFrames_p2[m_physicIndex_p2].frame)
// {
// self->m_player2->m_position.x = m_physicFrames_p2[m_physicIndex_p2].x;
// self->m_player2->m_position.y = m_physicFrames_p2[m_physicIndex_p2].y;
// if (rotation_fix)
// self->m_player2->setRotation(m_physicFrames_p2[m_physicIndex_p2].rotation);
// self->m_player2->m_yVelocity = m_physicFrames_p2[m_physicIndex_p2].y_accel;
// m_physicIndex_p2++;
// }
while (m_physicIndex_p2 < m_physicFrames_p2.size() && frame >= m_physicFrames_p2[m_physicIndex_p2].frame)
{
self->m_player2->m_position.x = m_physicFrames_p2[m_physicIndex_p2].x;
self->m_player2->m_position.y = m_physicFrames_p2[m_physicIndex_p2].y;
if (rotation_fix)
self->m_player2->setRotation(m_physicFrames_p2[m_physicIndex_p2].rotation);
self->m_player2->m_yVelocity = m_physicFrames_p2[m_physicIndex_p2].y_accel;
m_physicIndex_p2++;
}
}
while (m_inputIndex_p1 < m_inputFrames_p1.size() && frame >= m_inputFrames_p1[m_inputIndex_p1].frame)
{
self->handleButton(m_inputFrames_p1[m_inputIndex_p1].down, m_inputFrames_p1[m_inputIndex_p1].button, m_inputFrames_p1[m_inputIndex_p1].isPlayer1);
bool swapControls = GameManager::get()->getGameVariable("0010");
bool isPlayer1 = m_inputFrames_p1[m_inputIndex_p1].isPlayer1;
isPlayer1 = swapControls ? !isPlayer1 : isPlayer1;
self->handleButton(m_inputFrames_p1[m_inputIndex_p1].down, m_inputFrames_p1[m_inputIndex_p1].button, isPlayer1);
m_inputIndex_p1++;
}
while (m_inputIndex_p2 < m_inputFrames_p2.size() && frame >= m_inputFrames_p2[m_inputIndex_p2].frame)
{
self->handleButton(m_inputFrames_p2[m_inputIndex_p2].down, m_inputFrames_p2[m_inputIndex_p2].button, m_inputFrames_p2[m_inputIndex_p2].isPlayer1);
bool swapControls = GameManager::get()->getGameVariable("0010");
bool isPlayer1 = m_inputFrames_p2[m_inputIndex_p2].isPlayer1;
isPlayer1 = swapControls ? !isPlayer1 : isPlayer1;
self->handleButton(m_inputFrames_p2[m_inputIndex_p2].down, m_inputFrames_p2[m_inputIndex_p2].button, isPlayer1);
m_inputIndex_p2++;
}
}
@@ -393,7 +432,6 @@ void ReplayEngine::handle_reset() {
if (mode == state::record) {
int lastCheckpointFrame = get_frame();
remove_actions(lastCheckpointFrame);
auto_button_release();
}
else if (mode == state::play) {
m_physicIndex_p1 = 0;
@@ -407,6 +445,9 @@ void ReplayEngine::handle_button(bool down, int button, bool isPlayer1) {
if (mode != state::record)
return;
bool swapControls = GameManager::get()->getGameVariable("0010");
isPlayer1 = swapControls ? !isPlayer1 : isPlayer1;
unsigned frame = get_frame();
if (isPlayer1) {
// if (!m_inputFrames_p1.empty() && down && !m_inputFrames_p1.back().down && m_inputFrames_p1.back().frame == frame)
@@ -422,16 +463,6 @@ void ReplayEngine::handle_button(bool down, int button, bool isPlayer1) {
}
}
void ReplayEngine::auto_button_release() {
if (mode == state::record) {
if (!m_inputFrames_p1.empty() && m_inputFrames_p1.back().down)
handle_button(false, m_inputFrames_p1.back().button, m_inputFrames_p1.back().isPlayer1);
if (!m_inputFrames_p2.empty() && m_inputFrames_p2.back().down)
handle_button(false, m_inputFrames_p2.back().button, m_inputFrames_p2.back().isPlayer1);
}
}
bool SpamBot::next_frame()
{
auto& config = Config::get();
@@ -507,4 +538,4 @@ void StraightFly::handle_straightfly(GJBaseGameLayer *self)
void StraightFly::start(GJBaseGameLayer *self)
{
start_y = self ? self->m_player1->m_position.y : 0.0f;
}
}

View File

@@ -50,7 +50,7 @@ public:
bool next_frame = false;
unsigned get_frame();
void remove_actions(unsigned frame);
void remove_actions(unsigned currentFrame);
size_t get_actions_size();
int get_current_index();
@@ -67,8 +67,6 @@ public:
void handle_reset();
void handle_button(bool down, int button, bool isPlayer1);
void auto_button_release();
void renderUI();
std::vector<replay_data>& getPhysicFrames(bool player) {