mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
remove DisableSabotages, DisableSabotagesForDead and HideAndSeekImpNum
This commit is contained in:
1 parent
7798d16ece
commit
7b4dcfe83b
4 files changed
+12
-88
No files matched your search
@@ -1,6 +1,5 @@
|
||||
using BetterAmongUs.Attributes;
|
||||
using BetterAmongUs.Helpers;
|
||||
using BetterAmongUs.Patches.Gameplay.UI.Settings;
|
||||
using Hazel;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -69,28 +68,6 @@ internal sealed class UpdateSystemHandler : RPCHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
internal override bool BetterHandle(PlayerControl? sender, MessageReader reader)
|
||||
{
|
||||
// Prevent dead impostors from sabotaging if setting is enabled
|
||||
if (CatchedSystemType is SystemTypes.Sabotage or SystemTypes.Electrical or SystemTypes.LifeSupp or
|
||||
SystemTypes.Reactor or SystemTypes.Laboratory or SystemTypes.HeliSabotage or
|
||||
SystemTypes.Comms or SystemTypes.MushroomMixupSabotage)
|
||||
{
|
||||
if (BetterGameSettings.DisableSabotages.GetBool())
|
||||
return false;
|
||||
|
||||
if (BetterGameSettings.DisableSabotagesForDead.GetBool())
|
||||
{
|
||||
if (!sender.IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool HandleSabotageSystem(PlayerControl? sender, SabotageSystemType sabotageSystem, MessageReader reader)
|
||||
{
|
||||
byte count = reader.ReadByte();
|
||||
|
||||
@@ -238,7 +238,7 @@ internal static class RoleManagerPatch
|
||||
Logger_.LogHeader($"Better Role Assignment Has Started", "RoleManager");
|
||||
|
||||
// Get impostor count from BAU settings (defaults to 1)
|
||||
int NumImpostors = BetterGameSettings.HideAndSeekImpNum?.GetInt() ?? 1;
|
||||
int NumImpostors = GameOptionsManager.Instance.currentHideNSeekGameOptions.NumImpostors;
|
||||
|
||||
if (NumImpostors > BAUPlugin.AllPlayerControls.Count)
|
||||
NumImpostors = BAUPlugin.AllPlayerControls.Count;
|
||||
@@ -247,30 +247,17 @@ internal static class RoleManagerPatch
|
||||
List<NetworkedPlayerInfo> Crewmates = [];
|
||||
List<NetworkedPlayerInfo> CrewAndImps() => [.. Impostors, .. Crewmates];
|
||||
|
||||
// Get predefined impostors from settings (host can set specific players as impostors)
|
||||
int[] betterImpostorSettings =
|
||||
[
|
||||
GameOptionsManager.Instance.currentHideNSeekGameOptions.ImpostorPlayerID,
|
||||
BetterGameSettingsTemp.HideAndSeekImp2?.GetInt() ?? -1,
|
||||
BetterGameSettingsTemp.HideAndSeekImp3?.GetInt() ?? -1,
|
||||
BetterGameSettingsTemp.HideAndSeekImp4?.GetInt() ?? -1,
|
||||
BetterGameSettingsTemp.HideAndSeekImp5?.GetInt() ?? -1
|
||||
];
|
||||
|
||||
for (int i = 0; i < NumImpostors; i++)
|
||||
// Get predefined impostor from settings
|
||||
var impId = GameOptionsManager.Instance.currentHideNSeekGameOptions.ImpostorPlayerID;
|
||||
if (impId != -1)
|
||||
{
|
||||
int tempSetImpostor = betterImpostorSettings[i];
|
||||
|
||||
if (tempSetImpostor >= 0)
|
||||
var player = Utils.PlayerFromPlayerId(impId);
|
||||
if (player != null)
|
||||
{
|
||||
var player = Utils.PlayerFromPlayerId(tempSetImpostor);
|
||||
if (player != null)
|
||||
if (Impostors.Count < NumImpostors)
|
||||
{
|
||||
if (Impostors.Count < NumImpostors)
|
||||
{
|
||||
Impostors.Add(player.Data);
|
||||
Logger_.LogPrivate($"Settings Assigned {RoleTypes.Impostor.GetRoleName()} role to {player.Data.PlayerName}", "RoleManager");
|
||||
}
|
||||
Impostors.Add(player.Data);
|
||||
Logger_.LogPrivate($"Settings Assigned {RoleTypes.Impostor.GetRoleName()} role to {player.Data.PlayerName}", "RoleManager");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
using BetterAmongUs.Helpers;
|
||||
using BetterAmongUs.Modules;
|
||||
using BetterAmongUs.Patches.Gameplay.UI.Settings;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace BetterAmongUs.Patches.Gameplay.Ship;
|
||||
|
||||
[HarmonyPatch]
|
||||
internal static class DisableSabotagePatch
|
||||
{
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageReactor))]
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageHeli))]
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageComms))]
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageOxygen))]
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageLights))]
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageSeismic))]
|
||||
[HarmonyPatch(typeof(MapRoom), nameof(MapRoom.SabotageMushroomMixup))]
|
||||
[HarmonyPrefix]
|
||||
internal static bool MapRoom_Sabotage_Prefix()
|
||||
{
|
||||
if (GameState.IsHost)
|
||||
{
|
||||
if (BetterGameSettings.DisableSabotages.GetBool())
|
||||
return false;
|
||||
|
||||
if (BetterGameSettings.DisableSabotagesForDead.GetBool())
|
||||
{
|
||||
if (!PlayerControl.LocalPlayer.IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using AmongUs.GameOptions;
|
||||
using BetterAmongUs.Helpers;
|
||||
using BetterAmongUs.Modules;
|
||||
using BetterAmongUs.Modules;
|
||||
using BetterAmongUs.Modules.OptionItems;
|
||||
using BetterAmongUs.Modules.OptionItems.NoneOption;
|
||||
using BetterAmongUs.Modules.Support;
|
||||
@@ -18,7 +16,6 @@ internal sealed class BetterGameSettings
|
||||
internal static OptionCheckboxItem? UseBanNameList;
|
||||
internal static OptionCheckboxItem? UseBanWordList;
|
||||
internal static OptionCheckboxItem? UseBanWordListOnlyLobby;
|
||||
internal static OptionIntItem? HideAndSeekImpNum;
|
||||
internal static OptionIntItem? DetectedLevelAbove;
|
||||
internal static OptionIntItem? KickLevelBelow;
|
||||
internal static OptionCheckboxItem? DetectCheatClients;
|
||||
@@ -26,11 +23,9 @@ internal sealed class BetterGameSettings
|
||||
|
||||
internal static OptionStringItem? RoleRandomizer;
|
||||
internal static OptionCheckboxItem? DesyncRoles;
|
||||
internal static OptionCheckboxItem? DisableSabotagesForDead;
|
||||
|
||||
internal static OptionCheckboxItem? CancelInvalidSabotage;
|
||||
internal static OptionCheckboxItem? CensorDetectionReason;
|
||||
internal static OptionCheckboxItem? DisableSabotages;
|
||||
}
|
||||
|
||||
// Temporary settings for Hide & Seek impostor selection
|
||||
@@ -98,6 +93,7 @@ internal static class GameSettingsPatch
|
||||
// Show only for hosts
|
||||
if (IsPreload || GameState.IsHost)
|
||||
{
|
||||
/*
|
||||
// Normal game mode settings
|
||||
if (IsPreload || !GameState.IsHideNSeek)
|
||||
{
|
||||
@@ -132,6 +128,7 @@ internal static class GameSettingsPatch
|
||||
BetterGameSettingsTemp.HideAndSeekImp3.GetValue() != -1 &&
|
||||
BetterGameSettingsTemp.HideAndSeekImp4.GetValue() != -1;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user