Files
AmongUsRevamped/Modules/FixedUpdate.cs
T
Ape 9d20bdfb95 Transfer HNSR -> AUR
Time to pray to God this all goes well!
2025-12-17 16:08:45 +01:00

35 lines
1.2 KiB
C#

using Hazel;
using System;
using System.Runtime.CompilerServices;
using InnerNet;
using UnityEngine;
namespace AmongUsRevamped;
[HarmonyPatch(typeof(InnerNetClient), nameof(InnerNetClient.FixedUpdate))]
public static class FixedUpdate
{
public static void Postfix()
{
if (!AmongUsClient.Instance.AmHost) return;
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance)
{
// 2 = Shift and Seek
if (Options.Gamemode.GetValue() == 2 && !Utils.isHideNSeek && Options.CrewAutoWinsGameAfter.GetInt() != 0 && !Options.NoGameEnd.GetBool())
{
Main.GameTimer += Time.fixedDeltaTime;
if (Main.GameTimer > Options.CrewAutoWinsGameAfter.GetInt())
{
Main.GameTimer = 0f;
MessageWriter writer = AmongUsClient.Instance.StartEndGame();
writer.Write((byte)GameOverReason.CrewmatesByVote);
AmongUsClient.Instance.FinishEndGame(writer);
Logger.Info($" Crewmates win because the game took longer than {Options.CrewAutoWinsGameAfter.GetInt()}s", "SNSManager");
}
}
}
}
}