GA fixes, disable peace period, bugfixes

This commit is contained in:
Ape committed 2026-10-08 10:19:58 +02:00
1 parent ae1f4c7290
commit 11fb96ccc2
10 files changed
+54 -26

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ public partial class Main : BasePlugin
public static bool HasArgumentException;
public static string CredentialsText;
public const string ModVersion = "v2.2.0";
public const string ModVersion = "v2.2.1";
public static float GameTimer;
public static float AfkTimer;
+7
View File
@@ -337,6 +337,9 @@ namespace AmongUsRevamped
public static OptionItem TabGroupHNS;
public static OptionItem NumSeekers;
public static OptionItem TabGroupNoKcd;
public static OptionItem DisablePeacePeriod;
public static OptionItem TabGroupSNS;
public static OptionItem SNSChatInGame;
public static OptionItem SNSChatInGameExtend;
@@ -550,6 +553,10 @@ namespace AmongUsRevamped
NumSeekers = IntegerOptionItem.Create(70001, Translator.Get("numSeekers"), new(1, 15, 1), 1, TabGroup.GamemodeSettings, false)
.SetValueFormat(OptionFormat.Level);
TabGroupNoKcd = TextOptionItem.Create(70010, Translator.Get("tabGroupNoKcd"), TabGroup.GamemodeSettings)
.SetColor(Color.green);
DisablePeacePeriod = BooleanOptionItem.Create(70011, Translator.Get("disablePeacePeriod"), false, TabGroup.GamemodeSettings, false);
TabGroupSNS = TextOptionItem.Create(70050, Translator.Get("tabGroupSNS"), TabGroup.GamemodeSettings)
.SetColor(Color.green);
SNSChatInGame = BooleanOptionItem.Create(70051, Translator.Get("snsChatInGame"), false, TabGroup.GamemodeSettings, false);
+10
View File
@@ -8,6 +8,7 @@ namespace AmongUsRevamped;
public static class OptionManager
{
private static float OldKillCooldown;
private static float OldGuardianCooldown;
public static void SyncGameOptions()
{
@@ -31,6 +32,10 @@ public static class OptionManager
if (!AmongUsClient.Instance.AmHost) return;
OldKillCooldown = Main.NormalOptions.KillCooldown;
if (Main.NormalOptions.roleOptions.TryGetRoleOptions<GuardianAngelRoleOptionsV12>(RoleTypes.GuardianAngel, out var GuardianAngelOptions))
{
OldGuardianCooldown = GuardianAngelOptions.ProtectionDurationSeconds;
}
}
public static void RestoreOptions()
@@ -42,6 +47,11 @@ public static class OptionManager
Main.NormalOptions.KillCooldown = OldKillCooldown;
Logger.Info("Force overrided Kill Cooldown back to original", "RestoreOptions");
}
if (Main.NormalOptions.roleOptions.TryGetRoleOptions<GuardianAngelRoleOptionsV12>(RoleTypes.GuardianAngel, out var GuardianAngelOptions) && GuardianAngelOptions.ProtectionDurationSeconds != OldGuardianCooldown)
{
GuardianAngelOptions.ProtectionDurationSeconds = OldGuardianCooldown;
Logger.Info("Force overrided Guardian Angel Cooldown back to original", "RestoreOptions");
}
SyncGameOptions();
}
+4 -4
View File
@@ -559,7 +559,7 @@ internal static class SendChatPatch
if (text == "/0kc" || text == "/0killcooldown")
{
Utils.ChatCommand(__instance, "0 Kill Cooldown:\n\nImpostors have no kill cooldown, and can't kill after a game starts for 5 seconds", "", false);
Utils.ChatCommand(__instance, "0 Kill Cooldown:\n\nImpostors have no kill cooldown, and optionally can't kill after a game starts for 5 seconds", "", false);
return false;
}
@@ -593,7 +593,7 @@ internal static class SendChatPatch
case 0:
if (GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f)
{
Utils.ChatCommand(__instance, "0 Kill Cooldown:\n\nImpostors have no kill cooldown, and can't kill after a game starts for 5 seconds", "", false);
Utils.ChatCommand(__instance, "0 Kill Cooldown:\n\nImpostors have no kill cooldown, and optionally can't kill after a game starts for 5 seconds", "", false);
}
break;
@@ -1004,7 +1004,7 @@ public static class RPCHandlerPatch
if (text == "/0kc" || text == "/0killcooldown")
{
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return;
Utils.ModeratorChatCommand("0 Kill Cooldown:\n\nImpostors have no kill cooldown, and can't kill after a game starts for 5 seconds", "", false);
Utils.ModeratorChatCommand("0 Kill Cooldown:\n\nImpostors have no kill cooldown, and optionally can't kill after a game starts for 5 seconds", "", false);
}
if (text == "/sns" || text == "/shiftandseek")
{
@@ -1037,7 +1037,7 @@ public static class RPCHandlerPatch
case 0:
if (GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f)
{
Utils.ModeratorChatCommand("0 Kill Cooldown:\n\nImpostors have no kill cooldown, and can't kill after a game starts for 5 seconds", "", false);
Utils.ModeratorChatCommand("0 Kill Cooldown:\n\nImpostors have no kill cooldown, and optionally can't kill after a game starts for 5 seconds", "", false);
}
break;
+12 -1
View File
@@ -1,4 +1,5 @@
using BepInEx.Unity.IL2CPP;
using AmongUs.Data.Player;
using BepInEx.Unity.IL2CPP;
using System;
using System.Text;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
@@ -386,6 +387,16 @@ namespace AmongUsRevamped
}
}
}
[HarmonyPatch(typeof(PlayerBanData), nameof(PlayerBanData.BanMinutesLeft), MethodType.Getter)]
public static class PlayerBanDataGetterPatch
{
public static void Postfix(PlayerBanData __instance, ref int __result)
{
__instance.BanPoints = 0f;
__result = 0;
}
}
}
#if !ANDROID
+2 -2
View File
@@ -50,8 +50,8 @@ class NormalGameEndChecker
public static string customRoles { get; set; }
public static void CheckWinnerText(string Winner)
{
string impostorList = string.Join(", ", imps.Select(p => p.Data.PlayerName));
string impostorString = impostorList != "" ? $"\n\nImpostors: {impostorList}" : "";
string impostorList = string.Join("\n", imps.Select(p => $"{p.Data.PlayerName} {p.Data.ColorName} - {p.Data.RoleType}"));
string impostorString = impostorList != "" ? $"\n\n{impostorList}" : "";
if (!canUpdateWinnerText) return;
+1 -1
View File
@@ -94,7 +94,7 @@ internal static class CoShowIntroPatch
}
}
if ((GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f))
if ((GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f) && !Options.DisablePeacePeriod.GetBool())
{
Main.NormalOptions.KillCooldown = 5f;
OptionManager.SyncGameOptions();
+12
View File
@@ -112,4 +112,16 @@ class MeetingHudStartPatch
return $"<color=red>({MurderPlayerPatch.killCount[player.Data.PlayerId]}†)</color> - {Utils.GetRoleText(player)}";
}
}
[HarmonyPatch(typeof(LogicOptionsNormal), nameof(LogicOptionsNormal.GetAnonymousVotes))]
public static class LogicOptionsNormalGetAnonymousVotesPatch
{
public static void Postfix(ref bool __result)
{
if (Utils.IsDead)
{
__result = false;
}
}
}
}
+2 -16
View File
@@ -104,7 +104,8 @@ public static class MessageReaderUpdateSystemPatch
public static bool Prefix(ShipStatus __instance, [HarmonyArgument(0)] SystemTypes systemType, [HarmonyArgument(1)] PlayerControl player, [HarmonyArgument(2)] MessageReader reader)
{
if (systemType is
SystemTypes.Security
SystemTypes.Ventilation
or SystemTypes.Security
or SystemTypes.Decontamination
or SystemTypes.Decontamination2
or SystemTypes.Decontamination3
@@ -112,20 +113,6 @@ public static class MessageReaderUpdateSystemPatch
if (player.Data.ClientId == AmongUsClient.Instance.HostId) return true;
// Thanks to D1GQ for finding.
if (systemType is SystemTypes.Ventilation)
{
_ = reader.ReadUInt16();
var operation = (VentilationSystem.Operation)reader.ReadByte();
if (operation == VentilationSystem.Operation.BootImpostors)
{
Logger.Info($"BLOCKED: {operation}, {player}", "s");
return false;
}
return false;
}
else
{
var amount = MessageReader.Get(reader).ReadByte();
if (EACR.RpcUpdateSystemCheck(player, systemType, amount))
{
@@ -134,7 +121,6 @@ public static class MessageReaderUpdateSystemPatch
}
else return true;
}
}
}
[HarmonyPatch(typeof(ReactorSystemType))]
+3 -1
View File
@@ -395,7 +395,9 @@
"tabGroupGameplayMapModifications": "Map Modifications",
"disableChatModifier": "Disable Chat Modifications",
"snsSuicideMode": "Disable Shield System",
"snsSuicideMode": "Disable Shield System"
"tabGroupNoKcd": "0 Kill Cooldown",
"disablePeacePeriod": "Disable 5s Peace Period"
}