From de4f057899838ec8dee18f403f3c58ea771c574a Mon Sep 17 00:00:00 2001 From: Ape <155788660+ApeMV@users.noreply.github.com> Date: Thu, 14 May 2026 21:59:09 +0200 Subject: [PATCH] 1.7.2 --- AmongUsRevamped.cs | 2 +- Modules/CustomOptionsHolder.cs | 14 +++++++++----- Modules/CustomRoleManagement.cs | 5 ++++- Modules/FixedUpdate.cs | 16 ---------------- Modules/OptionItem/OptionItem.cs | 2 +- Modules/Utils.cs | 6 ++++-- Patches/ChatPatches.cs | 16 ++++++++-------- Patches/DevicePatches.cs | 2 +- Patches/DleksPatch.cs | 6 +++++- Patches/ExilePatch.cs | 3 ++- Patches/GameSettingMenuPatch.cs | 2 ++ Patches/IntroPatch.cs | 8 ++++---- Patches/JoinAndLeavePatches.cs | 27 +++++++++++++++++++++++++++ Patches/MeetingPatches.cs | 4 +++- Patches/OnGameStartedPatch.cs | 7 ++++--- Patches/PlayerControlPatches.cs | 9 +++++---- Patches/VentPatches.cs | 6 +++++- README.md | 8 +------- 18 files changed, 86 insertions(+), 57 deletions(-) diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index b7b61a4..7e5fccb 100644 --- a/AmongUsRevamped.cs +++ b/AmongUsRevamped.cs @@ -42,7 +42,7 @@ public partial class Main : BasePlugin public static bool HasArgumentException; public static string CredentialsText; - public const string ModVersion = "v1.7.1"; + public const string ModVersion = "v1.7.2"; public static float GameTimer; diff --git a/Modules/CustomOptionsHolder.cs b/Modules/CustomOptionsHolder.cs index c0debc5..b10eefc 100644 --- a/Modules/CustomOptionsHolder.cs +++ b/Modules/CustomOptionsHolder.cs @@ -256,9 +256,10 @@ namespace AmongUsRevamped public static OptionItem DisableUploadData; // Gamemode +/* public static OptionItem TabGroupStandard; public static OptionItem ChatBeforeFirstMeeting; - +*/ public static OptionItem TabGroupHNS; public static OptionItem NumSeekers; @@ -285,6 +286,7 @@ namespace AmongUsRevamped public static OptionItem GameAutoEndsAfter; // Roles +/* public static OptionItem TabGroupCrewmate; public static OptionItem MayorPerc; public static OptionItem MayorExtraVoteCount; @@ -295,7 +297,7 @@ namespace AmongUsRevamped public static OptionItem JesterCanVent; public static OptionItem TabGroupImpostor; - +*/ public static bool IsLoaded = false; public static void Load() @@ -345,7 +347,7 @@ namespace AmongUsRevamped TabGroupMisc = TextOptionItem.Create(60379, Translator.Get("tabGroupMisc"), TabGroup.SystemSettings) .SetColor(Color.green); - StartCountdown = IntegerOptionItem.Create(60380, Translator.Get("startCountdown"), new(1, 600, 1), 5, TabGroup.SystemSettings, false) + StartCountdown = IntegerOptionItem.Create(60380, Translator.Get("startCountdown"), new(1, 5, 1), 5, TabGroup.SystemSettings, false) .SetValueFormat(OptionFormat.Seconds); AllowFortegreen = BooleanOptionItem.Create(60382, Translator.Get("allowFortegreen"), false, TabGroup.SystemSettings, false); NoGameEnd = BooleanOptionItem.Create(60383, Translator.Get("noGameEnd"), false, TabGroup.SystemSettings, false) @@ -364,6 +366,7 @@ namespace AmongUsRevamped // Custom role settings +/* TabGroupCrewmate = TextOptionItem.Create(100000, Translator.Get("tabGroupCrewmate"), TabGroup.CustomRoleSettings) .SetColor(CL.Hex("#8cffff")); MayorPerc = IntegerOptionItem.Create(100001, Translator.Get("Mayor"), new(0, 100, 5), 0, TabGroup.CustomRoleSettings, false) @@ -385,12 +388,13 @@ namespace AmongUsRevamped TabGroupImpostor = TextOptionItem.Create(102000, Translator.Get("tabGroupImpostor"), TabGroup.CustomRoleSettings) .SetColor(CL.Hex("#ff1919")); - +*/ // Gamemode Settings +/* TabGroupStandard = TextOptionItem.Create(69998, Translator.Get("tabGroupStandard"), TabGroup.GamemodeSettings) .SetColor(Color.white); ChatBeforeFirstMeeting = BooleanOptionItem.Create(69999, Translator.Get("chatBeforeFirstMeeting"), false, TabGroup.GamemodeSettings, false); - +*/ TabGroupHNS = TextOptionItem.Create(70000, Translator.Get("tabGroupHNS"), TabGroup.GamemodeSettings) .SetColor(Color.green); NumSeekers = IntegerOptionItem.Create(70001, Translator.Get("numSeekers"), new(1, 15, 1), 1, TabGroup.GamemodeSettings, false) diff --git a/Modules/CustomRoleManagement.cs b/Modules/CustomRoleManagement.cs index 329f651..941a30e 100644 --- a/Modules/CustomRoleManagement.cs +++ b/Modules/CustomRoleManagement.cs @@ -5,7 +5,9 @@ using InnerNet; using UnityEngine; namespace AmongUsRevamped; +// It was a fun ride, but this won't last. +/* public static class CustomRoleManagement { public static Dictionary PlayerRoles = new Dictionary(); @@ -206,4 +208,5 @@ public static class CustomRoleManagement } return string.Join("\n", lines); } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/Modules/FixedUpdate.cs b/Modules/FixedUpdate.cs index 38be327..46dad28 100644 --- a/Modules/FixedUpdate.cs +++ b/Modules/FixedUpdate.cs @@ -102,22 +102,6 @@ class FixedUpdateInGamePatch break; } - if (__instance.Data.PlayerLevel != 0 && __instance.Data.PlayerLevel < Options.KickLowLevelPlayer.GetInt() - 1 && __instance.Data.ClientId != AmongUsClient.Instance.HostId) - { - if (!Options.TempBanLowLevelPlayer.GetBool()) - { - AmongUsClient.Instance.KickPlayer(__instance.Data.ClientId, false); - Logger.Info($" {__instance.Data.PlayerName} was kicked for being under level {Options.KickLowLevelPlayer.GetInt()}", "KickLowLevelPlayer"); - Logger.SendInGame($" {__instance.Data.PlayerName} was kicked for being under level {Options.KickLowLevelPlayer.GetInt()}"); - } - else - { - AmongUsClient.Instance.KickPlayer(__instance.Data.ClientId, true); - Logger.Info($" {__instance.Data.PlayerName} was banned for being under level {Options.KickLowLevelPlayer.GetInt()} ", "BanLowLevelPlayer"); - Logger.SendInGame($" {__instance.Data.PlayerName} was banned for being under level {Options.KickLowLevelPlayer.GetInt()}"); - } - } - if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance) { // 2 = Shift and Seek diff --git a/Modules/OptionItem/OptionItem.cs b/Modules/OptionItem/OptionItem.cs index 6bec10f..fdf5172 100644 --- a/Modules/OptionItem/OptionItem.cs +++ b/Modules/OptionItem/OptionItem.cs @@ -214,7 +214,7 @@ namespace AmongUsRevamped public enum TabGroup { SystemSettings, - CustomRoleSettings, + //CustomRoleSettings, ModSettings, GamemodeSettings, diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 3b0b490..b1e2515 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -73,8 +73,10 @@ public static class Utils { case TabGroup.SystemSettings: return "System Settings"; +/* case TabGroup.CustomRoleSettings: return "Custom Roles"; +*/ case TabGroup.ModSettings: return "Gameplay Settings"; case TabGroup.GamemodeSettings: @@ -210,9 +212,9 @@ public static class Utils LateTask.Tasks.Clear(); NormalGameEndChecker.ImpCheckComplete = false; - CreateOptionsPickerPatch.SetDleks2 = false; + //CreateOptionsPickerPatch.SetDleks2 = false; CanCallMeetings = true; - CustomRoleManagement.HandlingRoleMessages = false; + //CustomRoleManagement.HandlingRoleMessages = false; PlayerControlSetRolePatch.FirstAssign = true; PlayerControlCompleteTaskPatch.playerTasksCompleted.Clear(); diff --git a/Patches/ChatPatches.cs b/Patches/ChatPatches.cs index 2eb6810..fbb0dcc 100644 --- a/Patches/ChatPatches.cs +++ b/Patches/ChatPatches.cs @@ -143,7 +143,7 @@ internal static class SendChatPatch return false; } - if (__instance.timeSinceLastMessage < 3f || OnGameJoinedPatch.WaitingForChat || CustomRoleManagement.HandlingRoleMessages) return false; + if (__instance.timeSinceLastMessage < 3f || OnGameJoinedPatch.WaitingForChat /*|| CustomRoleManagement.HandlingRoleMessages*/) return false; if (text == "/l" || text == "/lastgame" || text == "/win" || text == "/winner") { @@ -151,7 +151,7 @@ internal static class SendChatPatch Utils.ChatCommand(__instance, $"{NormalGameEndChecker.LastWinReason}", "", false); return false; } - +/* if (text == "/r jester"){ Utils.ChatCommand(__instance, Translator.Get("jesterPublic"), "", false); return false;} @@ -159,7 +159,7 @@ internal static class SendChatPatch if (text == "/r mayor"){ Utils.ChatCommand(__instance, Translator.Get("mayorPublic", Options.MayorExtraVoteCount.GetInt()), "", false); return false;} - +*/ if (text == "/aur" || text == "/amongusrevamped" || text == "/socials") { Utils.ChatCommand(__instance, Translator.Get("socialsAll"), "", false); @@ -189,7 +189,7 @@ internal static class SendChatPatch switch (Options.Gamemode.GetValue()) { case 0: - Utils.ChatCommand(__instance, $"Enabled Custom Roles:\n\n{CustomRoleManagement.GetActiveRoles()}", "", false); + //Utils.ChatCommand(__instance, $"Enabled Custom Roles:\n\n{CustomRoleManagement.GetActiveRoles()}", "", false); break; case 1: @@ -400,7 +400,7 @@ public static class RPCHandlerPatch } } - if (CustomRoleManagement.HandlingRoleMessages || OnGameJoinedPatch.WaitingForChat) return; + if (/*CustomRoleManagement.HandlingRoleMessages || */OnGameJoinedPatch.WaitingForChat) return; if (text == "/h" || text == "/help") { @@ -476,7 +476,7 @@ public static class RPCHandlerPatch switch (Options.Gamemode.GetValue()) { case 0: - Utils.ModeratorChatCommand($"Enabled Custom Roles:\n\n{CustomRoleManagement.GetActiveRoles()}", "", false); + //Utils.ModeratorChatCommand($"Enabled Custom Roles:\n\n{CustomRoleManagement.GetActiveRoles()}", "", false); break; case 1: @@ -493,13 +493,13 @@ public static class RPCHandlerPatch } } - +/* if (text == "/r jester"){ Utils.ModeratorChatCommand(Translator.Get("jesterPublic"), "", false);} if (text == "/r mayor"){ Utils.ModeratorChatCommand(Translator.Get("mayorPublic", Options.MayorExtraVoteCount.GetInt()), "", false);} - +*/ break; } } diff --git a/Patches/DevicePatches.cs b/Patches/DevicePatches.cs index 6ae332e..ee48f9d 100644 --- a/Patches/DevicePatches.cs +++ b/Patches/DevicePatches.cs @@ -148,7 +148,7 @@ public class RemoveDisableDevicesPatch { public static void Postfix() { - if (!Options.DisableDevices.GetBool()) return; + if (!Options.DisableDevices.GetBool() || !AmongUsClient.Instance.AmHost) return; UpdateDisableDevices(); } diff --git a/Patches/DleksPatch.cs b/Patches/DleksPatch.cs index e626da6..6eb77c6 100644 --- a/Patches/DleksPatch.cs +++ b/Patches/DleksPatch.cs @@ -4,6 +4,9 @@ using UnityEngine.SceneManagement; namespace AmongUsRevamped; +// DateTime spoofing is patched as of April 2026 + +/* [HarmonyPatch(typeof(AmongUsDateTime), nameof(AmongUsDateTime.UtcNow), MethodType.Getter)] public static class AmongUsDateTime_UtcNow { @@ -227,4 +230,5 @@ class CreateOptionsPickerPatch transform2.position = position2; } } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/Patches/ExilePatch.cs b/Patches/ExilePatch.cs index 1d7f626..d441021 100644 --- a/Patches/ExilePatch.cs +++ b/Patches/ExilePatch.cs @@ -42,7 +42,7 @@ class ExileControllerWrapUpPatch } Logger.Info($" {ejectedPlayer.PlayerName} was ejected", "ExileController"); - +/* if (CustomRoleManagement.PlayerRoles.TryGetValue(ejectedPlayer.PlayerId, out var role) && role == "Jester") { Utils.CustomWinnerEndGame(pc, 1); @@ -62,6 +62,7 @@ class ExileControllerWrapUpPatch { "Mayor", Translator.Get("mayorPriv", Options.MayorExtraVoteCount.GetInt())}, }); } +*/ } } diff --git a/Patches/GameSettingMenuPatch.cs b/Patches/GameSettingMenuPatch.cs index 8c7b3f1..03c2f9f 100644 --- a/Patches/GameSettingMenuPatch.cs +++ b/Patches/GameSettingMenuPatch.cs @@ -115,9 +115,11 @@ namespace AmongUsRevamped case TabGroup.SystemSettings: __instance.MenuDescriptionText.text = "Quality settings to improve comfort and testing."; break; +/* case TabGroup.CustomRoleSettings: __instance.MenuDescriptionText.text = "Custom Role enabling and settings."; break; +*/ case TabGroup.ModSettings: __instance.MenuDescriptionText.text = "Gameplay Settings to improve the in-game experience."; break; diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 81c0397..53fcd12 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -14,7 +14,7 @@ internal static class CoShowIntroPatch Logger.Info(" Intro initiated", "CoShowIntro"); if (!AmongUsClient.Instance.AmHost) return; - +/* NormalGameEndChecker.customRoles = CustomRoleManagement.PlayerToCustomRole(); if (CustomRoleManagement.PlayerRoles.Count != 0 && !Utils.isHideNSeek && Options.Gamemode.GetValue() < 2) @@ -28,7 +28,7 @@ internal static class CoShowIntroPatch }); }, 1f, "BlockACKick"); } - +*/ foreach (var p in PlayerControl.AllPlayerControls) { p.cosmetics.nameText.text = p.Data.PlayerName; @@ -45,10 +45,10 @@ internal static class CoShowIntroPatch _ = new LateTask(() => { Utils.CanCallMeetings = true; - }, Options.ChatBeforeFirstMeeting.GetBool() ? 39.5f : 33f, "MeetingEnabled"); + }, 33f, "MeetingEnabled"); } - if (Options.Gamemode.GetValue() == 2 && Options.SNSChatInGame.GetBool() || Options.Gamemode.GetValue() == 0 && Options.ChatBeforeFirstMeeting.GetBool()) + if (Options.Gamemode.GetValue() == 2 && Options.SNSChatInGame.GetBool() /*|| Options.Gamemode.GetValue() == 0 && Options.ChatBeforeFirstMeeting.GetBool()*/) { _ = new LateTask(() => { diff --git a/Patches/JoinAndLeavePatches.cs b/Patches/JoinAndLeavePatches.cs index 6583451..2e3ca67 100644 --- a/Patches/JoinAndLeavePatches.cs +++ b/Patches/JoinAndLeavePatches.cs @@ -111,4 +111,31 @@ class OnPlayerLeftPatch PlayerControlCompleteTaskPatch.CalculateTaskWin(); } } +} + +[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.SetLevel))] +public static class SetLevelPatch +{ + public static List HandledLevelKicks = []; + public static void Prefix(PlayerControl __instance, uint level) + { + if (AmongUsClient.Instance.AmHost && level < Options.KickLowLevelPlayer.GetInt() - 1 && __instance.Data.ClientId != AmongUsClient.Instance.HostId) + { + if (HandledLevelKicks.Contains(__instance)) return; + + if (!Options.TempBanLowLevelPlayer.GetBool()) + { + AmongUsClient.Instance.KickPlayer(__instance.Data.ClientId, false); + Logger.Info($" {__instance.Data.PlayerName} was kicked for being under level {Options.KickLowLevelPlayer.GetInt()}", "KickLowLevelPlayer"); + Logger.SendInGame($" {__instance.Data.PlayerName} was kicked for being under level {Options.KickLowLevelPlayer.GetInt()}"); + } + else + { + AmongUsClient.Instance.KickPlayer(__instance.Data.ClientId, true); + Logger.Info($" {__instance.Data.PlayerName} was banned for being under level {Options.KickLowLevelPlayer.GetInt()} ", "BanLowLevelPlayer"); + Logger.SendInGame($" {__instance.Data.PlayerName} was banned for being under level {Options.KickLowLevelPlayer.GetInt()}"); + } + HandledLevelKicks.Add(__instance); + } + } } \ No newline at end of file diff --git a/Patches/MeetingPatches.cs b/Patches/MeetingPatches.cs index 6bbcb94..49aca2a 100644 --- a/Patches/MeetingPatches.cs +++ b/Patches/MeetingPatches.cs @@ -2,6 +2,8 @@ namespace AmongUsRevamped; +//Old Patch for Mayor +/* [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.CheckForEndVoting))] public static class CheckForEndVotingPatch { @@ -44,7 +46,7 @@ public static class CheckForEndVotingPatch return false; } } - +*/ [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Start))] class MeetingHudStartPatch diff --git a/Patches/OnGameStartedPatch.cs b/Patches/OnGameStartedPatch.cs index 7a6a0e9..116cffd 100644 --- a/Patches/OnGameStartedPatch.cs +++ b/Patches/OnGameStartedPatch.cs @@ -15,11 +15,12 @@ internal class CoStartGamePatch Logger.Info(" -------- GAME STARTED --------", "StartGame"); Logger.Info($" Gamemode: {Options.Gamemode.GetValue()}", "StartGame"); Logger.Info($" Players: {PlayerControl.AllPlayerControls.Count}", "StartGame"); - +/* if ((Options.Gamemode.GetValue() == 0 || Options.Gamemode.GetValue() == 1) && !Utils.isHideNSeek) { CustomRoleManagement.AssignRoles(); } +*/ NormalGameEndChecker.imps.Clear(); NormalGameEndChecker.LastWinReason = ""; @@ -47,7 +48,7 @@ class PlayerControlSetRolePatch roleType = RoleTypes.CrewmateGhost; return true; } - +/* if (CustomRoleManagement.PlayerRoles.TryGetValue(__instance.PlayerId, out var role) && role == "Mayor" && Options.Gamemode.GetValue() < 2) { if (Options.MayorVentToMeeting.GetBool()) @@ -74,7 +75,7 @@ class PlayerControlSetRolePatch } Logger.Info($" {__instance.Data.PlayerName} | {oldRole} -> {roleType}", "ChangedRoleBase"); } - +*/ if (Utils.isHideNSeek && i == 0) { int seekersCount = Options.NumSeekers.GetInt(); diff --git a/Patches/PlayerControlPatches.cs b/Patches/PlayerControlPatches.cs index 1ab9aff..af30859 100644 --- a/Patches/PlayerControlPatches.cs +++ b/Patches/PlayerControlPatches.cs @@ -16,7 +16,7 @@ class ReportDeadBodyPatch { if (!AmongUsClient.Instance.AmHost || __instance == null) return true; - if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.CanCallMeetings && !Options.ChatBeforeFirstMeeting.GetBool() && target == null) + if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.CanCallMeetings /*&& !Options.ChatBeforeFirstMeeting.GetBool()*/ && target == null) { Logger.Info($" {__instance.Data.PlayerName} is calling a meeting too fast, attempt blocked", "ReportDeadBodyPatch"); return false; @@ -151,12 +151,13 @@ class PlayerControlCompleteTaskPatch foreach (var p in PlayerControl.AllPlayerControls) { +/* if (ignoredRoles.Contains(CustomRoleManagement.GetRole(p.PlayerId)) && !tasksInitiated) { ignoredTasks += p.Data.Tasks.Count; tasksInitiated = true; } - +*/ if (!playerTasksCompleted.ContainsKey(p)) { playerTasksCompleted[p] = 0; @@ -165,12 +166,12 @@ class PlayerControlCompleteTaskPatch } playerTasksCompleted[__instance]++; - +/* if (ignoredRoles.Contains(CustomRoleManagement.GetRole(__instance.PlayerId))) { ignoredCompletedTasks = playerTasksCompleted[__instance]; } - +*/ Logger.Info($" {__instance.Data.PlayerName} completed {idx}", "TaskPatch"); if (Options.Gamemode.GetValue() != 3) CalculateTaskWin(); diff --git a/Patches/VentPatches.cs b/Patches/VentPatches.cs index 873f218..2a3a5e3 100644 --- a/Patches/VentPatches.cs +++ b/Patches/VentPatches.cs @@ -1,5 +1,8 @@ namespace AmongUsRevamped; +//Old Patch for Mayor + +/* [HarmonyPatch(typeof(Vent), nameof(Vent.EnterVent))] class EnterVentPatch { @@ -13,4 +16,5 @@ class EnterVentPatch Logger.Info($" The Mayor, {pc.Data.PlayerName}, called a meeting by venting", "EnterVent"); } } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/README.md b/README.md index 2e74b4b..bc7da65 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,7 @@ **** ‎ -# 🎮 Features (v1.7.1): -## 🌟 Custom Roles: -- Mayor (Crewmate) -- The mayor has extra votes and can call meetings by venting, depending on settings. -- Jester (Neutral) -- The jester has to get voted to win alone and does not win with any other team. +# 🎮 Features (v1.7.2): ## ♠️ Client Side settings: - Game Master - Unlock FPS @@ -75,7 +70,6 @@ - Shift and Seek - Speedrun ## ❓ Other Improvements: -- ehT dlekS map (reverse Skeld) - Ability to cancel starting countdown - Improved main menu - Faster startup time