Compare commits

...
4 Commits
Author SHA1 Message Date
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
11 changed files with 89 additions and 44 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.6.4";
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);
+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);
+18 -12
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();
@@ -154,19 +160,19 @@ internal static class SendChatPatch
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;
@@ -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;
@@ -396,7 +402,7 @@ public static class RPCHandlerPatch
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);
+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);
+13 -6
View File
@@ -16,11 +16,18 @@ internal static class CoShowIntroPatch
if (!AmongUsClient.Instance.AmHost) return;
NormalGameEndChecker.customRoles = CustomRoleManagement.PlayerToCustomRole();
CustomRoleManagement.SendRoleMessages(new Dictionary<string, string>
if (CustomRoleManagement.PlayerRoles.Count != 0 && !Utils.isHideNSeek)
{
{ "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)
{
@@ -32,7 +39,7 @@ internal static class CoShowIntroPatch
PlayerControlCompleteTaskPatch.tasksPerPlayer[p] = 0;
}
if (Options.DisableAnnoyingMeetingCalls.GetBool())
if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.isHideNSeek)
{
Utils.CanCallMeetings = false;
_ = new LateTask(() =>
@@ -55,7 +62,7 @@ class BeginCrewmatePatch
_ = new LateTask(() =>
{
PlayerControl.LocalPlayer.CmdReportDeadBody(null);
MeetingHud.Instance.RpcClose();
if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose();
}, 7f, "SetChatVisible");
}
+2 -2
View File
@@ -77,7 +77,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 +97,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)
+5 -2
View File
@@ -16,7 +16,7 @@ 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;
@@ -180,9 +180,12 @@ class PlayerControlCompleteTaskPatch
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) 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())
{
+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;
}
}
+17 -9
View File
@@ -29,7 +29,12 @@
<img src="https://github.com/astra1dev/AUnlocker/assets/90265231/14226f03-a003-4efc-b27b-6df53fb394d6" width=410 height=240>****
‎
# 🎮 Features (v1.6.0):
# 🎮 Features (v1.6.2):
## <b> 🌟 Custom Roles:</b>
- 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.
## <b>♠️ Client Side settings:</b>
- Game Master
- Unlock FPS
@@ -40,14 +45,15 @@
## <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
- 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 +64,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
@@ -72,9 +80,8 @@
- 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 +111,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",