From f65486d82dfece3b305697e0fd258cdfaa9c6252 Mon Sep 17 00:00:00 2001 From: Ralphie Morell Date: Thu, 21 Apr 2022 18:39:39 -0400 Subject: Cheats Menu expansion (#176) * Added extra cheats; compacted cheats menu * fixed flag oversight --- soh/src/code/game.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'soh/src/code') diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 9392cbc25..b69537fd8 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -381,6 +381,11 @@ void GameState_Update(GameState* gameState) { gSaveContext.magic = (gSaveContext.doubleMagic + 1) * 0x30; } } + + // Inf Nayru's Love Timer + if (CVar_GetS32("gInfiniteNayru", 0) != 0) { + gSaveContext.nayrusLoveTimer = 0x44B; + } // Moon Jump On L if (CVar_GetS32("gMoonJumpOnL", 0) != 0) { @@ -393,6 +398,32 @@ void GameState_Update(GameState* gameState) { } } + // Permanent infinite sword glitch (ISG) + if (CVar_GetS32("gEzISG", 0) != 0) { + if (gGlobalCtx) { + Player* player = GET_PLAYER(gGlobalCtx); + player->swordState = 1; + } + } + + // Unrestricted Items + if (CVar_GetS32("gNoRestrictItems", 0) != 0) { + if (gGlobalCtx) { + memset(&gGlobalCtx->interfaceCtx.restrictions, 0, sizeof(gGlobalCtx->interfaceCtx.restrictions)); + } + } + + // Freeze Time + if (CVar_GetS32("gFreezeTime", 0) != 0) { + if (CVar_GetS32("gPrevTime", -1) == -1) { + CVar_SetS32("gPrevTime", gSaveContext.dayTime); + } + + int32_t prevTime = CVar_GetS32("gPrevTime", gSaveContext.dayTime); + gSaveContext.dayTime = prevTime; + } + + gameState->frames++; } -- cgit v1.2.3