diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index eaa280b..9ddebff 100644 --- a/AmongUsRevamped.cs +++ b/AmongUsRevamped.cs @@ -45,7 +45,7 @@ public partial class Main : BasePlugin public static bool HasArgumentException; public static string CredentialsText; - public const string ModVersion = "v2.1.0"; + public const string ModVersion = "v2.1.1"; public static float GameTimer; public static float AfkTimer; diff --git a/Modules/BanManager.cs b/Modules/BanManager.cs index a237028..748e8ed 100644 --- a/Modules/BanManager.cs +++ b/Modules/BanManager.cs @@ -287,7 +287,8 @@ public static class BanManager Dictionary variables = new() { { "ModVersion", Main.ModVersion }, - { "\\n", Environment.NewLine } + { "\\n", Environment.NewLine }, + { "FirstDeath", NormalGameEndChecker.firstDeath } }; foreach (var kvp in variables) diff --git a/Modules/CustomOptionsHolder.cs b/Modules/CustomOptionsHolder.cs index 7508c0f..5745fd7 100644 --- a/Modules/CustomOptionsHolder.cs +++ b/Modules/CustomOptionsHolder.cs @@ -352,6 +352,7 @@ namespace AmongUsRevamped public static OptionItem SNSDisableMushroomMixup; public static OptionItem SNSDisableCloseDoor; public static OptionItem SNSImpostorsCanVent; + public static OptionItem SNSSuicideMode; public static OptionItem TabGroupSpeedrun; public static OptionItem GameAutoEndsAfter; @@ -583,6 +584,7 @@ namespace AmongUsRevamped SNSDisableCloseDoor = BooleanOptionItem.Create(70064, Translator.Get("snsDisableCloseDoor"), true, TabGroup.GamemodeSettings, false) .SetColor(Color.red); SNSImpostorsCanVent = BooleanOptionItem.Create(70065, Translator.Get("snsImpostorCanVent"), true, TabGroup.GamemodeSettings, false); + SNSSuicideMode = BooleanOptionItem.Create(70066, Translator.Get("snsSuicideMode"), false, TabGroup.GamemodeSettings, false); TabGroupSpeedrun = TextOptionItem.Create(70076, Translator.Get("tabGroupSpeedrun"), TabGroup.GamemodeSettings) .SetColor(Color.green); diff --git a/Modules/FixedUpdate.cs b/Modules/FixedUpdate.cs index 6e9c882..ffa989a 100644 --- a/Modules/FixedUpdate.cs +++ b/Modules/FixedUpdate.cs @@ -119,7 +119,7 @@ public static class FixedUpdate } } - if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek && !Utils.IsLobby) + if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek && !Utils.IsLobby && !Options.SNSSuicideMode.GetBool()) { foreach (var p in PlayerControl.AllPlayerControls) { diff --git a/Patches/ChatPatches.cs b/Patches/ChatPatches.cs index a14d798..599a0c9 100644 --- a/Patches/ChatPatches.cs +++ b/Patches/ChatPatches.cs @@ -565,7 +565,7 @@ internal static class SendChatPatch if (text == "/sns" || text == "/shiftandseek") { - Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing\nWrong kills are blocked. Kill animations are off", true); + Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing Crewmates", true); return false; } if (text == "/sns2" || text == "/shiftandseek2") @@ -598,7 +598,7 @@ internal static class SendChatPatch break; case 1: - Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing\nWrong kills are blocked. Kill animations are off", true); + Utils.ChatCommand(__instance, "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing Crewmates", true); break; case 2: @@ -1009,7 +1009,7 @@ public static class RPCHandlerPatch if (text == "/sns" || text == "/shiftandseek") { if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return; - Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing\nWrong kills are blocked. Kill animations are off", true); + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing Crewmates", true); } if (text == "/sns2" || text == "/shiftandseek2") { @@ -1042,7 +1042,7 @@ public static class RPCHandlerPatch break; case 1: - Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing\nWrong kills are blocked. Kill animations are off", true); + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing Crewmates", true); break; case 2: diff --git a/Patches/ExilePatch.cs b/Patches/ExilePatch.cs index 9e7018f..128898d 100644 --- a/Patches/ExilePatch.cs +++ b/Patches/ExilePatch.cs @@ -31,7 +31,7 @@ class ExileControllerWrapUpPatch } } - if (Options.Gamemode.GetValue() == 1) + if (Options.Gamemode.GetValue() == 1 && !Options.SNSSuicideMode.GetBool()) { foreach (var p in PlayerControl.AllPlayerControls) { diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 6897261..5989730 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -64,30 +64,34 @@ internal static class CoShowIntroPatch if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek) { - if (Main.NormalOptions.roleOptions.TryGetRoleOptions(RoleTypes.GuardianAngel, out var GuardianAngelOptions)) - { - GuardianAngelOptions.ProtectionDurationSeconds = 254f; - } - OptionManager.SyncGameOptions(); - - foreach (var p in PlayerControl.AllPlayerControls) - { - if (p.Data == null || p.Data.IsDead || p.Data.RoleType == RoleTypes.Shapeshifter) continue; - p.RpcProtectPlayer(p, p.cosmetics.ColorId); - p.Data.MarkDirty(); - } - if (Options.SNSChatInGameExtend.GetBool()) { - Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing\nWrong kills are blocked. Kill animations are off", true); - } - if (Options.SNSChatInGameExtend2.GetBool()) + Utils.ModeratorChatCommand("Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nMeetings & Reports = Off", $"Crewmates win by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImpostors win by killing Crewmates", true); + } + + if (!Options.SNSSuicideMode.GetBool()) { - _ = new LateTask(() => + if (Main.NormalOptions.roleOptions.TryGetRoleOptions(RoleTypes.GuardianAngel, out var GuardianAngelOptions)) { - Utils.ChatCommand(DestroyableSingleton.Instance.Chat, "Correctly killing a target will directly turn them into a ghost and leave no dead body", "", false); - }, 6.6f, "SNSChatInGameExtend2"); - } + GuardianAngelOptions.ProtectionDurationSeconds = 254f; + } + OptionManager.SyncGameOptions(); + + foreach (var p in PlayerControl.AllPlayerControls) + { + if (p.Data == null || p.Data.IsDead || p.Data.RoleType == RoleTypes.Shapeshifter) continue; + p.RpcProtectPlayer(p, p.cosmetics.ColorId); + p.Data.MarkDirty(); + } + + if (Options.SNSChatInGameExtend2.GetBool()) + { + _ = new LateTask(() => + { + Utils.ChatCommand(DestroyableSingleton.Instance.Chat, "Correctly killing a target will directly turn them into a ghost and leave no dead body", "", false); + }, 6.6f, "SNSChatInGameExtend2"); + } + } } if ((GameOptionsManager.Instance.CurrentGameOptions.GetFloat(FloatOptionNames.KillCooldown) == 0.001f)) diff --git a/Patches/PlayerControlPatches.cs b/Patches/PlayerControlPatches.cs index 4d3aa49..a48a30b 100644 --- a/Patches/PlayerControlPatches.cs +++ b/Patches/PlayerControlPatches.cs @@ -68,11 +68,11 @@ internal static class MurderPlayerPatch if (resultFlags.HasFlag(MurderResultFlags.Succeeded)) { - if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek) + if (Options.Gamemode.GetValue() == 1 && !Utils.isHideNSeek && target.Data.PlayerId != __instance.shapeshiftTargetPlayerId) { - if (target.Data.PlayerId == __instance.shapeshiftTargetPlayerId) return; - Logger.Info($" {__instance.Data.PlayerName} directly killed {target.Data.PlayerName} in SnS, forcing suicide. (Are they hacking?)", "MurderPlayer"); - __instance.RpcSetRole(RoleTypes.ImpostorGhost); + Logger.SendInGame($"{__instance.Data.PlayerName} directly misfired, forcing suicide"); + Logger.Info($" {__instance.Data.PlayerName} directly misfired, forcing suicide", "MurderPlayer"); + __instance.RpcSetRole(RoleTypes.ImpostorGhost); } else { diff --git a/Patches/SabotagePatches.cs b/Patches/SabotagePatches.cs index 722ce23..5387fcf 100644 --- a/Patches/SabotagePatches.cs +++ b/Patches/SabotagePatches.cs @@ -113,17 +113,16 @@ public static class MessageReaderUpdateSystemPatch if (player.Data.ClientId == AmongUsClient.Instance.HostId) return true; // Thanks to D1GQ for finding. - if (systemType == SystemTypes.Ventilation) + 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 true; - + return false; } else { diff --git a/README.md b/README.md index 98ecd6d..ec849cf 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ **** ‎ -# 🎮 Features (v2.1.0): +# 🎮 Features (v2.1.1): ## ♠️ Client Side settings: - Toggle Game Master (Spectator) @@ -66,7 +66,7 @@ ## 🔧 Gameplay Settings: - Change sabotage cooldown and durations - Dead impostors can sabotage -- Disable critical sabotages (invividual) +- Disable critical sabotages (individual) - Disable door sabotages - Disable meeting calls first 30s - Disable devices (per map, individual) diff --git a/Resources/Language/English.json b/Resources/Language/English.json index 1687c6b..b4dbc28 100644 --- a/Resources/Language/English.json +++ b/Resources/Language/English.json @@ -394,6 +394,8 @@ "tabGroupGameplayMapModifications": "Map Modifications", - "disableChatModifier": "Disable Chat Modifications" + "disableChatModifier": "Disable Chat Modifications", + + "snsSuicideMode": "Disable Shield System" } diff --git a/Resources/Language/Japanese.json b/Resources/Language/Japanese.json index 29ecee6..5afba94 100644 --- a/Resources/Language/Japanese.json +++ b/Resources/Language/Japanese.json @@ -363,5 +363,36 @@ "fungleMushroomMixupDuration": "Fungle キノコ幻覚の持続時間", "privateDesc": "ロビーを非公開に設定します。", -"publicDesc": "ロビーを公開に設定します。" +"publicDesc": "ロビーを公開に設定します。", +"mapVoteDesc": "選択したマップの中から投票を開始します。", +"modeVoteDesc": "選択したゲームモードの中から投票を開始します。", + +"tabGroupAnticheat": "アンチチート", +"hackingPunishment": "チートへの処罰", +"detectBadRPC": "無効な RPC を検出", +"detectBadSabotage": "無効なサボタージュを検出", +"detectBadVent": "無効なベントを検出", +"detectBadTask": "無効なタスク完了を検出", +"detectBadKill": "無効なキルを検出", +"detectBadAnimation": "無効なアニメーションを検出", +"detectBadMeeting": "無効な会議を検出", + +"customizeMapVote": "マップ投票をカスタマイズ", +"includeSkeld": "Skeld を含める", +"includeMira": "Mira を含める", +"includePolus": "Polus を含める", +"includeAirship": "Airship を含める", +"includeFungle": "Fungle を含める", +"includeDleks": "Dleks を含める", + +"customizeModeVote": "ゲームモード投票をカスタマイズ", +"includeStandard": "スタンダードを含める", +"includeNoKillCooldown": "キルクールダウン 0 を含める", +"includeShiftAndSeek": "Shift And Seek を含める", +"includePoofAndSeek": "Poof And Seek を含める", +"includeSpeedrun": "Speedrun を含める", + +"tabGroupGameplayMapModifications": "マップの変更", + +"disableChatModifier": "チャット変更を無効化" } diff --git a/Resources/Language/Russian.json b/Resources/Language/Russian.json index 9484d9e..3d89764 100644 --- a/Resources/Language/Russian.json +++ b/Resources/Language/Russian.json @@ -364,5 +364,33 @@ "fungleMushroomMixupDuration": "Длительность Сабботажа Грибного Переполоха", "privateDesc": "Изменяет Публичность Лобби на Приватный.", - "publicDesc": "Изменяет Публичность Лобби на Публичный." + "publicDesc": "Изменяет Публичность Лобби на Публичный.", + "tabGroupAnticheat": "Античит", + "hackingPunishment": "Наказание за Читерство", + "detectBadRPC": "Обнаруживать Неправильные RPC", + "detectBadSabotage": "Обнаруживать Неправильные Sabotages", + "detectBadVent": "Обнаруживать Неправильные Уходы в Люк", + "detectBadTask": "Обнаруживать Неправильные Выполнения Заданий", + "detectBadKill": "Обнаруживать Неправильные Убийства", + "detectBadAnimation": "Обнаруживать Неправильные Анимации", + "detectBadMeeting": "Обнаруживать Неправильные Собрания", + + "customizeMapVote": "Кастомизировать Голосование За Карты", + "includeSkeld": "Включить Skeld", + "includeMira": "Включить Mira", + "includePolus": "Включить Polus", + "includeAirship": "Включить Airship", + "includeFungle": "Включить Fungle", + "includeDleks": "Включить Dleks", + + "customizeModeVote": "Кастомизировать Голосование За Режим", + "includeStandard": "Включить Стандарт", + "includeNoKillCooldown": "Включить 0 Перезарядка Убийств", + "includeShiftAndSeek": "Включить Клона", + "includePoofAndSeek": "Включить Фантомные Прятки", + "includeSpeedrun": "Включить Спидран", + + "tabGroupGameplayMapModifications": "Модификации Карт", + + "disableChatModifier": "Выключить Модификации Чата" } diff --git a/Resources/Language/SimplifiedChinese.json b/Resources/Language/SimplifiedChinese.json index 4840183..e8fe597 100644 --- a/Resources/Language/SimplifiedChinese.json +++ b/Resources/Language/SimplifiedChinese.json @@ -350,5 +350,36 @@ "fungleMushroomMixupDuration": "Fungle 蘑菇幻觉持续时间", "privateDesc": "将房间改为私人。", -"publicDesc": "将房间改为公开。" +"publicDesc": "将房间改为公开。", +"mapVoteDesc": "在选定的地图之间发起投票。", +"modeVoteDesc": "在选定的游戏模式之间发起投票。", + +"tabGroupAnticheat": "反作弊", +"hackingPunishment": "作弊惩罚", +"detectBadRPC": "检测无效 RPC", +"detectBadSabotage": "检测无效破坏", +"detectBadVent": "检测无效钻管", +"detectBadTask": "检测无效任务完成", +"detectBadKill": "检测无效击杀", +"detectBadAnimation": "检测无效动画", +"detectBadMeeting": "检测无效会议", + +"customizeMapVote": "自定义地图投票", +"includeSkeld": "包含 Skeld", +"includeMira": "包含 Mira", +"includePolus": "包含 Polus", +"includeAirship": "包含 Airship", +"includeFungle": "包含 Fungle", +"includeDleks": "包含 Dleks", + +"customizeModeVote": "自定义游戏模式投票", +"includeStandard": "包含标准模式", +"includeNoKillCooldown": "包含 0 击杀冷却", +"includeShiftAndSeek": "包含SnS", +"includePoofAndSeek": "包含PnS", +"includeSpeedrun": "包含速通", + +"tabGroupGameplayMapModifications": "地图修改", + +"disableChatModifier": "禁用聊天修改" }