Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Oct 3, 2024
1 parent 2c49426 commit 6d313b7
Show file tree
Hide file tree
Showing 8 changed files with 369 additions and 6 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.7.0

- Made Icon Effects change colour of objects that use player colour in the level
- Rewrote **Show Layout** to be better, allowing it to be ported to Windows and macOS
- Added **Chest Unlock Bypass**

# 1.6.10

- Fixed UI Button speed fading way too fast
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.7.1",
"version": "v1.6.10",
"version": "v1.7.0",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down
7 changes: 2 additions & 5 deletions src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ class ClientUtils

bypass->modules.push_back(new Module("Basement Bypass", "basement-bypass", "Allows you to enter the monsters basement without completing <cc>The Challenge</c>"));
bypass->modules.push_back(new Module("Basement Key Bypass", "basement-key-bypass", "Allows you to unlock the keys in the monsters basement"));

bypass->modules.push_back(new Module("Treasure Room Chest Bypass", "chest-unlock-bypass", "Allows you to open any chest in the <cc>treasure room</c>"));

Client::instance->windows.push_back(bypass);

Expand Down Expand Up @@ -521,7 +523,6 @@ class ClientUtils
#ifdef GEODE_IS_MACOS

std::vector<std::string> macInc = {
"show-layout",
"no-wave",
"no-particles",
"solid-wave",
Expand Down Expand Up @@ -576,10 +577,6 @@ class ClientUtils

#endif

#ifndef QOLMOD_SHOWLAYOUT
Client::GetModule("show-layout")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c>");
#endif

//Client::GetModule("rand-seed")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c>");
//Client::GetModule("show-trajectory")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c>");

Expand Down
12 changes: 12 additions & 0 deletions src/Client/Windows/IconEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ class $modify (GJBaseGameLayer)
m_player2->m_waveTrail->setColor(EffectUI::getColourForSelected(4, true));
}

auto plr1 = EffectUI::getColourForSelected(0, false);
auto plr2 = EffectUI::getColourForSelected(1, false);

if (m_effectManager)
{
if (auto action = m_effectManager->getColorAction(1005))
action->m_color = plr1;

if (auto action = m_effectManager->getColorAction(1006))
action->m_color = plr2;
}

GJBaseGameLayer::update(p0);
}

Expand Down
22 changes: 22 additions & 0 deletions src/Hacks/ChestOpenBypass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/SecretRewardsLayer.hpp>
#include "../Client/Client.h"

using namespace geode::prelude;

class $modify (SecretRewardsLayer)
{
void onSelectItem(cocos2d::CCObject* sender)
{
auto keys = GameStatsManager::sharedState()->getStat("21");
GameStatsManager::sharedState()->setStat("21", 9999);

SecretRewardsLayer::onSelectItem(sender);

GameStatsManager::sharedState()->setStat("21", keys);

m_keysLabel->setString(fmt::format("{}", keys).c_str());
}

QOLMOD_MOD_HOOK("chest-unlock-bypass", "SecretRewardsLayer::onSelectItem")
};
3 changes: 3 additions & 0 deletions src/Hacks/SafeMode/SafeMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ bool SafePlayLayer::init(GJGameLevel* level, bool useReplay, bool dontCreateObje
if (Client::GetModuleEnabled("show-triggers"))
SafeMode::get()->setHackedLoad();

if (Client::GetModuleEnabled("show-layout"))
SafeMode::get()->setHackedLoad();

return true;
}

Expand Down
236 changes: 236 additions & 0 deletions src/Hacks/Show Layout/Layout.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
#include "Layout.hpp"

std::vector<int> objectIDS =
{
// Gradient Trigger
2903,

// Area Tint
3010,
3015,
3021,

// Area Fade
3009,
3014,
3020,

// Ghost Triggers
32,
33,

// Transitions
22,
23,
24,
25,
26,
27,
28,
55,
56,
57,
58,
59,
1915,

// Colour Triggers
29,
30,
104,
105,
221,
717,
718,
743,
744,
899,
900,
915,

// BG Effect
1818,
1819,

// Hide Player
1612,
1613,

// Spawn Particle
3608,

// Edit XXX
3029,
3030,
3031,

// Setup MG
2999,

// XXX Speed
3606,
3612,

// Pulse Trigger
1006,

// Alpha Trigger
1007,

// Shake Trigger
1520,

// Shaders
2904,
2905,
2907,
2909,
2910,
2911,
2912,
2913,
2914,
2915,
2916,
2917,
2919,
2920,
2921,
2922,
2923,
2924,
};

void LayoutPlayLayer::addObject(GameObject* object)
{
bool dontAdd = false;
bool addToSpecial = false;

if (object->m_objectType == GameObjectType::Decoration)
dontAdd = true;

if (std::find(objectIDS.begin(), objectIDS.end(), object->m_objectID) != objectIDS.end())
dontAdd = true;

if (object->m_objectID == 749 || object->m_objectID == 44)
dontAdd = false;

if (object->m_isHide && object->m_objectType != GameObjectType::Modifier && object->m_objectType != GameObjectType::Special)
addToSpecial = true;

if (object->m_isNoTouch)
dontAdd = true;

if (object->m_groups && m_levelSettings->m_spawnGroup != 0)
{
if (std::find(object->m_groups->begin(), object->m_groups->end(), m_levelSettings->m_spawnGroup) != object->m_groups->end())
dontAdd = false;
}

if (object->m_hasGroupParent)
dontAdd = false;

if (object->m_hasAreaParent)
dontAdd = false;

if (!dontAdd)
PlayLayer::addObject(object);

if (addToSpecial)
{
m_fields->node->addChild(object);
}
}

bool LayoutPlayLayer::init(GJGameLevel* level, bool useReplay, bool dontCreateObjects)
{
for (auto hook : showLayoutHooks)
{
if (Client::GetModuleEnabled("show-layout"))
hook->enable();
else
hook->disable();
}

m_fields->node = NonRemovableNode::create();

if (!PlayLayer::init(level, useReplay, dontCreateObjects))
return false;

if (Client::GetModuleEnabled("show-layout"))
{
m_groundLayer->setPositionY(91);
m_groundLayer2->setPositionY(CCDirector::get()->getWinSize().height);
m_groundLayer2->setVisible(false);
}

m_objectLayer->addChild(m_fields->node);

return true;
}

void LayoutPlayLayer::onQuit()
{
m_fields->node->allowDeleting = true;

PlayLayer::onQuit();
}

void LayoutBaseGameLayer::updateColor(cocos2d::ccColor3B& color, float fadeTime, int colorID, bool blending, float opacity, cocos2d::ccHSVValue& copyHSV, int colorIDToCopy, bool copyOpacity, EffectGameObject* callerObject, int unk1, int unk2)
{
if (colorID <= 999)
color = ccWHITE;

static ColourModule* bg = nullptr;
static ColourModule* g = nullptr;

if (!bg)
bg = as<ColourModule*>(Client::GetModule("show-layout")->options[1]);

if (!g)
g = as<ColourModule*>(Client::GetModule("show-layout")->options[2]);

if (colorID == 1000)
color = bg->colour;

if (colorID == 1001)
color = g->colour;

if (colorID == 1002)
color = ccWHITE;

if (colorID == 1013 || colorID == 1014)
{
opacity = 0;
}

GJBaseGameLayer::updateColor(color, fadeTime, colorID, blending, opacity, copyHSV, colorIDToCopy, copyOpacity, callerObject, unk1, unk2);
}


void LayoutBaseGameLayer::createBackground(int p0)
{
if (typeinfo_cast<PlayLayer*>(this))
p0 = 0;

GJBaseGameLayer::createBackground(p0);
}

void LayoutBaseGameLayer::createGroundLayer(int p0, int p1)
{
if (typeinfo_cast<PlayLayer*>(this))
{
p0 = 0;
p1 = 1;
}

GJBaseGameLayer::createGroundLayer(p0, p1);
}

void LayoutBaseGameLayer::createMiddleground(int p0)
{
if (typeinfo_cast<PlayLayer*>(this))
p0 = 0;

GJBaseGameLayer::createMiddleground(p0);
}
Loading

0 comments on commit 6d313b7

Please sign in to comment.