mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-20 01:46:28 +00:00
GA fixes, disable peace period, bugfixes
This commit is contained in:
1 parent
ae1f4c7290
commit
11fb96ccc2
10 files changed
+58
-30
No files matched your search
+1
-1
@@ -45,7 +45,7 @@ public partial class Main : BasePlugin
|
|||||||
|
|
||||||
public static bool HasArgumentException;
|
public static bool HasArgumentException;
|
||||||
public static string CredentialsText;
|
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 GameTimer;
|
||||||
public static float AfkTimer;
|
public static float AfkTimer;
|
||||||
|
|||||||
@@ -337,6 +337,9 @@ namespace AmongUsRevamped
|
|||||||
public static OptionItem TabGroupHNS;
|
public static OptionItem TabGroupHNS;
|
||||||
public static OptionItem NumSeekers;
|
public static OptionItem NumSeekers;
|
||||||
|
|
||||||
|
public static OptionItem TabGroupNoKcd;
|
||||||
|
public static OptionItem DisablePeacePeriod;
|
||||||
|
|
||||||
public static OptionItem TabGroupSNS;
|
public static OptionItem TabGroupSNS;
|
||||||
public static OptionItem SNSChatInGame;
|
public static OptionItem SNSChatInGame;
|
||||||
public static OptionItem SNSChatInGameExtend;
|
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)
|
NumSeekers = IntegerOptionItem.Create(70001, Translator.Get("numSeekers"), new(1, 15, 1), 1, TabGroup.GamemodeSettings, false)
|
||||||
.SetValueFormat(OptionFormat.Level);
|
.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)
|
TabGroupSNS = TextOptionItem.Create(70050, Translator.Get("tabGroupSNS"), TabGroup.GamemodeSettings)
|
||||||
.SetColor(Color.green);
|
.SetColor(Color.green);
|
||||||
SNSChatInGame = BooleanOptionItem.Create(70051, Translator.Get("snsChatInGame"), false, TabGroup.GamemodeSettings, false);
|
SNSChatInGame = BooleanOptionItem.Create(70051, Translator.Get("snsChatInGame"), false, TabGroup.GamemodeSettings, false);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace AmongUsRevamped;
|
|||||||
public static class OptionManager
|
public static class OptionManager
|
||||||
{
|
{
|
||||||
private static float OldKillCooldown;
|
private static float OldKillCooldown;
|
||||||
|
private static float OldGuardianCooldown;
|
||||||
|
|
||||||
public static void SyncGameOptions()
|
public static void SyncGameOptions()
|
||||||
{
|
{
|
||||||
@@ -31,6 +32,10 @@ public static class OptionManager
|
|||||||
if (!AmongUsClient.Instance.AmHost) return;
|
if (!AmongUsClient.Instance.AmHost) return;
|
||||||
|
|
||||||
OldKillCooldown = Main.NormalOptions.KillCooldown;
|
OldKillCooldown = Main.NormalOptions.KillCooldown;
|
||||||
|
if (Main.NormalOptions.roleOptions.TryGetRoleOptions<GuardianAngelRoleOptionsV12>(RoleTypes.GuardianAngel, out var GuardianAngelOptions))
|
||||||
|
{
|
||||||
|
OldGuardianCooldown = GuardianAngelOptions.ProtectionDurationSeconds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RestoreOptions()
|
public static void RestoreOptions()
|
||||||
@@ -42,6 +47,11 @@ public static class OptionManager
|
|||||||
Main.NormalOptions.KillCooldown = OldKillCooldown;
|
Main.NormalOptions.KillCooldown = OldKillCooldown;
|
||||||
Logger.Info("Force overrided Kill Cooldown back to original", "RestoreOptions");
|
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();
|
SyncGameOptions();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ internal static class SendChatPatch
|
|||||||
|
|
||||||
if (text == "/0kc" || text == "/0killcooldown")
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,7 +593,7 @@ internal static class SendChatPatch
|
|||||||
case 0:
|
case 0:
|
||||||
if (GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f)
|
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;
|
break;
|
||||||
|
|
||||||
@@ -1004,7 +1004,7 @@ public static class RPCHandlerPatch
|
|||||||
if (text == "/0kc" || text == "/0killcooldown")
|
if (text == "/0kc" || text == "/0killcooldown")
|
||||||
{
|
{
|
||||||
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return;
|
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")
|
if (text == "/sns" || text == "/shiftandseek")
|
||||||
{
|
{
|
||||||
@@ -1037,7 +1037,7 @@ public static class RPCHandlerPatch
|
|||||||
case 0:
|
case 0:
|
||||||
if (GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f)
|
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;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using BepInEx.Unity.IL2CPP;
|
using AmongUs.Data.Player;
|
||||||
|
using BepInEx.Unity.IL2CPP;
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
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
|
#if !ANDROID
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ class NormalGameEndChecker
|
|||||||
public static string customRoles { get; set; }
|
public static string customRoles { get; set; }
|
||||||
public static void CheckWinnerText(string Winner)
|
public static void CheckWinnerText(string Winner)
|
||||||
{
|
{
|
||||||
string impostorList = string.Join(", ", imps.Select(p => p.Data.PlayerName));
|
string impostorList = string.Join("\n", imps.Select(p => $"{p.Data.PlayerName} {p.Data.ColorName} - {p.Data.RoleType}"));
|
||||||
string impostorString = impostorList != "" ? $"\n\nImpostors: {impostorList}" : "";
|
string impostorString = impostorList != "" ? $"\n\n{impostorList}" : "";
|
||||||
|
|
||||||
if (!canUpdateWinnerText) return;
|
if (!canUpdateWinnerText) return;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
Main.NormalOptions.KillCooldown = 5f;
|
||||||
OptionManager.SyncGameOptions();
|
OptionManager.SyncGameOptions();
|
||||||
|
|||||||
@@ -112,4 +112,16 @@ class MeetingHudStartPatch
|
|||||||
return $"<color=red>({MurderPlayerPatch.killCount[player.Data.PlayerId]}†)</color> - {Utils.GetRoleText(player)}";
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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)
|
public static bool Prefix(ShipStatus __instance, [HarmonyArgument(0)] SystemTypes systemType, [HarmonyArgument(1)] PlayerControl player, [HarmonyArgument(2)] MessageReader reader)
|
||||||
{
|
{
|
||||||
if (systemType is
|
if (systemType is
|
||||||
SystemTypes.Security
|
SystemTypes.Ventilation
|
||||||
|
or SystemTypes.Security
|
||||||
or SystemTypes.Decontamination
|
or SystemTypes.Decontamination
|
||||||
or SystemTypes.Decontamination2
|
or SystemTypes.Decontamination2
|
||||||
or SystemTypes.Decontamination3
|
or SystemTypes.Decontamination3
|
||||||
@@ -112,28 +113,13 @@ public static class MessageReaderUpdateSystemPatch
|
|||||||
|
|
||||||
if (player.Data.ClientId == AmongUsClient.Instance.HostId) return true;
|
if (player.Data.ClientId == AmongUsClient.Instance.HostId) return true;
|
||||||
|
|
||||||
// Thanks to D1GQ for finding.
|
var amount = MessageReader.Get(reader).ReadByte();
|
||||||
if (systemType is SystemTypes.Ventilation)
|
if (EACR.RpcUpdateSystemCheck(player, systemType, amount))
|
||||||
{
|
{
|
||||||
_ = reader.ReadUInt16();
|
Logger.Info("EACR patched Sabotage RPC", "MessageReaderUpdateSystemPatch");
|
||||||
var operation = (VentilationSystem.Operation)reader.ReadByte();
|
|
||||||
if (operation == VentilationSystem.Operation.BootImpostors)
|
|
||||||
{
|
|
||||||
Logger.Info($"BLOCKED: {operation}, {player}", "s");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else return true;
|
||||||
{
|
|
||||||
var amount = MessageReader.Get(reader).ReadByte();
|
|
||||||
if (EACR.RpcUpdateSystemCheck(player, systemType, amount))
|
|
||||||
{
|
|
||||||
Logger.Info("EACR patched Sabotage RPC", "MessageReaderUpdateSystemPatch");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -395,7 +395,9 @@
|
|||||||
"tabGroupGameplayMapModifications": "Map Modifications",
|
"tabGroupGameplayMapModifications": "Map Modifications",
|
||||||
|
|
||||||
"disableChatModifier": "Disable Chat Modifications",
|
"disableChatModifier": "Disable Chat Modifications",
|
||||||
|
"snsSuicideMode": "Disable Shield System",
|
||||||
|
|
||||||
"snsSuicideMode": "Disable Shield System"
|
"tabGroupNoKcd": "0 Kill Cooldown",
|
||||||
|
"disablePeacePeriod": "Disable 5s Peace Period"
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user