From 58df006f0700bf7dde7372ecbca1b38c0efe6131 Mon Sep 17 00:00:00 2001 From: Ape <155788660+ApeMV@users.noreply.github.com> Date: Mon, 30 Mar 2026 17:38:29 +0200 Subject: [PATCH] Yeah I still can't fix the dumb level stuff --- AmongUsRevamped.cs | 2 +- Modules/FixedUpdate.cs | 6 +----- Modules/Utils.cs | 2 -- Patches/IntroPatch.cs | 20 ++++++++++---------- Patches/PlayerControlPatches.cs | 6 +++--- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index 1823f7d..8ba1763 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.6.5"; + public const string ModVersion = "v1.6.6"; public static float GameTimer; diff --git a/Modules/FixedUpdate.cs b/Modules/FixedUpdate.cs index 2cb0b29..38be327 100644 --- a/Modules/FixedUpdate.cs +++ b/Modules/FixedUpdate.cs @@ -36,7 +36,6 @@ public static class FixedUpdate [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))] class FixedUpdateInGamePatch { - public static List ScheduledKicks = new(); private static Dictionary LastColors = new(); private static float t; private static GameObject settingsLabel; @@ -103,13 +102,10 @@ class FixedUpdateInGamePatch break; } - if (__instance.CanMove && __instance.Data.PlayerLevel + 1 < Options.KickLowLevelPlayer.GetInt() && __instance.Data.ClientId != AmongUsClient.Instance.HostId) + if (__instance.Data.PlayerLevel != 0 && __instance.Data.PlayerLevel < Options.KickLowLevelPlayer.GetInt() - 1 && __instance.Data.ClientId != AmongUsClient.Instance.HostId) { - if (ScheduledKicks.Contains(__instance)) return; - if (!Options.TempBanLowLevelPlayer.GetBool()) { - ScheduledKicks.Add(__instance); 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()}"); diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 1047a9b..3b0b490 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -220,8 +220,6 @@ public static class Utils PlayerControlCompleteTaskPatch.tasksInitiated = false; PlayerControlCompleteTaskPatch.ignoredCompletedTasks = 0; PlayerControlCompleteTaskPatch.ignoredTasks = 0; - - FixedUpdateInGamePatch.ScheduledKicks.Clear(); } public static PlayerControl[] AllAlivePlayerControls diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 0d0c828..18a0643 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -47,6 +47,16 @@ internal static class CoShowIntroPatch Utils.CanCallMeetings = true; }, Options.ChatBeforeFirstMeeting.GetBool() ? 39.5f : 33f, "MeetingEnabled"); } + + if (Options.Gamemode.GetValue() == 2 && Options.SNSChatInGame.GetBool() || Options.Gamemode.GetValue() == 0 && Options.ChatBeforeFirstMeeting.GetBool()) + { + _ = new LateTask(() => + { + PlayerControl.LocalPlayer.CmdReportDeadBody(null); + if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose(); + + }, 9f, "SetChatVisible"); + } } } @@ -57,16 +67,6 @@ class BeginCrewmatePatch { if (!AmongUsClient.Instance.AmHost) return; - if (Options.Gamemode.GetValue() == 2 && Options.SNSChatInGame.GetBool() || Options.Gamemode.GetValue() == 0 && Options.ChatBeforeFirstMeeting.GetBool()) - { - _ = new LateTask(() => - { - PlayerControl.LocalPlayer.CmdReportDeadBody(null); - if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose(); - - }, 7f, "SetChatVisible"); - } - if (Main.GM.Value) { __instance.TeamTitle.text = "Game Master"; diff --git a/Patches/PlayerControlPatches.cs b/Patches/PlayerControlPatches.cs index 0fa9aaf..7a7e02b 100644 --- a/Patches/PlayerControlPatches.cs +++ b/Patches/PlayerControlPatches.cs @@ -62,7 +62,7 @@ internal static class MurderPlayerPatch { if (p.Data.Role.IsImpostor) { - p.cosmetics.nameText.text = $"{p.Data.PlayerName}({killCount[__instance.Data.PlayerId]}†)"; + p.cosmetics.nameText.text = $"{p.Data.PlayerName}({killCount[p.Data.PlayerId]}†)"; } else { @@ -106,8 +106,8 @@ internal static class MurderPlayerPatch if (misfireCount[__instance.Data.PlayerId] >= Options.MisfiresToSuicide.GetFloat()) { __instance.RpcSetRole(RoleTypes.ImpostorGhost); - Logger.Info($" {__instance.Data.PlayerName} misfired {misfireCount[playerId]} times and suicided", "SNSKillManager"); - Logger.SendInGame($" {__instance.Data.PlayerName} misfired {misfireCount[playerId]} times and suicided"); + Logger.Info($" {__instance.Data.PlayerName} misfired {misfireCount[playerId]} time(s) and suicided", "SNSKillManager"); + Logger.SendInGame($" {__instance.Data.PlayerName} misfired {misfireCount[playerId]} time(s) and suicided"); } }