From cbc66948c09b5890280c7c36e15c330f92332c95 Mon Sep 17 00:00:00 2001 From: Ape <155788660+ApeMV@users.noreply.github.com> Date: Mon, 15 Jun 2026 15:51:36 +0200 Subject: [PATCH] 1.8.2 --- AmongUsRevamped.cs | 2 +- Modules/CustomOptionsHolder.cs | 11 +++--- Modules/CustomRoleManagement.cs | 14 ++++---- Modules/Translator.cs | 5 +-- Modules/Utils.cs | 1 + Patches/ChatPatches.cs | 64 ++++++++++++++++----------------- Patches/CredentialsPatch.cs | 32 ++++++++++++++++- Patches/DevicePatches.cs | 3 -- Patches/EndGamePatches.cs | 18 +++++----- Patches/ExilePatch.cs | 4 +-- Patches/IntroPatch.cs | 10 ------ Patches/JoinAndLeavePatches.cs | 9 ++--- Patches/OnGameStartedPatch.cs | 11 ++++++ Patches/PlayerControlPatches.cs | 6 ++-- README.md | 3 +- Resources/Language/English.json | 53 ++++----------------------- 16 files changed, 121 insertions(+), 125 deletions(-) diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index 20ac6c5..019ebc3 100644 --- a/AmongUsRevamped.cs +++ b/AmongUsRevamped.cs @@ -43,7 +43,7 @@ public partial class Main : BasePlugin public static bool HasArgumentException; public static string CredentialsText; - public const string ModVersion = "v1.8.1"; + public const string ModVersion = "v1.8.2"; public static float GameTimer; diff --git a/Modules/CustomOptionsHolder.cs b/Modules/CustomOptionsHolder.cs index d1da5bf..15927f9 100644 --- a/Modules/CustomOptionsHolder.cs +++ b/Modules/CustomOptionsHolder.cs @@ -65,7 +65,14 @@ namespace AmongUsRevamped "Tyrant", "Stealer", "Juggernaut", "None" }; + public static readonly string[] languages = + { + "English", "French" + }; + //System + public static OptionItem Language; + public static OptionItem Gamemode; public static OptionItem TabGroupMain; @@ -626,10 +633,6 @@ namespace AmongUsRevamped .SetParent(DisableDevices) .SetColor(new Color32(255, 153, 153, byte.MaxValue)); - DisableFungleCamera = BooleanOptionItem.Create(22926, Translator.Get("disableFungleCamera"), false, TabGroup.ModSettings, false) - .SetParent(DisableFungleDevices) - .SetColor(new Color32(255, 153, 153, byte.MaxValue)); - DisableFungleVital = BooleanOptionItem.Create(22927, Translator.Get("disableFungleVital"), false, TabGroup.ModSettings, false) .SetParent(DisableFungleDevices) .SetColor(new Color32(255, 153, 153, byte.MaxValue)); diff --git a/Modules/CustomRoleManagement.cs b/Modules/CustomRoleManagement.cs index 6650898..0ee0456 100644 --- a/Modules/CustomRoleManagement.cs +++ b/Modules/CustomRoleManagement.cs @@ -151,13 +151,13 @@ public static class AbilityManagement public static string RoleInfoString(PlayerControl player) { if (!AmongUsClient.Instance.AmHost) return ""; - if (IsMayor(player)) return Translator.Get("youAreMayor", Options.ExtraVotesCrewmate.GetInt()); - if (IsWorkhorse(player)) return Translator.Get("youAreWorkhorse", Options.ExtraVotesPerTask.GetFloat()); - if (IsJester(player)) return Translator.Get("youAreJester"); - if (IsSpeedrunner(player)) return Translator.Get("youAreSpeedrunner"); - if (IsTyrant(player)) return Translator.Get("youAreTyrant", Options.ExtraVotesImpostor.GetInt()); - if (IsStealer(player)) return Translator.Get("youAreStealer", Options.ExtraVotesPerKill.GetFloat()); - if (IsJuggernaut(player)) return Translator.Get("youAreJuggernaut", Options.KillsNeededForJuggernaut.GetInt()); + if (IsMayor(player)) return $"Your Ability: Mayor\n\nYou are a Crewmate with {Options.ExtraVotesCrewmate.GetInt()} additional vote(s). Use them wisely."; + if (IsWorkhorse(player)) return $"Your Ability: Workhorse\n\nYou gain {Options.ExtraVotesPerTask.GetFloat()} additional vote(s) per completed task. Votes are rounded down."; + if (IsJester(player)) return "Your Ability: Jester\n\nYou can optionally win alone by getting voted, you are still a Crewmate."; + if (IsSpeedrunner(player)) return "Your Ability: Tasker\n\nThe Crewmates win if you complete tasks while being alive. You have more tasks."; + if (IsTyrant(player)) return $"Your Ability: Tyrant\n\nYou are an Impostor with {Options.ExtraVotesImpostor.GetInt()} additional vote(s). Use them wisely."; + if (IsStealer(player)) return $"Your Ability: Stealer\n\nYou gain {Options.ExtraVotesPerKill.GetFloat()} additional vote(s) per killed player. Votes are rounded down."; + if (IsJuggernaut(player)) return $"Your Ability: Juggernaut\n\nThe Impostor team instantly wins if you gain {Options.KillsNeededForJuggernaut.GetInt()} kills."; else return ""; } diff --git a/Modules/Translator.cs b/Modules/Translator.cs index 69d2e4e..8267105 100644 --- a/Modules/Translator.cs +++ b/Modules/Translator.cs @@ -10,11 +10,12 @@ public static class Translator { public enum SupportedLangs { - English + English, + French } private static readonly Dictionary> _languages = new(); - private static SupportedLangs _currentLang = SupportedLangs.English; + public static SupportedLangs _currentLang; private static string LanguageFolder => $"{BanManager.DataPath}/Language"; public static void Init() diff --git a/Modules/Utils.cs b/Modules/Utils.cs index ae8df9a..6c1a9ee 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -582,6 +582,7 @@ public static class Utils return moveNext; } + public static readonly Dictionary StoredRoleText = new(); public static string GetRoleText(PlayerControl p) { if (p == null) return ""; diff --git a/Patches/ChatPatches.cs b/Patches/ChatPatches.cs index 880124f..637003c 100644 --- a/Patches/ChatPatches.cs +++ b/Patches/ChatPatches.cs @@ -332,42 +332,42 @@ internal static class SendChatPatch return false; } if (text == "/r jester"){ - Utils.ChatCommand(__instance, Translator.Get("jesterPublic"), "", false); + Utils.ChatCommand(__instance, "Jester:\n\nThe Jester is a Crewmate who can also win alone by getting voted.", "", false); return false;} if (text == "/r mayor"){ - Utils.ChatCommand(__instance, Translator.Get("mayorPublic", Options.ExtraVotesCrewmate.GetInt()), "", false); + Utils.ChatCommand(__instance, $"Mayor:\n\nThe Mayor is a Crewmate with {Options.ExtraVotesCrewmate.GetInt()} additional vote(s). Use them wisely.", "", false); return false;} if (text == "/r tyrant"){ - Utils.ChatCommand(__instance, Translator.Get("tyrantPublic", Options.ExtraVotesImpostor.GetInt()), "", false); + Utils.ChatCommand(__instance, $"Tyrant:\n\nThe Tyrant is an Impostor with {Options.ExtraVotesImpostor.GetInt()} additional vote(s). Use them wisely.", "", false); return false;} if (text == "/r workhorse"){ - Utils.ChatCommand(__instance, Translator.Get("workhorsePublic", Options.ExtraVotesPerTask.GetFloat()), "", false); + Utils.ChatCommand(__instance, $"Workhorse:\n\nThe Workhorse gains {Options.ExtraVotesPerTask.GetInt()} additional vote(s) per completed task. Votes are rounded down.", "", false); return false;} if (text == "/r stealer"){ - Utils.ChatCommand(__instance, Translator.Get("stealerPublic", Options.ExtraVotesPerKill.GetFloat()), "", false); + Utils.ChatCommand(__instance, $"Stealer:\n\nThe Stealer gains {Options.ExtraVotesPerKill.GetInt()} additional vote(s) per killed player. Votes are rounded down.", "", false); return false;} if (text == "/r juggernaut"){ - Utils.ChatCommand(__instance, Translator.Get("juggernautPublic", Options.KillsNeededForJuggernaut.GetInt()), "", false); + Utils.ChatCommand(__instance, $"Juggernaut:\n\nThe Impostors instantly win if the Juggernaut gains {Options.KillsNeededForJuggernaut.GetInt()} kills.", "", false); return false;} if (text == "/r tasker"){ - Utils.ChatCommand(__instance, Translator.Get("speedrunnerPublic"), "", false); + Utils.ChatCommand(__instance, "Tasker:\n\nThe Crewmates win if the Tasker completes tasks and is alive. The Tasker has more tasks.", "", false); return false;} if (text == "/aur" || text == "/socials") { - Utils.ChatCommand(__instance, Translator.Get("socialsAll"), "", false); + Utils.ChatCommand(__instance, "AUR socials:\n\ng i t h u b . c o m /\nApeMV/AmongUsRevamped\n\nd i s c o r d . g g /\n83Zhzhyhya", "", false); return false; } if (text == "/0kc" || text == "/0killcooldown") { - Utils.ChatCommand(__instance, Translator.Get("noKcdMode"), "", false); + Utils.ChatCommand(__instance, "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!", "", false); return false; } @@ -375,18 +375,18 @@ internal static class SendChatPatch { if (Options.MisfiresToSuicide.GetInt() == 1 || Options.CantKillTime.GetInt() == 0) { - Utils.ChatCommand(__instance, Translator.Get("SnSModeOne"), Translator.Get("SnSModeThree", Options.CrewAutoWinsGameAfter.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crewmates win by doing tasks or surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing everyone\n{Options.MisfiresToSuicide.GetInt()} wrong kill(s) = suicide", true); } else { - Utils.ChatCommand(__instance, Translator.Get("SnSModeOne"), Translator.Get("SnSModeTwo", Options.CrewAutoWinsGameAfter.GetInt(), Options.CantKillTime.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Options.MisfiresToSuicide.GetInt()} wrong kills = suicide", true); } return false; } if (text == "/sr" || text == "/speedrun") { - Utils.ChatCommand(__instance, Translator.Get("speedrunMode", Options.GameAutoEndsAfter.GetInt()), "", false); + Utils.ChatCommand(__instance, $"Speedrun:\n\nEveryone is a crewmate. The 1st player to finish tasks wins the game. Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s", "", false); return false; } @@ -399,22 +399,22 @@ internal static class SendChatPatch break; case 1: - Utils.ChatCommand(__instance, Translator.Get("noKcdMode"), "", false); + Utils.ChatCommand(__instance, "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!", "", false); break; case 2: if (Options.MisfiresToSuicide.GetInt() == 1 || Options.CantKillTime.GetInt() == 0) { - Utils.ChatCommand(__instance, Translator.Get("SnSModeOne"), Translator.Get("SnSModeThree", Options.CrewAutoWinsGameAfter.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crewmates win by doing tasks or surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing everyone\n{Options.MisfiresToSuicide.GetInt()} wrong kill(s) = suicide", true); } else { - Utils.ChatCommand(__instance, Translator.Get("SnSModeOne"), Translator.Get("SnSModeTwo", Options.CrewAutoWinsGameAfter.GetInt(), Options.CantKillTime.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Options.MisfiresToSuicide.GetInt()} wrong kills = suicide", true); } break; case 3: - Utils.ChatCommand(__instance, Translator.Get("speedrunMode", Options.GameAutoEndsAfter.GetInt()), "", false); + Utils.ChatCommand(__instance, $"Speedrun:\n\nEveryone is a crewmate. The 1st player to finish tasks wins the game. Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s", "", false); break; } @@ -673,13 +673,13 @@ public static class RPCHandlerPatch if (text == "/aur" || text == "/socials") { if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashLastGameCmd.GetValue()) return; - Utils.ModeratorChatCommand(Translator.Get("socialsAll"), "", false); + Utils.ModeratorChatCommand("AUR socials:\n\ng i t h u b . c o m /\nApeMV/AmongUsRevamped\n\nd i s c o r d . g g /\n83Zhzhyhya", "", false); } if (text == "/0kc" || text == "/0killcooldown") { if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return; - Utils.ModeratorChatCommand(Translator.Get("noKcdMode"), "", false); + Utils.ModeratorChatCommand("0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!", "", false); } if (text == "/sns" || text == "/shiftandseek") { @@ -687,18 +687,18 @@ public static class RPCHandlerPatch if (Options.MisfiresToSuicide.GetInt() == 1 || Options.CantKillTime.GetInt() == 0) { - Utils.ModeratorChatCommand(Translator.Get("SnSModeOne"), Translator.Get("SnSModeThree", Options.CrewAutoWinsGameAfter.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crewmates win by doing tasks or surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing everyone\n{Options.MisfiresToSuicide.GetInt()} wrong kill(s) = suicide", true); } else { - Utils.ModeratorChatCommand(Translator.Get("SnSModeOne"), Translator.Get("SnSModeTwo", Options.CrewAutoWinsGameAfter.GetInt(), Options.CantKillTime.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Options.MisfiresToSuicide.GetInt()} wrong kills = suicide", true); } } if (text == "/sr" || text == "/speedrun") { if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return; - Utils.ModeratorChatCommand(Translator.Get("speedrunMode", Options.GameAutoEndsAfter.GetInt()), "", false); + Utils.ModeratorChatCommand($"Speedrun:\n\nEveryone is a crewmate. The 1st player to finish tasks wins the game. Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s", "", false); } if (text == "/r" || text == "/roles") @@ -711,22 +711,22 @@ public static class RPCHandlerPatch break; case 1: - Utils.ModeratorChatCommand(Translator.Get("noKcdMode"), "", false); + Utils.ModeratorChatCommand("0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!", "", false); break; case 2: if (Options.MisfiresToSuicide.GetInt() == 1 || Options.CantKillTime.GetInt() == 0) { - Utils.ModeratorChatCommand(Translator.Get("SnSModeOne"), Translator.Get("SnSModeThree", Options.CrewAutoWinsGameAfter.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crewmates win by doing tasks or surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing everyone\n{Options.MisfiresToSuicide.GetInt()} wrong kill(s) = suicide", true); } else { - Utils.ModeratorChatCommand(Translator.Get("SnSModeOne"), Translator.Get("SnSModeTwo", Options.CrewAutoWinsGameAfter.GetInt(), Options.CantKillTime.GetInt(), Options.MisfiresToSuicide.GetInt()), true); + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Options.MisfiresToSuicide.GetInt()} wrong kills = suicide", true); } break; case 3: - Utils.ModeratorChatCommand(Translator.Get("speedrunMode", Options.GameAutoEndsAfter.GetInt()), "", false); + Utils.ModeratorChatCommand($"Speedrun:\n\nEveryone is a crewmate. The 1st player to finish tasks wins the game. Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s", "", false); break; } @@ -735,25 +735,25 @@ public static class RPCHandlerPatch if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return; if (text == "/r jester"){ - Utils.ModeratorChatCommand(Translator.Get("jesterPublic"), "", false);} + Utils.ModeratorChatCommand("Jester:\n\nThe Jester is a Crewmate who can also win alone by getting voted.", "", false);} if (text == "/r mayor"){ - Utils.ModeratorChatCommand(Translator.Get("mayorPublic", Options.ExtraVotesCrewmate.GetInt()), "", false);} + Utils.ModeratorChatCommand($"Mayor:\n\nThe Mayor is a Crewmate with {Options.ExtraVotesCrewmate.GetInt()} additional vote(s). Use them wisely.", "", false);} if (text == "/r tyrant"){ - Utils.ModeratorChatCommand(Translator.Get("tyrantPublic", Options.ExtraVotesImpostor.GetInt()), "", false);} + Utils.ModeratorChatCommand($"Tyrant:\n\nThe Tyrant is an Impostor with {Options.ExtraVotesImpostor.GetInt()} additional vote(s). Use them wisely.", "", false);} if (text == "/r workhorse"){ - Utils.ModeratorChatCommand(Translator.Get("workhorsePublic", Options.ExtraVotesPerTask.GetFloat()), "", false);} + Utils.ModeratorChatCommand($"Workhorse:\n\nThe Workhorse gains {Options.ExtraVotesPerTask.GetInt()} additional vote(s) per completed task. Votes are rounded down.", "", false);} if (text == "/r stealer"){ - Utils.ModeratorChatCommand(Translator.Get("stealerPublic", Options.ExtraVotesPerKill.GetFloat()), "", false);} + Utils.ModeratorChatCommand($"Stealer:\n\nThe Stealer gains {Options.ExtraVotesPerKill.GetInt()} additional vote(s) per killed player. Votes are rounded down.", "", false);} if (text == "/r juggernaut"){ - Utils.ModeratorChatCommand(Translator.Get("juggernautPublic", Options.KillsNeededForJuggernaut.GetInt()), "", false);} + Utils.ModeratorChatCommand($"Juggernaut:\n\nThe Impostors instantly win if the Juggernaut gains {Options.KillsNeededForJuggernaut.GetInt()} kills.", "", false);} if (text == "/r tasker"){ - Utils.ModeratorChatCommand(Translator.Get("speedrunnerPublic"), "", false);} + Utils.ModeratorChatCommand("Tasker:\n\nThe Crewmates win if the Tasker completes tasks and is alive. The Tasker has more tasks.", "", false);} if (text.StartsWith("/t ")) { diff --git a/Patches/CredentialsPatch.cs b/Patches/CredentialsPatch.cs index f060f7d..3feb379 100644 --- a/Patches/CredentialsPatch.cs +++ b/Patches/CredentialsPatch.cs @@ -1,4 +1,5 @@ -using System; +using BepInEx.Unity.IL2CPP; +using System; using System.Text; using Il2CppInterop.Runtime.InteropTypes.Arrays; using TMPro; @@ -249,6 +250,18 @@ namespace AmongUsRevamped logo.SetActive(false); } + var h1 = GameObject.Find("AccountManager/AccountTab/GameHeader/BarSprite/FriendsButton/Highlight/NewRequestActive/Text_TMP"); + if (h1 != null) + { + Object.Destroy(h1); + } + + var h2 = GameObject.Find("AccountManager/AccountTab/GameHeader/BarSprite/FriendsButton/Highlight/NewRequestActive/Background"); + if (h2 != null) + { + Object.Destroy(h2); + } + Transform tintTrans = __instance.transform.Find("MainUI/Tint"); var tint = tintTrans.gameObject; @@ -343,6 +356,23 @@ namespace AmongUsRevamped return button; } } + + [HarmonyPatch(typeof(SignInStatusComponent), nameof(SignInStatusComponent.SetOnline))] + public static class SignInStatusComponentSetOnlinePatch + { + private static void Postfix() + { + int pluginCount = IL2CPPChainloader.Instance.Plugins.Count; + Logger.Info($" {pluginCount} Plugins detected", "PluginCheck"); + + if (pluginCount > 1) + { + DisconnectPopup.Instance.gameObject.SetActive(true); + DisconnectPopup.Instance._textArea.enableWordWrapping = false; + DisconnectPopup.Instance._textArea.text = Translator.Get("pluginWarning"); + } + } + } } #if !ANDROID diff --git a/Patches/DevicePatches.cs b/Patches/DevicePatches.cs index ab140d9..7f13608 100644 --- a/Patches/DevicePatches.cs +++ b/Patches/DevicePatches.cs @@ -27,7 +27,6 @@ internal static class DisableDevice ["AirshipRecordsAdmin"] = new(19.89f, 12.60f), ["AirshipCamera"] = new(8.10f, -9.63f), ["AirshipVital"] = new(25.24f, -7.94f), - ["FungleCamera"] = new(6.20f, 0.10f), ["FungleVital"] = new(-2.50f, -9.80f), ["SubmergedVital"] = new(5f, 32.54f), ["SubmergedLeftAdmin"] = new(-9.45f, 10.16f), @@ -98,7 +97,6 @@ internal static class DisableDevice if (Options.DisableAirshipVital.GetBool()) doComms |= Vector2.Distance(PlayerPos, DevicePos["AirshipVital"]) <= UsableDistance; break; case 5: - if (Options.DisableFungleCamera.GetBool()) doComms |= Vector2.Distance(PlayerPos, DevicePos["FungleCamera"]) <= UsableDistance; if (Options.DisableFungleVital.GetBool()) doComms |= Vector2.Distance(PlayerPos, DevicePos["FungleVital"]) <= UsableDistance; break; } @@ -190,7 +188,6 @@ public class RemoveDisableDevicesPatch if (Options.DisableAirshipVital.GetBool()) consoles.DoIf(x => x.name == "panel_vitals", x => x.gameObject.GetComponent().enabled = false); break; case 5: - if (Options.DisableFungleCamera.GetBool()) consoles.DoIf(x => x.name == "BinocularsSecurityConsole", x => x.gameObject.GetComponent().enabled = false); if (Options.DisableFungleVital.GetBool()) consoles.DoIf(x => x.name == "VitalsConsole", x => x.gameObject.GetComponent().enabled = false); break; } diff --git a/Patches/EndGamePatches.cs b/Patches/EndGamePatches.cs index 444fe0b..591ed0f 100644 --- a/Patches/EndGamePatches.cs +++ b/Patches/EndGamePatches.cs @@ -53,57 +53,57 @@ class NormalGameEndChecker if (Winner == "Jester") { - LastWinReason = Translator.Get("jesterWin") + impostorList; + LastWinReason = "Jester wins! (voted)\n\nImpostors: " + impostorList; canUpdateWinnerText = false; return; } if (Winner == "Juggernaut") { - LastWinReason = Translator.Get("juggernautWin", Options.KillsNeededForJuggernaut.GetInt()) + impostorList; + LastWinReason = $"Impostors win! (Juggernaut killed {Options.KillsNeededForJuggernaut.GetInt()} players)\n\nImpostors: " + impostorList; canUpdateWinnerText = false; return; } if (Winner == "Speedrunner") { - LastWinReason = Translator.Get("speedrunnerWin") + impostorList; + LastWinReason = "Crewmates win! (Tasker finished tasks)\n\nImpostors: " + impostorList; canUpdateWinnerText = false; return; } if (Winner == "SnSTimer") { - LastWinReason = Translator.Get("crewmateWinTimer", Options.CrewAutoWinsGameAfter.GetInt()) + impostorList; + LastWinReason = $"Crewmates Win! (Survived {Options.CrewAutoWinsGameAfter.GetInt()}s)\n\n Impostors: " + impostorList; canUpdateWinnerText = false; return; } if (Winner == "NoOneWinsSpeedrun") { - LastWinReason = Translator.Get("noOneWin", Options.GameAutoEndsAfter.GetInt()); + LastWinReason = $"No one wins. ({Options.GameAutoEndsAfter.GetInt()}s Timer)"; canUpdateWinnerText = false; return; } if (Utils.AliveImpostors == 0 || Winner == "Crewmate") { - LastWinReason = Translator.Get("crewmateWin") + impostorList; + LastWinReason = "Crewmates Win!\n\nImpostors: " + impostorList; canUpdateWinnerText = false; } else if (Utils.AliveImpostors >= Utils.AliveCrewmates || Winner == "Impostor") { - LastWinReason = Translator.Get("impostorWin") + impostorList; + LastWinReason = "Impostors Win!\n\nImpostors: " + impostorList; canUpdateWinnerText = false; } else if (GameData.Instance != null && GameData.Instance.TotalTasks > 0 && GameData.Instance.CompletedTasks >= GameData.Instance.TotalTasks || Winner == "CrewmateTasks") { - LastWinReason = Translator.Get("crewmateWinTasks", Options.TaskPercentNeededToWin.GetInt()) + impostorList; + LastWinReason = $"Crewmates Win! ({Options.TaskPercentNeededToWin.GetInt()}% tasks completed)\n\nImpostors: " + impostorList; canUpdateWinnerText = false; } else if (Options.Gamemode.GetValue() < 2 || Winner == "ImpostorSabotage") { - LastWinReason = Translator.Get("impostorWinMisc") + impostorList; + LastWinReason = "Impostors Win! (Sabotage)\n\n Impostors: " + impostorList; } } } diff --git a/Patches/ExilePatch.cs b/Patches/ExilePatch.cs index 5cf1ee0..6c7b706 100644 --- a/Patches/ExilePatch.cs +++ b/Patches/ExilePatch.cs @@ -34,7 +34,7 @@ class ExileControllerWrapUpPatch { if (p.Data.Role.IsImpostor) { - p.cosmetics.nameText.text = $"{p.Data.PlayerName}({MurderPlayerPatch.killCount[p.Data.PlayerId]}†)"; + p.cosmetics.nameText.text = $"{p.Data.PlayerName}({MurderPlayerPatch.killCount[p.Data.PlayerId]}† - {Utils.StoredRoleText[p.PlayerId]})"; } else { @@ -42,7 +42,7 @@ class ExileControllerWrapUpPatch { PlayerControlCompleteTaskPatch.playerTasksCompleted[p.PlayerId] = 0; } - p.cosmetics.nameText.text = $"{p.Data.PlayerName}({PlayerControlCompleteTaskPatch.playerTasksCompleted[p.PlayerId]}/{PlayerControlCompleteTaskPatch.tasksPerPlayer[p.PlayerId]})"; + p.cosmetics.nameText.text = $"{p.Data.PlayerName}({PlayerControlCompleteTaskPatch.playerTasksCompleted[p.PlayerId]}/{PlayerControlCompleteTaskPatch.tasksPerPlayer[p.PlayerId]} - {Utils.StoredRoleText[p.PlayerId]})"; } } } diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 54da53b..b06f735 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -42,16 +42,6 @@ internal static class CoShowIntroPatch Utils.CanCallMeetings = true; }, 33f, "MeetingEnabled"); } - - if (Options.Gamemode.GetValue() == 2 && Options.SNSChatInGame.GetBool()) - { - _ = new LateTask(() => - { - PlayerControl.LocalPlayer.CmdReportDeadBody(null); - if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose(); - - }, 9.5f, "SetChatVisible"); - } } } diff --git a/Patches/JoinAndLeavePatches.cs b/Patches/JoinAndLeavePatches.cs index 5a5247a..7276444 100644 --- a/Patches/JoinAndLeavePatches.cs +++ b/Patches/JoinAndLeavePatches.cs @@ -88,14 +88,15 @@ class OnPlayerJoinedPatch if (!Options.TempBanInvalidFriendCodes.GetBool()) { AmongUsClient.Instance.KickPlayer(Client.Id, false); - Logger.Info($" {Client.PlayerName} Was kicked for having an invalid FriendCode", "KickInvalidFriendCode"); - Logger.SendInGame($" {Client.PlayerName} Was kicked for having an invalid FriendCode"); + Logger.Info(Translator.Get("invalidFriendCodeKick", Client.PlayerName), "KickInvalidFriendCode"); + Logger.SendInGame(Translator.Get("invalidFriendCodeKick", Client.PlayerName)); } else { + if (!BanManager.TempBanWhiteList.Contains(Client.GetHashedPuid())) BanManager.TempBanWhiteList.Add(Client.GetHashedPuid()); AmongUsClient.Instance.KickPlayer(Client.Id, true); - Logger.Info($" {Client.PlayerName} Was banned for having an invalid FriendCode", "BanInvalidFriendCode"); - Logger.SendInGame($" {Client.PlayerName} Was banned for having an invalid FriendCode"); + Logger.Info(Translator.Get("invalidFriendCodeBan", Client.PlayerName), "BanInvalidFriendCode"); + Logger.SendInGame(Translator.Get("invalidFriendCodeBan", Client.PlayerName)); } } diff --git a/Patches/OnGameStartedPatch.cs b/Patches/OnGameStartedPatch.cs index a8c17a7..d937d5f 100644 --- a/Patches/OnGameStartedPatch.cs +++ b/Patches/OnGameStartedPatch.cs @@ -116,10 +116,21 @@ internal static class OnGameStartPatch public static bool ScheduleExile; public static void Postfix() { + if (Options.Gamemode.GetValue() == 2 && Options.SNSChatInGame.GetBool()) + { + PlayerControl.LocalPlayer.CmdReportDeadBody(null); + if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose(); + } + if (ScheduleExile) { PlayerControl.LocalPlayer.Exiled(); ScheduleExile = false; } + + foreach (var p in PlayerControl.AllPlayerControls) + { + Utils.StoredRoleText[p.PlayerId] = Utils.GetRoleText(p); + } } } \ No newline at end of file diff --git a/Patches/PlayerControlPatches.cs b/Patches/PlayerControlPatches.cs index 28d9a28..dfa37a7 100644 --- a/Patches/PlayerControlPatches.cs +++ b/Patches/PlayerControlPatches.cs @@ -71,11 +71,11 @@ internal static class MurderPlayerPatch { if (p.Data.Role.IsImpostor) { - p.cosmetics.nameText.text = $"{p.Data.PlayerName}({killCount[p.Data.PlayerId]}†) - {Utils.GetRoleText(p)}"; + p.cosmetics.nameText.text = $"{p.Data.PlayerName}({killCount[p.Data.PlayerId]}†) - {Utils.StoredRoleText[p.PlayerId]}"; } else { - p.cosmetics.nameText.text = $"{p.Data.PlayerName}({PlayerControlCompleteTaskPatch.playerTasksCompleted[p.PlayerId]}/{PlayerControlCompleteTaskPatch.tasksPerPlayer[p.PlayerId]}) - {Utils.GetRoleText(p)}"; + p.cosmetics.nameText.text = $"{p.Data.PlayerName}({PlayerControlCompleteTaskPatch.playerTasksCompleted[p.PlayerId]}/{PlayerControlCompleteTaskPatch.tasksPerPlayer[p.PlayerId]}) - {Utils.StoredRoleText[p.PlayerId]}"; } } } @@ -213,7 +213,7 @@ class PlayerControlCompleteTaskPatch if (PlayerControl.LocalPlayer.Data.IsDead && !Main.DisableInfoWhenDead.Value) { TMP_Text nameText = __instance.cosmetics.nameText; - nameText.text = $"{__instance.Data.PlayerName}({playerTasksCompleted[__instance.PlayerId]}/{tasksPerPlayer[__instance.PlayerId]}) - {Utils.GetRoleText(__instance)}"; + nameText.text = $"{__instance.Data.PlayerName}({playerTasksCompleted[__instance.PlayerId]}/{tasksPerPlayer[__instance.PlayerId]}) - {Utils.StoredRoleText[__instance.PlayerId]}"; } } diff --git a/README.md b/README.md index da2f723..4b7c1e9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ **** ‎ -# 🎮 Features (v1.8.1): +# 🎮 Features (v1.8.2): ## 🌟 Custom Abilities: - Mayor (Crewmate) - The Mayor has a configurable amount of extra votes @@ -88,6 +88,7 @@ - Shift and Seek - Speedrun ## ❓ Other Improvements: +- Preset system for mod settings - Command Helper - Creatable and customizable Templates - Eht Dleks (Reverse Skeld) Map diff --git a/Resources/Language/English.json b/Resources/Language/English.json index c6a96fb..b7e21f1 100644 --- a/Resources/Language/English.json +++ b/Resources/Language/English.json @@ -2,7 +2,6 @@ "LanguageID": "0", "gameMaster": "Game Master", - "unlockFPS": "Unlock FPS", "showFPS": "Show FPS", "autoStart": "Auto Start", "enableDarkTheme": "Enable Dark Theme", @@ -14,6 +13,9 @@ "cancelStartCountdown": "Start countdown canceled", + "invalidFriendCodeKick": "{0} was kicked for having an invalid Friendcode", + "invalidFriendCodeBan": "{0} was banned for having an invalid Friendcode", + "language": "Language (Requires Restart)", "gamemode": "Gamemode", "tabGroupMain": "Moderation", "kickLowLevelPlayer": "Kick Players Under Level", @@ -22,9 +24,6 @@ "kickInvalidFriendCodes": "Kick Invalid (Empty) Friendcodes", "tempBanInvalidFriendCodes": "Ban Instead Of Kick", "deniedWordsToKick": "Sent Denied Words To Kick Player", - "applyBanList": "Apply BanList", - "applyDenyNameList": "Apply DenyName List", - "applyModeratorList": "Apply Moderator List", "moderatorCanUseCommand": "Moderators can use commands", "autoKickStart": "Kick Players Who Say Start", "autoKickStartAsBan": "Ban Instead Of Kick", @@ -58,7 +57,6 @@ "tabGroupImpostor": "Impostor Roles", "tabGroupStandard": "Standard", - "chatBeforeFirstMeeting": "Force chat 1st round to see roles (experimental)", "tabGroupHNS": "Hide and Seek", "numSeekers": "# Seekers", @@ -121,7 +119,6 @@ "disableAirshipCamera": "Disable Airship Camera", "disableAirshipVital": "Disable Airship Vitals", "disableFungleDevices": "Disable Fungle Devices", - "disableFungleCamera": "Disable Fungle Camera", "disableFungleVital": "Disable Fungle Vitals", "tabGroupTasks": "Tasks", @@ -218,29 +215,9 @@ "disableSubmitScan": "Disable Submit Scan", "disableUploadData": "Disable Upload Data", - "noKcdMode": "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!", - "SnSModeOne": "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nEmergency Meetings = Off", - "SnSModeTwo": "Crew wins by tasks/surviving {0}s\nImp wins by killing\nOne wrong kill = Can't kill for {1}s\n{2} wrong kills = suicide", - "SnSModeThree": "Crewmates win by doing tasks or surviving {0}s\nImpostors win by killing everyone\n{1} wrong kill(s) = suicide", - "speedrunMode": "Speedrun:\n\nEveryone is a crewmate. The 1st player to finish tasks wins the game. Game auto ends after {0}s", - "allCommandsFull": "ALL COMMANDS:\n\n/help\nShow this message.\n/aur, /socials\nSend Among Us Revamped social links.\n\n/r, /gm\nSend current mode description or ability list.\n/r {ability}\nSend specific ability info.\n/l, /lastgame\nSend last winner info.\n\n/0kc, /0killcooldown\nSend 0 Kill Cooldown mode description.\n/sns, /shiftandseek\nSend Shift and Seek mode description.\n/sp, /speedrun\nSend Speedrun mode description.\n\n/kick, /ban\nKick or ban a player by name.\n/ckick, /cban\nKick or ban a player by color.\n\n/vip /moderator /admin\nAdd a player as VIP, Moderator, or Admin.\n/removevip, /removemoderator, /removeadmin\nRemove VIP, Moderator, or Admin from a player.\n\n/eg, /endgame\nEnd the current game.\n/em, /endmeeting\nEnd the current meeting.\n/s, /start\nBegin the game starting countdown.\n\n/t {template}\nSend a template from AUR-DATA/templates.txt.\n\n/col, /color, /colour\nSet your color, can be used to bypass limits.", - "socialsAll": "AUR socials:\n\ng i t h u b . c o m /\nApeMV/AmongUsRevamped\n\nd i s c o r d . g g /\n83Zhzhyhya", - "translationReloaded": "Your file has successfully been reset.\nTo apply the changes, restart your game.", - - "mayorPublic": "Mayor:\n\nThe Mayor is a Crewmate with {0} additional vote(s). Use them wisely.", - "tyrantPublic": "Tyrant:\n\nThe Tyrant is an Impostor with {0} additional vote(s). Use them wisely.", - - "juggernautPublic": "Juggernaut:\n\nThe Impostors instantly win if the Juggernaut gains {0} kills.", - "speedrunnerPublic": "Tasker:\n\nThe Crewmates win if the Tasker completes tasks and is alive. The Tasker has more tasks.", - - "stealerPublic": "Stealer:\n\nThe Stealer gains {0} additional vote(s) per killed player. Votes are rounded down.", - "workhorsePublic": "Workhorse:\n\nThe Workhorse gains {0} additional vote(s) per completed task. Votes are rounded down.", - - "jesterPublic": "Jester:\n\nThe Jester is a Crewmate who can also win alone by getting voted.", - - "customRoleAnnouncement": "Custom Roles are enabled!\n\nIf you have a Custom Role, it will show in a message below this one.", + "translationReloaded": "Your file has successfully been reset.\nTo apply all changes, restart your game.", "tabGroupCrewmateAbilities": "Crewmate Ability Settings", "crewmateAbility": "Crewmate (Role) Ability", @@ -265,24 +242,6 @@ "extraVotesPerKill": "Extra Votes Per Kill For Stealer", "killsNeededForJuggernaut": "Kills Needed For Juggernaut", - "youAreMayor": "Your Ability: Mayor\n\nYou are a Crewmate with {0} additional vote(s). Use them wisely.", - "youAreJester": "Your Ability: Jester\n\nYou can optionally win alone by getting voted, you are still a Crewmate.", - "youAreSpeedrunner": "Your Ability: Tasker\n\nThe Crewmates win if you complete tasks while being alive. You have more tasks.", - "youAreTyrant": "Your Ability: Tyrant\n\nYou are an Impostor with {0} additional vote(s). Use them wisely.", - "youAreStealer": "Your Ability: Stealer\n\nYou gain {0} additional vote(s) per killed player. Votes are rounded down.", - "youAreWorkhorse": "Your Ability: Workhorse\n\nYou gain {0} additional vote(s) per completed task. Votes are rounded down.", - "youAreJuggernaut": "Your Ability: Juggernaut\n\nThe Impostor team instantly wins if you gain {0} kills.", - - "jesterWin": "Jester wins! (voted)\n\nImpostors: ", - "speedrunnerWin": "Crewmates win! (Tasker finished tasks)\n\nImpostors: ", - "juggernautWin": "Impostors win! (Juggernaut killed {0} players)\n\nImpostors: ", - "crewmateWin": "Crewmates Win!\n\nImpostors: ", - "impostorWin": "Impostors Win!\n\nImpostors: ", - "crewmateWinTasks": "Crewmates Win! ({0}% tasks completed)\n\nImpostors: ", - "impostorWinMisc": "Impostors Win! (Sabotage)\n\n Impostors: ", - "crewmateWinTimer": "Crewmates Win! (Survived {0}s)\n\n Impostors: ", - "noOneWin": "No one wins. ({0}s Timer)", - "ability": "Ability", "templateWelcome": "# In this file you can add Templates, which serve as easy copy-paste alternatives.\n# To create a template, write a new line with the same formatting as the test Template below.\n# Note that Templates can't be longer than 120 characters and can't contain special characters. Having so will kick you.\n\ntest: this is an example template. Type '/t test' to see it.\n\nwelcome: Welcome! This lobby uses Among Us Revamped {ModVersion} by MV. Enjoy!", @@ -331,5 +290,7 @@ "lastgameDesc": "Send last game info.", "templateDesc": "Send a specified template from AUR-DATA/templates.txt.", - "banWordKick": "{0} was kicked because they sent a banned word {1} time(s)" + "banWordKick": "{0} was kicked because they sent a banned word {1} time(s)", + + "pluginWarning": "WARNING:\nYou have 2 or more detected Plugins.\nAmong Us Revamped is not compatible with most mods.\nIf you find bugs, they are most likely due to incompatibility." }