mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-22 07:36:05 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ac4728f8a | ||
|
|
88599a0680 | ||
|
|
5ae6d648e3 | ||
|
|
21dec84e64 | ||
|
|
79425e5fb8 | ||
|
|
294b5df4d9 | ||
|
|
f7f0be4eb8 | ||
|
|
3ff2df26dc | ||
|
|
b422d65b47 | ||
|
|
2b844e31a9 |
No files matched your search
+1
-11
@@ -24,11 +24,6 @@ public partial class Main : BasePlugin
|
||||
public static ConfigEntry<string> Preset3 { get; private set; }
|
||||
public static ConfigEntry<string> Preset4 { get; private set; }
|
||||
public static ConfigEntry<string> Preset5 { get; private set; }
|
||||
public static ConfigEntry<string> Preset6 { get; private set; }
|
||||
public static ConfigEntry<string> Preset7 { get; private set; }
|
||||
public static ConfigEntry<string> Preset8 { get; private set; }
|
||||
public static ConfigEntry<string> Preset9 { get; private set; }
|
||||
public static ConfigEntry<string> Preset10 { get; private set; }
|
||||
|
||||
public static ConfigEntry<bool> GM { get; private set; }
|
||||
public static ConfigEntry<bool> UnlockFps { get; private set; }
|
||||
@@ -40,7 +35,7 @@ public partial class Main : BasePlugin
|
||||
public static NormalGameOptionsV10 NormalOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentNormalGameOptions : null;
|
||||
public static bool HasArgumentException;
|
||||
public static string CredentialsText;
|
||||
public const string ModVersion = "v1.3.0";
|
||||
public const string ModVersion = "v1.4.0";
|
||||
|
||||
public static float GameTimer;
|
||||
|
||||
@@ -78,11 +73,6 @@ public partial class Main : BasePlugin
|
||||
Preset3 = Config.Bind("Preset Name Options", "Preset3", "Preset 3");
|
||||
Preset4 = Config.Bind("Preset Name Options", "Preset4", "Preset 4");
|
||||
Preset5 = Config.Bind("Preset Name Options", "Preset5", "Preset 5");
|
||||
Preset6 = Config.Bind("Preset Name Options", "Preset6", "Preset 6");
|
||||
Preset7 = Config.Bind("Preset Name Options", "Preset7", "Preset 7");
|
||||
Preset8 = Config.Bind("Preset Name Options", "Preset8", "Preset 8");
|
||||
Preset9 = Config.Bind("Preset Name Options", "Preset9", "Preset 9");
|
||||
Preset10 = Config.Bind("Preset Name Options", "Preset10", "Preset 10");
|
||||
|
||||
AutoStart = Config.Bind("Client Options", "Auto Start", false);
|
||||
GM = Config.Bind("Client Options", "Game Master", false);
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Reactor" Version="2.0.0" />
|
||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native" />
|
||||
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.10.14" PrivateAssets="all" />
|
||||
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.11.18" PrivateAssets="all" />
|
||||
|
||||
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
|
||||
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.0.1" PrivateAssets="all" ExcludeAssets="runtime" />
|
||||
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" ExcludeAssets="runtime" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Copy" AfterTargets="Build" Condition="'$(AmongUs)' != ''">
|
||||
|
||||
@@ -21,14 +21,34 @@ namespace AmongUsRevamped
|
||||
taskOptionsLoad.Wait();
|
||||
}
|
||||
|
||||
public static class CL
|
||||
{
|
||||
public static Color32 Hex(string hex)
|
||||
{
|
||||
if (hex.StartsWith("#"))
|
||||
hex = hex.Substring(1);
|
||||
|
||||
if (hex.Length == 3)
|
||||
{
|
||||
hex = $"{hex[0]}{hex[0]}{hex[1]}{hex[1]}{hex[2]}{hex[2]}";
|
||||
}
|
||||
|
||||
if (hex.Length != 6)
|
||||
throw new System.ArgumentException("Hex color must be 6 or 3 characters long.");
|
||||
|
||||
byte r = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
|
||||
byte g = byte.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
|
||||
byte b = byte.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
|
||||
|
||||
return new Color32(r, g, b, 255);
|
||||
}
|
||||
}
|
||||
public const int PresetId = 0;
|
||||
|
||||
private static readonly string[] presets =
|
||||
{
|
||||
Main.Preset1.Value, Main.Preset2.Value, Main.Preset3.Value,
|
||||
Main.Preset4.Value, Main.Preset5.Value, Main.Preset6.Value,
|
||||
Main.Preset7.Value, Main.Preset8.Value, Main.Preset9.Value,
|
||||
Main.Preset10.Value
|
||||
Main.Preset4.Value, Main.Preset5.Value
|
||||
};
|
||||
|
||||
public static readonly string[] gameModes =
|
||||
@@ -72,12 +92,14 @@ namespace AmongUsRevamped
|
||||
public static OptionItem AllowFortegreen;
|
||||
public static OptionItem NoGameEnd;
|
||||
|
||||
//Mod
|
||||
//Gameplay
|
||||
public static OptionItem TabGroupGameplayGeneral;
|
||||
public static OptionItem DisableSabotage;
|
||||
public static OptionItem DisableCloseDoor;
|
||||
|
||||
public static OptionItem DisableReport;
|
||||
|
||||
public static OptionItem TabGroupTasks;
|
||||
public static OptionItem OverrideTaskSettings;
|
||||
|
||||
public static OptionItem AllPlayersSameTasks;
|
||||
@@ -203,6 +225,13 @@ namespace AmongUsRevamped
|
||||
public static OptionItem SpeedrunSettingsOverride;
|
||||
public static OptionItem GameAutoEndsAfter;
|
||||
|
||||
// Roles
|
||||
public static OptionItem TabGroupCrewmate;
|
||||
|
||||
public static OptionItem TabGroupNeutral;
|
||||
public static OptionItem JesterPerc;
|
||||
|
||||
public static OptionItem TabGroupImpostor;
|
||||
|
||||
public static bool IsLoaded = false;
|
||||
|
||||
@@ -256,6 +285,24 @@ namespace AmongUsRevamped
|
||||
NoGameEnd = BooleanOptionItem.Create(60383, "No Game End", false, TabGroup.SystemSettings, false)
|
||||
.SetColor(Color.red);
|
||||
|
||||
|
||||
|
||||
|
||||
// Custom role settings
|
||||
TabGroupCrewmate = TextOptionItem.Create(100000, "Crewmate Roles", TabGroup.CustomRoleSettings)
|
||||
.SetColor(CL.Hex("#8cffff"));
|
||||
|
||||
TabGroupNeutral = TextOptionItem.Create(101000, "Neutral Roles", TabGroup.CustomRoleSettings)
|
||||
.SetColor(CL.Hex("#FFFF99"));
|
||||
JesterPerc = IntegerOptionItem.Create(101001, "PLACEHOLDER", new(0, 100, 5), 0, TabGroup.CustomRoleSettings, false)
|
||||
.SetValueFormat(OptionFormat.Percent)
|
||||
.SetColor(CL.Hex("#ec62a5"));
|
||||
|
||||
TabGroupImpostor = TextOptionItem.Create(102000, "Impostor Roles", TabGroup.CustomRoleSettings)
|
||||
.SetColor(CL.Hex("#ff1919"));
|
||||
|
||||
|
||||
|
||||
// Gamemode Settings
|
||||
TabGroupHNS = TextOptionItem.Create(70000, "Hide and Seek", TabGroup.GamemodeSettings)
|
||||
.SetColor(Color.green);
|
||||
@@ -284,23 +331,22 @@ namespace AmongUsRevamped
|
||||
|
||||
|
||||
// Gameplay Settings
|
||||
TabGroupGameplayGeneral = TextOptionItem.Create(60564, "General", TabGroup.ModSettings)
|
||||
.SetColor(Color.blue);
|
||||
DisableSabotage = BooleanOptionItem.Create(60565, "Disable Critical Sabotages", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(255, 153, 153, byte.MaxValue))
|
||||
.SetHeader(true);
|
||||
.SetColor(new Color32(255, 153, 153, byte.MaxValue));
|
||||
DisableCloseDoor = BooleanOptionItem.Create(60566, "Disable Door Sabotages", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(255, 153, 153, byte.MaxValue));
|
||||
DisableReport = BooleanOptionItem.Create(60520, "Disable Body Reports", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(255, 153, 153, byte.MaxValue));
|
||||
|
||||
|
||||
|
||||
OverrideTaskSettings = BooleanOptionItem.Create(22998, "<#ffd>Ove<#ffb>rri<#ff9>de T<#ffb>ask <#ffd>Set<#ffb>tin<#ff9>gs", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(239, 89, 175, byte.MaxValue))
|
||||
.SetHeader(true);
|
||||
|
||||
AllPlayersSameTasks = BooleanOptionItem.Create(22999, "Everyone has same tasks", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(255, 255, 153, byte.MaxValue))
|
||||
.SetParent(OverrideTaskSettings);
|
||||
TabGroupTasks = TextOptionItem.Create(22997, "Tasks", TabGroup.ModSettings)
|
||||
.SetColor(Color.yellow);
|
||||
AllPlayersSameTasks = BooleanOptionItem.Create(22998, "Everyone has same tasks", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(255, 255, 153, byte.MaxValue));
|
||||
OverrideTaskSettings = BooleanOptionItem.Create(22999, "<#ffd>Di<#ffb>sa<#ff9>bl<#ffb>e T<#ffd>as<#ffb>ks", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(239, 89, 175, byte.MaxValue));
|
||||
|
||||
DisableMiraTasks = BooleanOptionItem.Create(23000, "Disable Mira HQ Tasks", false, TabGroup.ModSettings, false)
|
||||
.SetColor(new Color32(173, 216, 230, byte.MaxValue))
|
||||
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
using Hazel;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AmongUsRevamped;
|
||||
|
||||
internal class EACR
|
||||
{
|
||||
public static bool PlayerControlReceiveRpc(PlayerControl pc, byte callId, MessageReader reader)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return false;
|
||||
if (pc == null || reader == null) return false;
|
||||
|
||||
try
|
||||
{
|
||||
MessageReader sr = MessageReader.Get(reader);
|
||||
var rpc = (RpcCalls)callId;
|
||||
switch (rpc)
|
||||
{
|
||||
case RpcCalls.StartMeeting:
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(pc.Data.ClientId, true);
|
||||
Logger.SendInGame($"{pc.Data.PlayerName} was banned for being calling an invalid meeting (cheating)");
|
||||
Logger.Info($" {pc.Data.PlayerName} was banned for being calling an invalid meeting (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
switch (callId)
|
||||
{
|
||||
case 101: // Aum Chat
|
||||
try
|
||||
{
|
||||
var firstString = sr.ReadString();
|
||||
var secondString = sr.ReadString();
|
||||
sr.ReadInt32();
|
||||
|
||||
var flag = string.IsNullOrEmpty(firstString) && string.IsNullOrEmpty(secondString);
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(pc.Data.ClientId, true);
|
||||
Logger.SendInGame($"{pc.Data.PlayerName} was banned for AUM chat CallId (cheating)");
|
||||
Logger.Info($" {pc.Data.PlayerName} was banned for AUM chat CallId (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case unchecked((byte)42069): // 85 AUM
|
||||
try
|
||||
{
|
||||
var aumid = sr.ReadByte();
|
||||
|
||||
if (aumid == pc.PlayerId)
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(pc.Data.ClientId, true);
|
||||
Logger.SendInGame($"{pc.Data.PlayerName} was banned for AUM CallId (cheating)");
|
||||
Logger.Info($" {pc.Data.PlayerName} was banned for AUM CallId (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 119: // KN Chat
|
||||
try
|
||||
{
|
||||
var firstString = sr.ReadString();
|
||||
var secondString = sr.ReadString();
|
||||
sr.ReadInt32();
|
||||
|
||||
var flag = string.IsNullOrEmpty(firstString) && string.IsNullOrEmpty(secondString);
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(pc.Data.ClientId, true);
|
||||
Logger.SendInGame($"{pc.Data.PlayerName} was banned for KN chat CallId (cheating)");
|
||||
Logger.Info($" {pc.Data.PlayerName} was banned for KN chat CallId (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 250: // KN
|
||||
if (sr.BytesRemaining == 0)
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(pc.Data.ClientId, true);
|
||||
Logger.SendInGame($"{pc.Data.PlayerName} was banned for KN CallId (cheating)");
|
||||
Logger.Info($" {pc.Data.PlayerName} was banned for KN CallId (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case unchecked((byte)420): // 164 Sicko
|
||||
if (sr.BytesRemaining == 0)
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(pc.Data.ClientId, true);
|
||||
Logger.SendInGame($"{pc.Data.PlayerName} was banned for Sickomenu RPC (cheating)");
|
||||
Logger.Info($" {pc.Data.PlayerName} was banned for Sickomenu RPC (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Exception(e, "EACR");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool RpcUpdateSystemCheck(PlayerControl player, SystemTypes systemType, byte amount)
|
||||
{
|
||||
var Mapid = Utils.GetActiveMapId();
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
Logger.Warn("PlayerControl is null", "EACR-RpcUpdateSystemCheck");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (systemType == SystemTypes.Sabotage)
|
||||
{
|
||||
if (!player.Data.Role.IsImpostor && !player.isNew)
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(player.Data.ClientId, true);
|
||||
Logger.SendInGame($"{player.Data.PlayerName} was banned for invalid sabotage (cheating)");
|
||||
Logger.Info($" {player.Data.PlayerName} was banned for invalid sabotage", "EACR");
|
||||
}
|
||||
}
|
||||
else if (systemType == SystemTypes.LifeSupp)
|
||||
{
|
||||
if (Mapid != 0 && Mapid != 1 && Mapid != 3) goto YesCheat;
|
||||
else if (amount != 64 && amount != 65) goto YesCheat;
|
||||
}
|
||||
else if (systemType == SystemTypes.Comms)
|
||||
{
|
||||
if (amount == 0)
|
||||
{
|
||||
if (Mapid == 1 || Mapid == 5) goto YesCheat;
|
||||
}
|
||||
else if (amount == 64 || amount == 65 || amount == 32 || amount == 33 || amount == 16 || amount == 17)
|
||||
{
|
||||
if (!(Mapid == 1 || Mapid == 5)) goto YesCheat;
|
||||
}
|
||||
else goto YesCheat;
|
||||
}
|
||||
else if (systemType == SystemTypes.Electrical)
|
||||
{
|
||||
if (Mapid == 5) goto YesCheat;
|
||||
if (amount >= 5)
|
||||
{
|
||||
goto YesCheat;
|
||||
}
|
||||
}
|
||||
else if (systemType == SystemTypes.Laboratory)
|
||||
{
|
||||
if (Mapid != 2) goto YesCheat;
|
||||
else if (!(amount == 64 || amount == 65 || amount == 32 || amount == 33)) goto YesCheat;
|
||||
}
|
||||
else if (systemType == SystemTypes.Reactor)
|
||||
{
|
||||
if (Mapid == 2 || Mapid == 4) goto YesCheat;
|
||||
else if (!(amount == 64 || amount == 65 || amount == 32 || amount == 33)) goto YesCheat;
|
||||
}
|
||||
else if (systemType == SystemTypes.HeliSabotage)
|
||||
{
|
||||
if (Mapid != 4) goto YesCheat;
|
||||
else if (!(amount == 64 || amount == 65 || amount == 16 || amount == 17 || amount == 32 || amount == 33)) goto YesCheat;
|
||||
}
|
||||
else if (systemType == SystemTypes.MushroomMixupSabotage)
|
||||
{
|
||||
goto YesCheat;
|
||||
}
|
||||
|
||||
if (Utils.IsMeeting && MeetingHud.Instance.state != MeetingHud.VoteStates.Animating)
|
||||
{
|
||||
Logger.SendInGame($"{player.Data.PlayerName} might have called an invalid sabotage (cheating)");
|
||||
Logger.Info($" {player.Data.PlayerName} might have called an invalid sabotage (cheating)", "EACR");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
YesCheat:
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(player.Data.ClientId, true);
|
||||
Logger.SendInGame($"{player.Data.PlayerName} was banned for an invalid sabotage (cheating)");
|
||||
Logger.Info($" {player.Data.PlayerName} was banned for an invalid sabotage", "EACR");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,11 @@ public static class FixedUpdate
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance)
|
||||
{
|
||||
Main.GameTimer += Time.fixedDeltaTime;
|
||||
}
|
||||
|
||||
GameObject n = GameObject.Find("NewRequestInactive");
|
||||
if (n != null)
|
||||
{
|
||||
@@ -69,8 +74,6 @@ class FixedUpdateInGamePatch
|
||||
// Speedrun
|
||||
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && g == null)
|
||||
{
|
||||
Main.NormalOptions.NumEmergencyMeetings = 0;
|
||||
|
||||
Main.NormalOptions.TaskBarMode = 0;
|
||||
|
||||
if (__instance.AllTasksCompleted() && Utils.InGame && Utils.GamePastRoleSelection && !Utils.HandlingGameEnd)
|
||||
@@ -111,9 +114,7 @@ class FixedUpdateInGamePatch
|
||||
{
|
||||
// 2 = Shift and Seek
|
||||
if (Options.Gamemode.GetValue() == 2 && !Utils.isHideNSeek && Options.CrewAutoWinsGameAfter.GetInt() != 0 && !Options.NoGameEnd.GetBool())
|
||||
{
|
||||
Main.GameTimer += Time.fixedDeltaTime;
|
||||
|
||||
{
|
||||
if (Main.GameTimer > Options.CrewAutoWinsGameAfter.GetInt())
|
||||
{
|
||||
Main.GameTimer = 0f;
|
||||
@@ -125,9 +126,7 @@ class FixedUpdateInGamePatch
|
||||
}
|
||||
// 3 = Speedrun
|
||||
if (Options.Gamemode.GetValue() == 3 && !Utils.isHideNSeek && Options.GameAutoEndsAfter.GetInt() != 0 && !Options.NoGameEnd.GetBool())
|
||||
{
|
||||
Main.GameTimer += Time.fixedDeltaTime;
|
||||
|
||||
{
|
||||
if (Main.GameTimer > Options.GameAutoEndsAfter.GetInt())
|
||||
{
|
||||
Main.GameTimer = 0f;
|
||||
|
||||
+10
-1
@@ -10,7 +10,9 @@ internal class Hotkeys
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
// I don't know which psychopath would use right keys, but I know someday, someone will complain
|
||||
bool Shift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
|
||||
bool Ctrl = Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);
|
||||
bool Enter = Input.GetKeyDown(KeyCode.Return);
|
||||
|
||||
if (Input.GetKey(KeyCode.L) && Shift && Enter)
|
||||
@@ -39,7 +41,14 @@ internal class Hotkeys
|
||||
|
||||
if ((!AmongUsClient.Instance.IsGameStarted || !Utils.IsOnlineGame) && Utils.CanMove && PlayerControl.LocalPlayer.Collider != null)
|
||||
{
|
||||
PlayerControl.LocalPlayer.Collider.enabled = !Input.GetKey(KeyCode.LeftControl);
|
||||
PlayerControl.LocalPlayer.Collider.enabled = !Ctrl;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.C) && GameStartManager.InstanceExists && GameStartManager.Instance != null && GameStartManager.Instance.startState == GameStartManager.StartingStates.Countdown && !HudManager.Instance.Chat.IsOpenOrOpening && Utils.IsLobby)
|
||||
{
|
||||
Logger.Info("Resetted start countdown", "KeyCommand");
|
||||
GameStartManager.Instance.ResetStartState();
|
||||
Logger.SendInGame("Starting countdown canceled");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ namespace AmongUsRevamped
|
||||
|
||||
Children = new();
|
||||
|
||||
AllConfigEntries = new ConfigEntry<int>[10];
|
||||
AllConfigEntries = new ConfigEntry<int>[5];
|
||||
if (Id == 0)
|
||||
{
|
||||
singleEntry = Main.Instance.Config.Bind("Current Preset", id.ToString(), DefaultValue);
|
||||
@@ -80,7 +80,7 @@ namespace AmongUsRevamped
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
AllConfigEntries[i] = Main.Instance.Config.Bind($"Preset{i + 1}", id.ToString(), DefaultValue);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ namespace AmongUsRevamped
|
||||
|
||||
public static void SwitchPreset(int newPreset)
|
||||
{
|
||||
CurrentPreset = Math.Clamp(newPreset, 0, 9);
|
||||
CurrentPreset = Math.Clamp(newPreset, 0, 4);
|
||||
|
||||
foreach (var op in AllOptions)
|
||||
op.Refresh();
|
||||
@@ -214,6 +214,7 @@ namespace AmongUsRevamped
|
||||
public enum TabGroup
|
||||
{
|
||||
SystemSettings,
|
||||
CustomRoleSettings,
|
||||
ModSettings,
|
||||
GamemodeSettings,
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace AmongUsRevamped
|
||||
public PresetOptionItem(int defaultValue, TabGroup tab)
|
||||
: base(0, "Preset", defaultValue, tab, true)
|
||||
{
|
||||
Rule = (0, 9, 1);
|
||||
Rule = (0, 4, 1);
|
||||
}
|
||||
public static PresetOptionItem Create(int defaultValue, TabGroup tab)
|
||||
{
|
||||
@@ -27,11 +27,6 @@ namespace AmongUsRevamped
|
||||
2 => Main.Preset3.Value == (string)Main.Preset3.DefaultValue ? "Preset 3" : Main.Preset3.Value,
|
||||
3 => Main.Preset4.Value == (string)Main.Preset4.DefaultValue ? "Preset 4" : Main.Preset4.Value,
|
||||
4 => Main.Preset5.Value == (string)Main.Preset5.DefaultValue ? "Preset 5" : Main.Preset5.Value,
|
||||
5 => Main.Preset6.Value == (string)Main.Preset6.DefaultValue ? "Preset 6" : Main.Preset6.Value,
|
||||
6 => Main.Preset7.Value == (string)Main.Preset7.DefaultValue ? "Preset 7" : Main.Preset7.Value,
|
||||
7 => Main.Preset8.Value == (string)Main.Preset8.DefaultValue ? "Preset 8" : Main.Preset8.Value,
|
||||
8 => Main.Preset9.Value == (string)Main.Preset9.DefaultValue ? "Preset 9" : Main.Preset9.Value,
|
||||
9 => Main.Preset10.Value == (string)Main.Preset10.DefaultValue ? "Preset 10" : Main.Preset10.Value,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public static class Utils
|
||||
|
||||
public static string ColorString(Color32 color, string str) => $"<#{color.r:x2}{color.g:x2}{color.b:x2}{color.a:x2}>{str}</color>";
|
||||
public static string ColorToHex(Color32 color) => $"#{color.r:x2}{color.g:x2}{color.b:x2}{color.a:x2}";
|
||||
public static byte GetActiveMapId() => GameOptionsManager.Instance.CurrentGameOptions.MapId;
|
||||
|
||||
public static bool IsPlayerModerator(string friendCode)
|
||||
{
|
||||
@@ -79,6 +80,8 @@ public static class Utils
|
||||
{
|
||||
case TabGroup.SystemSettings:
|
||||
return "System Settings";
|
||||
case TabGroup.CustomRoleSettings:
|
||||
return "Custom Roles";
|
||||
case TabGroup.ModSettings:
|
||||
return "Gameplay Settings";
|
||||
case TabGroup.GamemodeSettings:
|
||||
@@ -386,5 +389,23 @@ public static class Utils
|
||||
writer.Write(gameOverReason);
|
||||
AmongUsClient.Instance.FinishEndGame(writer);
|
||||
HandlingGameEnd = false;
|
||||
Logger.Info(" -------- GAME ENDED --------", "ManualEndGame");
|
||||
}
|
||||
|
||||
public static void DumpLog()
|
||||
{
|
||||
string f = $"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}/AUR-logs/";
|
||||
string t = DateTime.Now.ToString("yyyy-MM-dd_HH.mm.ss");
|
||||
string filename = $"{f}AUR-{Main.ModVersion}-{t}.log";
|
||||
if (!Directory.Exists(f)) Directory.CreateDirectory(f);
|
||||
FileInfo file = new(@$"{Environment.CurrentDirectory}/BepInEx/LogOutput.log");
|
||||
file.CopyTo(@filename);
|
||||
|
||||
if (PlayerControl.LocalPlayer != null)
|
||||
{
|
||||
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"/Dump command activated\n\nFile: AUR-{Main.ModVersion}-{t}");
|
||||
ProcessStartInfo psi = new("Explorer.exe") { Arguments = "/e,/select," + @filename.Replace("/", "\\") };
|
||||
Process.Start(psi);
|
||||
}
|
||||
}
|
||||
}
|
||||
+70
-22
@@ -2,6 +2,8 @@
|
||||
using InnerNet;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
// https://github.com/SuperNewRoles/SuperNewRoles/blob/master/SuperNewRoles/Patches/LobbyBehaviourPatch.cs
|
||||
namespace AmongUsRevamped;
|
||||
@@ -12,28 +14,60 @@ internal static class ChatControllerUpdatePatch
|
||||
|
||||
public static void Postfix(ChatController __instance)
|
||||
{
|
||||
if (!__instance||!__instance.freeChatField||!__instance.freeChatField.textArea||!__instance.freeChatField.background||__instance.freeChatField.textArea.compoText == null||!__instance.freeChatField.textArea.outputText) return;
|
||||
if (!__instance.quickChatField||!__instance.quickChatField.background||__instance.quickChatField.text==null) return;
|
||||
|
||||
if (Main.DarkTheme.Value)
|
||||
{
|
||||
__instance.freeChatField.background.color = new Color32(40, 40, 40, byte.MaxValue);
|
||||
__instance.freeChatField.textArea.compoText.Color(Color.white);
|
||||
__instance.freeChatField.textArea.outputText.color = Color.white;
|
||||
|
||||
__instance.quickChatField.background.color = new Color32(40, 40, 40, byte.MaxValue);
|
||||
__instance.quickChatField.text.color = Color.white;
|
||||
}
|
||||
else __instance.freeChatField.textArea.outputText.color = Color.black;
|
||||
else
|
||||
{
|
||||
__instance.freeChatField.background.color = Color.white;
|
||||
__instance.freeChatField.textArea.compoText.Color(Color.black);
|
||||
__instance.freeChatField.textArea.outputText.color = Color.black;
|
||||
|
||||
__instance.quickChatField.background.color = Color.white;
|
||||
__instance.quickChatField.text.color = Color.black;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ChatBubble), nameof(ChatBubble.SetName))]
|
||||
internal static class ChatBubbleSetNamePatch
|
||||
{
|
||||
public static void Postfix(ChatBubble __instance, [HarmonyArgument(2)] bool voted)
|
||||
{
|
||||
if (!__instance||!__instance.playerInfo||!__instance.playerInfo.Object||!__instance.playerInfo.Object.Data||!__instance.TextArea||!__instance.Background) return;
|
||||
|
||||
PlayerControl target = __instance.playerInfo.Object;
|
||||
|
||||
if (Main.DarkTheme.Value)
|
||||
{
|
||||
__instance.Background.color = new(0.1f, 0.1f, 0.1f, 1f);
|
||||
__instance.TextArea.color = Color.white;
|
||||
|
||||
if (__instance.playerInfo.Object.Data.IsDead && Utils.InGame) __instance.Background.color = new(0.1f, 0.1f, 0.1f, 0.7f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ChatController), nameof(ChatController.SendChat))]
|
||||
internal static class SendChatPatch
|
||||
{
|
||||
public static string noKcdMode = "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!";
|
||||
public static string SnSModeOne = "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nSabotages & Meetings = Off";
|
||||
public static string SnSModeTwo = $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Utils.BasicIntToWord(Options.MisfiresToSuicide.GetInt())} wrong kills = suicide";
|
||||
public static string speedrunMode = $"Speedrun:\n\nEveryone is a crewmate The 1st player to finish tasks wins the game Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s";
|
||||
public static string noKcdMode => "0 Kill Cooldown:\n\nImpostors have no kill cooldown, Crewmates have low tasks\nThink fast and pay attention!";
|
||||
public static string SnSModeOne => "Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nSabotages & Meetings = Off";
|
||||
public static string SnSModeTwo => $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Utils.BasicIntToWord(Options.MisfiresToSuicide.GetInt())} wrong kills = suicide";
|
||||
public static string speedrunMode => $"Speedrun:\n\nEveryone is a crewmate The 1st player to finish tasks wins the game Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s";
|
||||
|
||||
public static string allCommandsFull = "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info\n/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
|
||||
public static string allCommandsOne = "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info";
|
||||
public static string allCommandsTwo = "/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
|
||||
public static string allCommandsFull => "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info\n/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
|
||||
public static string allCommandsOne => "Commands:\n/r - Current mode description\n/0kc, /sns, /sp - Specific mode description\n/l - Shows last winner info";
|
||||
public static string allCommandsTwo => "/kick, /ban - Bans or kicks a player by name\n/ckick, /cban - Bans or kicks a player by color";
|
||||
|
||||
public static bool Prefix(ChatController __instance)
|
||||
{
|
||||
@@ -41,6 +75,14 @@ internal static class SendChatPatch
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
|
||||
if (text == "/dump")
|
||||
{
|
||||
Utils.DumpLog();
|
||||
__instance.freeChatField.textArea.Clear();
|
||||
__instance.freeChatField.textArea.SetText(string.Empty);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (text == "/h" || text == "/help" || text == "/cmd" || text == "/commands")
|
||||
{
|
||||
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"{allCommandsFull}");
|
||||
@@ -102,23 +144,28 @@ internal static class SendChatPatch
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool col1 = text.StartsWith("/col ") || text.StartsWith("/cor ");
|
||||
bool col2 = text.StartsWith("/color ");
|
||||
bool col3 = text.StartsWith("/colour ");
|
||||
|
||||
else
|
||||
if (col1 || col2 || col3)
|
||||
{
|
||||
bool col1 = text.StartsWith("/col ") || text.StartsWith("/cor ");
|
||||
bool col2 = text.StartsWith("/color ");
|
||||
|
||||
bool col3 = text.StartsWith("/colour ");
|
||||
|
||||
string argCol = text.Substring(col1 ? 5 : col2 ? 7 : col3 ? 8 : 0).Trim();
|
||||
|
||||
if (Utils.TryGetColorId(argCol, out byte colId))
|
||||
if (Utils.TryGetColorId(argCol, out byte colId) && (col1 || col2 || col3))
|
||||
{
|
||||
PlayerControl.LocalPlayer.RpcSetColor(colId);
|
||||
__instance.freeChatField.textArea.Clear();
|
||||
__instance.freeChatField.textArea.SetText(string.Empty);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
bool isKick = text.StartsWith("/kick ");
|
||||
bool isBan = text.StartsWith("/ban ");
|
||||
|
||||
@@ -254,14 +301,12 @@ public static class RPCHandlerPatch
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
bool col1 = text.StartsWith("/col ") || text.StartsWith("/cor ");
|
||||
bool col2 = text.StartsWith("/color ");
|
||||
bool col3 = text.StartsWith("/colour ");
|
||||
|
||||
if ((col1 || col2 || col3) && !Utils.InGame)
|
||||
{
|
||||
|
||||
bool col1 = text.StartsWith("/col ") || text.StartsWith("/cor ");
|
||||
bool col2 = text.StartsWith("/color ");
|
||||
|
||||
bool col3 = text.StartsWith("/colour ");
|
||||
|
||||
string argCol = text.Substring(col1 ? 5 : col2 ? 7 : col3 ? 8 : 0).Trim();
|
||||
|
||||
if (Utils.TryGetColorId(argCol, out byte colId))
|
||||
@@ -272,6 +317,9 @@ public static class RPCHandlerPatch
|
||||
__instance.RpcSetColor(colId);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (!Utils.IsPlayerModerator(__instance.Data.FriendCode)) return;
|
||||
// Banning works by name and color. Commands are seperated incase someone has a color as their name
|
||||
|
||||
+78
-16
@@ -67,22 +67,6 @@ namespace AmongUsRevamped
|
||||
{
|
||||
ErrorText.Instance.AddError(ErrorCode.Main_DictionaryError);
|
||||
}
|
||||
|
||||
GameObject t = GameObject.Find("Tint");
|
||||
if (t != null)
|
||||
{
|
||||
t.SetActive(false);
|
||||
}
|
||||
GameObject b = GameObject.Find("BackgroundTexture");
|
||||
if (b != null)
|
||||
{
|
||||
b.SetActive(false);
|
||||
}
|
||||
GameObject w = GameObject.Find("WindowShine");
|
||||
if (w != null)
|
||||
{
|
||||
w.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,4 +166,82 @@ namespace AmongUsRevamped
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/3X3CODE/MainMenuEnhanced/blob/main/MainMenuEnhanced/VisualPatch.cs
|
||||
[HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start))]
|
||||
public static class MainMenuManagerStartPatch
|
||||
{
|
||||
public static void Postfix(MainMenuManager __instance)
|
||||
{
|
||||
if (__instance == null) return;
|
||||
|
||||
var bg = GameObject.Find("BackgroundTexture");
|
||||
if (bg != null)
|
||||
{
|
||||
bg.SetActive(false);
|
||||
}
|
||||
|
||||
var leftPanel = GameObject.Find("LeftPanel");
|
||||
if (leftPanel != null)
|
||||
{
|
||||
leftPanel.gameObject.GetComponent<SpriteRenderer>().enabled = false;
|
||||
}
|
||||
|
||||
var div = GameObject.Find("MainUI/AspectScaler/LeftPanel/Main Buttons/Divider");
|
||||
if (div != null)
|
||||
{
|
||||
div.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
Transform tintTrans = __instance.transform.Find("MainUI/Tint");
|
||||
var tint = tintTrans.gameObject;
|
||||
if (tint != null)
|
||||
{
|
||||
tint.SetActive(false);
|
||||
}
|
||||
|
||||
DisableObject("WindowShine");
|
||||
DisableComponent("RightPanel");
|
||||
DisableComponent("MaskedBlackScreen");
|
||||
|
||||
Transform playTransform = __instance.transform.Find("MainUI/AspectScaler/LeftPanel/Main Buttons/PlayButton/FontPlacer/Text_TMP");
|
||||
if (playTransform != null)
|
||||
{
|
||||
var playbutton = playTransform.gameObject;
|
||||
if (playbutton != null)
|
||||
{
|
||||
if (playbutton.TryGetComponent<TextTranslatorTMP>(out var tmp))
|
||||
{
|
||||
tmp.enabled = false;
|
||||
}
|
||||
if (playbutton.TryGetComponent<TextMeshPro>(out var text))
|
||||
{
|
||||
text.text = "Start";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void DisableObject(string name)
|
||||
{
|
||||
var obj = GameObject.Find(name);
|
||||
if (obj != null)
|
||||
{
|
||||
obj.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
static void DisableComponent(string name)
|
||||
{
|
||||
var obj = GameObject.Find(name);
|
||||
if (obj != null)
|
||||
{
|
||||
if (obj.TryGetComponent<SpriteRenderer>(out var renderer))
|
||||
{
|
||||
renderer.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ public static class EndGameManagerPatch
|
||||
{
|
||||
public static void Postfix(EndGameManager __instance)
|
||||
{
|
||||
Logger.Info(" -------- GAME ENDED --------", "EndGame");
|
||||
Utils.ClearLeftoverData();
|
||||
|
||||
EndGameNavigation navigation = __instance.Navigation;
|
||||
@@ -50,11 +51,10 @@ class NormalGameEndChecker
|
||||
{
|
||||
LastWinReason = $"★ Crewmates win! (Tasks)\n\nImpostors:\n" + string.Join("\n", imps.Select(p => p.Data.PlayerName));
|
||||
}
|
||||
else
|
||||
else if (Options.Gamemode.GetValue() < 2)
|
||||
{
|
||||
LastWinReason = $"★ Impostors win! (Sabotage)\n\nImpostors:\n★" + string.Join("\n★", imps.Select(p => p.Data.PlayerName));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace AmongUsRevamped
|
||||
baseGameSetting = new StringGameSetting
|
||||
{
|
||||
Type = OptionTypes.String,
|
||||
Values = new StringNames[10],
|
||||
Values = new StringNames[5],
|
||||
Index = presetItem.GetInt(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -114,13 +114,16 @@ namespace AmongUsRevamped
|
||||
switch ((TabGroup)(tabNum - 3))
|
||||
{
|
||||
case TabGroup.SystemSettings:
|
||||
__instance.MenuDescriptionText.text = "Quality settings to improve comfort and testing";
|
||||
__instance.MenuDescriptionText.text = "Quality settings to improve comfort and testing.";
|
||||
break;
|
||||
case TabGroup.CustomRoleSettings:
|
||||
__instance.MenuDescriptionText.text = "Custom Role enabling and settings.";
|
||||
break;
|
||||
case TabGroup.ModSettings:
|
||||
__instance.MenuDescriptionText.text = "Gameplay Settings to improve the in-game experience";
|
||||
__instance.MenuDescriptionText.text = "Gameplay Settings to improve the in-game experience.";
|
||||
break;
|
||||
case TabGroup.GamemodeSettings:
|
||||
__instance.MenuDescriptionText.text = "Situational settings to apply for specific gamemodes";
|
||||
__instance.MenuDescriptionText.text = "Situational settings to apply for specific gamemodes.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AmongUsRevamped;
|
||||
|
||||
@@ -10,15 +12,18 @@ public static class GameStartManagerUpdatePatch
|
||||
|
||||
public static void Prefix(GameStartManager __instance)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost || AmongUsClient.Instance == null) return;
|
||||
if (__instance == null || MeetingHud.Instance != null) return;
|
||||
if (AmongUsClient.Instance == null || !AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
if (__instance.StartButton == null || __instance.GameStartText == null) return;
|
||||
|
||||
__instance.MinPlayers = 1;
|
||||
|
||||
if (Main.AutoStart.Value && OnGameJoinedPatch.AutoStartCheck && GameStartManager.InstanceExists && GameStartManager.Instance.startState != GameStartManager.StartingStates.Countdown && GameData.Instance?.PlayerCount >= Options.PlayerAutoStart.GetInt())
|
||||
if (Main.AutoStart.Value && OnGameJoinedPatch.AutoStartCheck && GameStartManager.InstanceExists && __instance.startState != GameStartManager.StartingStates.Countdown && GameData.Instance?.PlayerCount >= Options.PlayerAutoStart.GetInt())
|
||||
{
|
||||
GameStartManager.Instance.startState = GameStartManager.StartingStates.Countdown;
|
||||
GameStartManager.Instance.countDownTimer = Options.AutoStartTimer.GetFloat();
|
||||
GameStartManager.Instance?.StartButton.gameObject.SetActive(false);
|
||||
__instance.startState = GameStartManager.StartingStates.Countdown;
|
||||
__instance.countDownTimer = Options.AutoStartTimer.GetFloat();
|
||||
__instance.StartButton.gameObject.SetActive(false);
|
||||
Autostarting = true;
|
||||
}
|
||||
|
||||
@@ -26,7 +31,6 @@ public static class GameStartManagerUpdatePatch
|
||||
{
|
||||
__instance.countDownTimer = Options.StartCountdown.GetInt();
|
||||
CustomTimerApplied = true;
|
||||
|
||||
}
|
||||
|
||||
if (__instance.startState != GameStartManager.StartingStates.Countdown)
|
||||
@@ -35,4 +39,68 @@ public static class GameStartManagerUpdatePatch
|
||||
CustomTimerApplied = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Postfix(GameStartManager __instance)
|
||||
{
|
||||
string warningMessage = "";
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost || __instance.GameStartText == null) return;
|
||||
|
||||
if (GameStartManagerStartPatch.warningText != null)
|
||||
{
|
||||
if (warningMessage == "")
|
||||
{
|
||||
GameStartManagerStartPatch.warningText.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameStartManagerStartPatch.warningText.text = warningMessage;
|
||||
GameStartManagerStartPatch.warningText.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (__instance.GameStartText != null)
|
||||
{
|
||||
__instance.GameStartText.transform.localPosition = new Vector3(__instance.GameStartText.transform.localPosition.x, 2f, __instance.GameStartText.transform.localPosition.z);
|
||||
}
|
||||
|
||||
if (GameStartManagerStartPatch.cancelButton != null)
|
||||
{
|
||||
GameStartManagerStartPatch.cancelButton.gameObject.SetActive(__instance.startState == GameStartManager.StartingStates.Countdown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))]
|
||||
public class GameStartManagerStartPatch
|
||||
{
|
||||
public static TextMeshPro warningText;
|
||||
public static PassiveButton cancelButton;
|
||||
|
||||
public static void Postfix(GameStartManager __instance)
|
||||
{
|
||||
if (__instance == null || !Utils.IsLobby) return;
|
||||
|
||||
warningText = UnityEngine.Object.Instantiate(__instance.GameStartText, __instance.transform.parent);
|
||||
warningText.name = "WarningText";
|
||||
warningText.transform.localPosition = new Vector3(0f, __instance.transform.localPosition.y + 3f, -1f);
|
||||
warningText.gameObject.SetActive(false);
|
||||
|
||||
cancelButton = UnityEngine.Object.Instantiate(__instance.StartButton, __instance.transform);
|
||||
cancelButton.name = "CancelButton";
|
||||
|
||||
var cancelLabel = cancelButton.buttonText;
|
||||
cancelLabel.DestroyTranslator();
|
||||
cancelLabel.text = "Cancel";
|
||||
|
||||
cancelButton.activeTextColor = cancelButton.inactiveTextColor = Color.white;
|
||||
cancelButton.gameObject.SetActive(false);
|
||||
|
||||
cancelButton.OnClick = new();
|
||||
cancelButton.OnClick.AddListener((UnityEngine.Events.UnityAction)(() =>
|
||||
{
|
||||
__instance.ResetStartState();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ internal static class OnGameJoinedPatch
|
||||
public static bool AutoStartCheck;
|
||||
public static void Postfix()
|
||||
{
|
||||
Logger.Info(" -------- JOINED GAME --------", "OnGameJoined");
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
WaitingForChat = false;
|
||||
|
||||
@@ -11,12 +11,22 @@ internal class ApplyCustomImpostorCount
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
Logger.Info(" -------- GAME STARTED --------", "StartGame");
|
||||
|
||||
NormalGameEndChecker.imps.Clear();
|
||||
NormalGameEndChecker.LastWinReason = "";
|
||||
|
||||
if (Main.GM.Value)
|
||||
{
|
||||
PlayerControl.LocalPlayer.RpcSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
if (Options.Gamemode.GetValue() == 3)
|
||||
{
|
||||
PlayerControl.LocalPlayer.CoSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerControl.LocalPlayer.RpcSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
}
|
||||
|
||||
PlayerControl.LocalPlayer.myTasks.Clear();
|
||||
}
|
||||
|
||||
@@ -24,17 +34,14 @@ internal class ApplyCustomImpostorCount
|
||||
{
|
||||
foreach (var p in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
|
||||
new LateTask(() =>
|
||||
if (p != PlayerControl.LocalPlayer)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
}, 5f, "Speedrun Secondary RPCSetRole");
|
||||
|
||||
new LateTask(() =>
|
||||
}
|
||||
if (p == PlayerControl.LocalPlayer)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
}, 9f, "Speedrun Tertiary RPCSetRole");
|
||||
p.CoSetRole(AmongUs.GameOptions.RoleTypes.Crewmate, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ class ReportDeadBodyPatch
|
||||
{
|
||||
public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)] NetworkedPlayerInfo target)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
if (!AmongUsClient.Instance.AmHost || target == null || __instance == null) return true;
|
||||
|
||||
if (Options.DisableReport.GetBool() && target != null || Options.Gamemode.GetValue() == 2)
|
||||
if (Options.DisableReport.GetBool() || Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3)
|
||||
{
|
||||
Logger.Info($" Stopped {__instance.Data.PlayerName} reporting the body of {target.PlayerName}", "ReportDeadBodyPatch");
|
||||
return false;
|
||||
|
||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
namespace AmongUsRevamped;
|
||||
|
||||
[HarmonyPatch(typeof(SabotageSystemType), nameof(SabotageSystemType.UpdateSystem))] // SetInitialSabotageCooldown - set sabotage cooldown in start game
|
||||
[HarmonyPatch(typeof(SabotageSystemType), nameof(SabotageSystemType.UpdateSystem))]
|
||||
public static class SabotageSystemTypeRepairDamagePatch
|
||||
{
|
||||
private static bool Prefix([HarmonyArgument(0)] PlayerControl player, [HarmonyArgument(1)] MessageReader msgReader)
|
||||
@@ -45,4 +45,27 @@ class ShipStatusCloseDoorsPatch
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.UpdateSystem), typeof(SystemTypes), typeof(PlayerControl), typeof(MessageReader))]
|
||||
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.Ventilation
|
||||
or SystemTypes.Security
|
||||
or SystemTypes.Decontamination
|
||||
or SystemTypes.Decontamination2
|
||||
or SystemTypes.Decontamination3
|
||||
or SystemTypes.MedBay) 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;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ internal static class AddVotePatch
|
||||
|
||||
Logger.Info($" Kicked {target.Data.PlayerName}, {target.Data.FriendCode}", "KickPatch");
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<img src="https://github.com/astra1dev/AUnlocker/assets/90265231/14226f03-a003-4efc-b27b-6df53fb394d6" width=410 height=240>****
|
||||
|
||||
|
||||
# 🎮 Features (v1.2.1):
|
||||
# 🎮 Features (v1.4.0):
|
||||
- <b>🔶 Client Side settings:</b>
|
||||
- Game Master
|
||||
- Unlock FPS
|
||||
@@ -45,6 +45,7 @@
|
||||
- Moderator system
|
||||
- Banlist system
|
||||
- Enable No Game End
|
||||
- Custom starting countdown
|
||||
- <b>🔶 Automation settings:</b>
|
||||
- Auto start game and conditions for it
|
||||
- Auto rejoin lobby
|
||||
@@ -53,30 +54,51 @@
|
||||
- Disable critical sabotages
|
||||
- Disable door sabotages
|
||||
- Disable body reporting
|
||||
- Enable/Disable any desired tasks
|
||||
- Enable/Disable any task
|
||||
- All players have same tasks
|
||||
- Hide and Seek: Custom Impostor count
|
||||
- <b>🔶 Custom Gamemodes:</b>
|
||||
- 0 Kill Cooldown
|
||||
- Shift and Seek
|
||||
- Speedrun
|
||||
- <b>🔷 Extra features:</b>
|
||||
- Shift + L + Enter - Force End Game
|
||||
- Shift + M + Enter - Force Call/Close Meeting
|
||||
- /help command
|
||||
- Specific gamemode info commands -> /0kc, /sns, /sp
|
||||
- Current gamemode info command -> /r
|
||||
- <b>🔷 Other:</b>
|
||||
- Ability to cancel starting countdown
|
||||
- Improved main menu
|
||||
- Custom anticheat system
|
||||
- Zoom out in lobby or when dead
|
||||
- Unlimited default Option ranges
|
||||
- Logging for useful information
|
||||
|
||||
- <b>🎉 And this all without Modded Protocol!</b>
|
||||
|
||||
### Hotkeys
|
||||
| HotKey | Function | Usable Scene |
|
||||
| ------------------- | ------------------------------------------- | ---------------------------------- |
|
||||
| `Shift`+`L`+`Enter` | Force End Game | In Game |
|
||||
| `Shift`+`M`+`Enter` | Skip meeting or call meeting | In Game |
|
||||
| `C` | Cancel game start | In Countdown |
|
||||
| `Shift` | Start the game immediately | In Countdown |
|
||||
| `Ctrl` | Noclip in lobby | In Lobby |
|
||||
|
||||
### Chat Commands
|
||||
| Command | Function |
|
||||
| ------------------------------------------- | ------------------------------------------------- |
|
||||
| /h<br>/help | Show command help |
|
||||
| /l<br>/win | Show winner |
|
||||
| /r | Show current gamemode/roles description |
|
||||
| /0kc<br>/sns</br>/sp | Show respective gamemode description |
|
||||
| /ban <name> | Ban a player by name |
|
||||
| /kick <name> | Kick a player by name |
|
||||
| /cban <color> | Ban a player by color |
|
||||
| /ckick <color> | Kick a player by color |
|
||||
| /dump | Copy your LogOutput file |
|
||||
| /color <color> | Set color |
|
||||
|
||||
|
||||
**Credit to these mods and their developers for their code:**
|
||||
### :star: [AUnlocker](https://github.com/astra1dev/AUnlocker)
|
||||
> - NumberOptionsPatch
|
||||
### :star: [EHR (Formerly TOHE+)](https://github.com/Gurge44/EndlessHostRoles)
|
||||
> - Dark Theme
|
||||
> - Task Patching
|
||||
### :star: [TOH](https://github.com/tukasa0001/TownOfHost) :
|
||||
> - Ban Manager
|
||||
|
||||
Reference in new issue
Block a user