Compare commits

...
11 Commits
Author SHA1 Message Date
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
10 changed files with 144 additions and 85 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.3";
public const string ModVersion = "v1.7.0";
public static float GameTimer;
+2
View File
@@ -19,6 +19,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()
+54 -52
View File
@@ -36,71 +36,73 @@ 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)
{
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)
{
Main.NormalOptions.TaskBarMode = 0;
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 (__instance.Data.PlayerLevel != 0 && __instance.Data.PlayerLevel < Options.KickLowLevelPlayer.GetInt() - 1 && __instance.Data.ClientId != AmongUsClient.Instance.HostId)
{
if (!Options.TempBanLowLevelPlayer.GetBool())
{
+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);
+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
}
+22 -15
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 && 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)
{
@@ -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(() =>
@@ -40,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");
}
}
}
@@ -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";
+5 -4
View File
@@ -43,9 +43,10 @@ class PlayerControlSetRolePatch
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())
{
@@ -57,7 +58,7 @@ class PlayerControlSetRolePatch
roleType = RoleTypes.Crewmate;
}
}
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())
{
@@ -77,7 +78,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 +98,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)
+19 -8
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");
}
}
@@ -174,6 +175,16 @@ class PlayerControlCompleteTaskPatch
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;
@@ -183,9 +194,9 @@ class PlayerControlCompleteTaskPatch
public static void CalculateTaskWin()
{
if (!Utils.GamePastRoleSelection) return;
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");
//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.7.0):
## <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>