-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3755 from garrettjoecox/develop-rando-changes
Vanilla Behavior Overhaul
- Loading branch information
Showing
208 changed files
with
6,163 additions
and
4,548 deletions.
There are no files selected for viewing
Submodule libultraship
updated
62 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <libultraship/bridge.h> | ||
#include "soh/OTRGlobals.h" | ||
#include "soh/Enhancements/game-interactor/GameInteractor.h" | ||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" | ||
#include "soh/Enhancements/enhancementTypes.h" | ||
|
||
extern "C" { | ||
#include "macros.h" | ||
#include "variables.h" | ||
|
||
extern SaveContext gSaveContext; | ||
extern PlayState* gPlayState; | ||
} | ||
|
||
void CheatsOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* opt) { | ||
switch (id) { | ||
case GI_VB_DEKU_STICK_BREAK: { | ||
if (CVarGetInteger("gDekuStickCheat", DEKU_STICK_NORMAL) != DEKU_STICK_NORMAL) { | ||
*should = false; | ||
} | ||
break; | ||
} | ||
case GI_VB_DEKU_STICK_BE_ON_FIRE: { | ||
if (CVarGetInteger("gDekuStickCheat", DEKU_STICK_NORMAL) == DEKU_STICK_UNBREAKABLE_AND_ALWAYS_ON_FIRE) { | ||
Player* player = GET_PLAYER(gPlayState); | ||
player->unk_860 = 200; // Keeps the stick's flame lit | ||
player->unk_85C = 1.0f; // Ensures the stick is the proper length | ||
*should = true; | ||
} | ||
break; | ||
} | ||
case GI_VB_DEKU_STICK_BURN_OUT: { | ||
if (CVarGetInteger("gDekuStickCheat", DEKU_STICK_NORMAL) != DEKU_STICK_NORMAL) { | ||
*should = false; | ||
} | ||
break; | ||
} | ||
case GI_VB_DEKU_STICK_BURN_DOWN: { | ||
if (CVarGetInteger("gDekuStickCheat", DEKU_STICK_NORMAL) != DEKU_STICK_NORMAL) { | ||
*should = false; | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
|
||
static uint32_t onVanillaBehaviorHook = 0; | ||
void CheatsRegisterHooks() { | ||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>([](int32_t fileNum) mutable { | ||
|
||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnVanillaBehavior>(onVanillaBehaviorHook); | ||
onVanillaBehaviorHook = 0; | ||
onVanillaBehaviorHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnVanillaBehavior>(CheatsOnVanillaBehaviorHandler); | ||
|
||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef CHEAT_HOOK_HANDLERS_H | ||
#define CHEAT_HOOK_HANDLERS_H | ||
|
||
void CheatsRegisterHooks(); | ||
|
||
#endif // CHEAT_HOOK_HANDLERS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.