mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-20 01:46:28 +00:00
Dumb problems require dumb fixes
This commit is contained in:
1 parent
48eb09f448
commit
2b844e31a9
6 files changed
+28
-20
No files matched your search
+1
-1
@@ -40,7 +40,7 @@ public partial class Main : BasePlugin
|
||||
public static NormalGameOptionsV10 NormalOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentNormalGameOptions : null;
|
||||
public static bool HasArgumentException;
|
||||
public static string CredentialsText;
|
||||
public const string ModVersion = "v1.3.0";
|
||||
public const string ModVersion = "v1.3.1";
|
||||
|
||||
public static float GameTimer;
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@ public static class FixedUpdate
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance)
|
||||
{
|
||||
Main.GameTimer += Time.fixedDeltaTime;
|
||||
}
|
||||
|
||||
GameObject n = GameObject.Find("NewRequestInactive");
|
||||
if (n != null)
|
||||
{
|
||||
@@ -69,8 +74,6 @@ class FixedUpdateInGamePatch
|
||||
// Speedrun
|
||||
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && g == null)
|
||||
{
|
||||
Main.NormalOptions.NumEmergencyMeetings = 0;
|
||||
|
||||
Main.NormalOptions.TaskBarMode = 0;
|
||||
|
||||
if (__instance.AllTasksCompleted() && Utils.InGame && Utils.GamePastRoleSelection && !Utils.HandlingGameEnd)
|
||||
@@ -111,9 +114,7 @@ class FixedUpdateInGamePatch
|
||||
{
|
||||
// 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;
|
||||
@@ -125,9 +126,7 @@ class FixedUpdateInGamePatch
|
||||
}
|
||||
// 3 = Speedrun
|
||||
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && Options.GameAutoEndsAfter.GetInt() != 0 && !Options.NoGameEnd.GetBool())
|
||||
{
|
||||
Main.GameTimer += Time.fixedDeltaTime;
|
||||
|
||||
{
|
||||
if (Main.GameTimer > Options.GameAutoEndsAfter.GetInt())
|
||||
{
|
||||
Main.GameTimer = 0f;
|
||||
|
||||
@@ -386,5 +386,6 @@ public static class Utils
|
||||
writer.Write(gameOverReason);
|
||||
AmongUsClient.Instance.FinishEndGame(writer);
|
||||
HandlingGameEnd = false;
|
||||
Logger.Info(" -------- GAME ENDED --------", "ManualEndGame");
|
||||
}
|
||||
}
|
||||
@@ -50,11 +50,12 @@ class NormalGameEndChecker
|
||||
{
|
||||
LastWinReason = $"★ Crewmates win! (Tasks)\n\nImpostors:\n" + string.Join("\n", imps.Select(p => p.Data.PlayerName));
|
||||
}
|
||||
else
|
||||
else if (Options.Gamemode.GetValue() < 2)
|
||||
{
|
||||
LastWinReason = $"★ Impostors win! (Sabotage)\n\nImpostors:\n★" + string.Join("\n★", imps.Select(p => p.Data.PlayerName));
|
||||
}
|
||||
|
||||
Logger.Info(" -------- GAME ENDED --------", "EndGame");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,22 @@ internal class ApplyCustomImpostorCount
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
Logger.Info(" -------- GAME STARTED --------", "StartGame");
|
||||
|
||||
NormalGameEndChecker.imps.Clear();
|
||||
NormalGameEndChecker.LastWinReason = "";
|
||||
|
||||
if (Main.GM.Value)
|
||||
{
|
||||
PlayerControl.LocalPlayer.RpcSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
if (Options.Gamemode.GetValue() == 3)
|
||||
{
|
||||
PlayerControl.LocalPlayer.CoSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerControl.LocalPlayer.RpcSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
}
|
||||
|
||||
PlayerControl.LocalPlayer.myTasks.Clear();
|
||||
}
|
||||
|
||||
@@ -24,17 +34,14 @@ internal class ApplyCustomImpostorCount
|
||||
{
|
||||
foreach (var p in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
|
||||
new LateTask(() =>
|
||||
if (p != PlayerControl.LocalPlayer)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
}, 5f, "Speedrun Secondary RPCSetRole");
|
||||
|
||||
new LateTask(() =>
|
||||
}
|
||||
if (p == PlayerControl.LocalPlayer)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
}, 9f, "Speedrun Tertiary RPCSetRole");
|
||||
p.CoSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class ReportDeadBodyPatch
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
|
||||
if (Options.DisableReport.GetBool() && target != null || Options.Gamemode.GetValue() == 2)
|
||||
if (Options.DisableReport.GetBool() && target != null || Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3)
|
||||
{
|
||||
Logger.Info($" Stopped {__instance.Data.PlayerName} reporting the body of {target.PlayerName}", "ReportDeadBodyPatch");
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user