From: Eisbison Date: Thu, 15 Apr 2021 14:40:17 +0000 (+0200) Subject: v2.2.2 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=f45aa7afc4c6258351c1ab7c1fe0f0d6f2919b45;p=rhonda%2Ftheotherroles.git v2.2.2 --- diff --git a/README.md b/README.md index c243bb1..ceeaae7 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein # Releases | Among Us - Version| Mod Version | Link | |----------|-------------|-----------------| +| 2021.4.14s| v2.2.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.2/TheOtherRoles.zip) | 2021.4.12s| v2.2.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.1/TheOtherRoles.zip) | 2021.4.12s| v2.2.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.0/TheOtherRoles.zip) | 2021.3.31.3s| v2.1.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.1.0/TheOtherRoles.zip) @@ -66,6 +67,10 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
Click to show the Changelog +**Version 2.2.2** +- Among Us version 2021.4.14s compatibility +- Improved the block votes on emergency meeting option + **Version 2.2.1** - 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. - Fixed a bug where the Bad Child's kill button went on cooldown when someone else performed a kill diff --git a/Source Code/CredentialsPatch.cs b/Source Code/CredentialsPatch.cs index 490d344..646e1d8 100644 --- a/Source Code/CredentialsPatch.cs +++ b/Source Code/CredentialsPatch.cs @@ -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 = $"TheOtherRoles v{TheOtherRolesPlugin.Major}.{TheOtherRolesPlugin.Minor}.{TheOtherRolesPlugin.Patch}:\n- Modded by Eisbison and Thunderstorm584\n- Balanced with Dhalucard\n- Button design by Bavari"; 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 += "\nTheOtherRoles\nModded by Eisbison"; diff --git a/Source Code/CustomOptions.cs b/Source Code/CustomOptions.cs index 40e2699..6c66490 100644 --- a/Source Code/CustomOptions.cs +++ b/Source Code/CustomOptions.cs @@ -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("{4}", 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); } } diff --git a/Source Code/EndGamePatch.cs b/Source Code/EndGamePatch.cs index a147697..dc1da14 100644 --- a/Source Code/EndGamePatch.cs +++ b/Source Code/EndGamePatch.cs @@ -221,6 +221,7 @@ namespace TheOtherRoles { { __instance.enabled = false; ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.ChildLose, false); + return true; } DestroyableSingleton.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton.CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray(0))); ReviveEveryone(); @@ -235,6 +236,7 @@ namespace TheOtherRoles { { __instance.enabled = false; ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.JesterWin, false); + return true; } DestroyableSingleton.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton.CHNDKKBEIDG.GetString(StringNames.GameOverImpostorDead, new Il2CppReferenceArray(0))); ReviveEveryone(); @@ -288,6 +290,7 @@ namespace TheOtherRoles { { DestroyableSingleton.CHNDKKBEIDG.ShowPopUp(DestroyableSingleton.CHNDKKBEIDG.GetString(StringNames.GameOverTaskWin, new Il2CppReferenceArray(0))); __instance.Begin(); + return true; } return false; } diff --git a/Source Code/Main.cs b/Source Code/Main.cs index 996a591..c338172 100644 --- a/Source Code/Main.cs +++ b/Source Code/Main.cs @@ -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; diff --git a/Source Code/MapOptions.cs b/Source Code/MapOptions.cs index dd08b44..2093bf1 100644 --- a/Source Code/MapOptions.cs +++ b/Source Code/MapOptions.cs @@ -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 diff --git a/Source Code/MeetingPatch.cs b/Source Code/MeetingPatch.cs index e4e3e84..6386a88 100644 --- a/Source Code/MeetingPatch.cs +++ b/Source Code/MeetingPatch.cs @@ -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); } } diff --git a/Source Code/PlayerControlPatch.cs b/Source Code/PlayerControlPatch.cs index 7b66e45..782ed26 100644 --- a/Source Code/PlayerControlPatch.cs +++ b/Source Code/PlayerControlPatch.cs @@ -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); } } diff --git a/Source Code/TheOtherRoles.csproj b/Source Code/TheOtherRoles.csproj index 81fd962..3b65c97 100644 --- a/Source Code/TheOtherRoles.csproj +++ b/Source Code/TheOtherRoles.csproj @@ -1,19 +1,19 @@ netstandard2.1 - 2.2.1 + 2.2.2 TheOtherRoles Eisbison - 2021.4.12s + 2021.4.14s $(DefineConstants);STEAM - 2021.4.21i + 2021.4.14i $(DefineConstants);ITCH