]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
Version 3.4.3
authordwd0tcom <info@dominikwierl.com>
Sun, 6 Feb 2022 23:17:51 +0000 (00:17 +0100)
committerdwd0tcom <info@dominikwierl.com>
Sun, 6 Feb 2022 23:17:51 +0000 (00:17 +0100)
README.md
TheOtherRoles/Buttons.cs
TheOtherRoles/CustomOptionHolder.cs
TheOtherRoles/Main.cs
TheOtherRoles/Patches/RoleAssignmentPatch.cs
TheOtherRoles/Patches/UpdatePatch.cs
TheOtherRoles/Patches/UsablesPatch.cs
TheOtherRoles/RPC.cs
TheOtherRoles/TheOtherRoles.csproj

index ad1daef8529d8a5232d5cd39566a188f29c6a72a..f515b05431b5161353a2e4c13ba258e715125ee7 100644 (file)
--- 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
 <details>
   <summary>Click to show the Changelog</summary>
+
+**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 |
index 0fca0e40be6310b14a6e5fa7a99e1bf99e39a0d9..73df41878a414108a62964d3fda28f53424e5d63 100644 (file)
@@ -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.
             {
index c8491fce6f124c4098d84516da7097e15a66be05..88a27968e90b3581c20e723398d4b7fbd6069fa9 100644 (file)
@@ -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});
             
         }
     }
index 25aa98468adb3a5339aed04553855f33906ef73f..055a56789971f0a29b465da252bee0054daeef69 100644 (file)
@@ -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;
index c642d1c38e599b2135ba54340df4d415585827bf..cce8c3d5bfb9299166c06d5d3fe04becb3f17969 100644 (file)
@@ -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;
             }
index cb49551034fd4eee6ed48b33216261fadad2cd12..2110737586ca67c074df544153c05334aa487eb3 100644 (file)
@@ -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")})";
                 }
             }
         }
index f811fcc28910b32e40e012d6ce4d3dd4191ab612..7dd49d7fcabd25049d56385322fe4fb034e6b478 100644 (file)
@@ -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);
         }
     }
index 5a020137480ac7a2830ab3726b110f3d539041e4..1a014db423209d640bd3acaf7ae48a89c9a4e735 100644 (file)
@@ -566,6 +566,7 @@ namespace TheOtherRoles
                 DestroyableSingleton<RoleManager>.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;
         }
index 53c802003aa20dfcf178cfe926db319096bbf1af..0d40409cff9073cab50e128d004513ea188349c1 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
         <TargetFramework>netstandard2.1</TargetFramework>
-        <Version>3.4.2</Version>
+        <Version>3.4.3</Version>
         <Description>TheOtherRoles</Description>
         <Authors>Eisbison</Authors>
     </PropertyGroup>