Compare commits

..
16 Commits
Author SHA1 Message Date
Ape de4f057899 1.7.2 2026-05-14 21:59:09 +02:00
Ape 3e4d833b66 1.7.1 2026-04-12 19:07:06 +02:00
Ape 6a5fbe7300 1.7.0 2026-04-01 12:58:58 +02:00
Ape fbf9b2b6eb 3 Small fixes 2026-04-01 12:49:21 +02:00
Ape 7da659af7b 1.6.6 2026-03-30 17:42:23 +02:00
Ape 58df006f07 Yeah I still can't fix the dumb level stuff 2026-03-30 17:38:29 +02:00
Ape 0f373b8328 Super important change 2026-03-27 20:08:15 +01:00
Ape 16ed549de4 Update ExilePatch.cs 2026-03-27 20:06:29 +01:00
Ape bc2aa74046 .. Why did it do that? 2026-03-27 19:58:41 +01:00
Ape 45859032bd Merge branch 'main' of https://github.com/ApeMV/AmongUsRevamped 2026-03-27 19:57:32 +01:00
Ape 66a5eb0b09 Small fixes and optimize FixedUpdate 2026-03-27 19:55:57 +01:00
Ape 95306ba8a9 1.6.4 2026-03-22 13:30:08 +01:00
Ape 2ee17166f2 The sizes of your fixes don't matter 2026-03-22 13:09:14 +01:00
Ape 10bae07af1 The size of your fix doesn't matter 2026-03-03 20:47:17 +01:00
Ape df0a68ff19 1.6.2 2026-02-25 14:58:09 +01:00
Ape 69ecb3c7a0 Fix start detection, few more strings 2026-02-25 14:26:50 +01:00
23 changed files with 285 additions and 160 deletions

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ public partial class Main : BasePlugin
public static bool HasArgumentException;
public static string CredentialsText;
public const string ModVersion = "v1.6.1";
public const string ModVersion = "v1.7.2";
public static float GameTimer;
+1 -1
View File
@@ -186,7 +186,7 @@ public static class BanManager
public static bool IsWordBanned(PlayerControl player, string input)
{
if (input == "" || !AmongUsClient.Instance.AmHost) return false;
if (input == "" || !AmongUsClient.Instance.AmHost || Utils.CheckAccessLevel(player.Data.FriendCode) > 0) return false;
var bannedWords = File.ReadAllLines(BanWordPath);
+9 -5
View File
@@ -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)
+12 -2
View File
@@ -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<byte, string> PlayerRoles = new Dictionary<byte, string>();
@@ -19,6 +21,8 @@ public static class CustomRoleManagement
public static void AssignRoles()
{
if (Options.Gamemode.GetValue() > 1) return;
// crewmateRoles = assigned with crewmate role base
// impostorRoles = assigned with impostor role base
List<(string roleName, int percentage)> crewmateRoles = new()
@@ -114,7 +118,12 @@ public static class CustomRoleManagement
private static int PendingRoleMessages = 0;
public static void SendRoleMessages(Dictionary<string, string> roleMessages)
{
if (PlayerRoles.Count == 0 || PlayerControl.LocalPlayer.Data.IsDead) return;
if (PlayerRoles.Count == 0 || PlayerControl.LocalPlayer.Data.IsDead)
{
HandlingRoleMessages = false;
PendingRoleMessages = 0;
return;
}
HashSet<string> sentRoles = new HashSet<string>();
@@ -199,4 +208,5 @@ public static class CustomRoleManagement
}
return string.Join("\n", lines);
}
}
}
*/
+48 -62
View File
@@ -36,84 +36,70 @@ public static class FixedUpdate
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))]
class FixedUpdateInGamePatch
{
private static Dictionary<byte, string> LastColors = new();
private static float t;
private static GameObject settingsLabel;
public static void Postfix(PlayerControl __instance)
{
if (__instance == null || __instance.PlayerId == 255 || !AmongUsClient.Instance.AmHost) return;
t += Time.deltaTime;
if (t < 0.2f) return;
t = 0f;
int access = Utils.CheckAccessLevel(__instance.Data.FriendCode);
string color = access switch
if (Utils.IsLobby)
{
1 => "yellow",
2 => "purple",
3 => "red",
_ => "white"
};
if (!__instance.cosmetics.nameText.text.Contains($"{color}") && Utils.IsLobby)
{
__instance.cosmetics.nameText.text = $"<color={color}>{__instance.Data.PlayerName}</color>";
}
GameObject g = GameObject.Find("GameSettingsLabel");
// 0Kc
if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek && Main.NormalOptions.KillCooldown != 0.01f)
{
Main.NormalOptions.KillCooldown = 0.01f;
if (Options.NoKcdSettingsOverride.GetBool() && g == null)
int access = Utils.CheckAccessLevel(__instance.Data.FriendCode);
string color = access switch
{
Main.NormalOptions.EmergencyCooldown = 0;
1 => "yellow",
2 => "purple",
3 => "red",
_ => "white"
};
Main.NormalOptions.TaskBarMode = 0;
if (!LastColors.TryGetValue(__instance.PlayerId, out var lastColor) || lastColor != color || !__instance.cosmetics.nameText.text.Contains($"<color={color}>"))
{
__instance.cosmetics.nameText.text = $"<color={color}>{__instance.Data.PlayerName}</color>";
LastColors[__instance.PlayerId] = color;
}
}
// SnS
if (Options.Gamemode.GetValue() == 2 && !Utils.isHideNSeek && Main.NormalOptions.KillCooldown != 2.5f)
if (settingsLabel == null) settingsLabel = GameObject.Find("GameSettingsLabel");
int gamemode = Options.Gamemode.GetValue();
switch (gamemode)
{
Main.NormalOptions.KillCooldown = 2.5f;
case 1: // 0Kc
if (Main.NormalOptions.KillCooldown != 0.01f)
Main.NormalOptions.KillCooldown = 0.01f;
if (Options.SNSSettingsOverride.GetBool() && g == null)
{
Main.NormalOptions.TaskBarMode = 0;
}
}
if (Options.NoKcdSettingsOverride.GetBool() && settingsLabel == null)
{
Main.NormalOptions.EmergencyCooldown = 0;
Main.NormalOptions.TaskBarMode = 0;
}
break;
// Speedrun
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && g == null)
{
Main.NormalOptions.TaskBarMode = 0;
case 2: // SnS
if (Main.NormalOptions.KillCooldown != 2.5f)
Main.NormalOptions.KillCooldown = 2.5f;
if (__instance.AllTasksCompleted() && Utils.InGame && Utils.GamePastRoleSelection && !Utils.HandlingGameEnd)
{
if (__instance == PlayerControl.LocalPlayer && Main.GM.Value) return;
if (Options.SNSSettingsOverride.GetBool() && settingsLabel == null)
Main.NormalOptions.TaskBarMode = 0;
break;
Utils.CustomWinnerEndGame(__instance, 1);
NormalGameEndChecker.LastWinReason = $"{__instance.Data.PlayerName} Wins! (Completed tasks first)";
case 3: // Speedrun
if (settingsLabel == null)
Main.NormalOptions.TaskBarMode = 0;
break;
}
}
if (Options.Gamemode.GetValue() == 0 && Main.NormalOptions.KillCooldown <= 0.01f)
{
Main.NormalOptions.KillCooldown = 25f;
}
if (__instance.Data.PlayerLevel != 0 && __instance.Data.PlayerLevel < Options.KickLowLevelPlayer.GetInt() && __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()}");
}
case 0: // Reset
if (Main.NormalOptions.KillCooldown <= 0.01f)
Main.NormalOptions.KillCooldown = 25f;
break;
}
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance)
+2
View File
@@ -12,6 +12,8 @@ internal class Hotkeys
public static int IncrementMultiplier;
public static void Postfix()
{
if (AmongUsClient.Instance == null || PlayerControl.LocalPlayer == null) return;
bool Shift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
bool Ctrl = Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);
bool Enter = Input.GetKeyDown(KeyCode.Return);
+1 -1
View File
@@ -214,7 +214,7 @@ namespace AmongUsRevamped
public enum TabGroup
{
SystemSettings,
CustomRoleSettings,
//CustomRoleSettings,
ModSettings,
GamemodeSettings,
+4 -2
View File
@@ -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();
+29 -23
View File
@@ -91,7 +91,7 @@ internal static class SendChatPatch
if (!AmongUsClient.Instance.AmHost) return true;
if (text == "/reload" || text == "/translatereload" || text == "/reset" || text == "/translatereset")
if (text == "/reload")
{
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"{Translator.Get("translationReloaded")}");
Translator.Reload();
@@ -107,7 +107,7 @@ internal static class SendChatPatch
__instance.freeChatField.textArea.SetText(string.Empty);
return false;
}
if (text == "/h" || text == "/help" || text == "/cmd" || text == "/commands")
if (text == "/h" || text == "/help")
{
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"{Translator.Get("allCommandsFull")}");
__instance.freeChatField.textArea.Clear();
@@ -115,6 +115,12 @@ internal static class SendChatPatch
return false;
}
if (text == "/s" || text == "/start")
{
GameStartManager.Instance.BeginGame();
return false;
}
if (text == "/eg" || text == "/endgame")
{
__instance.freeChatField.textArea.Clear();
@@ -137,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")
{
@@ -145,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;}
@@ -153,20 +159,20 @@ 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" || text == "/github" || text == "/discord")
*/
if (text == "/aur" || text == "/amongusrevamped" || text == "/socials")
{
Utils.ChatCommand(__instance, Translator.Get("socialsAll"), "", false);
return false;
}
if (text == "/0kc" || text == "/0kcd" || text == "/0killcooldown")
if (text == "/0kc" || text == "/0killcooldown")
{
Utils.ChatCommand(__instance, Translator.Get("noKcdMode"), "", false);
return false;
}
if (text == "/sns" || text == "/shiftandseek" || text == "/shift&seek")
if (text == "/sns" || text == "/shiftandseek")
{
Utils.ChatCommand(__instance, Translator.Get("SnSModeOne"), Translator.Get("SnSModeTwo", Options.CrewAutoWinsGameAfter.GetInt(), Options.CantKillTime.GetInt(), Options.MisfiresToSuicide.GetInt()), true);
return false;
@@ -183,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:
@@ -237,10 +243,10 @@ internal static class SendChatPatch
if (!isKick && !isBan && !isColorKick && !isColorBan)
{
__instance.freeChatField.textArea.SetText(converted);
Utils.ChatCommand(__instance, $"{converted}", "", false);
//__instance.freeChatField.textArea.SetText(converted);
//Utils.ChatCommand(__instance, $"{converted}", "", false);
Logger.Info($" {PlayerControl.LocalPlayer.Data.PlayerName}: {msgtext}", "SendChat");
return false;
return true;
}
string arg = text.Substring(isKick ? 6 : isBan ? 5 : isColorKick ? 7 : isColorBan ? 6 : 0).Trim();
@@ -311,7 +317,7 @@ public static class RPCHandlerPatch
c = keywords.Any(k => text == k);
}
if (c && Utils.CheckAccessLevel(__instance.Data.FriendCode) >= 1 && Options.AutoKickStart.GetBool() && !Utils.InGame)
if (c && Utils.CheckAccessLevel(__instance.Data.FriendCode) < 1 && Options.AutoKickStart.GetBool() && !Utils.InGame)
{
int clientId = __instance.Data.ClientId;
@@ -394,9 +400,9 @@ public static class RPCHandlerPatch
}
}
if (CustomRoleManagement.HandlingRoleMessages || OnGameJoinedPatch.WaitingForChat) return;
if (/*CustomRoleManagement.HandlingRoleMessages || */OnGameJoinedPatch.WaitingForChat) return;
if (text == "/h" || text == "/help" || text == "/cmd" || text == "/commands")
if (text == "/h" || text == "/help")
{
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashHelpAndAurCmd.GetValue()) return;
OnGameJoinedPatch.WaitingForChat = true;
@@ -417,7 +423,7 @@ public static class RPCHandlerPatch
}, 6.6f, "MHP3");
}
if (text == "/eg" || text == "/endgame" || text == "/finishgame" || text == "/stop")
if (text == "/eg" || text == "/endgame")
{
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashStartAndEndGameCmd.GetValue()) return;
MessageWriter writer = AmongUsClient.Instance.StartEndGame();
@@ -425,7 +431,7 @@ public static class RPCHandlerPatch
AmongUsClient.Instance.FinishEndGame(writer);
}
if (text == "/em" || text == "/endmeeting" || text == "/finishmeeting" || text == "/stopmeeting")
if (text == "/em" || text == "/endmeeting")
{
if (Utils.IsMeeting)
{
@@ -434,7 +440,7 @@ public static class RPCHandlerPatch
}
}
if (text == "/s" || text == "/start" || text == "/startgame" || text == "/begin")
if (text == "/s" || text == "/start")
{
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashStartAndEndGameCmd.GetValue()) return;
GameStartManager.Instance.BeginGame();
@@ -447,12 +453,12 @@ public static class RPCHandlerPatch
Utils.ModeratorChatCommand($"{NormalGameEndChecker.LastWinReason}", "", false);
}
if (text == "/0kc" || text == "/0kcd" || text == "/0killcooldown")
if (text == "/0kc" || text == "/0killcooldown")
{
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return;
Utils.ModeratorChatCommand(Translator.Get("noKcdMode"), "", false);
}
if (text == "/sns" || text == "/shiftandseek" || text == "/shift&seek")
if (text == "/sns" || text == "/shiftandseek")
{
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return;
Utils.ModeratorChatCommand(Translator.Get("SnSModeOne"), Translator.Get("SnSModeTwo", Options.CrewAutoWinsGameAfter.GetInt(), Options.CantKillTime.GetInt(), Options.MisfiresToSuicide.GetInt()), true);
@@ -470,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:
@@ -487,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;
}
}
+9 -9
View File
@@ -22,18 +22,18 @@ namespace AmongUsRevamped
if (GM == null || GM.ToggleButton == null)
{
GM = ClientOptionItem.Create("Game Master", Main.GM, __instance, GMButtonToggle);
GM = ClientOptionItem.Create(Translator.Get("gameMaster"), Main.GM, __instance, GMButtonToggle);
static void GMButtonToggle()
{
if (Main.GM.Value)
HudManager.Instance.ShowPopUp("You will now spectate games until GM is turned off.");
HudManager.Instance.ShowPopUp(Translator.Get("gameMasterWarning"));
}
}
if (UnlockFPS == null || UnlockFPS.ToggleButton == null)
{
UnlockFPS = ClientOptionItem.Create("Unlock FPS", Main.UnlockFps, __instance, UnlockFPSButtonToggle);
UnlockFPS = ClientOptionItem.Create(Translator.Get("unlockFPS"), Main.UnlockFps, __instance, UnlockFPSButtonToggle);
static void UnlockFPSButtonToggle()
{
@@ -43,11 +43,11 @@ namespace AmongUsRevamped
}
if (ShowFPS == null || ShowFPS.ToggleButton == null)
ShowFPS = ClientOptionItem.Create("Show FPS", Main.ShowFps, __instance);
ShowFPS = ClientOptionItem.Create(Translator.Get("showFPS"), Main.ShowFps, __instance);
if (AutoStart == null || AutoStart.ToggleButton == null)
{
AutoStart = ClientOptionItem.Create("Auto Start", Main.AutoStart, __instance, AutoStartButtonToggle);
AutoStart = ClientOptionItem.Create(Translator.Get("autoStart"), Main.AutoStart, __instance, AutoStartButtonToggle);
static void AutoStartButtonToggle()
{
@@ -55,16 +55,16 @@ namespace AmongUsRevamped
GameStartManager.Instance.startState == GameStartManager.StartingStates.Countdown)
{
GameStartManager.Instance.ResetStartState();
Logger.SendInGame("CancelStartCountDown");
Logger.SendInGame(Translator.Get("CancelStartCountDown"));
}
}
}
if (DarkTheme == null || DarkTheme.ToggleButton == null)
DarkTheme = ClientOptionItem.Create("Enable Dark Theme", Main.DarkTheme, __instance);
DarkTheme = ClientOptionItem.Create(Translator.Get("enableDarkTheme"), Main.DarkTheme, __instance);
if (LobbyMusic == null || LobbyMusic.ToggleButton == null)
LobbyMusic = ClientOptionItem.Create("Lobby Music", Main.LobbyMusic, __instance);
LobbyMusic = ClientOptionItem.Create(Translator.Get("enableLobbyMusic"), Main.LobbyMusic, __instance);
}
}
@@ -92,7 +92,7 @@ namespace AmongUsRevamped
{
public static void Postfix(HudManager __instance)
{
if (Main.GM.Value)
if (Main.GM.Value && AmongUsClient.Instance.AmHost)
{
__instance.Chat.gameObject.SetActive(true);
__instance.MapButton.gameObject.SetActive(true);
+1 -1
View File
@@ -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();
}
+5 -1
View File
@@ -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;
}
}
}
}
*/
+28 -2
View File
@@ -6,10 +6,14 @@ class ExileControllerWrapUpPatch
class ExileControllerPatch
{
public static void Postfix(ExileController __instance)
{
AfterExile(__instance.initData.networkedPlayer);
}
public static void AfterExile(NetworkedPlayerInfo ejectedPlayer)
{
if (!AmongUsClient.Instance.AmHost) return;
var ejectedPlayer = __instance.initData?.networkedPlayer;
if (ejectedPlayer == null) return;
PlayerControl pc = null;
@@ -38,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);
@@ -58,6 +62,28 @@ class ExileControllerWrapUpPatch
{ "Mayor", Translator.Get("mayorPriv", Options.MayorExtraVoteCount.GetInt())},
});
}
*/
}
}
#if ANDROID
[HarmonyPatch(typeof(AirshipExileController), nameof(AirshipExileController.WrapUpAndSpawn))]
class AirshipExileControllerPatchAndroid
{
public static void Postfix(AirshipExileController __instance)
{
ExileControllerPatch.AfterExile(__instance.initData.networkedPlayer);
}
}
#else
[HarmonyPatch(typeof(AirshipExileController._WrapUpAndSpawn_d__11), nameof(AirshipExileController._WrapUpAndSpawn_d__11.MoveNext))]
class AirshipExileControllerPatchPC
{
public static void Postfix(AirshipExileController._WrapUpAndSpawn_d__11 __instance, ref bool __result)
{
var instance = __instance.__4__this;
ExileControllerPatch.AfterExile(instance.initData.networkedPlayer);
}
}
#endif
}
+2
View File
@@ -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;
+25 -18
View File
@@ -14,14 +14,21 @@ internal static class CoShowIntroPatch
Logger.Info(" Intro initiated", "CoShowIntro");
if (!AmongUsClient.Instance.AmHost) return;
/*
NormalGameEndChecker.customRoles = CustomRoleManagement.PlayerToCustomRole();
CustomRoleManagement.SendRoleMessages(new Dictionary<string, string>
if (CustomRoleManagement.PlayerRoles.Count != 0 && !Utils.isHideNSeek && Options.Gamemode.GetValue() < 2)
{
{ "Jester", Translator.Get("jesterPriv")},
{ "Mayor", Translator.Get("mayorPriv", Options.MayorExtraVoteCount.GetInt())},
});
_ = new LateTask(() =>
{
CustomRoleManagement.SendRoleMessages(new Dictionary<string, string>
{
{ "Jester", Translator.Get("jesterPriv")},
{ "Mayor", Translator.Get("mayorPriv", Options.MayorExtraVoteCount.GetInt())},
});
}, 1f, "BlockACKick");
}
*/
foreach (var p in PlayerControl.AllPlayerControls)
{
p.cosmetics.nameText.text = p.Data.PlayerName;
@@ -32,13 +39,23 @@ internal static class CoShowIntroPatch
PlayerControlCompleteTaskPatch.tasksPerPlayer[p] = 0;
}
if (Options.DisableAnnoyingMeetingCalls.GetBool())
if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.isHideNSeek)
{
Utils.CanCallMeetings = false;
_ = 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()*/)
{
_ = new LateTask(() =>
{
PlayerControl.LocalPlayer.CmdReportDeadBody(null);
if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose();
}, 9f, "SetChatVisible");
}
}
}
@@ -50,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);
MeetingHud.Instance.RpcClose();
}, 7f, "SetChatVisible");
}
if (Main.GM.Value)
{
__instance.TeamTitle.text = "Game Master";
+27
View File
@@ -111,4 +111,31 @@ class OnPlayerLeftPatch
PlayerControlCompleteTaskPatch.CalculateTaskWin();
}
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.SetLevel))]
public static class SetLevelPatch
{
public static List<PlayerControl> 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);
}
}
}
+3 -1
View File
@@ -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
+13 -7
View File
@@ -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 = "";
@@ -38,14 +39,17 @@ class PlayerControlSetRolePatch
{
if (!FirstAssign || !AmongUsClient.Instance.AmHost) return true;
var oldRole = roleType;
canOverrideRole = false;
if (Main.GM.Value && __instance == PlayerControl.LocalPlayer)
{
roleType = RoleTypes.CrewmateGhost;
return true;
}
if (CustomRoleManagement.PlayerRoles.TryGetValue(__instance.PlayerId, out var role) && role == "Mayor")
/*
if (CustomRoleManagement.PlayerRoles.TryGetValue(__instance.PlayerId, out var role) && role == "Mayor" && Options.Gamemode.GetValue() < 2)
{
if (Options.MayorVentToMeeting.GetBool())
{
@@ -56,8 +60,9 @@ class PlayerControlSetRolePatch
{
roleType = RoleTypes.Crewmate;
}
Logger.Info($" {__instance.Data.PlayerName} | {oldRole} -> {roleType}", "ChangedRoleBase");
}
if (CustomRoleManagement.PlayerRoles.TryGetValue(__instance.PlayerId, out var r) && r == "Jester")
if (CustomRoleManagement.PlayerRoles.TryGetValue(__instance.PlayerId, out var r) && r == "Jester" && Options.Gamemode.GetValue() < 2)
{
if (Options.JesterCanVent.GetBool())
{
@@ -68,8 +73,9 @@ class PlayerControlSetRolePatch
{
roleType = RoleTypes.Crewmate;
}
Logger.Info($" {__instance.Data.PlayerName} | {oldRole} -> {roleType}", "ChangedRoleBase");
}
*/
if (Utils.isHideNSeek && i == 0)
{
int seekersCount = Options.NumSeekers.GetInt();
@@ -77,7 +83,7 @@ class PlayerControlSetRolePatch
var candidates = new List<PlayerControl>();
foreach (var p in PlayerControl.AllPlayerControls)
{
if (Main.GM.Value && p != PlayerControl.LocalPlayer) candidates.Add(p);
if (!Main.GM.Value || p != PlayerControl.LocalPlayer) candidates.Add(p);
}
seekersCount = Math.Min(seekersCount, candidates.Count);
@@ -97,7 +103,7 @@ class PlayerControlSetRolePatch
if (Utils.isHideNSeek)
{
if (Seekers.Contains(__instance.PlayerId)) roleType = RoleTypes.Impostor;
else roleType = RoleTypes.Crewmate;
else roleType = RoleTypes.Engineer;
}
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek)
+25 -10
View File
@@ -16,18 +16,19 @@ class ReportDeadBodyPatch
{
if (!AmongUsClient.Instance.AmHost || __instance == null) return true;
if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.CanCallMeetings && 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;
}
// target == null means meeting
if (target == null) return true;
if (Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3)
{
Logger.Info($" Stopped {__instance.Data.PlayerName} reporting the body of {target.PlayerName}", "ReportDeadBodyPatch");
if (target != null) Logger.Info($" Stopped {__instance.Data.PlayerName} reporting the body of {target.PlayerName}", "ReportDeadBodyPatch");
else Logger.Info($" Stopped {__instance.Data.PlayerName} trying to call a meeting", "ReportDeadBodyPatch");
return false;
}
else return true;
@@ -62,7 +63,7 @@ internal static class MurderPlayerPatch
{
if (p.Data.Role.IsImpostor)
{
p.cosmetics.nameText.text = $"{p.Data.PlayerName}<color=red><size=90%>({killCount[__instance.Data.PlayerId]}†)";
p.cosmetics.nameText.text = $"{p.Data.PlayerName}<color=red><size=90%>({killCount[p.Data.PlayerId]}†)";
}
else
{
@@ -106,8 +107,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");
}
}
@@ -150,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;
@@ -164,25 +166,38 @@ 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();
if (Options.Gamemode.GetValue() == 3)
{
if (!__instance.Data.IsDead && playerTasksCompleted[__instance] >= __instance.Data.Tasks.Count)
{
Utils.CustomWinnerEndGame(__instance, 1);
NormalGameEndChecker.LastWinReason = $"{__instance.Data.PlayerName} wins! (Completed tasks)";
NormalGameEndChecker.canUpdateWinnerText = false;
}
}
if (PlayerControl.LocalPlayer.Data.IsDead)
{
TMP_Text nameText = __instance.cosmetics.nameText;
nameText.text = $"{__instance.Data.PlayerName}<color=green><size=90%>({playerTasksCompleted[__instance]}/{tasksPerPlayer[__instance]})</color>";
}
}
public static void CalculateTaskWin()
{
Logger.Info($" Checking if {GameData.Instance.CompletedTasks} - {ignoredCompletedTasks} >= ({GameData.Instance.TotalTasks} - {ignoredTasks}) * 0.01 * {Options.TaskPercentNeededToWin.GetInt()}", "TaskPatch");
if (!Utils.GamePastRoleSelection || Utils.isHideNSeek || Options.NoGameEnd.GetBool()) return;
//Logger.Info($" Checking if {GameData.Instance.CompletedTasks} - {ignoredCompletedTasks} >= ({GameData.Instance.TotalTasks} - {ignoredTasks}) * 0.01 * {Options.TaskPercentNeededToWin.GetInt()}", "TaskPatch");
if ((GameData.Instance.CompletedTasks - ignoredCompletedTasks) >= (GameData.Instance.TotalTasks - ignoredTasks)*0.01*Options.TaskPercentNeededToWin.GetInt())
{
+5 -1
View File
@@ -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");
}
}
}
}
*/
+10 -2
View File
@@ -17,8 +17,6 @@ internal static class AddVotePatch
if (AmongUsClient.Instance.ClientId == srcClient)
{
AmongUsClient.Instance.KickPlayer(target.Data.ClientId, false);
Logger.Info($" Kicked {target.Data.PlayerName}, {target.Data.FriendCode}", "KickPatch");
}
return true;
@@ -48,6 +46,16 @@ internal static class BanMenuSetVisiblePatch
__instance.KickButton.gameObject.SetActive(true);
__instance.MenuButton.gameObject.SetActive(show);
return false;
}
}
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.CanBan))]
internal class InnerNetClientCanBanPatch
{
public static bool Prefix(InnerNetClient __instance, ref bool __result)
{
__result = __instance.AmHost;
return false;
}
}
+14 -11
View File
@@ -1,4 +1,4 @@
# Welcome to AmongUsRevamped!
# Welcome to Among Us Revamped!
<br>
</p>
@@ -29,7 +29,7 @@
<img src="https://github.com/astra1dev/AUnlocker/assets/90265231/14226f03-a003-4efc-b27b-6df53fb394d6" width=410 height=240>****
‎
# 🎮 Features (v1.6.0):
# 🎮 Features (v1.7.2):
## <b>♠️ Client Side settings:</b>
- Game Master
- Unlock FPS
@@ -40,14 +40,16 @@
## <b>⚙️ Technical settings:</b>
- Kick/Ban players under a certain level
- Kick/Ban invalid FriendCodes
- Kick/Ban players who say "start" and conitions
- DenyName system
- Moderator system
- Kick/Ban players who say "start"
- Banword system
- Banlist system
- DenyName system
- Multi layer moderator system
- To add Admins, Moderators and VIP's, type the user's Friendcode in the designated files located in AUR-DATA
- Enable No Game End
- Custom starting countdown
## <b>♻️ Automation settings:</b>
- Automatically start game and conditions for it
- Automatically start game
- Automatically rejoin lobby
- Automatically send winner info
## <b>🔧 Gameplay Settings:</b>
@@ -58,6 +60,8 @@
- Disable body reports
- Disable devices (per map, individual)
- Override decontamination time (per map)
- Disable spore triggers on The Fungle
- % Tasks completed for Crewmates to win
- Enable/Disable any task
- All players have same tasks
- Hide and Seek: Custom Impostor count
@@ -66,15 +70,13 @@
- Shift and Seek
- Speedrun
## <b>❓ Other Improvements:</b>
- ehT dlekS map (reverse Skeld)
- Ability to cancel starting countdown
- Improved main menu
- Faster startup time
- Custom anticheat system
- Zoom out in lobby or when dead
- Near unlimited default Option ranges
- More accurate Option incrementing
- Logging for useful information
- See player kill/task count when dead
- Higher and more accurate Option ranges
- <b>🎉 And this all works in public lobbies!</b>
### Hotkeys
@@ -104,7 +106,8 @@
| /endmeeting | Instantly end an ongoing meeting |
| /aur | Sends AUR socials (GitHub, Discord) |
| /color | Sets color. Can be used to bypass color limit |
| /reload | Resets the *Language*.JSON file to default |
| /reload | Resets the *Language*.JSON file to default |
| /start | Starts game countdown |
‎
**Credit to these mods and their developers for their code:**
+11
View File
@@ -1,6 +1,17 @@
{
"LanguageID": "0",
"gameMaster": "Game Master",
"unlockFPS": "Unlock FPS",
"showFPS": "Show FPS",
"autoStart": "Auto Start",
"enableDarkTheme": "Enable Dark Theme",
"enableLobbyMusic": "Lobby Music",
"gameMasterWarning":"You will now spectate games until GM is turned off. WARNING: Custom role notifications will not work with this setting on!",
"cancelStartCountdown": "Start countdown canceled",
"gamemode": "Gamemode",
"tabGroupMain": "Moderation",
"kickLowLevelPlayer": "Kick Players Under Level",