Compare commits

..
8 Commits
Author SHA1 Message Date
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
12 changed files with 128 additions and 68 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.2";
public const string ModVersion = "v1.6.5";
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);
+57 -51
View File
@@ -36,74 +36,80 @@ public static class FixedUpdate
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))]
class FixedUpdateInGamePatch
{
public static List<PlayerControl> ScheduledKicks = new();
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)
{
Main.NormalOptions.KillCooldown = 2.5f;
if (settingsLabel == null) settingsLabel = GameObject.Find("GameSettingsLabel");
if (Options.SNSSettingsOverride.GetBool() && g == null)
{
Main.NormalOptions.TaskBarMode = 0;
}
int gamemode = Options.Gamemode.GetValue();
switch (gamemode)
{
case 1: // 0Kc
if (Main.NormalOptions.KillCooldown != 0.01f)
Main.NormalOptions.KillCooldown = 0.01f;
if (Options.NoKcdSettingsOverride.GetBool() && settingsLabel == null)
{
Main.NormalOptions.EmergencyCooldown = 0;
Main.NormalOptions.TaskBarMode = 0;
}
break;
case 2: // SnS
if (Main.NormalOptions.KillCooldown != 2.5f)
Main.NormalOptions.KillCooldown = 2.5f;
if (Options.SNSSettingsOverride.GetBool() && settingsLabel == null)
Main.NormalOptions.TaskBarMode = 0;
break;
case 3: // Speedrun
if (settingsLabel == null)
Main.NormalOptions.TaskBarMode = 0;
break;
case 0: // Reset
if (Main.NormalOptions.KillCooldown <= 0.01f)
Main.NormalOptions.KillCooldown = 25f;
break;
}
// Speedrun
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && g == null)
if (__instance.CanMove && __instance.Data.PlayerLevel + 1 < Options.KickLowLevelPlayer.GetInt() && __instance.Data.ClientId != AmongUsClient.Instance.HostId)
{
Main.NormalOptions.TaskBarMode = 0;
if (ScheduledKicks.Contains(__instance)) return;
if (__instance.AllTasksCompleted() && Utils.InGame && Utils.GamePastRoleSelection && !Utils.HandlingGameEnd)
{
if (__instance == PlayerControl.LocalPlayer && Main.GM.Value) return;
Utils.CustomWinnerEndGame(__instance, 1);
NormalGameEndChecker.LastWinReason = $"{__instance.Data.PlayerName} Wins! (Completed tasks first)";
}
}
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())
{
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()}");
+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);
+2
View File
@@ -220,6 +220,8 @@ public static class Utils
PlayerControlCompleteTaskPatch.tasksInitiated = false;
PlayerControlCompleteTaskPatch.ignoredCompletedTasks = 0;
PlayerControlCompleteTaskPatch.ignoredTasks = 0;
FixedUpdateInGamePatch.ScheduledKicks.Clear();
}
public static PlayerControl[] AllAlivePlayerControls
+6
View File
@@ -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();
+26 -1
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;
@@ -60,4 +64,25 @@ class ExileControllerWrapUpPatch
}
}
}
#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
}
+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 || 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())
{
+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;
}
}
+3 -2
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.2):
# 🎮 Features (v1.6.5):
## <b> 🌟 Custom Roles:</b>
- Mayor (Crewmate)
- The mayor has extra votes and can call meetings by venting, depending on settings.
@@ -50,6 +50,7 @@
- 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>