From: dwd0tcom Date: Sun, 6 Feb 2022 23:17:51 +0000 (+0100) Subject: Version 3.4.3 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=74622740da69342168d64e3fd0db238778a8ee5c;p=rhonda%2Ftheotherroles.git Version 3.4.3 --- diff --git a/README.md b/README.md index ad1daef..f515b05 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein # Releases | Among Us - Version| Mod Version | Link | |----------|-------------|-----------------| +| 2021.12.15s| v3.4.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.4.2/TheOtherRoles.zip) +| 2021.12.15s| v3.4.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.4.2/TheOtherRoles.zip) | 2021.12.15s| v3.4.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.4.1/TheOtherRoles.zip) | 2021.12.15s| v3.4.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.4.0/TheOtherRoles.zip) | 2021.12.15s| v3.3.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.3.3/TheOtherRoles.zip) @@ -96,6 +98,18 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein # Changelog
Click to show the Changelog + +**Version 3.4.3** +- Fixed a bug where "Guesser Is Impostor Chance" crashed the role system +- Fixed a bug where a sidekicked Hacker was stuck +- Fixed a bug where a sidekicked Security Guard was stuck +- Fixed a bug where a disabled Report Button triggered handcuffs +- Fixed a bug where the Evil Guesser spawn rate was not correct +- Changed that Cleaner & Vulture exlude each other +- Changed that the lighter/darker color indicator can be displayed as dead + +**Version 3.4.2** +- Fixed a game breaking bug **Version 3.4.1** - Added a new mod option "Show Lighter/Darker" for meetings @@ -772,6 +786,7 @@ The Cleaner is an Impostor who has the ability to clean up dead bodies.\ \ **NOTE:** - The Kill and Clean cooldown are shared, preventing them from immediately cleaning their own kills. +- If there is a Cleaner in the game, there can't be a Vulture. ### Game Options | Name | Description | @@ -1395,6 +1410,7 @@ What is your killers role? (mini exluded) The Vulture does not have any tasks, they have to win the game as a solo.\ The Vulture is a neutral role that must eat a specified number of corpses (depending on the options) in order to win.\ Depending on the options, when a player dies, the Vulture gets an arrow pointing to the corpse. +If there is a Vulture in the game, there can't be a Cleaner. ### Game Options | Name | Description | diff --git a/TheOtherRoles/Buttons.cs b/TheOtherRoles/Buttons.cs index 0fca0e4..73df418 100644 --- a/TheOtherRoles/Buttons.cs +++ b/TheOtherRoles/Buttons.cs @@ -160,7 +160,7 @@ namespace TheOtherRoles // Vent Button if enabled if (PlayerControl.LocalPlayer.roleCanUseVents()) addReplacementHandcuffedButton(arsonistButton, new Vector3(-1.8f, 1f, 0), couldUse: () => { return HudManager.Instance.ImpostorVentButton.currentTarget != null; }); // Report Button - addReplacementHandcuffedButton(arsonistButton, new Vector3(-0.9f, -0.06f, 0), () => { return HudManager.Instance.ReportButton.enabled; }); + addReplacementHandcuffedButton(arsonistButton, new Vector3(-0.9f, -0.06f, 0), () => { return HudManager.Instance.ReportButton.graphic.color == Palette.EnabledColor; }); } else if (!handcuffed && deputyHandcuffedButtons.ContainsKey(PlayerControl.LocalPlayer.PlayerId)) // Reset to original. Disables the replacements, enables the original buttons. { diff --git a/TheOtherRoles/CustomOptionHolder.cs b/TheOtherRoles/CustomOptionHolder.cs index c8491fc..88a2796 100644 --- a/TheOtherRoles/CustomOptionHolder.cs +++ b/TheOtherRoles/CustomOptionHolder.cs @@ -483,6 +483,8 @@ namespace TheOtherRoles { blockedRolePairings.Add((byte)RoleId.Warlock, new [] { (byte)RoleId.Vampire}); blockedRolePairings.Add((byte)RoleId.Spy, new [] { (byte)RoleId.Mini}); blockedRolePairings.Add((byte)RoleId.Mini, new [] { (byte)RoleId.Spy}); + blockedRolePairings.Add((byte)RoleId.Vulture, new [] { (byte)RoleId.Cleaner}); + blockedRolePairings.Add((byte)RoleId.Cleaner, new [] { (byte)RoleId.Vulture}); } } diff --git a/TheOtherRoles/Main.cs b/TheOtherRoles/Main.cs index 25aa984..055a567 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.4.2"; + public const string VersionString = "3.4.3"; public static System.Version Version = System.Version.Parse(VersionString); internal static BepInEx.Logging.ManualLogSource Logger; diff --git a/TheOtherRoles/Patches/RoleAssignmentPatch.cs b/TheOtherRoles/Patches/RoleAssignmentPatch.cs index c642d1c..cce8c3d 100644 --- a/TheOtherRoles/Patches/RoleAssignmentPatch.cs +++ b/TheOtherRoles/Patches/RoleAssignmentPatch.cs @@ -19,6 +19,7 @@ namespace TheOtherRoles.Patches { class RoleManagerSelectRolesPatch { private static int crewValues; private static int impValues; + private static bool isEvilGuesser; public static void Postfix() { MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ResetVaribles, Hazel.SendOption.Reliable, -1); AmongUsClient.Instance.FinishRpcImmediately(writer); @@ -162,13 +163,12 @@ namespace TheOtherRoles.Patches { } // Assign Guesser (chance to be impostor based on setting) + isEvilGuesser = rnd.Next(1, 101) <= CustomOptionHolder.guesserIsImpGuesserRate.getSelection() * 10; if ((CustomOptionHolder.guesserSpawnBothRate.getSelection() > 0 && CustomOptionHolder.guesserSpawnRate.getSelection() == 10) || CustomOptionHolder.guesserSpawnBothRate.getSelection() == 0) { - - if (rnd.Next(1, 101) <= CustomOptionHolder.guesserIsImpGuesserRate.getSelection() * 10) - data.impSettings.Add((byte)RoleId.EvilGuesser, CustomOptionHolder.guesserSpawnRate.getSelection()); - else data.crewSettings.Add((byte)RoleId.NiceGuesser, CustomOptionHolder.guesserSpawnRate.getSelection()); + if (isEvilGuesser) data.impSettings.Add((byte)RoleId.EvilGuesser, CustomOptionHolder.guesserSpawnRate.getSelection()); + else data.crewSettings.Add((byte)RoleId.NiceGuesser, CustomOptionHolder.guesserSpawnRate.getSelection()); } @@ -236,8 +236,12 @@ namespace TheOtherRoles.Patches { 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; + bool guesserFlag = CustomOptionHolder.guesserSpawnBothRate.getSelection() > 0 + && CustomOptionHolder.guesserSpawnRate.getSelection() > 0; + bool sheriffFlag = CustomOptionHolder.deputySpawnRate.getSelection() > 0 + && CustomOptionHolder.sheriffSpawnRate.getSelection() > 0 + && Sheriff.sheriff == null; + if (!guesserFlag && !sheriffFlag) return; // assignDependentRoles is not needed int crew = data.crewmates.Count < data.maxCrewmateRoles ? data.crewmates.Count : data.maxCrewmateRoles; // Max number of crew loops @@ -249,8 +253,6 @@ namespace TheOtherRoles.Patches { bool isSheriff = !sheriffFlag; bool isGuesser = !guesserFlag; - bool isEvilGuesser = (rnd.Next(1, 101) <= CustomOptionHolder.guesserIsImpGuesserRate.getSelection() * 10); - // --- Simulate Crew & Imp ticket system --- while (crew > 0 && (!isSheriff || (!isEvilGuesser && !isGuesser))) { if (!isSheriff && rnd.Next(crewValues) < CustomOptionHolder.sheriffSpawnRate.getSelection()) isSheriff = true; @@ -259,7 +261,7 @@ namespace TheOtherRoles.Patches { crewValues -= crewSteps; } while (imp > 0 && (isEvilGuesser && !isGuesser)) { - if (rnd.Next(crewValues) < CustomOptionHolder.guesserSpawnRate.getSelection()) isGuesser = true; + if (rnd.Next(impValues) < CustomOptionHolder.guesserSpawnRate.getSelection()) isGuesser = true; imp--; impValues -= impSteps; } diff --git a/TheOtherRoles/Patches/UpdatePatch.cs b/TheOtherRoles/Patches/UpdatePatch.cs index cb49551..2110737 100644 --- a/TheOtherRoles/Patches/UpdatePatch.cs +++ b/TheOtherRoles/Patches/UpdatePatch.cs @@ -197,12 +197,10 @@ namespace TheOtherRoles.Patches { } // Display lighter / darker color for all alive players - if (PlayerControl.LocalPlayer != null && !PlayerControl.LocalPlayer.Data.IsDead) { - if (MeetingHud.Instance != null && MapOptions.showLighterDarker) { - foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates) { - var target = Helpers.playerById(player.TargetPlayerId); - if (target != null) player.NameText.text += $" ({(Helpers.isLighterColor(target.Data.DefaultOutfit.ColorId) ? "L" : "D")})"; - } + if (PlayerControl.LocalPlayer != null && MeetingHud.Instance != null && MapOptions.showLighterDarker) { + foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates) { + var target = Helpers.playerById(player.TargetPlayerId); + if (target != null) player.NameText.text += $" ({(Helpers.isLighterColor(target.Data.DefaultOutfit.ColorId) ? "L" : "D")})"; } } } diff --git a/TheOtherRoles/Patches/UsablesPatch.cs b/TheOtherRoles/Patches/UsablesPatch.cs index f811fcc..7dd49d7 100644 --- a/TheOtherRoles/Patches/UsablesPatch.cs +++ b/TheOtherRoles/Patches/UsablesPatch.cs @@ -169,7 +169,7 @@ namespace TheOtherRoles.Patches { [HarmonyPatch(typeof(ReportButton), nameof(ReportButton.DoClick))] class ReportButtonDoClickPatch { public static bool Prefix(ReportButton __instance) { - if (__instance.isActiveAndEnabled && Deputy.handcuffedPlayers.Contains(PlayerControl.LocalPlayer.PlayerId)) Deputy.setHandcuffedKnows(); + if (__instance.isActiveAndEnabled && Deputy.handcuffedPlayers.Contains(PlayerControl.LocalPlayer.PlayerId) && __instance.graphic.color == Palette.EnabledColor) Deputy.setHandcuffedKnows(); return !Deputy.handcuffedKnows.ContainsKey(PlayerControl.LocalPlayer.PlayerId); } } diff --git a/TheOtherRoles/RPC.cs b/TheOtherRoles/RPC.cs index 5a02013..1a014db 100644 --- a/TheOtherRoles/RPC.cs +++ b/TheOtherRoles/RPC.cs @@ -566,6 +566,7 @@ namespace TheOtherRoles DestroyableSingleton.Instance.SetRole(player, RoleTypes.Crewmate); erasePlayerRoles(player.PlayerId, true); Sidekick.sidekick = player; + if (player.PlayerId == PlayerControl.LocalPlayer.PlayerId) PlayerControl.LocalPlayer.moveable = true; } Jackal.canCreateSidekick = false; } diff --git a/TheOtherRoles/TheOtherRoles.csproj b/TheOtherRoles/TheOtherRoles.csproj index 53c8020..0d40409 100644 --- a/TheOtherRoles/TheOtherRoles.csproj +++ b/TheOtherRoles/TheOtherRoles.csproj @@ -1,7 +1,7 @@ netstandard2.1 - 3.4.2 + 3.4.3 TheOtherRoles Eisbison