diff --git a/MetalButtplug.csproj b/MetalButtplug.csproj index 680577a..c9edc4e 100644 --- a/MetalButtplug.csproj +++ b/MetalButtplug.csproj @@ -18,6 +18,9 @@ + + ./BepInEx/interop/UnityEngine.CoreModule.dll + ./BepInEx/interop/Assembly-CSharp.dll diff --git a/Patches/TestPatch.cs b/Patches/TestPatch.cs deleted file mode 100644 index c1bfece..0000000 --- a/Patches/TestPatch.cs +++ /dev/null @@ -1,12 +0,0 @@ -using HarmonyLib; - -namespace MetalButtplug.Patches; - -[HarmonyPatch(typeof(BeatSequencer), nameof(BeatSequencer.UpdateBeat))] -internal class TestPatch { - private static void Prefix(BeatStatusProvider beatStatus) { - if (beatStatus.BeatFlags.HasFlag(BeatFlags.Quarter)) { - Plugin.Log.LogInfo("Quarter beat"); - } - } -} diff --git a/Patches/UpdateBeat.cs b/Patches/UpdateBeat.cs new file mode 100644 index 0000000..dbcf357 --- /dev/null +++ b/Patches/UpdateBeat.cs @@ -0,0 +1,19 @@ +using HarmonyLib; + +namespace MetalButtplug.Patches; + +[HarmonyPatch(typeof(BeatSequencer), nameof(BeatSequencer.UpdateBeat))] +internal class UpdateBeatPatch { + private static void Prefix(BeatStatusProvider beatStatus) { + if (beatStatus.BeatFlags.HasFlag(BeatFlags.Quarter)) { + var playerController = UnityEngine.Object.FindObjectOfType(); + var player = playerController.m_player; + var controller = player.ScoreController; + + Plugin.Log.LogInfo( + $"Quarter beat, multiplier: {controller.GetCurrentTierIndex()}/{controller.GetNumTiers()} ({1 << controller.GetCurrentTierIndex()}x)" + ); + + } + } +} diff --git a/Plugin.cs b/Plugin.cs index 592cd63..8ffa24c 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -14,6 +14,6 @@ public class Plugin : BasePlugin { Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); Log.LogInfo("GAY SEX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - harmony.PatchAll(typeof(Patches.TestPatch)); + harmony.PatchAll(typeof(Patches.UpdateBeatPatch)); } }