mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-20 01:46:28 +00:00
v2.0.2
This commit is contained in:
1 parent
0d55683088
commit
f18dc3fa31
15 files changed
+119
-59
No files matched your search
@@ -301,7 +301,6 @@ namespace AmongUsRevamped
|
||||
public static OptionItem SNSChatInGameExtend2;
|
||||
public static OptionItem SNSChatInGameFast;
|
||||
public static OptionItem CrewAutoWinsGameAfter;
|
||||
public static OptionItem MisfiresToSuicide;
|
||||
public static OptionItem SNSDisableSabotage;
|
||||
public static OptionItem SNSDisableReactor;
|
||||
public static OptionItem SNSDisableOxygen;
|
||||
@@ -476,7 +475,6 @@ namespace AmongUsRevamped
|
||||
.SetParent(SNSChatInGame);
|
||||
SNSChatInGameFast = BooleanOptionItem.Create(70054, Translator.Get("snsChatInGameFast"), false, TabGroup.GamemodeSettings, false)
|
||||
.SetParent(SNSChatInGame);
|
||||
MisfiresToSuicide = IntegerOptionItem.Create(70055, Translator.Get("misfiresToSuicide"), new(1, 10, 1), 1, TabGroup.GamemodeSettings, false);
|
||||
CrewAutoWinsGameAfter = IntegerOptionItem.Create(70056, Translator.Get("crewAutoWinsGameAfter"), new(60, 600, 10), 300, TabGroup.GamemodeSettings, false)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
SNSDisableSabotage = BooleanOptionItem.Create(70057, Translator.Get("snsDisableSabotage"), true, TabGroup.GamemodeSettings, false)
|
||||
|
||||
+29
-20
@@ -128,6 +128,7 @@ public static class FixedUpdate
|
||||
if (p.protectedByGuardianId == -1)
|
||||
{
|
||||
p.RpcProtectPlayer(p, p.cosmetics.ColorId);
|
||||
p.Data.MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,12 +166,6 @@ class FixedUpdateInGamePatch
|
||||
private static float t;
|
||||
private static GameObject settingsLabel;
|
||||
|
||||
public static bool CanUseKillButton(PlayerControl pc)
|
||||
{
|
||||
pc.Data.Role.CanUseKillButton = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void Postfix(PlayerControl __instance)
|
||||
{
|
||||
if (__instance == null || __instance.PlayerId == 255 || !AmongUsClient.Instance.AmHost) return;
|
||||
@@ -208,13 +203,15 @@ class FixedUpdateInGamePatch
|
||||
break;
|
||||
|
||||
case 1: // SnS
|
||||
if (Utils.InGame) return;
|
||||
if (Main.NormalOptions.KillCooldown != 2.5f)
|
||||
if (!Utils.InGame)
|
||||
{
|
||||
Main.NormalOptions.KillCooldown = 2.5f;
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Shapeshifter, 3, 100);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Phantom, 0, 0);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Viper, 0, 0);
|
||||
if (Main.NormalOptions.KillCooldown != 2.5f)
|
||||
{
|
||||
Main.NormalOptions.KillCooldown = 2.5f;
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Shapeshifter, 3, 100);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Phantom, 0, 0);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Viper, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -222,18 +219,20 @@ class FixedUpdateInGamePatch
|
||||
break;
|
||||
|
||||
case 3: // PnS
|
||||
if (Utils.InGame) return;
|
||||
if (Main.NormalOptions.KillCooldown != 1f)
|
||||
if (!Utils.InGame)
|
||||
{
|
||||
Main.NormalOptions.KillCooldown = 1f;
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Shapeshifter, 0, 0);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Phantom, 3, 100);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Viper, 0, 0);
|
||||
if (Main.NormalOptions.KillCooldown != 1f)
|
||||
{
|
||||
Main.NormalOptions.KillCooldown = 1f;
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Shapeshifter, 0, 0);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Phantom, 3, 100);
|
||||
Main.NormalOptions.roleOptions.SetRoleRate(RoleTypes.Viper, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance)
|
||||
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance && Main.GameTimer > 6)
|
||||
{
|
||||
// 1 = Shift and Seek
|
||||
if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek && Options.CrewAutoWinsGameAfter.GetInt() != 0 && !Options.NoGameEnd.GetBool())
|
||||
@@ -260,7 +259,7 @@ class FixedUpdateInGamePatch
|
||||
}
|
||||
}
|
||||
// 3 = Poof and Seek
|
||||
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek)
|
||||
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && !Options.NoGameEnd.GetBool())
|
||||
{
|
||||
if (Main.GameTimer > Options.PNSCrewAutoWinsGameAfter.GetInt())
|
||||
{
|
||||
@@ -271,6 +270,16 @@ class FixedUpdateInGamePatch
|
||||
NormalGameEndChecker.CheckWinnerText("PnSTimer");
|
||||
}
|
||||
}
|
||||
|
||||
if ((Options.SNSChatInGameFast.GetBool() && Options.Gamemode.GetValue() == 1) || (Options.PNSChatInGameFast.GetBool() && Options.Gamemode.GetValue() == 3))
|
||||
{
|
||||
if (Main.GM.Value && !Utils.IsDead)
|
||||
{
|
||||
Logger.Info($" Game Master Successful", "StartGame");
|
||||
PlayerControl.LocalPlayer.Exiled();
|
||||
PlayerControl.LocalPlayer.RpcSetRole(RoleTypes.CrewmateGhost);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-2
@@ -38,7 +38,6 @@ public static class Utils
|
||||
|
||||
public static bool IsFreePlay => AmongUsClient.Instance.NetworkMode == NetworkModes.FreePlay;
|
||||
public static bool IsMeeting => InGame && (MeetingHud.Instance);
|
||||
public static bool GamePastRoleSelection => Main.GameTimer > 10f;
|
||||
public static bool HandlingGameEnd;
|
||||
public static byte CustomGameOverReason;
|
||||
public static bool CanCallMeetings;
|
||||
@@ -201,6 +200,8 @@ public static class Utils
|
||||
|
||||
public static void ClearLeftoverData()
|
||||
{
|
||||
Logger.Info(" Cleared Leftover Data", "Utils");
|
||||
|
||||
RpcSetTasksPatch.GlobalTaskIds = null;
|
||||
HandlingGameEnd = false;
|
||||
OnGameJoinedPatch.AutoStartCheck = false;
|
||||
@@ -217,7 +218,6 @@ public static class Utils
|
||||
NormalGameEndChecker.ImpCheckComplete = false;
|
||||
CreateOptionsPickerPatch.SetDleks2 = false;
|
||||
CanCallMeetings = true;
|
||||
PlayerControlSetRolePatch.FirstAssign = true;
|
||||
|
||||
PlayerControlCompleteTaskPatch.playerTasksCompleted.Clear();
|
||||
PlayerControlCompleteTaskPatch.tasksPerPlayer.Clear();
|
||||
@@ -227,6 +227,7 @@ public static class Utils
|
||||
|
||||
OnPlayerJoinedPatch.JoinNum = 0;
|
||||
|
||||
PlayerControlSetRolePatch.ProcessedPlayers.Clear();
|
||||
PlayerControlSetRolePatch.Seekers.Clear();
|
||||
PlayerControlSetRolePatch.FirstAssign = true;
|
||||
PlayerControlSetRolePatch.manualSeekers.Clear();
|
||||
@@ -760,4 +761,20 @@ public static class Utils
|
||||
ModeVoteActive = false;
|
||||
}, Options.ModeVoteDuration.GetInt(), "ModePoll");
|
||||
}
|
||||
|
||||
// As of v2026.8.18, Innersloth bans the host for hacking if the start game button is pressed when any player is not Serialized (or something similar).
|
||||
// CheckValidData serves as an emergency blockage to prevent this and stop host from being kicked.
|
||||
public static bool CheckValidData()
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
|
||||
foreach (var p in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
if (p == null || !p.hasBeenSerialized)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user