mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-19 15:51:59 +00:00
The sizes of your fixes don't matter
This commit is contained in:
1 parent
10bae07af1
commit
2ee17166f2
6 files changed
+31
-14
No files matched your search
+1
-1
@@ -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.6.4";
|
||||
|
||||
public static float GameTimer;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
+13
-6
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
@@ -183,9 +183,9 @@ class PlayerControlCompleteTaskPatch
|
||||
|
||||
public static void CalculateTaskWin()
|
||||
{
|
||||
if (!Utils.GamePastRoleSelection) return;
|
||||
if (!Utils.GamePastRoleSelection || Utils.isHideNSeek) 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())
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user