diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index d23c5609e8e..4c4ea1c86f9 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -859,6 +859,8 @@ typedef enum { ADD_AMMO_TRAP, ADD_KILL_TRAP, ADD_TELEPORT_TRAP, + ADD_REDEAD_TRAP, + ADD_MIRROR_TRAP, ADD_TRAP_MAX } AltTrapType; @@ -872,7 +874,9 @@ const char* altTrapTypeCvars[] = { "gAddTraps.Void", "gAddTraps.Ammo", "gAddTraps.Kill", - "gAddTraps.Tele" + "gAddTraps.Tele", + "gAddTraps.Redead", + "gAddTraps.Mirror" }; std::vector getEnabledAddTraps () { @@ -890,13 +894,15 @@ std::vector getEnabledAddTraps () { void RegisterAltTrapTypes() { static AltTrapType roll = ADD_TRAP_MAX; - static int statusTimer = -1; + static int speedTimer = -1; + static int mirrorTimer = -1; static int eventTimer = -1; GameInteractor::Instance->RegisterGameHook([](GetItemEntry itemEntry) { if (!CVarGetInteger("gAddTraps.enabled", 0) || itemEntry.modIndex != MOD_RANDOMIZER || itemEntry.getItemId != RG_ICE_TRAP) { return; } + Player* player = GET_PLAYER(gPlayState); roll = RandomElement(getEnabledAddTraps()); switch (roll) { case ADD_ICE_TRAP: @@ -914,7 +920,7 @@ void RegisterAltTrapTypes() { case ADD_SPEED_TRAP: Audio_PlaySoundGeneral(NA_SE_VO_KZ_MOVE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); GameInteractor::State::RunSpeedModifier = -2; - statusTimer = 200; + speedTimer = 200; Overlay_DisplayText(10, "Speed Decreased!"); break; case ADD_BOMB_TRAP: @@ -934,13 +940,26 @@ void RegisterAltTrapTypes() { case ADD_TELEPORT_TRAP: eventTimer = 3; break; + case ADD_REDEAD_TRAP: + Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_RD, player->actor.world.pos.x, + player->actor.world.pos.y, player->actor.world.pos.z, 0, 0, 0, 22, true); + break; + case ADD_MIRROR_TRAP: + mirrorTimer = 600; + CVarSetInteger("gMirroredWorldMode", 1); + UpdateMirrorModeState(gPlayState->sceneNum); + break; } }); GameInteractor::Instance->RegisterGameHook([]() { Player* player = GET_PLAYER(gPlayState); - if (statusTimer == 0) { + if (speedTimer == 0) { GameInteractor::State::RunSpeedModifier = 0; } + if (mirrorTimer == 0) { + CVarSetInteger("gMirroredWorldMode", 0); + UpdateMirrorModeState(gPlayState->sceneNum); + } if (eventTimer == 0) { switch (roll) { case ADD_KNOCK_TRAP: @@ -991,8 +1010,9 @@ void RegisterAltTrapTypes() { break; } } - statusTimer--; + speedTimer--; eventTimer--; + mirrorTimer--; }); } diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 04f25d2e882..2ed341c061c 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1159,6 +1159,12 @@ void DrawEnhancementsMenu() { UIWidgets::PaddedEnhancementCheckbox("Death Traps", "gAddTraps.Kill", true, false); UIWidgets::PaddedEnhancementCheckbox("Teleport Traps", "gAddTraps.Tele", true, false); + UIWidgets::PaddedSeparator(); + ImGui::Text("Nightmare Traps:"); + UIWidgets::Spacer(0); + UIWidgets::PaddedEnhancementCheckbox("Redead Traps", "gAddTraps.Redead", true, false); + UIWidgets::PaddedEnhancementCheckbox("Mirror Traps", "gAddTraps.Mirror", true, false); + ImGui::EndMenu(); } } diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 6f36bea369b..496354a1335 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -167,6 +167,10 @@ void EnRd_Init(Actor* thisx, PlayState* play) { if (thisx->params == 3) { thisx->flags |= ACTOR_FLAG_LENS; } + + if (thisx->params == 22) { + func_80AE3260(this, play); + } } void EnRd_Destroy(Actor* thisx, PlayState* play) {