diff --git a/src/ESP/EspMushroomPatches.cs b/src/ESP/EspMushroomPatches.cs deleted file mode 100644 index 8cff21a..0000000 --- a/src/ESP/EspMushroomPatches.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; - -namespace MalumMenu; - -[HarmonyPatch(typeof(Mushroom), nameof(Mushroom.FixedUpdate))] -public static class ESP_SeePlayersInSporesPostfix -{ - public static void Postfix(Mushroom __instance) - { - if (ESP_HudManagerPostfix.fullBrightActive) - { - __instance.sporeMask.transform.position = new UnityEngine.Vector3(__instance.sporeMask.transform.position.x, __instance.sporeMask.transform.position.y, -1); - return; - } - - __instance.sporeMask.transform.position = new UnityEngine.Vector3(__instance.sporeMask.transform.position.x, __instance.sporeMask.transform.position.y, 5f); - } -} \ No newline at end of file diff --git a/src/Mushrooms/MushroomPatches.cs b/src/Mushrooms/MushroomPatches.cs new file mode 100644 index 0000000..c82bb34 --- /dev/null +++ b/src/Mushrooms/MushroomPatches.cs @@ -0,0 +1,64 @@ +using HarmonyLib; + +namespace MalumMenu; + +[HarmonyPatch(typeof(Mushroom), nameof(Mushroom.FixedUpdate))] +public static class Mushrooms_SporeCloudVisionPostfix +{ + public static void Postfix(Mushroom __instance) + { + if (CheatSettings.sporeVision) + { + __instance.sporeMask.transform.position = new UnityEngine.Vector3(__instance.sporeMask.transform.position.x, __instance.sporeMask.transform.position.y, -1); + return; + } + + __instance.sporeMask.transform.position = new UnityEngine.Vector3(__instance.sporeMask.transform.position.x, __instance.sporeMask.transform.position.y, 5f); + } +} + +[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.FixedUpdate))] +public static class Mushrooms_MushroomMixupPostfix +{ + //Postfix patch of ShipStatus.FixedUpdate to sabotage different systems + public static void Postfix(ShipStatus __instance) + { + if (CheatSettings.mushSab){ + byte currentMapID = Utils.getCurrentMapID(); + + if (currentMapID == 5){ //MushroomMixup only works on Fungle + __instance.RpcUpdateSystem(SystemTypes.MushroomMixupSabotage, 1); //Sabotage MushroomMixup + }else{ + HudManager.Instance.Notifier.AddItem("Mushrooms not present on this map"); + } + + CheatSettings.mushSab = false; //Button behaviour + } + + } +} + +[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.FixedUpdate))] +public static class Mushrooms_SporeTriggerPostfix +{ + public static void Postfix(FungleShipStatus __instance) + { + if (CheatSettings.mushSpore) + { + byte currentMapID = Utils.getCurrentMapID(); + if (currentMapID == 5) + { + foreach (Mushroom mushroom in __instance.sporeMushrooms.Values) + { + PlayerControl.LocalPlayer.CmdCheckSporeTrigger(mushroom); + } + } + else + { + HudManager.Instance.Notifier.AddItem("Mushrooms not present on this map"); + } + + CheatSettings.mushSpore = false; + } + } +} \ No newline at end of file diff --git a/src/Sabotage/SabotagePatches.cs b/src/Sabotage/SabotagePatches.cs index 4f69c59..8d42a34 100644 --- a/src/Sabotage/SabotagePatches.cs +++ b/src/Sabotage/SabotagePatches.cs @@ -73,16 +73,6 @@ public static void Postfix(ShipStatus __instance) CheatSettings.oxygenSab = false; //Button behaviour - }else if (CheatSettings.mushSab){ - if (currentMapID == 5){ //MushroomMixup only works on Fungle - __instance.RpcUpdateSystem(SystemTypes.MushroomMixupSabotage, 1); //Sabotage MushroomMixup - }else{ - HudManager.Instance.Notifier.AddItem("MushroomMixup not possible on this map"); - } - - CheatSettings.mushSab = false; //Button behaviour - - }else if (CheatSettings.commsSab){ //Communications sabotages if (currentMapID == 1 || currentMapID == 5){ //MiraHQ and Fungle use HqHudSystemType to sabotage communications @@ -193,30 +183,4 @@ public static void Postfix(ShipStatus __instance) CheatSettings.blackOut = false; } } -} - - -[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.FixedUpdate))] -public static class MushroomSporePostfix -{ - public static void Postfix(FungleShipStatus __instance) - { - if (CheatSettings.mushSpore) - { - byte currentMapID = Utils.getCurrentMapID(); - if (currentMapID == 5) - { - foreach (Mushroom mushroom in __instance.sporeMushrooms.Values) - { - PlayerControl.LocalPlayer.CmdCheckSporeTrigger(mushroom); - } - } - else - { - HudManager.Instance.Notifier.AddItem("Mushrooms not present on this map"); - } - - CheatSettings.mushSpore = false; - } - } } \ No newline at end of file diff --git a/src/UI/CheatSettings.cs b/src/UI/CheatSettings.cs index c547a6e..b380f9f 100644 --- a/src/UI/CheatSettings.cs +++ b/src/UI/CheatSettings.cs @@ -43,8 +43,6 @@ public struct CheatSettings public static bool elecSab; public static bool reactorSab; public static bool oxygenSab; - public static bool mushSab; - public static bool mushSpore; //Meetings public static bool closeMeeting; @@ -58,11 +56,16 @@ public struct CheatSettings public static bool ventVision; - //Host-Only + //Mushrooms public static bool godMode; public static bool evilVote; public static bool voteImmune; + //Host-Only + public static bool mushSab; + public static bool mushSpore; + public static bool sporeVision; + //Passive public static bool unlockFeatures = true; public static bool freeCosmetics = true; diff --git a/src/UI/MenuUI.cs b/src/UI/MenuUI.cs index 77ab965..0269d8d 100644 --- a/src/UI/MenuUI.cs +++ b/src/UI/MenuUI.cs @@ -56,9 +56,7 @@ private void Start() new ToggleInfo(" Reactor", () => CheatSettings.reactorSab, x => CheatSettings.reactorSab = x), new ToggleInfo(" Oxygen", () => CheatSettings.oxygenSab, x => CheatSettings.oxygenSab = x), new ToggleInfo(" Electrical", () => CheatSettings.elecSab, x => CheatSettings.elecSab = x), - new ToggleInfo(" Comms", () => CheatSettings.commsSab, x => CheatSettings.commsSab = x), - new ToggleInfo(" MushroomMixup", () => CheatSettings.mushSab, x => CheatSettings.mushSab = x), - new ToggleInfo(" SporesTrigger", () => CheatSettings.mushSpore, x => CheatSettings.mushSpore = x) + new ToggleInfo(" Comms", () => CheatSettings.commsSab, x => CheatSettings.commsSab = x) })); groups.Add(new GroupInfo("Vents", false, new List() { @@ -74,6 +72,12 @@ private void Start() new ToggleInfo(" CallMeeting", () => CheatSettings.callMeeting, x => CheatSettings.callMeeting = x) })); + groups.Add(new GroupInfo("Mushrooms", false, new List() { + new ToggleInfo(" MushroomMixup", () => CheatSettings.mushSab, x => CheatSettings.mushSab = x), + new ToggleInfo(" SporesTrigger", () => CheatSettings.mushSpore, x => CheatSettings.mushSpore = x), + new ToggleInfo(" SporeCloudVision", () => CheatSettings.sporeVision, x => CheatSettings.sporeVision = x), + })); + groups.Add(new GroupInfo("Host-Only", false, new List() { new ToggleInfo(" ImpostorHack", () => CheatSettings.impostorHack, x => CheatSettings.impostorHack = x), new ToggleInfo(" Godmode", () => CheatSettings.godMode, x => CheatSettings.godMode = x),