]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
Version 3.3.3
authordwd0tcom <info@dominikwierl.com>
Mon, 20 Dec 2021 22:01:52 +0000 (23:01 +0100)
committerdwd0tcom <info@dominikwierl.com>
Mon, 20 Dec 2021 22:01:52 +0000 (23:01 +0100)
README.md
TheOtherRoles/Buttons.cs
TheOtherRoles/CustomOptionHolder.cs
TheOtherRoles/Main.cs
TheOtherRoles/Patches/CustomServerPatch.cs
TheOtherRoles/Patches/MeetingPatch.cs
TheOtherRoles/Patches/RoleAssignmentPatch.cs
TheOtherRoles/Patches/UpdatePatch.cs
TheOtherRoles/TheOtherRoles.cs
TheOtherRoles/TheOtherRoles.csproj

index 6c602889af21c3f39f821722e09106d8477ff977..cc272772d2f0bfecdfc44bb4005669c299832d27 100644 (file)
--- a/README.md
+++ b/README.md
@@ -38,6 +38,8 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
 # Releases
 | Among Us - Version| Mod Version | Link |
 |----------|-------------|-----------------|
+| 2021.12.15s| v3.3.3| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.3.3/TheOtherRoles.zip)
+| 2021.12.15s| v3.3.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.3.2/TheOtherRoles.zip)
 | 2021.12.14s| v3.3.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.3.1/TheOtherRoles.zip)
 | 2021.12.14s| v3.3.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.3.0/TheOtherRoles.zip)
 | 2021.11.9.5s| v3.2.4| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v3.2.4/TheOtherRoles.zip)
@@ -90,6 +92,16 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
 <details>
   <summary>Click to show the Changelog</summary>
 
+**Version 3.3.3**
+- Fixed a bug where a guessed Guesser could guess
+- Fixed a bug where buttons were visible during the meeting
+- Removed Hacker vitals for Skeld & dlekS
+- Changed the Guesser option "Other Guesser Spawn Rate" to "Both Guesser Spawn Rate" (now only take effect when the chance for the first guesser was successful)
+- Changed Hacker vitals to doorlog for MIRA HQ
+  
+**Version 3.3.2**
+- Fixed a bug where you can't create a lobby on Among Us 2021.12.15
+
 **Version 3.3.1**
 - Fixed a bug where sometimes the Evil Guesser could not guess. Thanks @tomarai
 
@@ -842,7 +854,7 @@ Depending on the options, the Guesser can't guess the shielded player and depend
 | Guesses Visible In Ghost Chat| -
 | Guesses Ignore The Medic Shield| -
 | Evil Guesser Can Guess The Spy| -
-| Other Guesser Spawn Rate| -
+| Both Guesser Spawn Rate| -
 
 -----------------------
 
index 7f4677589909fe21b310e4c80cfa484f6acda1ea..de050d2cb297ef954656a2da9e2246fea1a7752b 100644 (file)
@@ -409,7 +409,7 @@ namespace TheOtherRoles
 
             hackerVitalsButton = new CustomButton(
                () => {
-                   if (!Minigame.Instance) {
+                   if (PlayerControl.GameOptions.MapId != 1) {
                        if (Hacker.vitals == null) {
                            var e = UnityEngine.Object.FindObjectsOfType<SystemConsole>().FirstOrDefault(x => x.gameObject.name.Contains("panel_vitals"));
                            if (e == null || Camera.main == null) return;
@@ -418,12 +418,23 @@ namespace TheOtherRoles
                        Hacker.vitals.transform.SetParent(Camera.main.transform, false);
                        Hacker.vitals.transform.localPosition = new Vector3(0.0f, 0.0f, -50f);
                        Hacker.vitals.Begin(null);
+                   } else {
+                       if (Hacker.doorLog == null) {
+                           var e = UnityEngine.Object.FindObjectsOfType<SystemConsole>().FirstOrDefault(x => x.gameObject.name.Contains("SurvLogConsole"));
+                           if (e == null || Camera.main == null) return;
+                           Hacker.doorLog = UnityEngine.Object.Instantiate(e.MinigamePrefab, Camera.main.transform, false);
+                       }
+                       Hacker.doorLog.transform.SetParent(Camera.main.transform, false);
+                       Hacker.doorLog.transform.localPosition = new Vector3(0.0f, 0.0f, -50f);
+                       Hacker.doorLog.Begin(null);
                    }
                    Hacker.chargesVitals--;
                },
-               () => { return Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead;},
+               () => { return Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead && PlayerControl.GameOptions.MapId != 0 && PlayerControl.GameOptions.MapId != 3; },
                () => {
                    if (hackerVitalsChargesText != null) hackerVitalsChargesText.text = $"{Hacker.chargesVitals} / {Hacker.toolsNumber}";
+                   hackerVitalsButton.actionButton.graphic.sprite = PlayerControl.GameOptions.MapId == 1 ? Hacker.getLogSprite() : Hacker.getVitalsSprite();
+                   hackerVitalsButton.actionButton.OverrideText(PlayerControl.GameOptions.MapId == 1 ? "DOORLOG" : "VITALS");
                    return PlayerControl.LocalPlayer.CanMove && Hacker.chargesVitals > 0;
                },
                () => {
@@ -439,10 +450,13 @@ namespace TheOtherRoles
                0f,
                () => { 
                    hackerVitalsButton.Timer = hackerVitalsButton.MaxTimer;
-                   if (Minigame.Instance) Hacker.vitals.ForceClose();
+                   if (Minigame.Instance) {
+                       if (PlayerControl.GameOptions.MapId == 1) Hacker.doorLog.ForceClose();
+                       else Hacker.vitals.ForceClose();
+                   }
                },
                false,
-               "VITALS"
+               PlayerControl.GameOptions.MapId == 1 ? "DOORLOG" : "VITALS"
            );
 
             // Hacker Vitals Charges
@@ -810,6 +824,7 @@ namespace TheOtherRoles
                         writer.EndMessage();
                         RPCProcedure.sealVent(SecurityGuard.ventTarget.Id);
                         SecurityGuard.ventTarget = null;
+                        
                     } else if (PlayerControl.GameOptions.MapId != 1) { // Place camera if there's no vent and it's not MiraHQ
                         var pos = PlayerControl.LocalPlayer.transform.position;
                         byte[] buff = new byte[sizeof(float) * 2];
index e574e551b8634621e719049a69604da7d6e41067..5f1a2fdd1b09f97752ae449895e26ccecd599dc2 100644 (file)
@@ -304,7 +304,7 @@ namespace TheOtherRoles {
             guesserShowInfoInGhostChat = CustomOption.Create(314, "Guesses Visible In Ghost Chat", true, guesserSpawnRate);
             guesserKillsThroughShield  = CustomOption.Create(315, "Guesses Ignore The Medic Shield", true, guesserSpawnRate);
             guesserEvilCanKillSpy  = CustomOption.Create(316, "Evil Guesser Can Guess The Spy", true, guesserSpawnRate);
-            guesserSpawnBothRate = CustomOption.Create(317, "Other Guesser Spawn Rate", rates, guesserSpawnRate);
+            guesserSpawnBothRate = CustomOption.Create(317, "Both Guesser Spawn Rate", rates, guesserSpawnRate);
 
             jesterSpawnRate = CustomOption.Create(60, cs(Jester.color, "Jester"), rates, null, true);
             jesterCanCallEmergency = CustomOption.Create(61, "Jester can call emergency meeting", true, jesterSpawnRate);
index 71ff9251a116138998a4c8fae55c37de018e599e..bf0f5f07251fcc99cf9c2b3ff94b62f7e4bba8b6 100644 (file)
@@ -21,7 +21,7 @@ namespace TheOtherRoles
     public class TheOtherRolesPlugin : BasePlugin
     {
         public const string Id = "me.eisbison.theotherroles";
-        public const string VersionString = "3.3.1";
+        public const string VersionString = "3.3.3";
         public static System.Version Version = System.Version.Parse(VersionString);
         internal static BepInEx.Logging.ManualLogSource Logger;
 
index 591cdb7520d00742606deda8c9f0c88e7083fdcd..006e590655e06cb8e8bd407debf9cd77e5642f9a 100644 (file)
@@ -25,7 +25,7 @@ namespace TheOtherRoles.Patches
             DnsRegionInfo region = serverManager.CurrentRegion.TryCast<DnsRegionInfo>();
             if (region == null || !region.Fqdn.EndsWith("among.us")) {
                 var remoteEndPoint = new Il2CppSystem.Net.IPEndPoint(Il2CppSystem.Net.IPAddress.Parse(targetIp), (int)(targetPort - 3));
-                __result = new Hazel.Udp.UnityUdpClientConnection(remoteEndPoint);
+                __result = new Hazel.Udp.UnityUdpClientConnection(null, remoteEndPoint);
                 return false;
             }
             return true;
index f5a835274bdda11be5c5bdcea0de44336b1af82b..2fc30cc33ae9c9b49c1243bf5296f6065dc229ef 100644 (file)
@@ -277,7 +277,7 @@ namespace TheOtherRoles.Patches {
                 int copiedIndex = i;
 
                 button.GetComponent<PassiveButton>().OnClick.RemoveAllListeners();
-                button.GetComponent<PassiveButton>().OnClick.AddListener((UnityEngine.Events.UnityAction)(() => {
+                if (!PlayerControl.LocalPlayer.Data.IsDead) button.GetComponent<PassiveButton>().OnClick.AddListener((UnityEngine.Events.UnityAction)(() => {
                     if (selectedButton != button) {
                         selectedButton = button;
                         buttons.ForEach(x => x.GetComponent<SpriteRenderer>().color = x == selectedButton ? Color.red : Color.white);
index 2afc83e6c21057c50fb713411a95e9bb53878f7e..f396298f55f9e3ee4707809bca2f8326664bafad 100644 (file)
@@ -160,12 +160,27 @@ namespace TheOtherRoles.Patches {
             }
 
             // Assign Guesser (chance to be impostor based on setting)
-            if (data.impostors.Count > 0 && data.maxImpostorRoles > 0 &&  rnd.Next(1, 101) <= CustomOptionHolder.guesserIsImpGuesserRate.getSelection() * 10) {
-                data.impSettings.Add((byte)RoleId.EvilGuesser, CustomOptionHolder.guesserSpawnRate.getSelection());
-                if (data.crewmates.Count > 0 && data.maxCrewmateRoles > 0) data.crewSettings.Add((byte)RoleId.NiceGuesser, CustomOptionHolder.guesserSpawnBothRate.getSelection()); // Second guesser
-            } else if (data.crewmates.Count > 0 && data.maxCrewmateRoles > 0) {
-                data.crewSettings.Add((byte)RoleId.NiceGuesser, CustomOptionHolder.guesserSpawnRate.getSelection());
-                if (data.impostors.Count > 0 && data.maxImpostorRoles > 0) data.impSettings.Add((byte)RoleId.EvilGuesser, CustomOptionHolder.guesserSpawnBothRate.getSelection()); // Second guesser
+            bool isEvilGuesser = (rnd.Next(1, 101) <= CustomOptionHolder.guesserIsImpGuesserRate.getSelection() * 10);
+            if (CustomOptionHolder.guesserSpawnBothRate.getSelection() > 0) {
+                if (rnd.Next(1, 101) <= CustomOptionHolder.guesserSpawnRate.getSelection() * 10) {
+                    if (isEvilGuesser) {
+                        if (data.impostors.Count > 0 && data.maxImpostorRoles > 0) {
+                            byte evilGuesser = setRoleToRandomPlayer((byte)RoleId.EvilGuesser, data.impostors);
+                            data.impostors.ToList().RemoveAll(x => x.PlayerId == evilGuesser);
+                            data.maxImpostorRoles--;
+                            data.crewSettings.Add((byte)RoleId.NiceGuesser, CustomOptionHolder.guesserSpawnBothRate.getSelection());
+                        }
+                    }
+                    else if (data.crewmates.Count > 0 && data.maxCrewmateRoles > 0) {                    
+                        byte niceGuesser = setRoleToRandomPlayer((byte)RoleId.NiceGuesser, data.crewmates);
+                        data.crewmates.ToList().RemoveAll(x => x.PlayerId == niceGuesser);
+                        data.maxCrewmateRoles--;
+                        data.impSettings.Add((byte)RoleId.EvilGuesser, CustomOptionHolder.guesserSpawnBothRate.getSelection());
+                    }
+                }
+            } else {
+                if (isEvilGuesser) data.impSettings.Add((byte)RoleId.EvilGuesser, CustomOptionHolder.guesserSpawnRate.getSelection()); 
+                else data.crewSettings.Add((byte)RoleId.NiceGuesser, CustomOptionHolder.guesserSpawnRate.getSelection());
             }
         }
 
index d31cb9c1a8ef26b671955c67b4c112a81ca02b7c..1f51e518de6d7dc17f87355ef2723f89c27d735f 100644 (file)
@@ -233,7 +233,7 @@ namespace TheOtherRoles.Patches {
         }
 
         static void updateImpostorKillButton(HudManager __instance) {
-            if (!PlayerControl.LocalPlayer.Data.Role.IsImpostor) return;
+            if (!PlayerControl.LocalPlayer.Data.Role.IsImpostor || MeetingHud.Instance) return;
             bool enabled = true;
             if (Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer)
                 enabled = false;
index 8bb2a285d6e43e5d087536c27543c67abb297564..4243d1c9b949c684e45df9e552373e724a6cbaac 100644 (file)
@@ -479,6 +479,7 @@ namespace TheOtherRoles
     public static class Hacker {
         public static PlayerControl hacker;
         public static Minigame vitals = null;
+        public static Minigame doorLog = null;
         public static Color color = new Color32(117, 250, 76, byte.MaxValue);
 
         public static float cooldown = 30f;
@@ -493,6 +494,7 @@ namespace TheOtherRoles
 
         private static Sprite buttonSprite;
         private static Sprite vitalsSprite;
+        private static Sprite logSprite;
         private static Sprite adminSprite;
 
         public static Sprite getButtonSprite() {
@@ -507,6 +509,12 @@ namespace TheOtherRoles
             return vitalsSprite;
         }
 
+        public static Sprite getLogSprite() {
+            if (logSprite) return logSprite;
+            logSprite = HudManager.Instance.UseButton.fastUseSettings[ImageNames.DoorLogsButton].Image;
+            return logSprite;
+        }
+
         public static Sprite getAdminSprite() {
             byte mapId = PlayerControl.GameOptions.MapId;
             UseButtonSettings button = HudManager.Instance.UseButton.fastUseSettings[ImageNames.PolusAdminButton]; // Polus
@@ -520,6 +528,7 @@ namespace TheOtherRoles
         public static void clearAndReload() {
             hacker = null;
             vitals = null;
+            doorLog = null;
             hackerTimer = 0f;
             adminSprite = null;
             cooldown = CustomOptionHolder.hackerCooldown.getFloat();
index 287c3b1a856d7222369bcc7f8eac7d783b4663a1..ee0f6e63eb3b05c9358f2ef61628bf6911093a62 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
         <TargetFramework>netstandard2.1</TargetFramework>
-        <Version>3.3.1</Version>
+        <Version>3.3.3</Version>
         <Description>TheOtherRoles</Description>
         <Authors>Eisbison</Authors>
     </PropertyGroup>