]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
v2.2.2
authorEisbison <eisbison.creator@gmail.com>
Thu, 15 Apr 2021 14:40:17 +0000 (16:40 +0200)
committerEisbison <eisbison.creator@gmail.com>
Thu, 15 Apr 2021 14:40:17 +0000 (16:40 +0200)
README.md
Source Code/CredentialsPatch.cs
Source Code/CustomOptions.cs
Source Code/EndGamePatch.cs
Source Code/Main.cs
Source Code/MapOptions.cs
Source Code/MeetingPatch.cs
Source Code/PlayerControlPatch.cs
Source Code/TheOtherRoles.csproj

index c243bb11f57ac5afdf7b3a7cd63a9a00eaff0a6b..ceeaae7d2675f0bfe8f2341539df80078c35aa6b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
 # Releases\r
 | Among Us - Version| Mod Version | Link |\r
 |----------|-------------|-----------------|\r
+| 2021.4.14s| v2.2.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.2/TheOtherRoles.zip)\r
 | 2021.4.12s| v2.2.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.1/TheOtherRoles.zip)\r
 | 2021.4.12s| v2.2.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.0/TheOtherRoles.zip)\r
 | 2021.3.31.3s| v2.1.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.1.0/TheOtherRoles.zip)\r
@@ -66,6 +67,10 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
 <details>\r
   <summary>Click to show the Changelog</summary>\r
 \r
+**Version 2.2.2**\r
+- Among Us version 2021.4.14s compatibility\r
+- Improved the block votes on emergency meeting option\r
+\r
 **Version 2.2.1**\r
 - Trickster: The vent button now has a custom texture. Fixed a bug where the Trickster could clip out of bounds when his box was close to a wall.\r
 - Fixed a bug where the Bad Child's kill button went on cooldown when someone else performed a kill\r
index 490d3441dd15ce954f00c8d3f31b9c15e94b795b..646e1d80574d312b4a19e107e8dd807c7f678ae4 100644 (file)
@@ -14,19 +14,20 @@ namespace TheOtherRoles
         private static class VersionShowerPatch
         {
             static void Postfix(VersionShower __instance) {
-                string spacer = new String('\n', 21);
+                string spacer = new String('\n', 8);
                 string fullCredentials = $"<color=#FCCE03FF>TheOtherRoles</color> v{TheOtherRolesPlugin.Major}.{TheOtherRolesPlugin.Minor}.{TheOtherRolesPlugin.Patch}:\n- Modded by <color=#FCCE03FF>Eisbison</color> and <color=#FFEB91FF>Thunderstorm584</color>\n- Balanced with <color=#FFEB91FF>Dhalucard</color>\n- Button design by <color=#FFEB91FF>Bavari</color>";
                 if (__instance.text.text.Contains(spacer))
-                    __instance.text.text += "\n" + fullCredentials;
+                    __instance.text.text = __instance.text.text + "\n" + fullCredentials;
                 else
-                    __instance.text.text += spacer + fullCredentials;
+                    __instance.text.text = __instance.text.text + spacer + fullCredentials;
+                __instance.text.alignment = TMPro.TextAlignmentOptions.TopLeft;
             }
         }
 
         [HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))]
         private static class PingTrackerPatch
         {
-            static void Postfix(VersionShower __instance)
+            static void Postfix(PingTracker __instance)
             {
                 if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GCDONLGCMIL.Started)
                     __instance.text.text += "\n<color=#FCCE03FF>TheOtherRoles</color>\nModded by <color=#FCCE03FF>Eisbison</color>";
index 40e2699a23a8c258d9aa5556bfde51888b142b86..6c66490ef75237591b985da4967d1a9bbe1a3bec 100644 (file)
@@ -120,7 +120,8 @@ namespace TheOtherRoles {
         public static CustomOption tricksterLightsOutDuration;
 
         public static CustomOption maxNumberOfMeetings;
-        public static CustomOption allowSkipOnEmergencyMeetings;
+        public static CustomOption blockSkippingInEmergencyMeetings;
+        public static CustomOption noVoteIsSelfVote;
 
         public static string cs(Color c, string s) {
             return string.Format("<color=#{0:X2}{1:X2}{2:X2}{3:X2}>{4}</color>", ToByte(c.r), ToByte(c.g), ToByte(c.b), ToByte(c.a), s);
@@ -241,7 +242,8 @@ namespace TheOtherRoles {
 
             // Other options
             maxNumberOfMeetings = CustomOption.Create(3, "Number Of Meetings (excluding Mayor meeting)", 10, 0, 15, 1, null, true);
-            allowSkipOnEmergencyMeetings = CustomOption.Create(4, "Allow Skips On Emergency Meetings", true);
+            blockSkippingInEmergencyMeetings = CustomOption.Create(4, "Block Skipping In Emergency Meetings", false);
+            noVoteIsSelfVote = CustomOption.Create(5, "No Vote Is Self Vote", false, blockSkippingInEmergencyMeetings);
         }
     }
 
index a1476978cfc369a8fa9f4bc97508c7fc7185bc47..dc1da147c16e3f6a541d7567a3fa71032e653c0c 100644 (file)
@@ -221,6 +221,7 @@ namespace TheOtherRoles {
                 {
                     __instance.enabled = false;
                     ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.ChildLose, false);
+                    return true;
                 }
                 DestroyableSingleton<HudManager>.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
                 ReviveEveryone();
@@ -235,6 +236,7 @@ namespace TheOtherRoles {
                 {
                     __instance.enabled = false;
                     ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.JesterWin, false);
+                    return true;
                 }
                 DestroyableSingleton<HudManager>.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
                 ReviveEveryone();
@@ -288,6 +290,7 @@ namespace TheOtherRoles {
             {
                 DestroyableSingleton<HudManager>.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.GameOverTaskWin, new Il2CppReferenceArray<Il2CppSystem.Object>(0)));
                 __instance.Begin();
+                return true;
             }
             return false;
         }
index 996a591e13c65c635d7aa4e375b7f0d9bc0c26ed..c33817225d7a93092ca2c80bccb59c891a7515cc 100644 (file)
@@ -19,10 +19,10 @@ namespace TheOtherRoles
     public class TheOtherRolesPlugin : BasePlugin
     {
         public const string Id = "me.eisbison.theotherroles";
-        public const string Version = "2.2.1";
+        public const string Version = "2.2.2";
         public const byte Major = 2;
         public const byte Minor = 2;
-        public const byte Patch = 1;
+        public const byte Patch = 2;
 
         public Harmony Harmony { get; } = new Harmony(Id);
         public static TheOtherRolesPlugin Instance;
index dd08b446e6a82550d236cbfce828adf46ba68383..2093bf195a36adbaeccb4829df24e50a66ed7fbb 100644 (file)
@@ -8,7 +8,8 @@ namespace TheOtherRoles{
     static class MapOptions {
         // Set values
         public static int maxNumberOfMeetings = 10;
-        public static bool allowSkipOnEmergencyMeetings = true;
+        public static bool blockSkippingInEmergencyMeetings = false;
+        public static bool noVoteIsSelfVote = false;
 
         // Updating values
         public static int meetingsCount = 0;
@@ -17,7 +18,8 @@ namespace TheOtherRoles{
             meetingsCount = 0;
 
             maxNumberOfMeetings = Mathf.RoundToInt(CustomOptionHolder.maxNumberOfMeetings.getSelection());
-            allowSkipOnEmergencyMeetings = CustomOptionHolder.allowSkipOnEmergencyMeetings.getBool();
+            blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.getBool();
+            noVoteIsSelfVote = CustomOptionHolder.noVoteIsSelfVote.getBool();
         }
     }
 } 
\ No newline at end of file
index e4e3e848c16edadb226ff1476ef96367d164957e..6386a8873449a8e469da95bf8bce8af6d2daefd1 100644 (file)
@@ -89,7 +89,7 @@ namespace TheOtherRoles
                 if (__instance.GBKFCOAKLAH.All((PlayerVoteArea ps) => ps.isDead || ps.didVote))
                 {
                     // If skipping is disabled, replace skipps/no-votes with self vote
-                    if (target == null && !allowSkipOnEmergencyMeetings) {
+                    if (target == null && blockSkippingInEmergencyMeetings && noVoteIsSelfVote) {
                         foreach (PlayerVoteArea playerVoteArea in __instance.GBKFCOAKLAH) {
                             if (playerVoteArea.votedFor < 0) playerVoteArea.votedFor = playerVoteArea.GEIOMAPOPKA; // TargetPlayerId
                         }
@@ -351,7 +351,7 @@ namespace TheOtherRoles
         class MeetingHudUpdatePatch {
             static void Postfix(MeetingHud __instance) {
                 // Deactivate skip Button if skipping on emergency meetings is disabled
-                if (target == null && !allowSkipOnEmergencyMeetings)
+                if (target == null && blockSkippingInEmergencyMeetings)
                     __instance.SkipVoteButton.gameObject.SetActive(false);
             }
         }
index 7b66e4513feda9bf907c3c7da24625ac5e13261a..782ed2656cbb1534f398ca34e8ebc5b34c65e2db 100644 (file)
@@ -339,11 +339,15 @@ namespace TheOtherRoles {
         public static bool Prefix(KillButtonManager __instance) {
             if (__instance.isActiveAndEnabled && __instance.CurrentTarget && !__instance.isCoolingDown && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI && PlayerControl.LocalPlayer.POECPOEKKNO) { // Among Us default checks
                 if (Helpers.handleMurderAttempt(__instance.CurrentTarget)) { // Custom checks
-                    MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1);
-                    writer.Write(PlayerControl.LocalPlayer.PlayerId);
-                    writer.Write(__instance.CurrentTarget.PlayerId);
-                    AmongUsClient.Instance.FinishRpcImmediately(writer);
-                    RPCProcedure.uncheckedMurderPlayer(PlayerControl.LocalPlayer.PlayerId, __instance.CurrentTarget.PlayerId);
+                    if (Child.child != null && PlayerControl.LocalPlayer == Child.child) { // Not checked by official servers
+                        MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1);
+                        writer.Write(PlayerControl.LocalPlayer.PlayerId);
+                        writer.Write(__instance.CurrentTarget.PlayerId);
+                        AmongUsClient.Instance.FinishRpcImmediately(writer);
+                        RPCProcedure.uncheckedMurderPlayer(PlayerControl.LocalPlayer.PlayerId, __instance.CurrentTarget.PlayerId);
+                    } else { // Checked by official servers
+                        PlayerControl.LocalPlayer.RpcMurderPlayer(__instance.CurrentTarget);
+                    }
                     __instance.SetTarget(null);
                 }
                    }
index 81fd962211abc56f8480cca576d271a43d600255..3b65c97fd59be5b0d94ff79769dd0d1a5bfe7431 100644 (file)
@@ -1,19 +1,19 @@
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
         <TargetFramework>netstandard2.1</TargetFramework>
-        <Version>2.2.1</Version>
+        <Version>2.2.2</Version>
 
         <Description>TheOtherRoles</Description>
         <Authors>Eisbison</Authors>
     </PropertyGroup>
 
     <PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
-        <GameVersion>2021.4.12s</GameVersion>
+        <GameVersion>2021.4.14s</GameVersion>
         <DefineConstants>$(DefineConstants);STEAM</DefineConstants>
     </PropertyGroup>
 
     <PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
-        <GameVersion>2021.4.21i</GameVersion>
+        <GameVersion>2021.4.14i</GameVersion>
         <DefineConstants>$(DefineConstants);ITCH</DefineConstants>
     </PropertyGroup>