From eea137b589aeaa5f19cc6bdb79817ca9c440dd17 Mon Sep 17 00:00:00 2001 From: Eisbison Date: Wed, 1 Dec 2021 17:54:45 +0100 Subject: [PATCH] v3.2.4 --- README.md | 8 +++++++- TheOtherRoles/Buttons.cs | 15 +++------------ TheOtherRoles/CustomOptionHolder.cs | 2 +- TheOtherRoles/Main.cs | 2 +- TheOtherRoles/Patches/ClientOptionsPatch.cs | 10 +++++----- TheOtherRoles/Patches/CredentialsPatch.cs | 2 +- TheOtherRoles/Patches/EndGamePatch.cs | 2 +- TheOtherRoles/Patches/PlayerControlPatch.cs | 9 +++------ TheOtherRoles/TheOtherRoles.cs | 2 ++ TheOtherRoles/TheOtherRoles.csproj | 2 +- 10 files changed, 25 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 41e4b3003..63f644c1d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein # Releases | Among Us - Version| Mod Version | Link | |----------|-------------|-----------------| +| 2021.11.9.5s| v3.2.4| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.2.4/TheOtherRoles.zip) | 2021.11.9.5s| v3.2.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.2.3/TheOtherRoles.zip) | 2021.11.9.5s| v3.2.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.2.2/TheOtherRoles.zip) | 2021.11.9.5s| v3.2.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.2.1/TheOtherRoles.zip) @@ -87,11 +88,15 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
Click to show the Changelog +**Version 3.2.4** +- Fixed a bug where the Vampire teleported when the bitten player died +- The settings UI has been improved by [Amsyar Rasyiq](https://github.com/amsyarasyiq) +- New option to the Bait "Warn The Killer With A Flash", created by [gendelo3](https://github.com/gendelo3) + **Version 3.2.3** - Fixed a bug where the role of a dead client was visible to the Pursuer - Fixed a bug where the Morphling changed their color when killing players - Fixed a bug where voting the Lover partner of a Lover Witch did not safe the spellbound players -- Fixed a bug where the Vampire would teleport to the bitten player in some cases - When the Lawyer dies, the client doesn't have the client mark (§) anymore, making the client aware of the fact that the Lawyer can't steal the win anymore (only relevant if the "Client Knows" option is on) **Version 3.2.2** @@ -1263,6 +1268,7 @@ an outline or all vents do). | Bait Spawn Chance | - | Bait Highlight All Vents | If set to true, all vents will be highlighted if a player is inside of one of them. If set to false, only the vents where players are siting in will be highlighted. | Bait Report Delay | - +| Warn The Killer With A Flash | - ----------------------- ## Medium diff --git a/TheOtherRoles/Buttons.cs b/TheOtherRoles/Buttons.cs index e36c52656..9c9f25262 100644 --- a/TheOtherRoles/Buttons.cs +++ b/TheOtherRoles/Buttons.cs @@ -425,7 +425,7 @@ public static void Postfix(HudManager __instance) HudManager.Instance.StartCoroutine(Effects.Lerp(Vampire.delay, new Action((p) => { // Delayed action if (p == 1f) { // Perform kill if possible and reset bitten (regardless whether the kill was successful or not) - Helpers.checkMuderAttemptAndKill(Vampire.vampire, Vampire.bitten); + Helpers.checkMuderAttemptAndKill(Vampire.vampire, Vampire.bitten, showAnimation: false); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireSetBitten, Hazel.SendOption.Reliable, -1); writer.Write(byte.MaxValue); writer.Write(byte.MaxValue); @@ -676,19 +676,10 @@ public static void Postfix(HudManager __instance) warlockCurseButton.Sprite = Warlock.getCurseKillButtonSprite(); warlockCurseButton.Timer = 1f; } else if (Warlock.curseVictim != null && Warlock.curseVictimTarget != null) { - MurderAttemptResult murder = Helpers.checkMuderAttempt(Warlock.warlock, Warlock.curseVictimTarget); + MurderAttemptResult murder = Helpers.checkMuderAttemptAndKill(Warlock.warlock, Warlock.curseVictimTarget, showAnimation: false); if (murder == MurderAttemptResult.SuppressKill) return; - // Curse Kill - if (murder == MurderAttemptResult.PerformKill) { - MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1); - killWriter.Write(Warlock.warlock.Data.PlayerId); - killWriter.Write(Warlock.curseVictimTarget.PlayerId); - killWriter.Write((byte)0); - AmongUsClient.Instance.FinishRpcImmediately(killWriter); - RPCProcedure.uncheckedMurderPlayer(Warlock.warlock.Data.PlayerId, Warlock.curseVictimTarget.PlayerId, (byte)0); - } - + // If blanked or killed if(Warlock.rootTime > 0) { PlayerControl.LocalPlayer.moveable = false; PlayerControl.LocalPlayer.NetTransform.Halt(); // Stop current movement so the warlock is not just running straight into the next object diff --git a/TheOtherRoles/CustomOptionHolder.cs b/TheOtherRoles/CustomOptionHolder.cs index eb80abc42..0545db72a 100644 --- a/TheOtherRoles/CustomOptionHolder.cs +++ b/TheOtherRoles/CustomOptionHolder.cs @@ -413,7 +413,7 @@ public static void Load() { baitSpawnRate = CustomOption.Create(330, cs(Bait.color, "Bait"), rates, null, true); baitHighlightAllVents = CustomOption.Create(331, "Highlight All Vents If A Vent Is Occupied", false, baitSpawnRate); baitReportDelay = CustomOption.Create(332, "Bait Report Delay", 0f, 0f, 10f, 1f, baitSpawnRate); - baitShowKillFlash = CustomOption.Create(335, "Show Flash to Baits Killer", true, baitSpawnRate); + baitShowKillFlash = CustomOption.Create(333, "Warn The Killer With A Flash", true, baitSpawnRate); mediumSpawnRate = CustomOption.Create(360, cs(Medium.color, "Medium"), rates, null, true); mediumCooldown = CustomOption.Create(361, "Medium Questioning Cooldown", 30f, 5f, 120f, 5f, mediumSpawnRate); diff --git a/TheOtherRoles/Main.cs b/TheOtherRoles/Main.cs index ccf8c701e..43033adb6 100644 --- a/TheOtherRoles/Main.cs +++ b/TheOtherRoles/Main.cs @@ -21,7 +21,7 @@ namespace TheOtherRoles public class TheOtherRolesPlugin : BasePlugin { public const string Id = "me.eisbison.theotherroles"; - public const string VersionString = "3.2.3"; + public const string VersionString = "3.2.4"; public static System.Version Version = System.Version.Parse(VersionString); internal static BepInEx.Logging.ManualLogSource Logger; diff --git a/TheOtherRoles/Patches/ClientOptionsPatch.cs b/TheOtherRoles/Patches/ClientOptionsPatch.cs index 548b49ffd..2e50869ae 100644 --- a/TheOtherRoles/Patches/ClientOptionsPatch.cs +++ b/TheOtherRoles/Patches/ClientOptionsPatch.cs @@ -15,10 +15,10 @@ public static class ClientOptionsPatch { private static SelectionBehaviour[] AllOptions = { new SelectionBehaviour("Streamer Mode", () => TheOtherRolesPlugin.StreamerMode.Value = !TheOtherRolesPlugin.StreamerMode.Value, TheOtherRolesPlugin.StreamerMode.Value), - new SelectionBehaviour("Ghosts See Tasks", () => TheOtherRolesPlugin.GhostsSeeTasks.Value = !TheOtherRolesPlugin.GhostsSeeTasks.Value, TheOtherRolesPlugin.GhostsSeeTasks.Value), - new SelectionBehaviour("Vote Visible For Ghosts", () => TheOtherRolesPlugin.GhostsSeeVotes.Value = !TheOtherRolesPlugin.GhostsSeeVotes.Value, TheOtherRolesPlugin.GhostsSeeVotes.Value), - new SelectionBehaviour("Ghosts Can See Roles", () => TheOtherRolesPlugin.GhostsSeeRoles.Value = !TheOtherRolesPlugin.GhostsSeeRoles.Value, TheOtherRolesPlugin.GhostsSeeRoles.Value), - new SelectionBehaviour("Show Role Summary", () => TheOtherRolesPlugin.ShowRoleSummary.Value = !TheOtherRolesPlugin.ShowRoleSummary.Value, TheOtherRolesPlugin.ShowRoleSummary.Value), + new SelectionBehaviour("Ghosts See Remaining Tasks", () => MapOptions.ghostsSeeTasks = TheOtherRolesPlugin.GhostsSeeTasks.Value = !TheOtherRolesPlugin.GhostsSeeTasks.Value, TheOtherRolesPlugin.GhostsSeeTasks.Value), + new SelectionBehaviour("Ghosts Can See Votes", () => MapOptions.ghostsSeeVotes = TheOtherRolesPlugin.GhostsSeeVotes.Value = !TheOtherRolesPlugin.GhostsSeeVotes.Value, TheOtherRolesPlugin.GhostsSeeVotes.Value), + new SelectionBehaviour("Ghosts Can See Roles", () => MapOptions.ghostsSeeRoles = TheOtherRolesPlugin.GhostsSeeRoles.Value = !TheOtherRolesPlugin.GhostsSeeRoles.Value, TheOtherRolesPlugin.GhostsSeeRoles.Value), + new SelectionBehaviour("Show Role Summary", () => MapOptions.showRoleSummary = TheOtherRolesPlugin.ShowRoleSummary.Value = !TheOtherRolesPlugin.ShowRoleSummary.Value, TheOtherRolesPlugin.ShowRoleSummary.Value), }; private static GameObject popUp; @@ -93,7 +93,7 @@ private static void InitializeMoreButton(OptionsMenuBehaviour __instance) moreOptions.transform.localPosition = _origin.Value + Vector3.right * 1.3f; moreOptions.gameObject.SetActive(true); - moreOptions.Text.text = "More Options..."; + moreOptions.Text.text = "Mod Options..."; var moreOptionsButton = moreOptions.GetComponent(); moreOptionsButton.OnClick = new ButtonClickedEvent(); moreOptionsButton.OnClick.AddListener((Action) (() => diff --git a/TheOtherRoles/Patches/CredentialsPatch.cs b/TheOtherRoles/Patches/CredentialsPatch.cs index d241b3995..034bc1550 100644 --- a/TheOtherRoles/Patches/CredentialsPatch.cs +++ b/TheOtherRoles/Patches/CredentialsPatch.cs @@ -19,7 +19,7 @@ public static class CredentialsPatch { $@"Modded by Eisbison, Thunderstorm584, EndOfFile & Mallöris Design by Bavari"; - public static string contributorsCredentials = "GitHub Contributors: Alex2911, gendelo3"; + public static string contributorsCredentials = "GitHub Contributors: Alex2911, amsyarasyiq, gendelo3"; [HarmonyPatch(typeof(VersionShower), nameof(VersionShower.Start))] private static class VersionShowerPatch diff --git a/TheOtherRoles/Patches/EndGamePatch.cs b/TheOtherRoles/Patches/EndGamePatch.cs index 100a5c1fc..21732d4a8 100644 --- a/TheOtherRoles/Patches/EndGamePatch.cs +++ b/TheOtherRoles/Patches/EndGamePatch.cs @@ -146,7 +146,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End TempData.winners.Add(new WinningPlayerData(p.Data)); else if (p == Pursuer.pursuer && !Pursuer.pursuer.Data.IsDead) TempData.winners.Add(new WinningPlayerData(p.Data)); - else if (p != Jester.jester && p != Jackal.jackal && p != Sidekick.sidekick && p != Arsonist.arsonist && !Jackal.formerJackals.Contains(p) && !p.Data.Role.IsImpostor) + else if (p != Jester.jester && p != Jackal.jackal && p != Sidekick.sidekick && p != Arsonist.arsonist && p != Vulture.vulture && !Jackal.formerJackals.Contains(p) && !p.Data.Role.IsImpostor) TempData.winners.Add(new WinningPlayerData(p.Data)); } } diff --git a/TheOtherRoles/Patches/PlayerControlPatch.cs b/TheOtherRoles/Patches/PlayerControlPatch.cs index dd84fd899..5f7985104 100644 --- a/TheOtherRoles/Patches/PlayerControlPatch.cs +++ b/TheOtherRoles/Patches/PlayerControlPatch.cs @@ -944,18 +944,15 @@ public static void Postfix(PlayerControl __instance, [HarmonyArgument(0)]PlayerC } // Show flash on bait kill to the killer if enabled - if (Bait.bait != null && PlayerControl.LocalPlayer == deadPlayer.killerIfExisting && target == Bait.bait - && CustomOptionHolder.baitShowKillFlash.getBool() && __instance == PlayerControl.LocalPlayer) { + if (Bait.bait != null && target == Bait.bait && Bait.showKillFlash && __instance == PlayerControl.LocalPlayer) { HudManager.Instance.FullScreen.enabled = true; HudManager.Instance.StartCoroutine(Effects.Lerp(1f, new Action((p) => { var renderer = HudManager.Instance.FullScreen; - if (p < 0.5) - { + if (p < 0.5) { if (renderer != null) renderer.color = new Color(204f / 255f, 102f / 255f, 0f / 255f, Mathf.Clamp01(p * 2 * 0.75f)); } - else - { + else { if (renderer != null) renderer.color = new Color(204f / 255f, 102f / 255f, 0f / 255f, Mathf.Clamp01((1 - p) * 2 * 0.75f)); } diff --git a/TheOtherRoles/TheOtherRoles.cs b/TheOtherRoles/TheOtherRoles.cs index 6190ec5ed..93a08c480 100644 --- a/TheOtherRoles/TheOtherRoles.cs +++ b/TheOtherRoles/TheOtherRoles.cs @@ -1039,6 +1039,7 @@ public static class Bait { public static bool highlightAllVents = false; public static float reportDelay = 0f; + public static bool showKillFlash = true; public static bool reported = false; @@ -1047,6 +1048,7 @@ public static void clearAndReload() { reported = false; highlightAllVents = CustomOptionHolder.baitHighlightAllVents.getBool(); reportDelay = CustomOptionHolder.baitReportDelay.getFloat(); + showKillFlash = CustomOptionHolder.baitShowKillFlash.getBool(); } } diff --git a/TheOtherRoles/TheOtherRoles.csproj b/TheOtherRoles/TheOtherRoles.csproj index 07832d180..6e0becc7d 100644 --- a/TheOtherRoles/TheOtherRoles.csproj +++ b/TheOtherRoles/TheOtherRoles.csproj @@ -1,7 +1,7 @@ netstandard2.1 - 3.2.3 + 3.2.4 TheOtherRoles Eisbison