diff --git a/TheEpicRoles/Buttons.cs b/TheEpicRoles/Buttons.cs index 052de4fb1..d98ed6c9b 100644 --- a/TheEpicRoles/Buttons.cs +++ b/TheEpicRoles/Buttons.cs @@ -1479,6 +1479,7 @@ public static void Postfix(HudManager __instance) jumperChargesText.transform.localScale = Vector3.one * 0.5f; jumperChargesText.transform.localPosition += new Vector3(-0.05f, 0.7f, 0); + // ready button readyButton = new CustomButton( () => { MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetReadyStatus, Hazel.SendOption.Reliable, -1); diff --git a/TheEpicRoles/CustomOptionHolder.cs b/TheEpicRoles/CustomOptionHolder.cs index cb6fcb95c..54039fbdc 100644 --- a/TheEpicRoles/CustomOptionHolder.cs +++ b/TheEpicRoles/CustomOptionHolder.cs @@ -259,7 +259,7 @@ public class CustomOptionHolder { public static CustomOption dynamicMapEnableSkeld; public static CustomOption dynamicMapEnableMira; public static CustomOption dynamicMapEnablePolus; - public static CustomOption dynamicMapEnableDleks; + //public static CustomOption dynamicMapEnableDleks; public static CustomOption dynamicMapEnableAirShip; @@ -530,7 +530,7 @@ public static void Load() { dynamicMapEnableMira = CustomOption.Create(502, cs(new Color(0, 1, 217f / 255f, 1f), "Enable Mira Rotation"), "map", true, dynamicMap, false); dynamicMapEnablePolus = CustomOption.Create(503, cs(new Color(0, 1, 217f / 255f, 1f), "Enable Polus Rotation"), "map", true, dynamicMap, false); dynamicMapEnableAirShip = CustomOption.Create(504, cs(new Color(0, 1, 217f / 255f, 1f), "Enable Airship Rotation"), "map", true, dynamicMap, false); - dynamicMapEnableDleks = CustomOption.Create(505, cs(new Color(0, 1, 217f / 255f, 1f), "Enable dlekS Rotation"), "map", false, dynamicMap, false); + //dynamicMapEnableDleks = CustomOption.Create(505, cs(new Color(0, 1, 217f / 255f, 1f), "Enable dlekS Rotation"), "map", false, dynamicMap, false); blockedRolePairings.Add((byte)RoleId.Vampire, new [] { (byte)RoleId.Warlock}); blockedRolePairings.Add((byte)RoleId.Warlock, new [] { (byte)RoleId.Vampire}); diff --git a/TheEpicRoles/Main.cs b/TheEpicRoles/Main.cs index 935f3f6e5..38ce358d1 100644 --- a/TheEpicRoles/Main.cs +++ b/TheEpicRoles/Main.cs @@ -39,8 +39,8 @@ public class TheEpicRolesPlugin : BasePlugin public static ConfigEntry GhostsSeeVotes{ get; set; } public static ConfigEntry ShowRoleSummary { get; set; } public static ConfigEntry ShowLighterDarker { get; set; } + public static ConfigEntry EnableHorseMode { get; set; } public static ConfigEntry ToggleCursor { get; set; } - public static ConfigEntry ToggleScreenShake { get; set; } public static ConfigEntry StreamerModeReplacementText { get; set; } public static ConfigEntry StreamerModeReplacementColor { get; set; } public static ConfigEntry Ip { get; set; } @@ -63,14 +63,14 @@ public static void UpdateRegions() { public override void Load() { Logger = Log; DebugMode = Config.Bind("Custom", "Enable Debug Mode", false); - StreamerMode = Config.Bind("Custom", "Enable Streamer Mode", false); + StreamerMode = Config.Bind("Custom", "Enable Streamer Mode", true); GhostsSeeTasks = Config.Bind("Custom", "Ghosts See Remaining Tasks", true); GhostsSeeRoles = Config.Bind("Custom", "Ghosts See Roles", true); GhostsSeeVotes = Config.Bind("Custom", "Ghosts See Votes", true); ShowRoleSummary = Config.Bind("Custom", "Show Role Summary", true); ShowLighterDarker = Config.Bind("Custom", "Show Lighter / Darker", true); + EnableHorseMode = Config.Bind("Custom", "Enable Horse Mode", false); ToggleCursor = Config.Bind("Custom", "Better Cursor", true); - ToggleScreenShake = Config.Bind("Custom", "Screen Shake", false); ShowPopUpVersion = Config.Bind("Custom", "Show PopUp", "0"); StreamerModeReplacementText = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Epic Roles"); StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#00FFDDFF"); diff --git a/TheEpicRoles/MapOptions.cs b/TheEpicRoles/MapOptions.cs index 2828f4878..12fbed049 100644 --- a/TheEpicRoles/MapOptions.cs +++ b/TheEpicRoles/MapOptions.cs @@ -17,8 +17,8 @@ static class MapOptions { public static bool showRoleSummary = true; public static bool allowParallelMedBayScans = false; public static bool showLighterDarker = true; + public static bool enableHorseMode = false; public static bool toggleCursor = true; - public static bool toggleScreenShake = false; // Updating values public static int meetingsCount = 0; @@ -26,7 +26,7 @@ static class MapOptions { public static List ventsToSeal = new List(); public static Dictionary playerIcons = new Dictionary(); -public static void clearAndReloadMapOptions() { + public static void clearAndReloadMapOptions() { meetingsCount = 0; camerasToAdd = new List(); ventsToSeal = new List(); @@ -37,13 +37,18 @@ public static void clearAndReloadMapOptions() { noVoteIsSelfVote = CustomOptionHolder.noVoteIsSelfVote.getBool(); hidePlayerNames = CustomOptionHolder.hidePlayerNames.getBool(); allowParallelMedBayScans = CustomOptionHolder.allowParallelMedBayScans.getBool(); + } + + public static void reloadPluginOptions() + { ghostsSeeRoles = TheEpicRolesPlugin.GhostsSeeRoles.Value; ghostsSeeTasks = TheEpicRolesPlugin.GhostsSeeTasks.Value; ghostsSeeVotes = TheEpicRolesPlugin.GhostsSeeVotes.Value; showRoleSummary = TheEpicRolesPlugin.ShowRoleSummary.Value; showLighterDarker = TheEpicRolesPlugin.ShowLighterDarker.Value; toggleCursor = TheEpicRolesPlugin.ToggleCursor.Value; - toggleScreenShake = TheEpicRolesPlugin.ToggleScreenShake.Value; + enableHorseMode = TheEpicRolesPlugin.EnableHorseMode.Value; + Patches.ShouldAlwaysHorseAround.isHorseMode = TheEpicRolesPlugin.EnableHorseMode.Value; } } } \ No newline at end of file diff --git a/TheEpicRoles/Modules/CustomOptions.cs b/TheEpicRoles/Modules/CustomOptions.cs index 6edd1fc88..927766613 100644 --- a/TheEpicRoles/Modules/CustomOptions.cs +++ b/TheEpicRoles/Modules/CustomOptions.cs @@ -400,11 +400,12 @@ public static void Prefix(GameSettingMenu __instance) { public static void Postfix(GameSettingMenu __instance) { // Setup mapNameTransform - var mapNameTransform = __instance.AllItems.FirstOrDefault(x => x.gameObject.activeSelf && x.name.Equals("MapName", StringComparison.OrdinalIgnoreCase)); + var mapNameTransform = __instance.AllItems.FirstOrDefault(x => x.name.Equals("MapName", StringComparison.OrdinalIgnoreCase)); if (mapNameTransform == null) return; var options = new Il2CppSystem.Collections.Generic.List>(); for (int i = 0; i < Constants.MapNames.Length; i++) { + if (i == 3) continue; // Ignore dlekS var kvp = new Il2CppSystem.Collections.Generic.KeyValuePair(); kvp.key = Constants.MapNames[i]; kvp.value = i; diff --git a/TheEpicRoles/Patches/ClientOptionsPatch.cs b/TheEpicRoles/Patches/ClientOptionsPatch.cs index 66e39cb91..35391835c 100644 --- a/TheEpicRoles/Patches/ClientOptionsPatch.cs +++ b/TheEpicRoles/Patches/ClientOptionsPatch.cs @@ -21,7 +21,6 @@ public static class ClientOptionsPatch new SelectionBehaviour("Show Role Summary", () => MapOptions.showRoleSummary = TheEpicRolesPlugin.ShowRoleSummary.Value = !TheEpicRolesPlugin.ShowRoleSummary.Value, TheEpicRolesPlugin.ShowRoleSummary.Value), new SelectionBehaviour("Show Lighter / Darker", () => MapOptions.showLighterDarker = TheEpicRolesPlugin.ShowLighterDarker.Value = !TheEpicRolesPlugin.ShowLighterDarker.Value, TheEpicRolesPlugin.ShowLighterDarker.Value), new SelectionBehaviour("Better Cursor", () => MapOptions.toggleCursor = TheEpicRolesPlugin.ToggleCursor.Value = !TheEpicRolesPlugin.ToggleCursor.Value, TheEpicRolesPlugin.ToggleCursor.Value), - new SelectionBehaviour("Screen Shake", () => MapOptions.toggleScreenShake = TheEpicRolesPlugin.ToggleScreenShake.Value = !TheEpicRolesPlugin.ToggleScreenShake.Value, TheEpicRolesPlugin.ToggleScreenShake.Value), }; private static GameObject popUp; @@ -204,7 +203,7 @@ private static IEnumerable GetAllChilds(this GameObject Go) } } - private class SelectionBehaviour + public class SelectionBehaviour { public string Title; public Func OnClick; diff --git a/TheEpicRoles/Patches/CredentialsPatch.cs b/TheEpicRoles/Patches/CredentialsPatch.cs index 5d4d234ee..12bd2691f 100644 --- a/TheEpicRoles/Patches/CredentialsPatch.cs +++ b/TheEpicRoles/Patches/CredentialsPatch.cs @@ -46,41 +46,82 @@ static void Prefix(PingTracker __instance) { modStamp.transform.parent = __instance.transform.parent; modStamp.transform.localScale *= 0.6f; } - float offset = (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started) ? 0.75f : 0f; + float offset = (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started) ? 0.75f : 0.75f; modStamp.transform.position = HudManager.Instance.MapButton.transform.position + Vector3.down * offset; + + // changed position of friends list button + var objects = GameObject.FindObjectsOfType(); + if (objects == null) return; + objects[0].transform.localPosition = new Vector3(1.6f, -0.75f, objects[0].transform.localPosition.z); } - static void Postfix(PingTracker __instance){ + static void Postfix(PingTracker __instance) + { __instance.text.alignment = TMPro.TextAlignmentOptions.TopRight; __instance.text.SetOutlineThickness(0); - if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started) { - __instance.text.text = $"The Epic Roles v{TheEpicRolesPlugin.Version.ToString()}\n" + __instance.text.text; - if (PlayerControl.LocalPlayer.Data.IsDead || (!(PlayerControl.LocalPlayer == null) && (PlayerControl.LocalPlayer == Lovers.lover1 || PlayerControl.LocalPlayer == Lovers.lover2))) { - __instance.transform.localPosition = new Vector3(3.45f, __instance.transform.localPosition.y, __instance.transform.localPosition.z); - } else { - __instance.transform.localPosition = new Vector3(4.2f, __instance.transform.localPosition.y, __instance.transform.localPosition.z); - } - } else { - __instance.text.text = $"{fullCredentials}\n{__instance.text.text}"; - __instance.transform.localPosition = new Vector3(3.5f, __instance.transform.localPosition.y, __instance.transform.localPosition.z); - } + __instance.text.text = $"{fullCredentials}\n{__instance.text.text}"; + if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started || PlayerControl.LocalPlayer.Data.IsDead || (!(PlayerControl.LocalPlayer == null) && (PlayerControl.LocalPlayer == Lovers.lover1 || PlayerControl.LocalPlayer == Lovers.lover2))) + + __instance.transform.localPosition = new Vector3(3.45f, __instance.transform.localPosition.y, __instance.transform.localPosition.z); + else + __instance.transform.localPosition = new Vector3(4.25f, __instance.transform.localPosition.y, __instance.transform.localPosition.z); + __instance.enabled = false; + __instance.enabled = true; } } [HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start))] - private static class LogoPatch + public static class LogoPatch { - static void Postfix(MainMenuManager __instance) { + public static SpriteRenderer renderer; + public static Sprite bannerSprite; + public static Sprite horseBannerSprite; + private static PingTracker instance; + static void Postfix(PingTracker __instance) + { var amongUsLogo = GameObject.Find("bannerLogo_AmongUs"); - if (amongUsLogo != null) { + if (amongUsLogo != null) + { amongUsLogo.transform.localScale *= 0.6f; amongUsLogo.transform.position += Vector3.up * 0.25f; - } + } - var torLogo = new GameObject("bannerLogo_TOR"); + var torLogo = new GameObject("bannerLogo_TER"); torLogo.transform.position = Vector3.up; - var renderer = torLogo.AddComponent(); + renderer = torLogo.AddComponent(); + loadSprites(); renderer.sprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.Banner.png", 300f); + + instance = __instance; + loadSprites(); + renderer.sprite = MapOptions.enableHorseMode ? horseBannerSprite : bannerSprite; + } + + public static void loadSprites() + { + if (bannerSprite == null) bannerSprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.Banner.png", 300f); + if (horseBannerSprite == null) horseBannerSprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.BannerHorse.png", 300f); + } + + public static void updateSprite() + { + loadSprites(); + if (renderer != null) + { + float fadeDuration = 1f; + instance.StartCoroutine(Effects.Lerp(fadeDuration, new Action((p) => + { + renderer.color = new Color(1, 1, 1, 1 - p); + if (p == 1) + { + renderer.sprite = MapOptions.enableHorseMode ? horseBannerSprite : bannerSprite; + instance.StartCoroutine(Effects.Lerp(fadeDuration, new Action((p) => + { + renderer.color = new Color(1, 1, 1, p); + }))); + } + }))); + } } } } diff --git a/TheEpicRoles/Patches/EndGamePatch.cs b/TheEpicRoles/Patches/EndGamePatch.cs index 947a0731a..e2361134e 100644 --- a/TheEpicRoles/Patches/EndGamePatch.cs +++ b/TheEpicRoles/Patches/EndGamePatch.cs @@ -251,7 +251,7 @@ public static void Postfix(EndGameManager __instance) { poolablePlayer.transform.localScale = vector; poolablePlayer.UpdateFromPlayerOutfit(winningPlayerData2, winningPlayerData2.IsDead); if (winningPlayerData2.IsDead) { - poolablePlayer.CurrentBodySprite.GhostSprite = __instance.GhostSprite; // TODO test + poolablePlayer.CurrentBodySprite.BodySprite.sprite = poolablePlayer.CurrentBodySprite.GhostSprite; poolablePlayer.SetDeadFlipX(i % 2 == 0); } else { poolablePlayer.SetFlipX(i % 2 == 0); diff --git a/TheEpicRoles/Patches/GameStartManagerPatch.cs b/TheEpicRoles/Patches/GameStartManagerPatch.cs index a51782c35..66ea363e0 100644 --- a/TheEpicRoles/Patches/GameStartManagerPatch.cs +++ b/TheEpicRoles/Patches/GameStartManagerPatch.cs @@ -226,8 +226,8 @@ public static bool Prefix(GameStartManager __instance) { possibleMaps.Add(1); if (CustomOptionHolder.dynamicMapEnablePolus.getBool()) possibleMaps.Add(2); - if (CustomOptionHolder.dynamicMapEnableDleks.getBool()) - possibleMaps.Add(3); + //if (CustomOptionHolder.dynamicMapEnableDleks.getBool()) + // possibleMaps.Add(3); if (CustomOptionHolder.dynamicMapEnableAirShip.getBool()) possibleMaps.Add(4); byte chosenMapId = possibleMaps[TheEpicRoles.rnd.Next(possibleMaps.Count)]; diff --git a/TheEpicRoles/Patches/IntroPatch.cs b/TheEpicRoles/Patches/IntroPatch.cs index f0352b1fa..11aec67df 100644 --- a/TheEpicRoles/Patches/IntroPatch.cs +++ b/TheEpicRoles/Patches/IntroPatch.cs @@ -341,5 +341,21 @@ public static void Postfix(IntroCutscene __instance, ref Il2CppSystem.Collectio } } } + + [HarmonyPatch(typeof(Constants), nameof(Constants.ShouldHorseAround))] + public static class ShouldAlwaysHorseAround + { + public static bool isHorseMode; + public static bool Prefix(ref bool __result) + { + if (isHorseMode != MapOptions.enableHorseMode && LobbyBehaviour.Instance != null) __result = isHorseMode; + else + { + __result = MapOptions.enableHorseMode; + isHorseMode = MapOptions.enableHorseMode; + } + return false; + } + } } diff --git a/TheEpicRoles/Patches/LightSourcePatch.cs b/TheEpicRoles/Patches/LightSourcePatch.cs new file mode 100644 index 000000000..0112baac8 --- /dev/null +++ b/TheEpicRoles/Patches/LightSourcePatch.cs @@ -0,0 +1,36 @@ +using HarmonyLib; +using System; +using Hazel; +using UnityEngine; +using UnityEngine.Rendering; + + +namespace TheOtherRoles.Patches { + + [HarmonyPatch(typeof(LightSource), nameof(LightSource.DrawOcclusion))] + + class LightSourceUpdatePatch { + static bool Prefix(LightSource __instance, float effectiveRadius) { + if (__instance.cb == null) { + __instance.cb = new CommandBuffer(); + __instance.cb.name = "Draw occlusion"; + } + if (__instance.shadowTexture && __instance.shadowCasterMaterial) { + float num = (float)__instance.shadowTexture.width; + __instance.shadowCasterMaterial.SetFloat("_DepthCompressionValue", effectiveRadius); + __instance.cb.Clear(); + __instance.cb.SetRenderTarget(__instance.shadowTexture); + __instance.cb.ClearRenderTarget(true, true, new Color(1f, 1f, 1f, 1f)); + __instance.cb.SetGlobalTexture("_ShmapTexture", __instance.shadowTexture); + __instance.cb.SetGlobalFloat("_Radius", __instance.LightRadius); + __instance.cb.SetGlobalFloat("_Column", 0f); + __instance.cb.SetGlobalVector("_lightPosition", __instance.transform.position + Vector3.down * 0.095f); ; + __instance.cb.SetGlobalVector("_TexelSize", new Vector4(1f / num, 1f / num, num, num)); + __instance.cb.SetGlobalFloat("_DepthCompressionValue", effectiveRadius); + __instance.cb.DrawMesh(__instance.occluderMesh, Matrix4x4.identity, __instance.shadowCasterMaterial); + Graphics.ExecuteCommandBuffer(__instance.cb); + } + return false; + } + } +} \ No newline at end of file diff --git a/TheEpicRoles/Patches/MainMenuButtonsPatch.cs b/TheEpicRoles/Patches/MainMenuButtonsPatch.cs index d0453737b..a858341af 100644 --- a/TheEpicRoles/Patches/MainMenuButtonsPatch.cs +++ b/TheEpicRoles/Patches/MainMenuButtonsPatch.cs @@ -1,5 +1,9 @@ using HarmonyLib; using UnityEngine; +using UnityEngine.UI; +using static UnityEngine.UI.Button; +using Object = UnityEngine.Object; +using TheEpicRoles.Patches; /* * This patch adds two buttons to the main menu: @@ -12,6 +16,10 @@ namespace TheEpicRoles.Patches { [HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start))] public class MainMenuButtonsPatch { + private static bool horseButtonState = MapOptions.enableHorseMode; + private static Sprite horseModeOffSprite = null; + private static Sprite horseModeOnSprite = null; + private static Color buttonColor = new Color(0, 1, 0.9f, 1); private static Color buttonColorHover = new Color(0, 0.5f, 1, 1); private static Color buttonExitColor = Color.red; @@ -91,6 +99,44 @@ private static void Prefix(MainMenuManager __instance) { btnGithubsprite.color = textGithub.color = buttonColor; }); + + // Horse mode stuff + var horseModeSelectionBehavior = new ClientOptionsPatch.SelectionBehaviour("Enable Horse Mode", () => MapOptions.enableHorseMode = TheEpicRolesPlugin.EnableHorseMode.Value = !TheEpicRolesPlugin.EnableHorseMode.Value, TheEpicRolesPlugin.EnableHorseMode.Value); + + var bottomTemplate = GameObject.Find("InventoryButton"); + if (bottomTemplate == null) return; + var horseButton = Object.Instantiate(bottomTemplate, bottomTemplate.transform.parent); + var passiveHorseButton = horseButton.GetComponent(); + var spriteHorseButton = horseButton.GetComponent(); + + horseModeOffSprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.HorseModeButtonOff.png", 75f); + horseModeOnSprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.HorseModeButtonOn.png", 75f); + + spriteHorseButton.sprite = horseButtonState ? horseModeOnSprite : horseModeOffSprite; + + passiveHorseButton.OnClick = new ButtonClickedEvent(); + + passiveHorseButton.OnClick.AddListener((UnityEngine.Events.UnityAction)delegate { + horseButtonState = horseModeSelectionBehavior.OnClick(); + if (horseButtonState) + { + if (horseModeOnSprite == null) horseModeOnSprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.HorseModeButtonOn.png", 75f); + spriteHorseButton.sprite = horseModeOnSprite; + } + else + { + if (horseModeOffSprite == null) horseModeOffSprite = Helpers.loadSpriteFromResources("TheEpicRoles.Resources.HorseModeButtonOff.png", 75f); + spriteHorseButton.sprite = horseModeOffSprite; + } + CredentialsPatch.LogoPatch.updateSprite(); + // Avoid wrong Player Particles floating around in the background + var particles = GameObject.FindObjectOfType(); + if (particles != null) + { + particles.pool.ReclaimAll(); + particles.Start(); + } + }); } } } \ No newline at end of file diff --git a/TheEpicRoles/Patches/RoleAssignmentPatch.cs b/TheEpicRoles/Patches/RoleAssignmentPatch.cs index 2e6c33c64..a29a40937 100644 --- a/TheEpicRoles/Patches/RoleAssignmentPatch.cs +++ b/TheEpicRoles/Patches/RoleAssignmentPatch.cs @@ -246,9 +246,8 @@ private static void assignDependentRoles(RoleAssignmentData data) { // Roles that prob have a dependent role bool guesserFlag = CustomOptionHolder.guesserSpawnBothRate.getSelection() > 0 && CustomOptionHolder.guesserSpawnRate.getSelection() > 0; - bool sheriffFlag = CustomOptionHolder.deputySpawnRate.getSelection() > 0 - && CustomOptionHolder.sheriffSpawnRate.getSelection() > 0 - && Sheriff.sheriff == null; + bool sheriffFlag = CustomOptionHolder.deputySpawnRate.getSelection() > 0 + && CustomOptionHolder.sheriffSpawnRate.getSelection() > 0; if (!guesserFlag && !sheriffFlag) return; // assignDependentRoles is not needed diff --git a/TheEpicRoles/Patches/ScreenShakePatch.cs b/TheEpicRoles/Patches/ScreenShakePatch.cs deleted file mode 100644 index a1ad8a46c..000000000 --- a/TheEpicRoles/Patches/ScreenShakePatch.cs +++ /dev/null @@ -1,35 +0,0 @@ -using HarmonyLib; - -/* - * This patch removes the screen shake effect from the lobby - * and from the game. - */ - -namespace TheEpicRoles.Patches { - [Harmony] - public class ScreenShakePatch { - - [HarmonyPatch(typeof(FollowerCamera), nameof(FollowerCamera.Update))] - private static class ShakePatch { - - private static float lobbyShakeAmount; - private static float gameShakeAmount; - static void Prefix(FollowerCamera __instance) { - // Set values depending on mod option - if (TheEpicRolesPlugin.ToggleScreenShake.Value) { - // Default Among Us shake values - lobbyShakeAmount = 0.03f; - gameShakeAmount = 0.02f; - } - else { - lobbyShakeAmount = gameShakeAmount = 0; - } - // Sets shakeAmount value depending on Gamemode / Gamestate - if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started || AmongUsClient.Instance.GameMode == GameModes.FreePlay) - __instance.shakeAmount = gameShakeAmount; - else - __instance.shakeAmount = lobbyShakeAmount; - } - } - } -} diff --git a/TheEpicRoles/RPC.cs b/TheEpicRoles/RPC.cs index a49682157..f5e9e54a7 100644 --- a/TheEpicRoles/RPC.cs +++ b/TheEpicRoles/RPC.cs @@ -380,6 +380,7 @@ public static void timeMasterRewindTime() { HudManager.Instance.FullScreen.gameObject.SetActive(true); HudManager.Instance.FullScreen.color = new Color(0f, 0.5f, 0.8f, 0.3f); HudManager.Instance.FullScreen.enabled = true; + HudManager.Instance.FullScreen.gameObject.SetActive(true); HudManager.Instance.StartCoroutine(Effects.Lerp(TimeMaster.rewindTime / 2, new Action((p) => { if (p == 1f) HudManager.Instance.FullScreen.enabled = false; }))); diff --git a/TheEpicRoles/Resources/BannerHorse.png b/TheEpicRoles/Resources/BannerHorse.png new file mode 100644 index 000000000..f67b5a21f Binary files /dev/null and b/TheEpicRoles/Resources/BannerHorse.png differ diff --git a/TheEpicRoles/Resources/HorseModeButtonOff.png b/TheEpicRoles/Resources/HorseModeButtonOff.png new file mode 100644 index 000000000..dac3a5db6 Binary files /dev/null and b/TheEpicRoles/Resources/HorseModeButtonOff.png differ diff --git a/TheEpicRoles/Resources/HorseModeButtonOn.png b/TheEpicRoles/Resources/HorseModeButtonOn.png new file mode 100644 index 000000000..ddd7ccbaa Binary files /dev/null and b/TheEpicRoles/Resources/HorseModeButtonOn.png differ diff --git a/TheEpicRoles/TheEpicRoles.cs b/TheEpicRoles/TheEpicRoles.cs index 70d2fa17f..dbb4817fc 100644 --- a/TheEpicRoles/TheEpicRoles.cs +++ b/TheEpicRoles/TheEpicRoles.cs @@ -175,7 +175,7 @@ public static void replaceCurrentSheriff(PlayerControl deputy) if (!formerSheriff) formerSheriff = sheriff; sheriff = deputy; currentTarget = null; - cooldown = CustomOptionHolder.jackalKillCooldown.getFloat(); + cooldown = CustomOptionHolder.sheriffCooldown.getFloat(); } public static void clearAndReload() { diff --git a/TheEpicRoles/TheEpicRoles.csproj b/TheEpicRoles/TheEpicRoles.csproj index 095d59e7c..0fd9b4b95 100644 --- a/TheEpicRoles/TheEpicRoles.csproj +++ b/TheEpicRoles/TheEpicRoles.csproj @@ -24,6 +24,6 @@ - +