From 6c1605d0e9a272ccadf40a0f486322fb761982ba Mon Sep 17 00:00:00 2001 From: Joshua Thome Date: Mon, 14 Oct 2024 11:26:37 -0500 Subject: [PATCH] Fix alarm totem "face" angles when toggled by projection totem --- .../AlarmTotemPatches.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 NewHorizons/Patches/EchoesOfTheEyePatches/AlarmTotemPatches.cs diff --git a/NewHorizons/Patches/EchoesOfTheEyePatches/AlarmTotemPatches.cs b/NewHorizons/Patches/EchoesOfTheEyePatches/AlarmTotemPatches.cs new file mode 100644 index 00000000..5ec80d5d --- /dev/null +++ b/NewHorizons/Patches/EchoesOfTheEyePatches/AlarmTotemPatches.cs @@ -0,0 +1,21 @@ +using HarmonyLib; +using NewHorizons.Components.EOTE; +using System.Collections.Generic; +using System.Reflection.Emit; +using UnityEngine; + +namespace NewHorizons.Patches.EchoesOfTheEyePatches +{ + [HarmonyPatch(typeof(AlarmTotem))] + public static class AlarmTotemPatches + { + [HarmonyPostfix] + [HarmonyPatch(nameof(AlarmTotem.SetFaceOpen))] + public static void AlarmTotem_SetFaceOpen(AlarmTotem __instance, bool open) + { + // This method is unused in the base game and sets the rotations incorrectly (-90f instead of 90f); this corrects that + __instance._rightFaceCover.localEulerAngles = Vector3.up * (open ? 90f : 0f); + __instance._leftFaceCover.localEulerAngles = Vector3.up * (open ? -90f : 0f); + } + } +}