diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..ff5cca596 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: + pull_request: + branches: [ main ] + +jobs: + build: + if: github.head_ref != 'translation' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Cache NuGet packages + uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore diff --git a/.gitignore b/.gitignore index bd97e8675..f9f64647b 100644 --- a/.gitignore +++ b/.gitignore @@ -379,11 +379,6 @@ FodyWeavers.xml # VS Code files for those working on multiple tools .vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace # Local History for Visual Studio Code .history/ @@ -399,4 +394,7 @@ FodyWeavers.xml *.sln.iml /.idea/.idea.EHR/.idea -/Resources/Config/URL.txt \ No newline at end of file +/Resources/Config/URL.txt + +# Local variables +local.props \ No newline at end of file diff --git a/CTA/CustomTeamAssigner/CustomRoles.cs b/CTA/CustomTeamAssigner/CustomRoles.cs index 346db06d8..86a77827d 100644 --- a/CTA/CustomTeamAssigner/CustomRoles.cs +++ b/CTA/CustomTeamAssigner/CustomRoles.cs @@ -427,19 +427,19 @@ public enum CustomRoles VoodooMaster, Wyrd, - // Solo Kombat - SoloPVP_Player, + // Solo PVP + Challenger, // FFA Killer, - // Move And Stop + // Stop And Go Tasker, // Hot Potato Potato, - // H&S + // Hide And Seek Hider, Seeker, Fox, @@ -536,7 +536,7 @@ public enum CustomRoles Examiner, Facilitator, // Ghost role Finder, - Flashman, + Flash, Fragile, Fool, Giant, @@ -603,4 +603,4 @@ public enum CustomRoles Watcher, Workhorse, Youtuber -} \ No newline at end of file +} diff --git a/CustomRoles.cs b/CustomRoles.cs index ddf7c1274..58f486f6e 100644 --- a/CustomRoles.cs +++ b/CustomRoles.cs @@ -429,7 +429,7 @@ public enum CustomRoles Wyrd, // Solo Kombat - SoloPVP_Player, + Challenger, // FFA Killer, @@ -537,7 +537,7 @@ public enum CustomRoles Examiner, Facilitator, // Ghost role Finder, - Flashman, + Flash, Fragile, Fool, Giant, @@ -604,4 +604,4 @@ public enum CustomRoles Watcher, Workhorse, Youtuber -} \ No newline at end of file +} diff --git a/EHR.csproj b/EHR.csproj index 3ea6601bd..fa37a85ec 100644 --- a/EHR.csproj +++ b/EHR.csproj @@ -1,4 +1,9 @@  + + + D:\SteamLibrary\steamapps\common\Among Us + + net8.0 net6.0 @@ -8,8 +13,7 @@ EHR Gurge44 preview - D:\SteamLibrary\steamapps\common\Among Us - + $(AmongUsPath) true True $(MSBuildProjectName) diff --git a/GameMode/BedWars.cs b/Gamemodes/BedWars.cs similarity index 99% rename from GameMode/BedWars.cs rename to Gamemodes/BedWars.cs index ab1fadb20..a3d60a528 100644 --- a/GameMode/BedWars.cs +++ b/Gamemodes/BedWars.cs @@ -4,10 +4,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; +using EHR.Roles; using Hazel; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class BedWars { diff --git a/GameMode/CaptureTheFlag.cs b/Gamemodes/CaptureTheFlag.cs similarity index 99% rename from GameMode/CaptureTheFlag.cs rename to Gamemodes/CaptureTheFlag.cs index e27b9a41c..225d7ca11 100644 --- a/GameMode/CaptureTheFlag.cs +++ b/Gamemodes/CaptureTheFlag.cs @@ -4,10 +4,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; +using EHR.Roles; using Hazel; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class CaptureTheFlag { diff --git a/GameMode/CustomHnS.cs b/Gamemodes/CustomHnS.cs similarity index 98% rename from GameMode/CustomHnS.cs rename to Gamemodes/CustomHnS.cs index 8e3954a59..31bece2d3 100644 --- a/GameMode/CustomHnS.cs +++ b/Gamemodes/CustomHnS.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using AmongUs.GameOptions; -using EHR.GameMode.HideAndSeekRoles; +using EHR.Roles; using EHR.Modules; using HarmonyLib; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; internal static class CustomHnS { @@ -21,6 +21,7 @@ internal static class CustomHnS private static OptionItem MaxNeutrals; private static OptionItem DangerMeter; private static OptionItem PlayersSeeRoles; + private static OptionItem ChatDuringGame; public static Dictionary> HideAndSeekRoles = []; public static Dictionary PlayerRoles = []; @@ -31,6 +32,7 @@ internal static class CustomHnS public static int SeekerNum => Math.Max(Main.RealOptionsData.GetInt(Int32OptionNames.NumImpostors), 1); public static int MaximumGameLength => MaxGameLength.GetInt(); + public static bool Chat => ChatDuringGame.GetBool(); public static void SetupCustomOption() { @@ -57,6 +59,10 @@ internal static class CustomHnS PlayersSeeRoles = new BooleanOptionItem(id + 4, "HNS.PlayersSeeRoles", true, TabGroup.GameSettings) .SetGameMode(CustomGameMode.HideAndSeek) .SetColor(color); + + ChatDuringGame = new BooleanOptionItem(id + 5, "FFA_ChatDuringGame", false, TabGroup.GameSettings) + .SetGameMode(CustomGameMode.HideAndSeek) + .SetColor(color); } public static void Init() diff --git a/GameMode/Deathrace.cs b/Gamemodes/Deathrace.cs similarity index 99% rename from GameMode/Deathrace.cs rename to Gamemodes/Deathrace.cs index 730ea4042..8cb414648 100644 --- a/GameMode/Deathrace.cs +++ b/Gamemodes/Deathrace.cs @@ -3,9 +3,10 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; +using EHR.Roles; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class Deathrace { diff --git a/GameMode/FreeForAll.cs b/Gamemodes/FreeForAll.cs similarity index 98% rename from GameMode/FreeForAll.cs rename to Gamemodes/FreeForAll.cs index 4fb41f0b0..87325a696 100644 --- a/GameMode/FreeForAll.cs +++ b/Gamemodes/FreeForAll.cs @@ -6,7 +6,7 @@ using EHR.Modules; using UnityEngine; using static EHR.Translator; -namespace EHR; +namespace EHR.Gamemodes; internal static class FreeForAll { @@ -18,8 +18,6 @@ internal static class FreeForAll public static Dictionary KillCount = []; public static int RoundTime; - private static string LatestChatMessage = string.Empty; - public static Dictionary PlayerTeams = []; public static readonly Dictionary TeamColors = new() @@ -363,12 +361,6 @@ internal static class FreeForAll return Utils.ColorString(Utils.GetRoleColor(CustomRoles.Killer), arrow); } - public static void UpdateLastChatMessage(string playerName, string message) - { - LatestChatMessage = string.Format(GetString("FFAChatMessageNotify"), playerName, message); - Main.AllAlivePlayerControls.NotifyPlayers(LatestChatMessage); - } - //[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))] public static class FixedUpdatePatch { diff --git a/GameMode/HotPotato.cs b/Gamemodes/HotPotato.cs similarity index 99% rename from GameMode/HotPotato.cs rename to Gamemodes/HotPotato.cs index 705e5cd2c..a4d20fbce 100644 --- a/GameMode/HotPotato.cs +++ b/Gamemodes/HotPotato.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; internal static class HotPotato { diff --git a/GameMode/KingOfTheZones.cs b/Gamemodes/KingOfTheZones.cs similarity index 99% rename from GameMode/KingOfTheZones.cs rename to Gamemodes/KingOfTheZones.cs index fe1f7e39f..ba629e13d 100644 --- a/GameMode/KingOfTheZones.cs +++ b/Gamemodes/KingOfTheZones.cs @@ -8,7 +8,7 @@ using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR; +namespace EHR.Gamemodes; public static class KingOfTheZones { diff --git a/GameMode/Mingle.cs b/Gamemodes/Mingle.cs similarity index 97% rename from GameMode/Mingle.cs rename to Gamemodes/Mingle.cs index 051f5ee53..912ebda13 100644 --- a/GameMode/Mingle.cs +++ b/Gamemodes/Mingle.cs @@ -4,7 +4,7 @@ using System.Linq; using AmongUs.GameOptions; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class Mingle { @@ -35,6 +35,7 @@ public static class Mingle public static OptionItem MinTimeOption; public static OptionItem MaxRequiredPlayersPerRoomOption; public static OptionItem MaxWinningPlayersOption; + public static OptionItem ChatDuringGameOption; public static void SetupCustomOption() { @@ -78,10 +79,14 @@ public static class Mingle .SetGameMode(gameMode) .SetValueFormat(OptionFormat.Players); - MaxWinningPlayersOption = new IntegerOptionItem(id, "Mingle.MaxWinningPlayersOption", new(1, 10, 1), 1, tab) + MaxWinningPlayersOption = new IntegerOptionItem(id++, "Mingle.MaxWinningPlayersOption", new(1, 10, 1), 1, tab) .SetColor(color) .SetGameMode(gameMode) .SetValueFormat(OptionFormat.Players); + + ChatDuringGameOption = new BooleanOptionItem(id, "FFA_ChatDuringGame", false, TabGroup.GameSettings) + .SetColor(color) + .SetGameMode(gameMode); } public static string GetSuffix(PlayerControl seer) diff --git a/GameMode/NaturalDisasters.cs b/Gamemodes/NaturalDisasters.cs similarity index 98% rename from GameMode/NaturalDisasters.cs rename to Gamemodes/NaturalDisasters.cs index 08b65d49a..90a5367a8 100644 --- a/GameMode/NaturalDisasters.cs +++ b/Gamemodes/NaturalDisasters.cs @@ -5,12 +5,12 @@ using System.Linq; using System.Reflection; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using UnityEngine; using Random = UnityEngine.Random; -namespace EHR; +namespace EHR.Gamemodes; [SuppressMessage("ReSharper", "UnusedType.Local")] [SuppressMessage("ReSharper", "UnusedType.Global")] @@ -33,6 +33,7 @@ public static class NaturalDisasters private static OptionItem MaximumDisastersAtOnce; private static OptionItem WhenLimitIsReached; private static OptionItem PreferRemovingThunderstorm; + private static OptionItem ChatDuringGame; private static readonly Dictionary DisasterSpawnChances = []; private static readonly string[] LimitReachedOptions = @@ -54,6 +55,8 @@ public static class NaturalDisasters public static int FrequencyOfDisasters => DisasterFrequency.GetInt(); + public static bool Chat => ChatDuringGame.GetBool(); + public static void SetupCustomOption() { var id = 69_216_001; @@ -89,6 +92,10 @@ public static class NaturalDisasters .SetGameMode(gameMode) .SetParent(WhenLimitIsReached) .SetColor(color); + + ChatDuringGame = new BooleanOptionItem(id++, "FFA_ChatDuringGame", false, TabGroup.GameSettings) + .SetGameMode(gameMode) + .SetColor(color); LoadAllDisasters(); @@ -274,7 +281,7 @@ public static class NaturalDisasters if (ActiveDisasters.Exists(x => x is Thunderstorm)) disasters.RemoveAll(x => x.Name == "Thunderstorm"); Type disaster = disasters.SelectMany(x => Enumerable.Repeat(x, DisasterSpawnChances[x.Name].GetInt() / 5)).RandomElement(); - KeyValuePair roomKvp = RandomSpawn.SpawnMap.GetSpawnMap().Positions.RandomElement(); + KeyValuePair roomKvp = RandomSpawn.SpawnMap.GetSpawnMap().Positions.Where(x => x.Key is not (SystemTypes.Hallway or SystemTypes.Outside) && !x.Key.ToString().Contains("Decontamination")).RandomElement(); Vector2 position = disaster.Name switch { diff --git a/GameMode/Quiz.cs b/Gamemodes/Quiz.cs similarity index 98% rename from GameMode/Quiz.cs rename to Gamemodes/Quiz.cs index 27744e616..d4928e812 100644 --- a/GameMode/Quiz.cs +++ b/Gamemodes/Quiz.cs @@ -8,7 +8,7 @@ using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR; +namespace EHR.Gamemodes; public static class Quiz { @@ -36,7 +36,7 @@ public static class Quiz ['B'] = SystemTypes.UpperEngine, ['C'] = SystemTypes.Security, ['D'] = SystemTypes.LowerEngine, - ['E'] = SystemTypes.Hallway + ['E'] = SystemTypes.Outside }, [MapNames.MiraHQ] = new() { @@ -183,7 +183,7 @@ public static class Quiz char letter = (char)('A' + i); SystemTypes room = UsedRooms[Main.CurrentMap][letter]; - bool isInThisRoom = room == SystemTypes.Outside ? seer.GetPlainShipRoom() == null : seer.IsInRoom(room); + bool isInThisRoom = room == SystemTypes.Outside ? seer.GetPlainShipRoom() == null || seer.IsInRoom(SystemTypes.Hallway) : seer.IsInRoom(room); string prefix = isInThisRoom ? "\u27a1 " : string.Empty; string suffix = isInThisRoom ? "" : string.Empty; @@ -449,7 +449,7 @@ public static class Quiz QuestionTimeLimitEndTS = 0; PlayerControl[] aapc = Main.AllAlivePlayerControls; SystemTypes correctRoom = UsedRooms[Main.CurrentMap][(char)('A' + CurrentQuestion.CorrectAnswerIndex)]; - DyingPlayers = aapc.Select(x => (ID: x.PlayerId, Room: x.GetPlainShipRoom())).Where(x => correctRoom == SystemTypes.Outside ? x.Room != null : x.Room == null || x.Room.RoomId != correctRoom).Select(x => x.ID).ToList(); + DyingPlayers = aapc.Select(x => (ID: x.PlayerId, Room: x.GetPlainShipRoom())).Where(x => correctRoom == SystemTypes.Outside ? x.Room != null && x.Room.RoomId != SystemTypes.Hallway : x.Room == null || x.Room.RoomId != correctRoom).Select(x => x.ID).ToList(); if (DyingPlayers.Count == 0) NumAllCorrectAnswers++; bool everyoneWasWrong = DyingPlayers.Count == aapc.Length; if (!everyoneWasWrong) NumCorrectAnswers.IntersectBy(aapc.Select(x => x.PlayerId), x => x.Key).DoIf(x => !DyingPlayers.Contains(x.Key), x => x.Value[CurrentDifficulty][Round]++); @@ -590,7 +590,7 @@ public static class Quiz if (CurrentDifficulty == Difficulty.Test) { SystemTypes correctRoom = UsedRooms[Main.CurrentMap][(char)('A' + CurrentQuestion.CorrectAnswerIndex)]; - DyingPlayers = Main.AllAlivePlayerControls.Select(x => (ID: x.PlayerId, Room: x.GetPlainShipRoom())).Where(x => correctRoom == SystemTypes.Outside ? x.Room != null : x.Room == null || x.Room.RoomId != correctRoom).Select(x => x.ID).ToList(); + DyingPlayers = Main.AllAlivePlayerControls.Select(x => (ID: x.PlayerId, Room: x.GetPlainShipRoom())).Where(x => correctRoom == SystemTypes.Outside ? x.Room != null && x.Room.RoomId != SystemTypes.Hallway : x.Room == null || x.Room.RoomId != correctRoom).Select(x => x.ID).ToList(); QuestionTimeLimitEndTS = 0; Utils.NotifyRoles(); } diff --git a/GameMode/RoomRush.cs b/Gamemodes/RoomRush.cs similarity index 99% rename from GameMode/RoomRush.cs rename to Gamemodes/RoomRush.cs index dade5c72d..036a8c77b 100644 --- a/GameMode/RoomRush.cs +++ b/Gamemodes/RoomRush.cs @@ -5,10 +5,11 @@ using System.Diagnostics; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; +using EHR.Roles; using Hazel; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class RoomRush { diff --git a/GameMode/Snowdown.cs b/Gamemodes/Snowdown.cs similarity index 99% rename from GameMode/Snowdown.cs rename to Gamemodes/Snowdown.cs index f4d0a5de4..3e62077a5 100644 --- a/GameMode/Snowdown.cs +++ b/Gamemodes/Snowdown.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using EHR.Roles; using Hazel; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class Snowdown { diff --git a/GameMode/SoloPVP.cs b/Gamemodes/SoloPVP.cs similarity index 97% rename from GameMode/SoloPVP.cs rename to Gamemodes/SoloPVP.cs index e4a34fd61..1f475d4b9 100644 --- a/GameMode/SoloPVP.cs +++ b/Gamemodes/SoloPVP.cs @@ -6,7 +6,7 @@ using Hazel; using UnityEngine; using static EHR.RandomSpawn; -namespace EHR; +namespace EHR.Gamemodes; internal static class SoloPVP { @@ -78,6 +78,10 @@ internal static class SoloPVP SoloPVP_CanVent = new BooleanOptionItem(66_233_009, "SoloPVP_CanVent", true, TabGroup.GameSettings) .SetGameMode(CustomGameMode.SoloPVP) .SetColor(new Color32(245, 82, 82, byte.MaxValue)); + + SoloPVP_ChatDuringGame = new BooleanOptionItem(66_233_010, "FFA_ChatDuringGame", false, TabGroup.GameSettings) + .SetGameMode(CustomGameMode.SoloPVP) + .SetColor(new Color32(245, 82, 82, byte.MaxValue)); } public static void Init() @@ -346,6 +350,7 @@ internal static class SoloPVP private static OptionItem SoloPVP_ResurrectionWaitingTime; private static OptionItem SoloPVP_KillBonusMultiplier; private static OptionItem SoloPVP_CanVent; + public static OptionItem SoloPVP_ChatDuringGame; // ReSharper restore InconsistentNaming } diff --git a/GameMode/Speedrun.cs b/Gamemodes/Speedrun.cs similarity index 99% rename from GameMode/Speedrun.cs rename to Gamemodes/Speedrun.cs index 4086a1c3b..cbea47675 100644 --- a/GameMode/Speedrun.cs +++ b/Gamemodes/Speedrun.cs @@ -1,10 +1,11 @@ using System.Collections.Generic; using System.Linq; using EHR.Modules; +using EHR.Roles; using Hazel; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class Speedrun { diff --git a/GameMode/StopAndGo.cs b/Gamemodes/StopAndGo.cs similarity index 99% rename from GameMode/StopAndGo.cs rename to Gamemodes/StopAndGo.cs index 489d776f1..f84d4d53b 100644 --- a/GameMode/StopAndGo.cs +++ b/Gamemodes/StopAndGo.cs @@ -6,7 +6,7 @@ using EHR.Modules; using UnityEngine; using static EHR.Translator; -namespace EHR; +namespace EHR.Gamemodes; public class Counter(int totalGreenTime, int totalRedTime, long startTimeStamp, char symbol, bool isRed, Func randomRedTimeFunc, Func randomGreenTimeFunc, bool isYellow = false) { diff --git a/GameMode/TheMindGame.cs b/Gamemodes/TheMindGame.cs similarity index 99% rename from GameMode/TheMindGame.cs rename to Gamemodes/TheMindGame.cs index 893d3ee49..1adc74f80 100644 --- a/GameMode/TheMindGame.cs +++ b/Gamemodes/TheMindGame.cs @@ -3,11 +3,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using EHR.Modules; +using EHR.Roles; using Hazel; using InnerNet; using UnityEngine; -namespace EHR; +namespace EHR.Gamemodes; public static class TheMindGame { diff --git a/Main.cs b/Main.cs index a0b96a06b..0ba101a7b 100644 --- a/Main.cs +++ b/Main.cs @@ -14,7 +14,7 @@ using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using EHR; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using Il2CppInterop.Runtime.Injection; using UnityEngine; @@ -42,8 +42,8 @@ public class Main : BasePlugin private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d"; private const string DebugKeySalt = "59687b"; private const string PluginGuid = "com.gurge44.endlesshostroles"; - public const string PluginVersion = "7.0.2"; - public const string PluginDisplayVersion = "7.0.2"; + public const string PluginVersion = "7.1.0"; + public const string PluginDisplayVersion = "7.1.0"; public const bool TestBuild = false; public const string NeutralColor = "#ffab1b"; @@ -690,7 +690,7 @@ public class Main : BasePlugin { CustomRoles.Stained, "#e6bf91" }, { CustomRoles.Clumsy, "#b8b8b8" }, { CustomRoles.Mischievous, "#30221c" }, - { CustomRoles.Flashman, "#ff8400" }, + { CustomRoles.Flash, "#ff8400" }, { CustomRoles.Haste, "#f0ec22" }, { CustomRoles.Busy, "#32a852" }, { CustomRoles.Sleep, "#000000" }, @@ -754,7 +754,7 @@ public class Main : BasePlugin { CustomRoles.Underdog, "#ff1919" }, // Solo PVP - { CustomRoles.SoloPVP_Player, "#f55252" }, + { CustomRoles.Challenger, "#f55252" }, // FFA { CustomRoles.Killer, "#00ffff" }, // Stop And Go diff --git a/Modules/AutoHaunt.cs b/Modules/AutoHaunt.cs index 69960983c..3ec2df505 100644 --- a/Modules/AutoHaunt.cs +++ b/Modules/AutoHaunt.cs @@ -2,7 +2,8 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.GameMode.HideAndSeekRoles; +using EHR.Gamemodes; +using EHR.Roles; using UnityEngine; namespace EHR.Modules; diff --git a/Modules/BanManager.cs b/Modules/BanManager.cs index 676867b9e..0e6f32a47 100644 --- a/Modules/BanManager.cs +++ b/Modules/BanManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; @@ -55,54 +56,58 @@ public static class BanManager } Main.Instance.StartCoroutine(LoadEACList()); - - static System.Collections.IEnumerator LoadEACList() - { - EACList.Clear(); - - UnityWebRequest request = UnityWebRequest.Get("https://raw.githubusercontent.com/Gurge44/EndlessHostRoles/main/Resources/Config/EACList.txt"); - request.timeout = 5; - request.SetRequestHeader("User-Agent", $"{Main.ModName} v{Main.PluginVersion}"); - - yield return request.SendWebRequest(); - - if (request.result == UnityWebRequest.Result.Success && !string.IsNullOrWhiteSpace(request.downloadHandler.text)) - { - using StringReader reader = new(request.downloadHandler.text); - - while (reader.ReadLine() is { } line) - { - line = line.Trim(); - if (line.Length == 0 || line.StartsWith("#")) continue; - - EACList.Add(line); - } - - Logger.Info("EAC list loaded from GitHub", "BanManager"); - yield break; - } - - Logger.Warn($"Failed to load EAC list from GitHub, falling back to local copy: {request.error}", "BanManager"); - - // Fallback: embedded resource - Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EHR.Resources.Config.EACList.txt")!; - stream.Position = 0; - using StreamReader sr = new(stream, Encoding.UTF8); - - while (sr.ReadLine() is { } line) - { - line = line.Trim(); - if (line == "" || line.StartsWith("#")) continue; - - EACList.Add(line); - } - - Logger.Info("EAC list loaded from embedded resource", "BanManager"); - } } catch (Exception ex) { Logger.Exception(ex, "BanManager"); } } + public static IEnumerator LoadEACList(bool reload = false) + { + if (!reload) EACList.Clear(); + + UnityWebRequest request = UnityWebRequest.Get("https://raw.githubusercontent.com/Gurge44/EndlessHostRoles/main/Resources/Config/EACList.txt"); + request.timeout = 5; + request.SetRequestHeader("User-Agent", $"{Main.ModName} v{Main.PluginVersion}"); + + yield return request.SendWebRequest(); + + if (request.result == UnityWebRequest.Result.Success && !string.IsNullOrWhiteSpace(request.downloadHandler.text)) + { + if (reload) EACList.Clear(); + + using StringReader reader = new(request.downloadHandler.text); + + while (reader.ReadLine() is { } line) + { + line = line.Trim(); + if (line.Length == 0 || line.StartsWith("#")) continue; + + EACList.Add(line); + } + + Logger.Info("EAC list loaded from GitHub", "BanManager"); + yield break; + } + + if (reload) yield break; + + Logger.Warn($"Failed to load EAC list from GitHub, falling back to local copy: {request.error}", "BanManager"); + + // Fallback: embedded resource + Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EHR.Resources.Config.EACList.txt")!; + stream.Position = 0; + using StreamReader sr = new(stream, Encoding.UTF8); + + while (sr.ReadLine() is { } line) + { + line = line.Trim(); + if (line == "" || line.StartsWith("#")) continue; + + EACList.Add(line); + } + + Logger.Info("EAC list loaded from embedded resource", "BanManager"); + } + private static string GetResourcesTxt(string path) { Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path)!; diff --git a/Modules/Camouflague.cs b/Modules/Camouflage.cs similarity index 96% rename from Modules/Camouflague.cs rename to Modules/Camouflage.cs index fb717cd45..9c559a27a 100644 --- a/Modules/Camouflague.cs +++ b/Modules/Camouflage.cs @@ -1,10 +1,8 @@ using System.Collections; using System.Collections.Generic; using AmongUs.Data; -using EHR.AddOns.Common; -using EHR.Impostor; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using Hazel; namespace EHR; diff --git a/Modules/CustomNetObject.cs b/Modules/CustomNetObject.cs index 29cbea795..41703904f 100644 --- a/Modules/CustomNetObject.cs +++ b/Modules/CustomNetObject.cs @@ -2,14 +2,13 @@ using System; using System.Collections.Generic; using System.Linq; using AmongUs.InnerNet.GameDataMessages; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Gamemodes; using EHR.Modules; +using EHR.Roles; using HarmonyLib; using Hazel; using InnerNet; using UnityEngine; -using Tree = EHR.Crewmate.Tree; // Credit: https://github.com/Rabek009/MoreGamemodes/blob/e054eb498094dfca0a365fc6b6fea8d17f9974d7/Modules/AllObjects // Huge thanks to Rabek009 for this code! @@ -157,13 +156,23 @@ namespace EHR protected virtual void OnFixedUpdate() { - if (!AmongUsClient.Instance.AmHost) return; - if (AmongUsClient.Instance.AmClient) playerControl.NetTransform.SnapTo(Position, (ushort)(playerControl.NetTransform.lastSequenceId + 1U)); - ushort num = (ushort)(playerControl.NetTransform.lastSequenceId + 2U); - MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(playerControl.NetTransform.NetId, 21, SendOption.None); - NetHelpers.WriteVector2(Position, messageWriter); - messageWriter.Write(num); - AmongUsClient.Instance.FinishRpcImmediately(messageWriter); + try + { + if (!AmongUsClient.Instance.AmHost) return; + + if (AmongUsClient.Instance.AmClient) + { + try { playerControl.NetTransform.SnapTo(Position, (ushort)(playerControl.NetTransform.lastSequenceId + 1U)); } + catch { } + } + + ushort num = (ushort)(playerControl.NetTransform.lastSequenceId + 2U); + MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(playerControl.NetTransform.NetId, 21, SendOption.None); + NetHelpers.WriteVector2(Position, messageWriter); + messageWriter.Write(num); + AmongUsClient.Instance.FinishRpcImmediately(messageWriter); + } + catch { } } protected void CreateNetObject(string sprite, Vector2 position) @@ -887,7 +896,7 @@ namespace EHR { public FallenTree(Vector2 position) { - CreateNetObject(Tree.FallenSprite, position); + CreateNetObject(EHR.Roles.Tree.FallenSprite, position); } } diff --git a/Modules/CustomRoleSelector.cs b/Modules/CustomRoleSelector.cs index 7daa80398..bdcf6819d 100644 --- a/Modules/CustomRoleSelector.cs +++ b/Modules/CustomRoleSelector.cs @@ -2,9 +2,8 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.Impostor; -using EHR.Neutral; +using EHR.Gamemodes; +using EHR.Roles; namespace EHR.Modules; @@ -23,7 +22,7 @@ internal static class CustomRoleSelector public static readonly Dictionary GameModeRoles = new() { - { CustomGameMode.SoloPVP, CustomRoles.SoloPVP_Player }, + { CustomGameMode.SoloPVP, CustomRoles.Challenger }, { CustomGameMode.FFA, CustomRoles.Killer }, { CustomGameMode.StopAndGo, CustomRoles.Tasker }, { CustomGameMode.HotPotato, CustomRoles.Potato }, @@ -75,6 +74,7 @@ internal static class CustomRoleSelector var readyNeutralKillingNum = 0; var readyMadmateNum = 0; var readyCovenNum = 0; + var readyCrewmateNum = 0; List finalRolesList = []; @@ -309,7 +309,7 @@ internal static class CustomRoleSelector Dictionary preSetRoles = Main.SetRoles.AddRange(ChatCommands.DraftResult, false); - if (ChatCommands.DraftResult.Count > 0 && ChatCommands.DraftResult.Count + Main.SetRoles.Count >= allPlayers.Count && preSetRoles.All(x => x.Value.GetCountTypes() is CountTypes.Crew or CountTypes.None or CountTypes.OutOfGame)) + if (ChatCommands.DraftResult.Count > 0 && ChatCommands.DraftResult.Count + preSetRoles.Count >= allPlayers.Count && preSetRoles.All(x => x.Value.GetCountTypes() is CountTypes.Crew or CountTypes.None or CountTypes.OutOfGame)) { byte removeKey = ChatCommands.DraftResult.Keys.RandomElement(); ChatCommands.DraftResult.Remove(removeKey); @@ -360,527 +360,27 @@ internal static class CustomRoleSelector roles.Values.Do(l => l.DoIf(x => x.AssignedCount >= x.MaxCount, x => l.Remove(x), false)); - RoleAssignInfo[] imps; - RoleAssignInfo[] nnKs = []; - RoleAssignInfo[] nKs = []; - RoleAssignInfo[] mads = []; - RoleAssignInfo[] coven = []; - RoleAssignInfo[] crews = []; - - // Impostor Roles + AssignRoles(RoleAssignType.Impostor, optImpNum, ref readyImpNum, ref readyRoleNum, playerCount, finalRolesList, roles); + AssignRoles(RoleAssignType.NonKillingNeutral, nnkNum, ref readyNonNeutralKillingNum, ref readyRoleNum, playerCount, finalRolesList, roles); + AssignRoles(RoleAssignType.NeutralKilling, nkNum, ref readyNeutralKillingNum, ref readyRoleNum, playerCount, finalRolesList, roles); + AssignRoles(RoleAssignType.Madmate, madmateNum, ref readyMadmateNum, ref readyRoleNum, playerCount, finalRolesList, roles); + AssignRoles(RoleAssignType.Coven, numCovens, ref readyCovenNum, ref readyRoleNum, playerCount, finalRolesList, roles); + AssignRoles(RoleAssignType.Crewmate, playerCount - readyRoleNum, ref readyCrewmateNum, ref readyRoleNum, playerCount, finalRolesList, roles); + + if (readyRoleNum < playerCount && subCategoryLimits.Count > 0) { - List alwaysImpRoles = []; - List chanceImpRoles = []; + const RoleAssignType redoType = RoleAssignType.Crewmate; + roles[redoType] = allRoles[redoType]; - for (var i = 0; i < roles[RoleAssignType.Impostor].Count; i++) - { - RoleAssignInfo item = roles[RoleAssignType.Impostor][i]; + subCategoryLimits = Options.RoleSubCategoryLimits + .Where(x => x.Key.GetTabFromOptionType() == TabGroup.CrewmateRoles && x.Value[0].GetBool()) + .ToDictionary(x => x.Key, x => x.Value[2].GetInt()); - if (item.SpawnChance == 100) - { - for (var j = 0; j < item.MaxCount - item.AssignedCount; j++) - alwaysImpRoles.Add(item.Role); - } - else - { - for (var j = 0; j < item.SpawnChance / 5; j++) - { - for (var k = 0; k < item.MaxCount - item.AssignedCount; k++) - chanceImpRoles.Add(item.Role); - } - } - } - - RoleAssignInfo[] impRoleCounts = alwaysImpRoles.Distinct().Select(GetAssignInfo).Concat(chanceImpRoles.Distinct().Select(GetAssignInfo)).ToArray(); - imps = impRoleCounts; - - // Assign roles set to ALWAYS - if (readyImpNum < optImpNum) - { - while (alwaysImpRoles.Count > 0) - { - CustomRoles selected = alwaysImpRoles.RandomElement(); - RoleAssignInfo info = impRoleCounts.FirstOrDefault(x => x.Role == selected); - - if (info.AssignedCount >= info.MaxCount) - { - alwaysImpRoles.Remove(selected); - continue; - } - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyImpNum++; - - imps = impRoleCounts; - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyImpNum >= optImpNum) break; - } - } - - // Assign other roles when needed - if (readyRoleNum < playerCount && readyImpNum < optImpNum) - { - while (chanceImpRoles.Count > 0) - { - CustomRoles selected = chanceImpRoles.RandomElement(); - RoleAssignInfo info = impRoleCounts.FirstOrDefault(x => x.Role == selected); - for (var i = 0; i < info.SpawnChance / 5; i++) chanceImpRoles.Remove(selected); - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyImpNum++; - - imps = impRoleCounts; - - if (info.AssignedCount >= info.MaxCount) - { - while (chanceImpRoles.Contains(selected)) - chanceImpRoles.Remove(selected); - } - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyImpNum >= optImpNum) break; - } - } + ApplySubCategoryLimits(redoType, subCategoryLimits); + roles[redoType].DoIf(x => x.AssignedCount >= x.MaxCount, x => roles[redoType].Remove(x), false); + AssignRoles(RoleAssignType.Crewmate, playerCount - readyRoleNum, ref readyCrewmateNum, ref readyRoleNum, playerCount, finalRolesList, roles); } - // Neutral Roles - { - // Neutral Non-Killing Roles - { - List alwaysNNKRoles = []; - List chanceNNKRoles = []; - - for (var i = 0; i < roles[RoleAssignType.NonKillingNeutral].Count; i++) - { - RoleAssignInfo item = roles[RoleAssignType.NonKillingNeutral][i]; - - if (item.SpawnChance == 100) - { - for (var j = 0; j < item.MaxCount - item.AssignedCount; j++) - alwaysNNKRoles.Add(item.Role); - } - else - { - for (var j = 0; j < item.SpawnChance / 5; j++) - { - for (var k = 0; k < item.MaxCount - item.AssignedCount; k++) - chanceNNKRoles.Add(item.Role); - } - } - } - - RoleAssignInfo[] nnkRoleCounts = alwaysNNKRoles.Distinct().Select(GetAssignInfo).Concat(chanceNNKRoles.Distinct().Select(GetAssignInfo)).ToArray(); - nnKs = nnkRoleCounts; - - // Assign roles set to ALWAYS - if (readyNonNeutralKillingNum < nnkNum) - { - while (alwaysNNKRoles.Count > 0 && nnkNum > 0) - { - CustomRoles selected = alwaysNNKRoles.RandomElement(); - RoleAssignInfo info = nnkRoleCounts.FirstOrDefault(x => x.Role == selected); - - if (info.AssignedCount >= info.MaxCount) - { - alwaysNNKRoles.Remove(selected); - continue; - } - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyNonNeutralKillingNum++; - - nnKs = nnkRoleCounts; - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyNonNeutralKillingNum >= nnkNum) break; - } - } - - // Assign other roles when needed - if (readyRoleNum < playerCount && readyNonNeutralKillingNum < nnkNum) - { - while (chanceNNKRoles.Count > 0 && nnkNum > 0) - { - CustomRoles selected = chanceNNKRoles.RandomElement(); - RoleAssignInfo info = nnkRoleCounts.FirstOrDefault(x => x.Role == selected); - for (var i = 0; i < info.SpawnChance / 5; i++) chanceNNKRoles.Remove(selected); - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyNonNeutralKillingNum++; - - nnKs = nnkRoleCounts; - - if (info.AssignedCount >= info.MaxCount) - { - while (chanceNNKRoles.Contains(selected)) - chanceNNKRoles.Remove(selected); - } - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyNonNeutralKillingNum >= nnkNum) break; - } - } - } - - // Neutral Killing Roles - { - List alwaysNKRoles = []; - List chanceNKRoles = []; - - for (var i = 0; i < roles[RoleAssignType.NeutralKilling].Count; i++) - { - RoleAssignInfo item = roles[RoleAssignType.NeutralKilling][i]; - - if (item.SpawnChance == 100) - { - for (var j = 0; j < item.MaxCount - item.AssignedCount; j++) - alwaysNKRoles.Add(item.Role); - } - else - { - for (var j = 0; j < item.SpawnChance / 5; j++) - { - for (var k = 0; k < item.MaxCount - item.AssignedCount; k++) - chanceNKRoles.Add(item.Role); - } - } - } - - RoleAssignInfo[] nkRoleCounts = alwaysNKRoles.Distinct().Select(GetAssignInfo).Concat(chanceNKRoles.Distinct().Select(GetAssignInfo)).ToArray(); - nKs = nkRoleCounts; - - // Assign roles set to ALWAYS - if (readyNeutralKillingNum < nkNum) - { - while (alwaysNKRoles.Count > 0 && nkNum > 0) - { - CustomRoles selected = alwaysNKRoles.RandomElement(); - RoleAssignInfo info = nkRoleCounts.FirstOrDefault(x => x.Role == selected); - - if (info.AssignedCount >= info.MaxCount) - { - alwaysNKRoles.Remove(selected); - continue; - } - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyNeutralKillingNum++; - - nKs = nkRoleCounts; - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyNeutralKillingNum >= nkNum) break; - } - } - - // Assign other roles when needed - if (readyRoleNum < playerCount && readyNeutralKillingNum < nkNum) - { - while (chanceNKRoles.Count > 0 && nkNum > 0) - { - CustomRoles selected = chanceNKRoles.RandomElement(); - RoleAssignInfo info = nkRoleCounts.FirstOrDefault(x => x.Role == selected); - for (var i = 0; i < info.SpawnChance / 5; i++) chanceNKRoles.Remove(selected); - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyNeutralKillingNum++; - - nKs = nkRoleCounts; - - if (info.AssignedCount >= info.MaxCount) - { - while (chanceNKRoles.Contains(selected)) - chanceNKRoles.Remove(selected); - } - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyNeutralKillingNum >= nkNum) break; - } - } - } - } - - // Madmate Roles - { - List alwaysMadmateRoles = []; - List chanceMadmateRoles = []; - - for (var i = 0; i < roles[RoleAssignType.Madmate].Count; i++) - { - RoleAssignInfo item = roles[RoleAssignType.Madmate][i]; - - if (item.SpawnChance == 100) - { - for (var j = 0; j < item.MaxCount - item.AssignedCount; j++) - alwaysMadmateRoles.Add(item.Role); - } - else - { - for (var j = 0; j < item.SpawnChance / 5; j++) - { - for (var k = 0; k < item.MaxCount - item.AssignedCount; k++) - chanceMadmateRoles.Add(item.Role); - } - } - } - - RoleAssignInfo[] madRoleCounts = alwaysMadmateRoles.Distinct().Select(GetAssignInfo).Concat(chanceMadmateRoles.Distinct().Select(GetAssignInfo)).ToArray(); - mads = madRoleCounts; - - // Assign roles set to ALWAYS - if (readyRoleNum < playerCount && readyMadmateNum < madmateNum) - { - while (alwaysMadmateRoles.Count > 0) - { - CustomRoles selected = alwaysMadmateRoles.RandomElement(); - RoleAssignInfo info = madRoleCounts.FirstOrDefault(x => x.Role == selected); - - if (info.AssignedCount >= info.MaxCount) - { - alwaysMadmateRoles.Remove(selected); - continue; - } - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyMadmateNum++; - - mads = madRoleCounts; - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyMadmateNum >= madmateNum) break; - } - } - - // Assign other roles when needed - if (readyRoleNum < playerCount && readyMadmateNum < madmateNum) - { - while (chanceMadmateRoles.Count > 0) - { - CustomRoles selected = chanceMadmateRoles.RandomElement(); - RoleAssignInfo info = madRoleCounts.FirstOrDefault(x => x.Role == selected); - for (var i = 0; i < info.SpawnChance / 5; i++) chanceMadmateRoles.Remove(selected); - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyMadmateNum++; - - mads = madRoleCounts; - - if (info.AssignedCount >= info.MaxCount) - { - while (chanceMadmateRoles.Contains(selected)) - chanceMadmateRoles.Remove(selected); - } - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyMadmateNum >= madmateNum) break; - } - } - } - - // Coven Roles - { - List alwaysCovenRoles = []; - List chanceCovenRoles = []; - - for (var i = 0; i < roles[RoleAssignType.Coven].Count; i++) - { - RoleAssignInfo item = roles[RoleAssignType.Coven][i]; - - if (item.SpawnChance == 100) - { - for (var j = 0; j < item.MaxCount - item.AssignedCount; j++) - alwaysCovenRoles.Add(item.Role); - } - else - { - for (var j = 0; j < item.SpawnChance / 5; j++) - { - for (var k = 0; k < item.MaxCount - item.AssignedCount; k++) - chanceCovenRoles.Add(item.Role); - } - } - } - - RoleAssignInfo[] covenRoleCounts = alwaysCovenRoles.Distinct().Select(GetAssignInfo).Concat(chanceCovenRoles.Distinct().Select(GetAssignInfo)).ToArray(); - coven = covenRoleCounts; - - // Assign roles set to ALWAYS - if (readyCovenNum < numCovens) - { - while (alwaysCovenRoles.Count > 0) - { - CustomRoles selected = alwaysCovenRoles.RandomElement(); - RoleAssignInfo info = covenRoleCounts.FirstOrDefault(x => x.Role == selected); - - if (info.AssignedCount >= info.MaxCount) - { - alwaysCovenRoles.Remove(selected); - continue; - } - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyCovenNum++; - - coven = covenRoleCounts; - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyCovenNum >= numCovens) break; - } - } - - // Assign other roles when needed - if (readyRoleNum < playerCount && readyCovenNum < numCovens) - { - while (chanceCovenRoles.Count > 0) - { - CustomRoles selected = chanceCovenRoles.RandomElement(); - RoleAssignInfo info = covenRoleCounts.FirstOrDefault(x => x.Role == selected); - for (var i = 0; i < info.SpawnChance / 5; i++) chanceCovenRoles.Remove(selected); - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - readyCovenNum++; - - coven = covenRoleCounts; - - if (info.AssignedCount >= info.MaxCount) - { - while (chanceCovenRoles.Contains(selected)) - chanceCovenRoles.Remove(selected); - } - - if (readyRoleNum >= playerCount) goto EndOfAssign; - if (readyCovenNum >= numCovens) break; - } - } - } - - // Crewmate Roles - { - var attempts = 0; - - Crew: - - if (attempts++ > 10) goto EndOfAssign; - - List alwaysCrewRoles = []; - List chanceCrewRoles = []; - - for (var i = 0; i < roles[RoleAssignType.Crewmate].Count; i++) - { - RoleAssignInfo item = roles[RoleAssignType.Crewmate][i]; - - if (item.SpawnChance == 100) - { - for (var j = 0; j < item.MaxCount - item.AssignedCount; j++) - alwaysCrewRoles.Add(item.Role); - } - else - { - for (var j = 0; j < item.SpawnChance / 5; j++) - { - for (var k = 0; k < item.MaxCount - item.AssignedCount; k++) - chanceCrewRoles.Add(item.Role); - } - } - } - - RoleAssignInfo[] crewRoleCounts = alwaysCrewRoles.Distinct().Select(GetAssignInfo).Concat(chanceCrewRoles.Distinct().Select(GetAssignInfo)).ToArray(); - crews = crewRoleCounts; - - // Assign roles set to ALWAYS - if (readyRoleNum < playerCount) - { - while (alwaysCrewRoles.Count > 0) - { - CustomRoles selected = alwaysCrewRoles.RandomElement(); - RoleAssignInfo info = crewRoleCounts.FirstOrDefault(x => x.Role == selected); - - if (info.AssignedCount >= info.MaxCount) - { - alwaysCrewRoles.Remove(selected); - continue; - } - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - - crews = crewRoleCounts; - - if (readyRoleNum >= playerCount) goto EndOfAssign; - } - } - - // Assign other roles when needed - if (readyRoleNum < playerCount) - { - while (chanceCrewRoles.Count > 0) - { - CustomRoles selected = chanceCrewRoles.RandomElement(); - RoleAssignInfo info = crewRoleCounts.FirstOrDefault(x => x.Role == selected); - for (var i = 0; i < info.SpawnChance / 5; i++) chanceCrewRoles.Remove(selected); - - finalRolesList.Add(selected); - info.AssignedCount++; - readyRoleNum++; - - crews = crewRoleCounts; - - if (info.AssignedCount >= info.MaxCount) - { - while (chanceCrewRoles.Contains(selected)) - chanceCrewRoles.Remove(selected); - } - - if (readyRoleNum >= playerCount) goto EndOfAssign; - } - } - - if (readyRoleNum < playerCount && subCategoryLimits.Count > 0) - { - const RoleAssignType redoType = RoleAssignType.Crewmate; - roles[redoType] = allRoles[redoType]; - - subCategoryLimits = Options.RoleSubCategoryLimits - .Where(x => x.Key.GetTabFromOptionType() == TabGroup.CrewmateRoles && x.Value[0].GetBool()) - .ToDictionary(x => x.Key, x => x.Value[2].GetInt()); - - ApplySubCategoryLimits(redoType, subCategoryLimits); - roles[redoType].DoIf(x => x.AssignedCount >= x.MaxCount, x => roles[redoType].Remove(x), false); - goto Crew; - } - } - - EndOfAssign: - - if (imps.Length > 0) Logger.Info(string.Join(", ", imps.Select(x => $"{x.Role} - {x.AssignedCount}/{x.MaxCount} ({x.SpawnChance}%)")), "ImpRoleResult"); - if (nnKs.Length > 0) Logger.Info(string.Join(", ", nnKs.Select(x => $"{x.Role} - {x.AssignedCount}/{x.MaxCount} ({x.SpawnChance}%)")), "NNKRoleResult"); - if (nKs.Length > 0) Logger.Info(string.Join(", ", nKs.Select(x => $"{x.Role} - {x.AssignedCount}/{x.MaxCount} ({x.SpawnChance}%)")), "NKRoleResult"); - if (crews.Length > 0) Logger.Info(string.Join(", ", crews.Select(x => $"{x.Role} - {x.AssignedCount}/{x.MaxCount} ({x.SpawnChance}%)")), "CrewRoleResult"); - if (mads.Length > 0) Logger.Info(string.Join(", ", mads.Select(x => $"{x.Role} - {x.AssignedCount}/{x.MaxCount} ({x.SpawnChance}%)")), "MadRoleResult"); - if (coven.Length > 0) Logger.Info(string.Join(", ", coven.Select(x => $"{x.Role} - {x.AssignedCount}/{x.MaxCount} ({x.SpawnChance}%)")), "CovenRoleResult"); - if (rd.Next(0, 100) < Jester.SunnyboyChance.GetInt() && finalRolesList.Remove(CustomRoles.Jester)) finalRolesList.Add(CustomRoles.Sunnyboy); if (rd.Next(0, 100) < Arrogance.BardChance.GetInt() && finalRolesList.Remove(CustomRoles.Arrogance)) finalRolesList.Add(CustomRoles.Bard); if (rd.Next(0, 100) < Bomber.NukerChance.GetInt() && finalRolesList.Remove(CustomRoles.Bomber)) finalRolesList.Add(CustomRoles.Nuker); @@ -906,8 +406,6 @@ internal static class CustomRoleSelector } } - RoleAssignInfo GetAssignInfo(CustomRoles role) => roles.Values.FirstOrDefault(x => x.Any(y => y.Role == role))?.FirstOrDefault(x => x.Role == role); - void ApplySubCategoryLimits(RoleAssignType type, Dictionary dictionary) => roles[type] = roles[type] .Shuffle() @@ -921,7 +419,9 @@ internal static class CustomRoleSelector .GroupBy(x => x.Info.OptionType) .Select(x => (Grouping: x, x.FirstOrDefault().Limit)) .SelectMany(x => x.Limit.Exists ? x.Grouping.Take(x.Limit.Value) : x.Grouping) - .OrderByDescending(x => x.Limit is { Exists: true, Value: > 0 }) + .Shuffle() + .OrderBy(x => x.Info.SpawnChance != 100) + .ThenByDescending(x => x.Limit is { Exists: true, Value: > 0 }) .Take(type switch { RoleAssignType.Impostor => optImpNum, @@ -934,6 +434,76 @@ internal static class CustomRoleSelector }) .Select(x => x.Info) .ToList(); + + static RoleAssignInfo PickWeighted(List pool, IRandom rng) + { + int totalWeight = 0; + + foreach (var info in pool) + totalWeight += info.SpawnChance * (info.MaxCount - info.AssignedCount); + + if (totalWeight <= 0) return null; + + int roll = rng.Next(totalWeight); + int cumulative = 0; + + foreach (var info in pool) + { + cumulative += info.SpawnChance * (info.MaxCount - info.AssignedCount); + if (roll < cumulative) return info; + } + + return null; + } + + void AssignRoles( + RoleAssignType type, + int targetCount, + ref int readyCategoryCount, + ref int readyRoleNumInner, + int playerCountInner, + List finalRoles, + Dictionary> rolesInner + ) + { + if (targetCount <= 0) return; + + var list = rolesInner[type]; + + // 1️⃣ Assign ALWAYS roles first (SpawnChance == 100) + for (int i = 0; i < list.Count && readyCategoryCount < targetCount; i++) + { + var info = list[i]; + if (info.SpawnChance != 100) continue; + + while (info.AssignedCount < info.MaxCount && + readyCategoryCount < targetCount && + readyRoleNumInner < playerCountInner) + { + finalRoles.Add(info.Role); + info.AssignedCount++; + readyCategoryCount++; + readyRoleNumInner++; + } + } + + // 2️⃣ Assign weighted roles + while (readyCategoryCount < targetCount && readyRoleNumInner < playerCountInner) + { + // Build current valid pool + List pool = list.FindAll(info => info.SpawnChance > 0 && info.AssignedCount < info.MaxCount); + + if (pool.Count == 0) break; + + var chosen = PickWeighted(pool, rd); + if (chosen == null) break; + + finalRoles.Add(chosen.Role); + chosen.AssignedCount++; + readyCategoryCount++; + readyRoleNumInner++; + } + } } public static void CalculateVanillaRoleCount() @@ -1031,4 +601,5 @@ internal static class CustomRoleSelector public int AssignedCount { get; set; } public RoleOptionType OptionType { get; } = role.GetRoleOptionType(); } -} \ No newline at end of file + +} diff --git a/Modules/CustomRolesHelper.cs b/Modules/CustomRolesHelper.cs index 1435c54eb..c2546ad91 100644 --- a/Modules/CustomRolesHelper.cs +++ b/Modules/CustomRolesHelper.cs @@ -3,12 +3,10 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using AmongUs.GameOptions; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using UnityEngine; +using EHR.Gamemodes; namespace EHR; @@ -61,7 +59,7 @@ internal static class CustomRolesHelper public static bool IsForOtherGameMode(this CustomRoles role) { return CustomHnS.AllHnSRoles.Contains(role) || role is - CustomRoles.SoloPVP_Player or + CustomRoles.Challenger or CustomRoles.Killer or CustomRoles.Tasker or CustomRoles.Potato or @@ -461,7 +459,7 @@ internal static class CustomRolesHelper return role switch { // Solo PVP - CustomRoles.SoloPVP_Player => RoleTypes.Impostor, + CustomRoles.Challenger => RoleTypes.Impostor, // FFA CustomRoles.Killer => RoleTypes.Impostor, // Capture The Flag @@ -977,7 +975,7 @@ internal static class CustomRolesHelper return role is CustomRoles.KOTZPlayer or CustomRoles.CTFPlayer or - CustomRoles.SoloPVP_Player or + CustomRoles.Challenger or CustomRoles.BedWarsPlayer or CustomRoles.Weatherman or CustomRoles.Altruist or @@ -1129,6 +1127,7 @@ internal static class CustomRolesHelper CustomRoles.Commited when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) => false, CustomRoles.Underdog when pc.Is(CustomRoles.Mare) => false, CustomRoles.Shy when Options.DisableWhisperCommand.GetBool() => false, + CustomRoles.Listener when Options.DisableWhisperCommand.GetBool() => false, CustomRoles.Blocked when !pc.CanUseVent() => false, CustomRoles.Aide when pc.IsMadmate() || pc.Is(CustomRoles.Saboteur) => false, CustomRoles.Sleuth when pc.GetCustomRole() is CustomRoles.NecroGuesser or CustomRoles.Imitator or CustomRoles.Forensic => false, @@ -1158,7 +1157,7 @@ internal static class CustomRolesHelper CustomRoles.Torch when !pc.IsCrewmate() || pc.Is(CustomRoles.Bewilder) || pc.Is(CustomRoles.Sunglasses) || pc.Is(CustomRoles.GuardianAngelEHR) => false, CustomRoles.Bewilder when pc.Is(CustomRoles.Torch) || pc.Is(CustomRoles.GuardianAngelEHR) || pc.Is(CustomRoles.Sunglasses) => false, CustomRoles.Dynamo when pc.Is(CustomRoles.Spurt) || pc.GetCustomRole() is CustomRoles.Tank or CustomRoles.Ankylosaurus => false, - CustomRoles.Spurt when pc.GetCustomSubRoles().Any(x => x is CustomRoles.Dynamo or CustomRoles.Swiftclaw or CustomRoles.Giant or CustomRoles.Flashman) || pc.Is(CustomRoles.Ankylosaurus) => false, + CustomRoles.Spurt when pc.GetCustomSubRoles().Any(x => x is CustomRoles.Dynamo or CustomRoles.Swiftclaw or CustomRoles.Giant or CustomRoles.Flash) || pc.Is(CustomRoles.Ankylosaurus) => false, CustomRoles.Sunglasses when pc.Is(CustomRoles.Torch) || pc.Is(CustomRoles.GuardianAngelEHR) || pc.Is(CustomRoles.Bewilder) => false, CustomRoles.Guesser when pc.GetCustomRole() is CustomRoles.EvilGuesser or CustomRoles.NiceGuesser or CustomRoles.Doomsayer or CustomRoles.CopyCat => false, CustomRoles.Madmate when !pc.CanBeMadmate() || pc.Is(CustomRoles.Egoist) || pc.Is(CustomRoles.Rascal) => false, @@ -1167,22 +1166,15 @@ internal static class CustomRolesHelper CustomRoles.Egoist when !pc.IsImpostor() => false, CustomRoles.Damocles when pc.GetCustomRole() is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.Mercenary or CustomRoles.Cantankerous => false, CustomRoles.Damocles when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) => false, - CustomRoles.Flashman when pc.Is(CustomRoles.Swiftclaw) || pc.Is(CustomRoles.Giant) || pc.Is(CustomRoles.Spurt) || pc.GetCustomRole() is CustomRoles.Tank or CustomRoles.Zombie => false, - CustomRoles.Giant when pc.Is(CustomRoles.Flashman) || pc.Is(CustomRoles.Spurt) || pc.Is(CustomRoles.RoomRusher) => false, + CustomRoles.Flash when pc.Is(CustomRoles.Swiftclaw) || pc.Is(CustomRoles.Giant) || pc.Is(CustomRoles.Spurt) || pc.GetCustomRole() is CustomRoles.Tank or CustomRoles.Zombie => false, + CustomRoles.Giant when pc.Is(CustomRoles.Flash) || pc.Is(CustomRoles.Spurt) || pc.Is(CustomRoles.RoomRusher) => false, CustomRoles.Necroview when pc.Is(CustomRoles.Visionary) => false, CustomRoles.Mimic when pc.Is(CustomRoles.Nemesis) => false, CustomRoles.Rascal when !pc.IsCrewmate() => false, CustomRoles.LazyGuy when pc.GetCustomRole().IsAdditionRole() => false, CustomRoles.Stealer when pc.Is(CustomRoles.Vindicator) => false, CustomRoles.Bloodlust when !pc.GetCustomRole().IsCrewmate() || pc.GetCustomRole().IsTaskBasedCrewmate() || pc.GetCustomRole() is CustomRoles.Medic => false, - CustomRoles.Mare when pc.Is(CustomRoles.Inhibitor) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Saboteur) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Swift) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Nemesis) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Sniper) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Fireworker) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Swooper) => false, - CustomRoles.Mare when pc.Is(CustomRoles.Vampire) => false, + CustomRoles.Mare when pc.GetCustomRole() is CustomRoles.Inhibitor or CustomRoles.Saboteur or CustomRoles.Swift or CustomRoles.Nemesis or CustomRoles.Sniper or CustomRoles.Fireworker or CustomRoles.Swooper or CustomRoles.Vampire => false, CustomRoles.Torch when pc.GetCustomRole() is CustomRoles.Lighter or CustomRoles.Ignitor or CustomRoles.Investigator or CustomRoles.Eclipse or CustomRoles.Decryptor => false, CustomRoles.Bewilder when pc.GetCustomRole() is CustomRoles.Lighter or CustomRoles.Ignitor or CustomRoles.Investigator or CustomRoles.Eclipse or CustomRoles.Decryptor => false, CustomRoles.Sunglasses when pc.GetCustomRole() is CustomRoles.Lighter or CustomRoles.Ignitor or CustomRoles.Investigator or CustomRoles.Eclipse or CustomRoles.Decryptor => false, @@ -1204,14 +1196,7 @@ internal static class CustomRolesHelper CustomRoles.Bait when pc.Is(CustomRoles.Beartrap) => false, CustomRoles.Beartrap when pc.Is(CustomRoles.Bait) => false, CustomRoles.Schizophrenic when pc.Is(CustomRoles.Dictator) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Swooper) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Vampire) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Scavenger) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Puppeteer) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Warlock) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Consigliere) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Witch) => false, - CustomRoles.Swift when pc.Is(CustomRoles.Nemesis) => false, + CustomRoles.Swift when pc.GetCustomRole() is CustomRoles.Swooper or CustomRoles.Vampire or CustomRoles.Scavenger or CustomRoles.Puppeteer or CustomRoles.Warlock or CustomRoles.Consigliere or CustomRoles.Witch or CustomRoles.Nemesis => false, CustomRoles.Reach when pc.GetCustomRole() is CustomRoles.Mafioso or CustomRoles.Evolver or CustomRoles.Berserker => false, CustomRoles.Beartrap when pc.Is(CustomRoles.GuardianAngelEHR) => false, CustomRoles.Reach when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) => false, @@ -1219,7 +1204,7 @@ internal static class CustomRolesHelper CustomRoles.Haste when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) || !pc.CanUseImpostorVentButton() || pc.Is(CustomRoles.Glitch) => false, CustomRoles.Diseased when pc.Is(CustomRoles.Antidote) => false, CustomRoles.Antidote when pc.Is(CustomRoles.Diseased) => false, - CustomRoles.Flashman or CustomRoles.Giant when pc.GetCustomRole() is CustomRoles.Swooper or CustomRoles.Wraith or CustomRoles.Chameleon or CustomRoles.Alchemist or CustomRoles.Ankylosaurus => false, + CustomRoles.Flash or CustomRoles.Giant when pc.GetCustomRole() is CustomRoles.Swooper or CustomRoles.Wraith or CustomRoles.Chameleon or CustomRoles.Alchemist or CustomRoles.Ankylosaurus or CustomRoles.Swiftclaw => false, CustomRoles.Bait when pc.Is(CustomRoles.Disregarded) => false, CustomRoles.Busy when !pc.GetTaskState().HasTasks => false, CustomRoles.Truant when pc.Is(CustomRoles.SoulHunter) => false, @@ -1235,11 +1220,13 @@ internal static class CustomRolesHelper CustomRoles.DoubleShot when pc.Is(CustomRoles.CopyCat) => false, CustomRoles.Tiebreaker when pc.Is(CustomRoles.Dictator) => false, CustomRoles.Lucky when pc.Is(CustomRoles.Luckey) => false, - CustomRoles.Unlucky when pc.GetCustomRole() is CustomRoles.Luckey or CustomRoles.Tank => false, + CustomRoles.Unlucky when pc.GetCustomRole() is CustomRoles.Luckey or CustomRoles.Tank or CustomRoles.Vector or CustomRoles.Addict or CustomRoles.Lurker => false, CustomRoles.Unlucky when pc.Is(CustomRoles.Lucky) => false, CustomRoles.Lucky when pc.Is(CustomRoles.Unlucky) => false, CustomRoles.Fool when pc.GetCustomRole() is CustomRoles.Mechanic or CustomRoles.GuardianAngelEHR or CustomRoles.Technician => false, CustomRoles.Coroner when pc.Is(CustomRoles.Oblivious) => false, + CustomRoles.Fragile when pc.Is(CustomRoles.Detour) => false, + CustomRoles.Physicist when pc.GetCustomRole() is CustomRoles.Tracefinder or CustomRoles.Doctor => false, CustomRoles.DoubleShot when pc.GetCustomRole() is not CustomRoles.EvilGuesser and not CustomRoles.NiceGuesser and not CustomRoles.Augur && !Options.GuesserMode.GetBool() => false, CustomRoles.DoubleShot when !pc.Is(CustomRoles.Guesser) && !pc.Is(CustomRoles.EvilGuesser) && pc.Is(CustomRoleTypes.Impostor) && !Options.ImpostorsCanGuess.GetBool() => false, CustomRoles.DoubleShot when !pc.Is(CustomRoles.Guesser) && !pc.Is(CustomRoles.NiceGuesser) && pc.Is(CustomRoleTypes.Crewmate) && !Options.CrewmatesCanGuess.GetBool() => false, @@ -2038,3 +2025,5 @@ public enum CountTypes Coven } + + diff --git a/Modules/CustomRpcSender.cs b/Modules/CustomRpcSender.cs index 45e82f1b1..e93e1c5c3 100644 --- a/Modules/CustomRpcSender.cs +++ b/Modules/CustomRpcSender.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using Hazel; using Il2CppInterop.Runtime.InteropTypes.Arrays; using InnerNet; diff --git a/Modules/DisableDevice.cs b/Modules/DisableDevice.cs index 9e7330c1c..7b8f26f01 100644 --- a/Modules/DisableDevice.cs +++ b/Modules/DisableDevice.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using Hazel; using Il2CppInterop.Runtime.InteropTypes.Arrays; diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 8a0086c43..29954e6e4 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -5,20 +5,15 @@ using System.Diagnostics; using System.Linq; using System.Reflection; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.Impostor; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using Hazel; using Il2CppInterop.Runtime.InteropTypes.Arrays; using InnerNet; using UnityEngine; using static EHR.Translator; using static EHR.Utils; +using EHR.Gamemodes; namespace EHR; @@ -1404,7 +1399,7 @@ internal static class ExtendedPlayerControl return pc.GetCustomRole() switch { // Solo PVP - CustomRoles.SoloPVP_Player => pc.SoloAlive(), + CustomRoles.Challenger => pc.SoloAlive(), // FFA CustomRoles.Killer => pc.IsAlive(), // Stop And Go @@ -1455,7 +1450,7 @@ internal static class ExtendedPlayerControl CustomGameMode.Snowdown => true, CustomGameMode.Deathrace => Deathrace.CanUseVent(pc, pc.GetClosestVent().Id), - CustomGameMode.Standard when CopyCat.Instances.Any(x => x.CopyCatPC.PlayerId == pc.PlayerId) => true, + CustomGameMode.Standard when CopyCat.PlayerIdList.Contains(pc.PlayerId) => true, CustomGameMode.Standard when pc.Is(CustomRoles.Nimble) || Options.EveryoneCanVent.GetBool() => true, CustomGameMode.Standard when pc.Is(CustomRoles.Bloodlust) || pc.Is(CustomRoles.Renegade) => true, @@ -1755,7 +1750,7 @@ internal static class ExtendedPlayerControl Main.AllPlayerKillCooldown[player.PlayerId] = player.GetCustomRole() switch { - CustomRoles.SoloPVP_Player => SoloPVP.SoloPVP_ATKCooldown.GetFloat(), + CustomRoles.Challenger => SoloPVP.SoloPVP_ATKCooldown.GetFloat(), CustomRoles.Killer => FreeForAll.FFAKcd.GetFloat(), CustomRoles.Runner => Speedrun.KCD, CustomRoles.CTFPlayer => CaptureTheFlag.KCD, diff --git a/Modules/Extensions/StopwatchHelper.cs b/Modules/Extensions/StopwatchHelper.cs new file mode 100644 index 000000000..278743d24 --- /dev/null +++ b/Modules/Extensions/StopwatchHelper.cs @@ -0,0 +1,8 @@ +using System.Diagnostics; + +namespace EHR.Modules.Extensions; + +public static class StopwatchHelper +{ + public static int GetRemainingTime(this Stopwatch stopwatch, int totalTime) => totalTime - stopwatch.Elapsed.Seconds; +} \ No newline at end of file diff --git a/Modules/FixedUpdateCaller.cs b/Modules/FixedUpdateCaller.cs index b8cf6b244..f28d0e371 100644 --- a/Modules/FixedUpdateCaller.cs +++ b/Modules/FixedUpdateCaller.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.Crewmate; +using EHR.Gamemodes; using EHR.Patches; using HarmonyLib; using InnerNet; @@ -121,12 +121,6 @@ public static class FixedUpdateCaller } catch { } - try - { - if (CopyCat.Instances.Count > 0) CopyCat.Instances.RemoveAll(x => x.CopyCatPC == null); - } - catch { } - try { if (amongUsClient.AmHost && GameStates.InGame && !GameStates.IsEnded) diff --git a/Modules/GameOptionsSender/PlayerGameOptionsSender.cs b/Modules/GameOptionsSender/PlayerGameOptionsSender.cs index a40e712f2..84328123f 100644 --- a/Modules/GameOptionsSender/PlayerGameOptionsSender.cs +++ b/Modules/GameOptionsSender/PlayerGameOptionsSender.cs @@ -1,18 +1,12 @@ using System; using System.Linq; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.GhostRoles; -using EHR.AddOns.Impostor; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; -using EHR.Neutral; +using EHR.Roles; using Hazel; using Il2CppInterop.Runtime.InteropTypes.Arrays; using InnerNet; using Mathf = UnityEngine.Mathf; +using EHR.Gamemodes; // ReSharper disable ForCanBeConvertedToForeach @@ -263,9 +257,9 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS opt.SetBool(BoolOptionNames.AnonymousVotes, false); break; } - case CustomRoles.Flashman: + case CustomRoles.Flash: { - Main.AllPlayerSpeed[player.PlayerId] = Options.FlashmanSpeed.GetFloat(); + Main.AllPlayerSpeed[player.PlayerId] = Options.FlashSpeed.GetFloat(); break; } case CustomRoles.Giant: @@ -660,4 +654,5 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS { return base.AmValid() && player != null && player.Data != null && !player.Data.Disconnected && Main.RealOptionsData != null; } -} \ No newline at end of file + +} diff --git a/Modules/GameState.cs b/Modules/GameState.cs index 2bc43aee4..bd05b6184 100644 --- a/Modules/GameState.cs +++ b/Modules/GameState.cs @@ -2,14 +2,10 @@ using System; using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.GhostRoles; -using EHR.Coven; -using EHR.Crewmate; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using InnerNet; +using EHR.Gamemodes; namespace EHR; @@ -337,7 +333,7 @@ public class PlayerState(byte playerId) { SubRoles.Remove(role); - if (role is CustomRoles.Flashman or CustomRoles.Dynamo or CustomRoles.Spurt) + if (role is CustomRoles.Flash or CustomRoles.Dynamo or CustomRoles.Spurt) { Main.AllPlayerSpeed[PlayerId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod); PlayerGameOptionsSender.SetDirty(PlayerId); @@ -597,4 +593,5 @@ public static class MeetingStates public static bool IsExistDeadBody => DeadBodies.Length > 0; public static NetworkedPlayerInfo ReportTarget { get; set; } -} \ No newline at end of file + +} diff --git a/Modules/GhostRolesManager.cs b/Modules/GhostRolesManager.cs index d6c835f99..8ddeb7801 100644 --- a/Modules/GhostRolesManager.cs +++ b/Modules/GhostRolesManager.cs @@ -3,8 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using AmongUs.GameOptions; -using EHR.AddOns.GhostRoles; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using UnityEngine; diff --git a/Modules/GuessManager.cs b/Modules/GuessManager.cs index f4e1d6a73..a0b74cf64 100644 --- a/Modules/GuessManager.cs +++ b/Modules/GuessManager.cs @@ -5,18 +5,15 @@ using System.Globalization; using System.Linq; using System.Text.RegularExpressions; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using HarmonyLib; using Hazel; using TMPro; using UnityEngine; using UnityEngine.Events; using static EHR.Translator; +using EHR.Gamemodes; namespace EHR; @@ -328,15 +325,17 @@ public static class GuessManager case CustomRoles.Ankylosaurus: ShowMessage("GuessAnkylosaurus"); return true; - case CustomRoles.Speedrunner when target.Is(CustomRoles.Speedrunner) && !pc.Is(Team.Crewmate) && target.GetTaskState().CompletedTasksCount >= Speedrunner.SpeedrunnerNotifyAtXTasksLeft.GetInt() && Speedrunner.SpeedrunnerNotifyKillers.GetBool(): + case CustomRoles.Car: case CustomRoles.DonutDelivery when DonutDelivery.IsUnguessable(pc, target): case CustomRoles.Shifter: - case CustomRoles.Car: + case CustomRoles.Speedrunner when target.Is(CustomRoles.Speedrunner) && !pc.Is(Team.Crewmate) && target.GetTaskState().CompletedTasksCount >= Speedrunner.SpeedrunnerNotifyAtXTasksLeft.GetInt() && Speedrunner.SpeedrunnerNotifyKillers.GetBool(): case CustomRoles.Goose when !Goose.CanBeGuessed.GetBool(): + case CustomRoles.BananaMan: case CustomRoles.Disco: + case CustomRoles.Flash: + case CustomRoles.Giant: case CustomRoles.Glow: case CustomRoles.LastImpostor: - case CustomRoles.BananaMan: ShowMessage("GuessObviousAddon"); return true; case CustomRoles.GM: @@ -781,7 +780,7 @@ public static class GuessManager private static void GuesserOnClick(byte playerId, MeetingHud __instance) { PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || GuesserUI != null || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || GuesserUI != null || MeetingHud.Instance.state is MeetingHud.VoteStates.Results or MeetingHud.VoteStates.Proceeding || Starspawn.IsDayBreak) return; try { @@ -1003,7 +1002,7 @@ public static class GuessManager } else { - if (__instance.state is not (MeetingHud.VoteStates.Voted or MeetingHud.VoteStates.NotVoted) || !PlayerControl.LocalPlayer.IsAlive()) return; + if (MeetingHud.Instance.state is MeetingHud.VoteStates.Results or MeetingHud.VoteStates.Proceeding || !PlayerControl.LocalPlayer.IsAlive()) return; Logger.Msg($"Click: {pc.GetNameWithRole()} => {role}", "Guesser UI"); @@ -1038,20 +1037,23 @@ public static class GuessManager { if (role is CustomRoles.GM or - CustomRoles.Oblivious or - CustomRoles.Flashman or + CustomRoles.Ankylosaurus or + CustomRoles.BananaMan or + CustomRoles.Car or CustomRoles.Disco or + CustomRoles.Flash or CustomRoles.Giant or + CustomRoles.LastImpostor or CustomRoles.NotAssigned or - CustomRoles.SoloPVP_Player or - CustomRoles.Paranoid or - CustomRoles.SuperStar or - CustomRoles.GuardianAngelEHR + CustomRoles.Shifter or + CustomRoles.Specter or + CustomRoles.SuperStar ) return false; + if (role.IsForOtherGameMode()) return false; if (!role.IsEnable() && !role.RoleExist(true) && !CanMakeRoleSpawn(role)) return false; - return Options.CurrentGameMode == CustomGameMode.Standard && !CustomHnS.AllHnSRoles.Contains(role) && !role.IsVanilla(); + return Options.CurrentGameMode == CustomGameMode.Standard && !CustomHnS.AllHnSRoles.Contains(role) && !role.IsGhostRole() && !role.IsVanilla(); bool CanMakeRoleSpawn(CustomRoles r) { diff --git a/Modules/MeetingTimeManager.cs b/Modules/MeetingTimeManager.cs index 67caeac1c..c305a9e91 100644 --- a/Modules/MeetingTimeManager.cs +++ b/Modules/MeetingTimeManager.cs @@ -1,8 +1,6 @@ using System; using AmongUs.GameOptions; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using HarmonyLib; namespace EHR.Modules; diff --git a/Modules/NameColorManager.cs b/Modules/NameColorManager.cs index e8a2552ab..2306f4653 100644 --- a/Modules/NameColorManager.cs +++ b/Modules/NameColorManager.cs @@ -1,13 +1,9 @@ using System.Collections.Generic; using System.Linq; -using EHR.AddOns.Common; -using EHR.AddOns.GhostRoles; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using Hazel; +using EHR.Gamemodes; namespace EHR; diff --git a/Modules/OptionHolder.cs b/Modules/OptionHolder.cs index 1a919c365..41a31543c 100644 --- a/Modules/OptionHolder.cs +++ b/Modules/OptionHolder.cs @@ -6,9 +6,9 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text.Json; -using EHR.AddOns; -using EHR.AddOns.GhostRoles; +using EHR.Gamemodes; using EHR.Modules; +using EHR.Roles; using HarmonyLib; using UnityEngine; @@ -826,7 +826,7 @@ public static class Options public static OptionItem PresidentCanBeMadmate; public static OptionItem MadSnitchTasks; - public static OptionItem FlashmanSpeed; + public static OptionItem FlashSpeed; public static OptionItem GiantSpeed; public static OptionItem ImpEgoistVisibalToAllies; public static OptionItem VotesPerKill; @@ -842,7 +842,9 @@ public static class Options public static OptionItem AutoMPollCommandCooldown; public static OptionItem AutoDraftStartCommandAfterJoin; public static OptionItem AutoDraftStartCommandCooldown; - + public static OptionItem AutoReadyCheckCommandAfterJoin; + public static OptionItem AutoReadyCheckCommandCooldown; + public static OptionItem DumpLogAfterGameEnd; private static readonly string[] SuffixModes = @@ -1676,6 +1678,12 @@ public static class Options AutoDraftStartCommandCooldown = new IntegerOptionItem(19427, "AutoDraftStartCommandCooldown", new(10, 600, 5), 150, TabGroup.SystemSettings) .SetParent(AutoDraftStartCommandAfterJoin) .SetValueFormat(OptionFormat.Seconds); + + AutoReadyCheckCommandAfterJoin = new BooleanOptionItem(19433, "AutoReadyCheckCommandAfterJoin", false, TabGroup.SystemSettings); + + AutoReadyCheckCommandCooldown = new IntegerOptionItem(19434, "AutoReadyCheckCommandCooldown", new(10, 600, 5), 325, TabGroup.SystemSettings) + .SetParent(AutoReadyCheckCommandAfterJoin) + .SetValueFormat(OptionFormat.Seconds); EnterKeyToStartGame = new BooleanOptionItem(19432, "EnterKeyToStartGame", false, TabGroup.SystemSettings); @@ -2828,16 +2836,19 @@ public static class Options }); HideGuesserCommands = new BooleanOptionItem(19717, "GuesserTryHideMsg", true, TabGroup.TaskSettings) - .SetParent(GuesserMode) - .SetColor(Color.green); + .SetColor(Color.green) + .SetParent(GuesserMode); GuesserDoesntDieOnMisguess = new BooleanOptionItem(19718, "GuesserDoesntDieOnMisguess", false, TabGroup.TaskSettings) + .SetColor(Color.yellow) .SetGameMode(CustomGameMode.Standard); CanGuessDuringDiscussionTime = new BooleanOptionItem(19799, "CanGuessDuringDiscussionTime", true, TabGroup.TaskSettings) + .SetColor(Color.yellow) .SetGameMode(CustomGameMode.Standard); MisguessDeathReason = new BooleanOptionItem(44444, "MisguessDeathReason", false, TabGroup.TaskSettings) + .SetColor(Color.yellow) .SetGameMode(CustomGameMode.Standard); LoadingPercentage = 92; diff --git a/Modules/OptionShower.cs b/Modules/OptionShower.cs index 4e81c14e8..5e4659b72 100644 --- a/Modules/OptionShower.cs +++ b/Modules/OptionShower.cs @@ -87,7 +87,7 @@ public static class OptionShower } Pages.Add(""); - sb.Append($"{Utils.GetRoleName(CustomRoles.GM)}: {(Main.GM.Value ? GetString("RoleRate") : GetString("RoleOff"))}\n\n"); + sb.Append($"{Utils.GetRoleName(CustomRoles.GM)}: {(Main.GM.Value ? GetString("RoleRate") : GetString("RoleOff"))}\n\n"); var index = 0; diff --git a/Modules/PetsHelper.cs b/Modules/PetsHelper.cs index 24101a347..5660c7caa 100644 --- a/Modules/PetsHelper.cs +++ b/Modules/PetsHelper.cs @@ -15,9 +15,12 @@ public static class PetsHelper public static void SetPet(PlayerControl pc, string petId) { var sender = CustomRpcSender.Create("PetsHelper.SetPet", SendOption.Reliable); + + try { pc.SetPet(petId); } + catch { } - pc.SetPet(petId); - pc.Data.DefaultOutfit.PetSequenceId += 10; + try { pc.Data.DefaultOutfit.PetSequenceId += 10; } + catch { } sender.AutoStartRpc(pc.NetId, RpcCalls.SetPetStr) .Write(petId) @@ -29,9 +32,13 @@ public static class PetsHelper public static string GetPetId() { - string[] pets = Options.PetToAssign; - string pet = pets[Options.PetToAssignToEveryone.GetValue()]; - string petId = pet == "pet_RANDOM_FOR_EVERYONE" ? pets[IRandom.Instance.Next(0, pets.Length - 1)] : pet; - return string.IsNullOrWhiteSpace(petId.Trim()) ? "pet_test" : petId; + try + { + string[] pets = Options.PetToAssign; + string pet = pets[Options.PetToAssignToEveryone.GetValue()]; + string petId = pet == "pet_RANDOM_FOR_EVERYONE" ? pets[IRandom.Instance.Next(0, pets.Length - 1)] : pet; + return string.IsNullOrWhiteSpace(petId) ? "pet_test" : petId; + } + catch { return "pet_test"; } } } \ No newline at end of file diff --git a/Modules/RPC.cs b/Modules/RPC.cs index 58dc27bf0..a3a71c84f 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -4,13 +4,9 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.Impostor; -using EHR.Crewmate; -using EHR.Impostor; -using EHR.Neutral; +using EHR.Gamemodes; using EHR.Patches; +using EHR.Roles; using HarmonyLib; using Hazel; using InnerNet; @@ -679,9 +675,6 @@ internal static class RPCHandlerPatch if (!command.CanUseCommand(player)) break; command.Action(player, commandKey, text, text.Split(' ')); - - // const BindingFlags flags = BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public; - // typeof(ChatCommands).GetMethod(methodName, flags)?.Invoke(null, [player, text, text.Split(' ')]); Logger.Info($"Invoke Command: {command.Action.Method.Name} ({player?.Data?.PlayerName}, {text})", "RequestCommandProcessing"); break; } @@ -713,7 +706,7 @@ internal static class RPCHandlerPatch case CustomRPC.SyncSentry: { byte id = reader.ReadByte(); - if (Main.PlayerStates[id].Role is not Crewmate.Sentry sentry) break; + if (Main.PlayerStates[id].Role is not Roles.Sentry sentry) break; sentry.MonitoredRoom = Utils.GetPlayerById(id).GetPlainShipRoom(); break; @@ -1033,7 +1026,7 @@ internal static class RPCHandlerPatch } case CustomRPC.SetGhostPlayer: { - Impostor.Lightning.ReceiveRPC(reader); + Roles.Lightning.ReceiveRPC(reader); break; } case CustomRPC.SetStalkerKillCount: diff --git a/Modules/Statistics.cs b/Modules/Statistics.cs index e2f129660..80b07ca29 100644 --- a/Modules/Statistics.cs +++ b/Modules/Statistics.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.AddOns.Common; -using EHR.Crewmate; -using EHR.Neutral; +using EHR.Gamemodes; +using EHR.Roles; namespace EHR.Modules; @@ -179,7 +178,7 @@ public static class Statistics case CustomRoles.Sheriff when won && lp.IsAlive() && Main.PlayerStates.Values.Where(x => x.IsDead && x.deathReason == PlayerState.DeathReason.Kill).All(x => x.GetRealKiller() == lp.PlayerId): Achievements.Type.Superhero.CompleteAfterGameEnd(); break; - case CustomRoles.Snitch when lp.AllTasksCompleted() && CustomWinnerHolder.WinnerTeam == CustomWinner.Crewmate && won: + case CustomRoles.Snitch when lp.IsAlive() && lp.AllTasksCompleted() && CustomWinnerHolder.WinnerTeam == CustomWinner.Crewmate && won: Achievements.Type.CrewHero.Complete(); break; case CustomRoles.KillingMachine when Main.PlayerStates.Values.Count(x => x.GetRealKiller() == lp.PlayerId) >= 8: diff --git a/Modules/Translator.cs b/Modules/Translator.cs index 2bb5ff90c..a5782fbaa 100644 --- a/Modules/Translator.cs +++ b/Modules/Translator.cs @@ -7,6 +7,8 @@ using System.Reflection; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; +using EHR.Gamemodes; + #if !ANDROID using Il2CppInterop.Runtime.InteropTypes.Arrays; #endif diff --git a/Modules/Utils.cs b/Modules/Utils.cs index ac46cecca..854e8b9bb 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -13,15 +13,8 @@ using AmongUs.Data; using AmongUs.GameOptions; using AmongUs.InnerNet.GameDataMessages; using BepInEx; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.GhostRoles; -using EHR.AddOns.Impostor; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; using HarmonyLib; using Hazel; @@ -31,7 +24,8 @@ using InnerNet; using Newtonsoft.Json; using UnityEngine; using static EHR.Translator; -using Tree = EHR.Crewmate.Tree; +using Tree = EHR.Roles.Tree; +using EHR.Gamemodes; namespace EHR; /* @@ -980,7 +974,7 @@ public static class Utils break; } - hasTasks &= !(CopyCat.Instances.Any(x => x.CopyCatPC.PlayerId == p.PlayerId) && forRecompute && (!Options.UsePets.GetBool() || CopyCat.UsePet.GetBool())); + hasTasks &= !(CopyCat.PlayerIdList.Contains(p.PlayerId) && forRecompute && (!Options.UsePets.GetBool() || CopyCat.UsePet.GetBool())); hasTasks |= p.Object.UsesPetInsteadOfKill() && role is not (CustomRoles.Renegade or CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Sidekick); foreach (CustomRoles subRole in state.SubRoles) @@ -2384,7 +2378,7 @@ public static class Utils { foreach (PlayerControl target in aapc) { - if (GameStates.IsMeeting) yield break; + if (GameStates.IsMeeting || ReportDeadBodyPatch.MeetingStarted) yield break; var sender = CustomRpcSender.Create("Utils.NotifyEveryoneAsync", SendOption.Reliable, log: false); var hasValue = WriteSetNameRpcsToSender(ref sender, false, noCache, false, false, false, false, seer, [seer], [target], out bool senderWasCleared) && !senderWasCleared; sender.SendMessage(!hasValue || sender.stream.Length <= 3); @@ -2504,7 +2498,7 @@ public static class Utils SelfMark.Append(Snitch.GetWarningArrow(seer)); if (Main.LoversPlayers.Exists(x => x.PlayerId == seer.PlayerId)) SelfMark.Append(ColorString(GetRoleColor(CustomRoles.Lovers), " ♥")); - if (Impostor.Lightning.IsGhost(seer)) SelfMark.Append(ColorString(GetRoleColor(CustomRoles.Lightning), "■")); + if (Roles.Lightning.IsGhost(seer)) SelfMark.Append(ColorString(GetRoleColor(CustomRoles.Lightning), "■")); SelfMark.Append(Medic.GetMark(seer, seer)); SelfMark.Append(Gaslighter.GetMark(seer, seer, forMeeting)); @@ -2802,7 +2796,7 @@ public static class Utils if (target.Is(CustomRoles.SuperStar) && Options.EveryOneKnowSuperStar.GetBool()) TargetMark.Append(ColorString(GetRoleColor(CustomRoles.SuperStar), "★")); - if (Impostor.Lightning.IsGhost(target)) TargetMark.Append(ColorString(GetRoleColor(CustomRoles.Lightning), "■")); + if (Roles.Lightning.IsGhost(target)) TargetMark.Append(ColorString(GetRoleColor(CustomRoles.Lightning), "■")); TargetMark.Append(Snitch.GetWarningMark(seer, target)); @@ -2926,7 +2920,7 @@ public static class Utils if (seer.Is(CustomRoleTypes.Impostor) && target.Is(CustomRoles.Snitch) && target.Is(CustomRoles.Madmate) && target.GetTaskState().IsTaskFinished) TargetMark.Append(ColorString(GetRoleColor(CustomRoles.Impostor), "★")); - if (Marshall.CanSeeMarshall(seer) && target.Is(CustomRoles.Marshall) && target.GetTaskState().IsTaskFinished) + if (target.Is(CustomRoles.Marshall) && Marshall.CanSeeMarshall(seer) && target.GetTaskState().IsTaskFinished) TargetMark.Append(ColorString(GetRoleColor(CustomRoles.Marshall), "★")); TargetMark.Append(Executioner.TargetMark(seer, target)); @@ -3076,7 +3070,7 @@ public static class Utils (target.Is(CustomRoles.Workaholic) && Workaholic.WorkaholicVisibleToEveryone.GetBool()) || (target.Is(CustomRoles.Doctor) && !target.HasEvilAddon() && Options.DoctorVisibleToEveryone.GetBool()) || (target.Is(CustomRoles.Mayor) && Mayor.MayorRevealWhenDoneTasks.GetBool() && target.GetTaskState().IsTaskFinished) || - (Marshall.CanSeeMarshall(seer) && target.Is(CustomRoles.Marshall) && target.GetTaskState().IsTaskFinished) || + (target.Is(CustomRoles.Marshall) && Marshall.CanSeeMarshall(seer) && target.GetTaskState().IsTaskFinished) || (Main.PlayerStates[target.PlayerId].deathReason == PlayerState.DeathReason.Vote && Options.SeeEjectedRolesInMeeting.GetBool()) || (CustomTeamManager.AreInSameCustomTeam(seer.PlayerId, target.PlayerId) && CustomTeamManager.IsSettingEnabledForPlayerTeam(seer.PlayerId, CTAOption.KnowRoles)) || Main.PlayerStates.Values.Any(x => x.Role.KnowRole(seer, target)) || @@ -3401,7 +3395,7 @@ public static class Utils CustomRoles.Sentinel => Sentinel.PatrolCooldown.GetInt(), CustomRoles.Druid => Druid.VentCooldown.GetInt(), CustomRoles.Catcher => Catcher.AbilityCooldown.GetInt(), - CustomRoles.Sentry => Crewmate.Sentry.ShowInfoCooldown.GetInt(), + CustomRoles.Sentry => EHR.Roles.Sentry.ShowInfoCooldown.GetInt(), CustomRoles.ToiletMaster => ToiletMaster.AbilityCooldown.GetInt(), CustomRoles.Ambusher => Ambusher.AbilityCooldown.GetInt(), CustomRoles.AntiAdminer => AntiAdminer.AbilityCooldown.GetInt(), @@ -3466,7 +3460,7 @@ public static class Utils if (Lovers.PrivateChat.GetBool() && Main.LoversPlayers.TrueForAll(x => x.IsAlive())) Main.LoversPlayers.ForEach(x => x.SetChatVisible(true)); } - catch (System.Exception e) { ThrowException(e); } + catch (Exception e) { ThrowException(e); } try { @@ -3478,7 +3472,7 @@ public static class Utils CopyCat.ResetRoles(); Imitator.SetRoles(); } - catch (System.Exception e) { ThrowException(e); } + catch (Exception e) { ThrowException(e); } foreach (PlayerControl pc in Main.AllPlayerControls) { @@ -3511,8 +3505,6 @@ public static class Utils if (Options.UsePets.GetBool()) { - pc.AddAbilityCD(false); - LateTask.New(() => { if (GameStates.IsEnded) return; @@ -3521,6 +3513,8 @@ public static class Utils pc.Data.DefaultOutfit.PetSequenceId += 10; pc.RpcSetPet(petId); }, 3f, "No Pet Reassign"); + + pc.AddAbilityCD(false); } AFKDetector.RecordPosition(pc); @@ -3572,7 +3566,7 @@ public static class Utils Deadlined.AfterMeetingTasks(); Tired.Reset(); } - catch (System.Exception e) { ThrowException(e); } + catch (Exception e) { ThrowException(e); } if (Options.AirshipVariableElectrical.GetBool()) AirshipElectricalDoors.Initialize(); @@ -3727,7 +3721,7 @@ public static class Utils Amnesiac.OnAnyoneDead(target); Scout.OnPlayerDeath(target); Dad.OnAnyoneDeath(target); - Crewmate.Sentry.OnAnyoneMurder(target); + EHR.Roles.Sentry.OnAnyoneMurder(target); Soothsayer.OnAnyoneDeath(targetRealKiller); TargetDies(targetRealKiller, target); diff --git a/Modules/Zoom.cs b/Modules/Zoom.cs index dac71ea48..4deba4f6f 100644 --- a/Modules/Zoom.cs +++ b/Modules/Zoom.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using UnityEngine; @@ -20,7 +20,41 @@ public static class Zoom if (((GameStates.IsShip && !GameStates.IsMeeting && GameStates.IsCanMove && !PlayerControl.LocalPlayer.IsAlive()) || (GameStates.IsLobby && GameStates.IsCanMove)) && !InGameRoleInfoMenu.Showing) { if (Camera.main.orthographicSize > 3.0f) ResetButtons = true; +#if ANDROID + if (Input.touchCount == 2) + { + Touch touch0 = Input.GetTouch(0); + Touch touch1 = Input.GetTouch(1); + Vector2 touch0PrevPos = touch0.position - touch0.deltaPosition; + Vector2 touch1PrevPos = touch1.position - touch1.deltaPosition; + + float prevTouchDeltaMag = (touch0PrevPos - touch1PrevPos).magnitude; + float currentTouchDeltaMag = (touch0.position - touch1.position).magnitude; + float deltaMagnitudeDiff = currentTouchDeltaMag - prevTouchDeltaMag; + + switch (deltaMagnitudeDiff) + { + case > 0: + { + if (Camera.main.orthographicSize > 3.0f) + SetZoomSize(); + + break; + } + case < 0: + { + if (GameStates.IsDead || GameStates.IsFreePlay || DebugModeManager.AmDebugger || GameStates.IsLobby) + { + if (Camera.main.orthographicSize < 18.0f) + SetZoomSize(true); + } + + break; + } + } + } +#else switch (Input.mouseScrollDelta.y) { case > 0: @@ -41,7 +75,7 @@ public static class Zoom break; } } - +#endif Flag.NewFlag("Zoom"); } else @@ -107,11 +141,4 @@ public static class Flag { if (!OneTimeList.Contains(type)) OneTimeList.Add(type); } - - /* - public static void DeleteFlag(string type) - { - if (OneTimeList.Contains(type)) OneTimeList.Remove(type); - } - */ -} \ No newline at end of file +} diff --git a/Patches/ChatCommandPatch.cs b/Patches/ChatCommandPatch.cs index 78331d450..e73102aee 100644 --- a/Patches/ChatCommandPatch.cs +++ b/Patches/ChatCommandPatch.cs @@ -7,12 +7,10 @@ using System.Text; using System.Text.RegularExpressions; using AmongUs.GameOptions; using Assets.CoreScripts; -using EHR.AddOns.Common; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; +using EHR.Roles; using HarmonyLib; using Hazel; using InnerNet; @@ -194,7 +192,7 @@ internal static class ChatCommands ["Command.DraftStart"] = new(["draftstart", "ds", "драфтстарт", "启用草稿", "todosescolhem-iniciar"], "", GetString("CommandDescription.DraftStart"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.InLobby, DraftStartCommand, true, false), ["Command.DraftDescription"] = new(["dd", "draftdesc", "draftdescription", "драфтописание", "драфтопис", "草稿描述", "todosescolhem-descricao"], "{index}", GetString("CommandDescription.DraftDescription"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, DraftDescriptionCommand, false, false, [GetString("CommandArgs.DraftDescription.Index")]), ["Command.Draft"] = new(["draft", "драфт", "选择草稿", "todosescolhem-escolher"], "{number}", GetString("CommandDescription.Draft"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, DraftCommand, false, false, [GetString("CommandArgs.Draft.Number")]), - ["Command.ReadyCheck"] = new(["rc", "readycheck", "проверитьготовность", "准备检测", "verificação-de-prontidão"], "", GetString("CommandDescription.ReadyCheck"), Command.UsageLevels.HostOrAdmin, Command.UsageTimes.InLobby, ReadyCheckCommand, true, false), + ["Command.ReadyCheck"] = new(["rc", "readycheck", "проверитьготовность", "准备检测", "verificação-de-prontidão"], "", GetString("CommandDescription.ReadyCheck"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.InLobby, ReadyCheckCommand, true, false), ["Command.Ready"] = new(["ready", "готов", "准备", "pronto"], "", GetString("CommandDescription.Ready"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, ReadyCommand, true, false), ["Command.EnableAllRoles"] = new(["enableallroles", "вклвсероли", "启用所有职业", "habilitar-todas-as-funções"], "", GetString("CommandDescription.EnableAllRoles"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, EnableAllRolesCommand, true, false), ["Command.Achievements"] = new(["achievements", "достижения", "成就", "conquistas"], "", GetString("CommandDescription.Achievements"), Command.UsageLevels.Modded, Command.UsageTimes.Always, AchievementsCommand, true, false), @@ -699,17 +697,20 @@ internal static class ChatCommands if (!targetState.IsDead) { + RPC.PlaySoundRPC(player.PlayerId, Sounds.SabotageSound); Utils.SendMessage("\n", player.PlayerId, GetString("Imitator.TargetMustBeDead")); return; } if (!targetState.MainRole.Is(Team.Crewmate) || targetState.MainRole == CustomRoles.GM) { + RPC.PlaySoundRPC(player.PlayerId, Sounds.SabotageSound); Utils.SendMessage("\n", player.PlayerId, GetString("Imitator.TargetMustBeCrew")); return; } Imitator.ImitatingRole[player.PlayerId] = targetState.MainRole; + RPC.PlaySoundRPC(player.PlayerId, Sounds.TaskComplete); Logger.Info($"{player.GetRealName()} will be imitating as {targetState.MainRole}", "Imitator"); Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("Imitator.Success"), targetId.ColoredPlayerName())); @@ -858,7 +859,7 @@ internal static class ChatCommands return; } - if (!player.IsHost() || args.Length < 3 || !GetRoleByName(args[1], out CustomRoles role1) || !GetRoleByName(args[2], out CustomRoles role2)) + if ((!player.IsHost() && !IsPlayerAdmin(player.FriendCode)) || args.Length < 3 || !GetRoleByName(args[1], out CustomRoles role1) || !GetRoleByName(args[2], out CustomRoles role2)) { Utils.SendMessage(string.Join('\n', Main.XORRoles.ConvertAll(x => $"{x.Item1.ToColoredString()} ⊕ {x.Item2.ToColoredString()}")), player.PlayerId, GetString("XORListTitle")); return; @@ -1336,7 +1337,7 @@ internal static class ChatCommands () => Utils.EnterQuickSetupRoles(false)); } - private static void ReadyCheckCommand(PlayerControl player, string commandKey, string text, string[] args) + public static void ReadyCheckCommand(PlayerControl player, string commandKey, string text, string[] args) { if (!AmongUsClient.Instance.AmHost) { @@ -1400,7 +1401,7 @@ internal static class ChatCommands DraftResult = []; byte[] allPlayerIds = Main.AllPlayerControls.Select(x => x.PlayerId).ToArray(); - List allRoles = Enum.GetValues().Where(x => x < CustomRoles.NotAssigned && x.IsEnable() && !x.IsForOtherGameMode() && !CustomHnS.AllHnSRoles.Contains(x) && !x.IsVanilla() && x is not CustomRoles.GM).ToList(); + List allRoles = Enum.GetValues().Where(x => x < CustomRoles.NotAssigned && x.IsEnable() && !x.IsForOtherGameMode() && !CustomHnS.AllHnSRoles.Contains(x) && !x.IsVanilla() && x is not CustomRoles.GM).Shuffle(); if (allRoles.Count < allPlayerIds.Length) { @@ -1409,8 +1410,8 @@ internal static class ChatCommands } IEnumerable impRoles = allRoles.Where(x => x.IsImpostor()).Shuffle().Take(Options.FactionMinMaxSettings[Team.Impostor].MaxSetting.GetInt()); - IEnumerable nkRoles = allRoles.Where(x => x.IsNK()).Shuffle().Take(Options.RoleSubCategoryLimits[RoleOptionType.Neutral_Killing][2].GetInt()); - IEnumerable nnkRoles = allRoles.Where(x => x.IsNonNK()).Shuffle().Take(Options.MaxNNKs.GetInt()); + IEnumerable nkRoles = allRoles.Where(x => x.IsNK()).Shuffle().Take(Math.Min(Options.FactionMinMaxSettings[Team.Neutral].MaxSetting.GetInt(), Options.RoleSubCategoryLimits[RoleOptionType.Neutral_Killing][2].GetInt())); + IEnumerable nnkRoles = allRoles.Where(x => x.IsNonNK()).Shuffle().Take(Math.Min(Options.FactionMinMaxSettings[Team.Neutral].MaxSetting.GetInt() - Options.RoleSubCategoryLimits[RoleOptionType.Neutral_Killing][2].GetInt(), Options.MaxNNKs.GetInt())); IEnumerable covenRoles = allRoles.Where(x => x.IsCoven()).Shuffle().Take(Options.FactionMinMaxSettings[Team.Coven].MaxSetting.GetInt()); allRoles.RemoveAll(x => x.IsImpostor()); @@ -1791,7 +1792,7 @@ internal static class ChatCommands string result = winners.Length == 1 ? string.Format(GetString("Poll.Winner"), winners[0].Key, PollAnswers[winners[0].Key], winners[0].Value) + - PollVotes.Where(x => x.Key != winners[0].Key).Aggregate("", (s, t) => s + $"{t.Key} - {t.Value} {PollAnswers[t.Key]}\n") + PollVotes.Where(x => x.Key != winners[0].Key).Aggregate("", (s, t) => s + $"{t.Key} - {t.Value} {PollAnswers[t.Key]}\n") : string.Format(GetString("Poll.Tie"), string.Join(" & ", winners.Select(x => $"{x.Key}{PollAnswers[x.Key]}")), maxVotes); Utils.SendMessage(result, title: Utils.ColorString(new(0, 255, 165, 255), GetString("PollResultTitle"))); @@ -2278,6 +2279,8 @@ internal static class ChatCommands var vl = (Ventriloquist)Main.PlayerStates[player.PlayerId].Role; vl.Target = args.Length < 2 ? byte.MaxValue : byte.TryParse(args[1], out byte targetId) ? targetId : byte.MaxValue; + player.RPCPlayCustomSound("Line"); + MeetingManager.SendCommandUsedMessage(args[0]); } @@ -2559,7 +2562,7 @@ internal static class ChatCommands return; } - if (!player.IsHost() || args.Length < 4) + if ((!player.IsHost() && !IsPlayerAdmin(player.FriendCode)) || args.Length < 4) { if (Main.AlwaysSpawnTogetherCombos.Count == 0 && Main.NeverSpawnTogetherCombos.Count == 0) return; diff --git a/Patches/ChatControlPatch.cs b/Patches/ChatControlPatch.cs index 511f976c7..9b0652aa3 100644 --- a/Patches/ChatControlPatch.cs +++ b/Patches/ChatControlPatch.cs @@ -2,13 +2,13 @@ using System; using System.Collections.Generic; using System.Linq; using AmongUs.Data; -using EHR.Coven; -using EHR.Impostor; +using EHR.Roles; using EHR.Patches; using HarmonyLib; using Hazel; using InnerNet; using UnityEngine; +using EHR.Gamemodes; namespace EHR; @@ -202,12 +202,8 @@ public static class ChatManager break; } - switch (Options.CurrentGameMode) - { - case CustomGameMode.FFA when GameStates.InGame && !message.StartsWith('/'): - FreeForAll.UpdateLastChatMessage(player.GetRealName(), message); - break; - } + if (Options.CurrentGameMode is CustomGameMode.FFA or CustomGameMode.SoloPVP or CustomGameMode.NaturalDisasters or CustomGameMode.Mingle or CustomGameMode.HideAndSeek && GameStates.InGame && !message.StartsWith('/')) + Main.AllAlivePlayerControls.NotifyPlayers(string.Format(Translator.GetString("FFAChatMessageNotify"), Main.GameModeColors.GetValueOrDefault(Options.CurrentGameMode, new(1,1,1)), player.PlayerId.ColoredPlayerName(), message)); } public static void AddChatHistory(PlayerControl player, string message) diff --git a/Patches/CheckGameEndPatch.cs b/Patches/CheckGameEndPatch.cs index 005cb2ad9..8d90fcba0 100644 --- a/Patches/CheckGameEndPatch.cs +++ b/Patches/CheckGameEndPatch.cs @@ -4,11 +4,9 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using BepInEx.Unity.IL2CPP.Utils.Collections; -using EHR.AddOns.Common; -using EHR.AddOns.GhostRoles; -using EHR.Impostor; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using Hazel; using InnerNet; diff --git a/Patches/CredentialsPatch.cs b/Patches/CredentialsPatch.cs index 98459e938..239848174 100644 --- a/Patches/CredentialsPatch.cs +++ b/Patches/CredentialsPatch.cs @@ -140,7 +140,7 @@ public static class UpdateFriendCodeUIPatch public static void Prefix() { - var credentialsText = $"Gurge44 \u00a9 2025"; + var credentialsText = $"Gurge44 \u00a9 2026"; credentialsText += "\t\t\t"; credentialsText += $"{Main.ModName} - {Main.PluginVersion}"; @@ -335,7 +335,7 @@ internal static class TitleLogoPatch GameObject.Find("BackgroundTexture")?.SetActive(!MainMenuManagerPatch.ShowedBak); DateTime now = DateTime.Now; - bool holidays = now is { Month: 12, Day: < 24 }; + bool holidays = now is { Month: 12, Day: < 24 or > 26 }; bool christmas = now is { Month: 12, Day: >= 24 and <= 26 }; bool newYear = now is { Month: 1, Day: <= 6 }; bool easter = IsEasterPeriod(); diff --git a/Patches/DiscordPatch.cs b/Patches/DiscordPatch.cs index dc41bc929..db596fa3b 100644 --- a/Patches/DiscordPatch.cs +++ b/Patches/DiscordPatch.cs @@ -7,7 +7,7 @@ namespace EHR.Patches; // Originally from "Town of Us Rewritten", by Det [HarmonyPatch(typeof(ActivityManager), nameof(ActivityManager.UpdateActivity))] -public class DiscordRPC +public static class DiscordRPC { private static string Lobbycode = ""; private static string Region = ""; @@ -18,6 +18,11 @@ public class DiscordRPC var details = $"EHR v{Main.PluginDisplayVersion}"; activity.Details = details; + + activity.Assets = new ActivityAssets + { + LargeImage = "https://i.imgur.com/07BjW2j.png" + }; try { diff --git a/Patches/ExilePatch.cs b/Patches/ExilePatch.cs index b645eff4e..6400608be 100644 --- a/Patches/ExilePatch.cs +++ b/Patches/ExilePatch.cs @@ -2,12 +2,8 @@ using System; using System.Diagnostics; using System.Linq; using AmongUs.Data; -using EHR.AddOns.Crewmate; -using EHR.AddOns.Impostor; -using EHR.Crewmate; -using EHR.Impostor; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; namespace EHR.Patches; diff --git a/Patches/GameOptionsMenuPatch.cs b/Patches/GameOptionsMenuPatch.cs index b0aab6e1f..701f042bc 100644 --- a/Patches/GameOptionsMenuPatch.cs +++ b/Patches/GameOptionsMenuPatch.cs @@ -2,7 +2,6 @@ using System; using System.Collections; using System.Linq; using BepInEx.Unity.IL2CPP.Utils.Collections; -using EHR.AddOns.GhostRoles; using EHR.Modules; using EHR.Patches; using HarmonyLib; @@ -10,6 +9,11 @@ using Hazel; using TMPro; using UnityEngine; using UnityEngine.Events; +using EHR.Roles; +using EHR.Gamemodes; + + + #if ANDROID using System.Collections.Generic; @@ -812,7 +816,7 @@ public static class StringOptionPatch if (instance == null) return string.Empty; Team team = instance.Team; - if ((int)team is 1 or 2 or 4) return $" {GetColoredShortTeamName(team)}"; + if ((int)team is 1 or 2 or 4 or 8) return $" {GetColoredShortTeamName(team)}"; Team[] teams = (int)team switch { @@ -949,7 +953,6 @@ public static class GameSettingMenuPatch private static readonly Vector3 ButtonPositionRight = new(-2.4f, -0.55f, 0f); private static readonly Vector3 ButtonSize = new(0.45f, 0.35f, 1f); - // private static readonly Vector3 ButtonSize = new(0.45f, 0.6f, 1f); private static GameOptionsMenu TemplateGameOptionsMenu; private static PassiveButton TemplateGameSettingsButton; @@ -1196,6 +1199,7 @@ public static class GameSettingMenuPatch { Options.GameMode.SetValue((int)gm - 1); GameOptionsMenuPatch.ReloadUI(); + CustomHnS.AllHnSRoles = CustomHnS.GetAllHnsRoles(CustomHnS.GetAllHnsRoleTypes()); })); gmPassiveButton.activeTextColor = gmPassiveButton.inactiveTextColor = gmPassiveButton.disabledTextColor = gmPassiveButton.selectedTextColor = Main.GameModeColors[gm]; @@ -1502,4 +1506,5 @@ public static class RpcSyncSettingsPatch { OptionItem.SyncAllOptions(); } -} \ No newline at end of file + +} diff --git a/Patches/GameStartManagerPatch.cs b/Patches/GameStartManagerPatch.cs index 4dab81bc6..e1a225e34 100644 --- a/Patches/GameStartManagerPatch.cs +++ b/Patches/GameStartManagerPatch.cs @@ -2,9 +2,8 @@ using System; using System.Linq; using AmongUs.Data; using AmongUs.GameOptions; -using EHR.GameMode.HideAndSeekRoles; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; using HarmonyLib; using Hazel; @@ -13,6 +12,7 @@ using InnerNet; using TMPro; using UnityEngine; using static EHR.Translator; +using EHR.Gamemodes; namespace EHR; @@ -148,12 +148,12 @@ public static class GameStartManagerPatch { if (DataManager.Settings.Gameplay.StreamerMode) { - if (__instance != null && __instance.GameRoomNameCode != null) __instance.GameRoomNameCode.color = new(255, 255, 255, 0); + if (__instance.GameRoomNameCode != null) __instance.GameRoomNameCode.color = new(255, 255, 255, 0); if (GameStartManagerStartPatch.HideName != null) GameStartManagerStartPatch.HideName.enabled = true; } else { - if (__instance != null && __instance.GameRoomNameCode != null) __instance.GameRoomNameCode.color = new(255, 255, 255, 255); + if (__instance.GameRoomNameCode != null) __instance.GameRoomNameCode.color = new(255, 255, 255, 255); if (GameStartManagerStartPatch.HideName != null) GameStartManagerStartPatch.HideName.enabled = false; } } @@ -196,6 +196,8 @@ public static class GameStartManagerPatch if (invalidColor.Length > 0) { + Main.UpdateTime = -100; + Main.AllPlayerControls .Where(p => p.Data.DefaultOutfit.ColorId < 0 || Palette.PlayerColors.Length <= p.Data.DefaultOutfit.ColorId) .Do(p => AmongUsClient.Instance.KickPlayer(p.OwnerId, false)); @@ -414,11 +416,11 @@ public static class GameStartManagerPatch int estimatedGameLength = Options.CurrentGameMode switch { CustomGameMode.SoloPVP => SoloPVP.SoloPVP_GameTime.GetInt(), - CustomGameMode.FFA => Math.Clamp((FreeForAll.FFAKcd.GetInt() * (PlayerControl.AllPlayerControls.Count / 2)) + FreeForAll.FFAKcd.GetInt() + 5, FreeForAll.FFAKcd.GetInt(), FreeForAll.FFAGameTime.GetInt()), + CustomGameMode.FFA => Math.Clamp((FreeForAll.FFAKcd.GetInt() * (PlayerControl.AllPlayerControls.Count / 2)) + FreeForAll.FFAKcd.GetInt(), FreeForAll.FFAKcd.GetInt(), FreeForAll.FFAGameTime.GetInt()), CustomGameMode.StopAndGo => ((Main.NormalOptions.NumShortTasks * 30) + (Main.NormalOptions.NumLongTasks * 60) + (Math.Min(3, Main.NormalOptions.NumCommonTasks) * 40)) / (int)(Main.NormalOptions.PlayerSpeedMod - ((Main.NormalOptions.PlayerSpeedMod - 1) / 2)), CustomGameMode.HotPotato => HotPotato.GetKillInterval() * (PlayerControl.AllPlayerControls.Count - 1), CustomGameMode.HideAndSeek => Math.Min((Seeker.KillCooldown.GetInt() * (PlayerControl.AllPlayerControls.Count - Main.NormalOptions.NumImpostors) / Main.NormalOptions.NumImpostors) + Seeker.BlindTime.GetInt() + 15, Math.Min(CustomHnS.MaximumGameLength, ((Main.NormalOptions.NumShortTasks * 20) + (Main.NormalOptions.NumLongTasks * 30) + (Math.Min(3, Main.NormalOptions.NumCommonTasks) * 20)) / (int)(Main.NormalOptions.PlayerSpeedMod - ((Main.NormalOptions.PlayerSpeedMod - 1) / 2)))), - CustomGameMode.Speedrun => (Speedrun.TimeLimitValue * (Main.NormalOptions.NumShortTasks + Main.NormalOptions.NumLongTasks + Main.NormalOptions.NumCommonTasks)) + (Speedrun.KCD * (PlayerControl.AllPlayerControls.Count / (Speedrun.RestrictedKilling ? 2 : 3))), + CustomGameMode.Speedrun => (Speedrun.TimeLimitValue * (Main.NormalOptions.NumShortTasks + Main.NormalOptions.NumLongTasks + Main.NormalOptions.NumCommonTasks)) + (Speedrun.KCD * (PlayerControl.AllPlayerControls.Count / (Speedrun.RestrictedKilling ? 3 : 4))), CustomGameMode.CaptureTheFlag => CaptureTheFlag.GameEndCriteriaType == 2 ? CaptureTheFlag.MaxGameLength : CaptureTheFlag.IsDeathPossible ? 40 : Math.Max(30, 1500 / (int)Math.Pow(CaptureTheFlag.KCD + 0.5f, 2) * CaptureTheFlag.TotalRoundsToPlay), CustomGameMode.NaturalDisasters => 180 + (15 * NaturalDisasters.FrequencyOfDisasters * Math.Max(1, Math.Min(20, PlayerControl.AllPlayerControls.Count) / 4)), CustomGameMode.RoomRush => (int)Math.Round((RoomRush.PointsSystem ? RoomRush.RawPointsToWin * 1.5f : PlayerControl.AllPlayerControls.Count - 1) * ((Main.NormalOptions.MapId is 0 or 3 ? 15 : 20) / Main.NormalOptions.PlayerSpeedMod)), @@ -634,6 +636,7 @@ public static class GameStartManagerBeginPatch if (__instance.startState == GameStartManager.StartingStates.Countdown) { __instance.ResetStartState(); + ChatCommands.VotedToStart.Clear(); return false; } diff --git a/Patches/HudPatch.cs b/Patches/HudPatch.cs index b6910ae40..cdb342405 100644 --- a/Patches/HudPatch.cs +++ b/Patches/HudPatch.cs @@ -4,10 +4,9 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.Crewmate; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using TMPro; using UnityEngine; @@ -205,7 +204,7 @@ internal static class HudManagerPatch ActionButton usedButton = __instance.KillButton; if (usesPetInsteadOfKill) usedButton = __instance.PetButton; - __instance.KillButton?.OverrideText(GetString("KillButtonText")); + __instance.KillButton?.OverrideText(player.GetRoleTypes() == RoleTypes.Viper ? GetString("KillButtonText.Viper") : GetString("KillButtonText")); __instance.ReportButton?.OverrideText(GetString("ReportButtonText")); __instance.PetButton?.OverrideText(GetString("PetButtonText")); __instance.ImpostorVentButton?.OverrideText(GetString("VentButtonText")); @@ -237,7 +236,7 @@ internal static class HudManagerPatch case CustomRoles.Medic: usedButton?.OverrideText(GetString("MedicalerButtonText")); break; - case CustomRoles.SoloPVP_Player: + case CustomRoles.Challenger: case CustomRoles.BedWarsPlayer: __instance.KillButton?.OverrideText(GetString("DemonButtonText")); break; @@ -384,7 +383,8 @@ internal static class HudManagerPatch __instance.ImpostorVentButton?.Hide(); __instance.KillButton?.Hide(); __instance.AbilityButton?.Show(); - __instance.AbilityButton?.OverrideText(GetString(StringNames.HauntAbilityName)); + __instance.AbilityButton?.SetEnabled(); + __instance.AbilityButton?.OverrideText(GetString(player.GetRoleTypes() == RoleTypes.GuardianAngel ? StringNames.ProtectAbility : StringNames.HauntAbilityName)); } } @@ -660,7 +660,7 @@ internal static class SetHudActivePatch __instance.ImpostorVentButton?.ToggleVisible(false); break; - case CustomRoles.SoloPVP_Player: + case CustomRoles.Challenger: __instance.SabotageButton?.ToggleVisible(false); __instance.AbilityButton?.ToggleVisible(false); __instance.ReportButton?.ToggleVisible(false); diff --git a/Patches/HudSpritePatch.cs b/Patches/HudSpritePatch.cs index 6ddc91c54..349752e49 100644 --- a/Patches/HudSpritePatch.cs +++ b/Patches/HudSpritePatch.cs @@ -1,8 +1,8 @@ using System; -using EHR.Crewmate; -using EHR.Impostor; -using EHR.Neutral; +using AmongUs.GameOptions; +using EHR.Gamemodes; using EHR.Patches; +using EHR.Roles; using UnityEngine; namespace EHR; @@ -177,7 +177,7 @@ public static class HudSpritePatch newAbilityButton = CustomButton.Get("JesterVent"); break; } - case CustomRoles.Transporter: + case CustomRoles.Transporter when player.GetRoleTypes() == RoleTypes.Shapeshifter: case CustomRoles.Swapster: { newAbilityButton = CustomButton.Get("Transport"); @@ -189,7 +189,7 @@ public static class HudSpritePatch else if (!shapeshifting) newAbilityButton = CustomButton.Get("Disperse"); break; - } + } case CustomRoles.Duellist: case CustomRoles.SoulCatcher: case CustomRoles.Twister: @@ -314,8 +314,8 @@ public static class HudSpritePatch { newKillButton = CustomButton.Get("Shield"); break; - } - case CustomRoles.Gangster when Gangster.CanRecruit(player.PlayerId): + } + case CustomRoles.Gangster when Gangster.CanRecruit(player.PlayerId): case CustomRoles.Jackal when player.GetAbilityUseLimit() > 0: { newKillButton = CustomButton.Get("Sidekick"); @@ -509,4 +509,4 @@ public static class HudSpritePatch } } } -} \ No newline at end of file +} diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 12db1e312..7a89c96b6 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -3,10 +3,10 @@ using System.Collections; using System.Linq; using AmongUs.GameOptions; using BepInEx.Unity.IL2CPP.Utils.Collections; -using EHR.AddOns.Common; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; +using EHR.Roles; using HarmonyLib; using Hazel; using Il2CppSystem.Collections.Generic; @@ -875,11 +875,11 @@ internal static class BeginCrewmatePatch { case CustomGameMode.SoloPVP: { - __instance.TeamTitle.text = GetString("SoloPVP_Player"); + __instance.TeamTitle.text = GetString("Challenger"); __instance.TeamTitle.color = __instance.BackgroundBar.material.color = new Color32(245, 82, 82, byte.MaxValue); PlayerControl.LocalPlayer.Data.Role.IntroSound = DestroyableSingleton.Instance.HnSOtherImpostorTransformSfx; __instance.ImpostorText.gameObject.SetActive(true); - __instance.ImpostorText.text = GetString("SoloPVP_PlayerInfo"); + __instance.ImpostorText.text = GetString("ChallengerInfo"); break; } case CustomGameMode.FFA: @@ -1171,8 +1171,12 @@ internal static class IntroCutsceneDestroyPatch switch (Options.CurrentGameMode) { + case CustomGameMode.SoloPVP when SoloPVP.SoloPVP_ChatDuringGame.GetBool(): case CustomGameMode.FFA when FreeForAll.FFAChatDuringGame.GetBool(): + case CustomGameMode.Mingle when Mingle.ChatDuringGameOption.GetBool(): case CustomGameMode.Quiz when Quiz.Chat: + case CustomGameMode.HideAndSeek when CustomHnS.Chat: + case CustomGameMode.NaturalDisasters when NaturalDisasters.Chat: Utils.SetChatVisibleForAll(); break; } diff --git a/Patches/MeetingHudPatch.cs b/Patches/MeetingHudPatch.cs index 910a33293..391668de2 100644 --- a/Patches/MeetingHudPatch.cs +++ b/Patches/MeetingHudPatch.cs @@ -2,17 +2,14 @@ using System; using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.Coven; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using HarmonyLib; using Hazel; using TMPro; using UnityEngine; using static EHR.Translator; +using EHR.Gamemodes; namespace EHR.Patches; @@ -1116,7 +1113,7 @@ internal static class MeetingHudStartPatch if (target.Is(CustomRoles.SuperStar) && Options.EveryOneKnowSuperStar.GetBool()) sb.Append(Utils.ColorString(Utils.GetRoleColor(CustomRoles.SuperStar), "★")); - if (Impostor.Lightning.IsGhost(target)) + if (Roles.Lightning.IsGhost(target)) sb.Append(Utils.ColorString(Utils.GetRoleColor(CustomRoles.Lightning), "■")); if (seer.PlayerId == target.PlayerId && (Medic.InProtect(seer.PlayerId) || Medic.TempMarkProtectedList.Contains(seer.PlayerId)) && Medic.WhoCanSeeProtect.GetInt() is 0 or 2) @@ -1146,7 +1143,7 @@ internal static class MeetingHudStartPatch // ------------------------------------------------------------------------------------------- - Coven.Coven.CovenMeetingStartPatch.Postfix(); + CovenBase.CovenMeetingStartPatch.Postfix(); GuessManager.StartMeetingPatch.Postfix(__instance); Inspector.StartMeetingPatch.Postfix(__instance); Judge.StartMeetingPatch.Postfix(__instance); diff --git a/Patches/OnGameStartedPatch.cs b/Patches/OnGameStartedPatch.cs index bc08f13c6..0c7b15257 100644 --- a/Patches/OnGameStartedPatch.cs +++ b/Patches/OnGameStartedPatch.cs @@ -6,14 +6,10 @@ using AmongUs.Data; using AmongUs.GameOptions; using Assets.CoreScripts; using BepInEx.Unity.IL2CPP.Utils.Collections; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.Impostor; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; +using EHR.Roles; using HarmonyLib; using Hazel; using InnerNet; @@ -304,7 +300,7 @@ internal static class ChangeRoleSettings ShipStatusFixedUpdatePatch.CanUseClosestVent = []; RandomSpawn.CustomNetworkTransformHandleRpcPatch.HasSpawned = []; - Coven.Coven.CovenMeetingStartPatch.MeetingNum = 0; + CovenBase.CovenMeetingStartPatch.MeetingNum = 0; AFKDetector.ShieldedPlayers.Clear(); Main.Invisible.Clear(); diff --git a/Patches/OutroPatch.cs b/Patches/OutroPatch.cs index b0c80700e..c60ae3a96 100644 --- a/Patches/OutroPatch.cs +++ b/Patches/OutroPatch.cs @@ -3,10 +3,9 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using BepInEx.Unity.IL2CPP.Utils.Collections; -using EHR.AddOns.GhostRoles; -using EHR.Crewmate; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using TMPro; @@ -174,6 +173,8 @@ internal static class EndGamePatch else Options.AutoGMRotationIndex = 0; } } + + Main.Instance.StartCoroutine(BanManager.LoadEACList(reload: true)); } } } diff --git a/Patches/PetActionsPatch.cs b/Patches/PetActionsPatch.cs index 2f91adc0a..5ba521995 100644 --- a/Patches/PetActionsPatch.cs +++ b/Patches/PetActionsPatch.cs @@ -2,10 +2,9 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using Hazel; using UnityEngine; diff --git a/Patches/PhantomRolePatch.cs b/Patches/PhantomRolePatch.cs index e2260154d..a802b8bf5 100644 --- a/Patches/PhantomRolePatch.cs +++ b/Patches/PhantomRolePatch.cs @@ -1,7 +1,6 @@ using System; using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Impostor; +using EHR.Roles; using HarmonyLib; using Hazel; using Il2CppInterop.Runtime.InteropTypes.Arrays; diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 76eb369ed..24f9b6214 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -4,16 +4,8 @@ using System.Linq; using System.Reflection; using AmongUs.Data; using AmongUs.GameOptions; -using EHR.AddOns.Common; -using EHR.AddOns.Crewmate; -using EHR.AddOns.GhostRoles; -using EHR.AddOns.Impostor; -using EHR.Coven; -using EHR.Crewmate; -using EHR.GameMode.HideAndSeekRoles; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; using HarmonyLib; using Hazel; @@ -22,7 +14,8 @@ using TMPro; using UnityEngine; using static EHR.Translator; using static EHR.Utils; -using Tree = EHR.Crewmate.Tree; +using Tree = EHR.Roles.Tree; +using EHR.Gamemodes; namespace EHR; @@ -661,7 +654,7 @@ internal static class MurderPlayerPatch if (killer.Is(CustomRoles.Sniper)) { - if (!Options.UsePets.GetBool()) + if (!Options.UsePets.GetBool() || Options.UsePhantomBasis.GetBool()) killer.RpcResetAbilityCooldown(); else { @@ -704,7 +697,7 @@ internal static class MurderPlayerPatch switch (target.GetCustomRole()) { case CustomRoles.Lightning when killer != target: - Impostor.Lightning.MurderPlayer(killer, target); + Roles.Lightning.MurderPlayer(killer, target); break; case CustomRoles.Bane when killer != target: Bane.OnKilled(killer); @@ -945,7 +938,7 @@ internal static class ShapeshiftPatch case Adventurer av when shapeshifting: Adventurer.OnAnyoneShapeshiftLoop(av, __instance); break; - case Crewmate.Sentry st: + case EHR.Roles.Sentry st: st.OnAnyoneShapeshiftLoop(__instance, target); break; } @@ -1065,7 +1058,8 @@ internal static class ReportDeadBodyPatch if (!Occultist.OnAnyoneReportDeadBody(target) || - !Altruist.OnAnyoneCheckReportDeadBody(__instance, target)) + !Altruist.OnAnyoneCheckReportDeadBody(__instance, target) || + !TimeMaster.OnAnyoneCheckReportDeadBody(__instance, target)) { Notify("PlayerWasRevived"); return false; @@ -1911,7 +1905,7 @@ internal static class FixedUpdatePatch if (target.AmOwner) Mark.Append(Sniper.GetShotNotify(target.PlayerId)); - if (Impostor.Lightning.IsGhost(target)) Mark.Append(ColorString(GetRoleColor(CustomRoles.Lightning), "■")); + if (Roles.Lightning.IsGhost(target)) Mark.Append(ColorString(GetRoleColor(CustomRoles.Lightning), "■")); Mark.Append(Medic.GetMark(seer, target)); Mark.Append(Gaslighter.GetMark(seer, target)); @@ -2041,7 +2035,7 @@ internal static class FixedUpdatePatch public static void LoversSuicide(byte deathId = 0x7f, bool exile = false, bool force = false, bool guess = false) { - if (Options.CurrentGameMode != CustomGameMode.Standard) return; + if (Main.LoversPlayers.Count == 0 || Options.CurrentGameMode != CustomGameMode.Standard) return; if (Lovers.LoverDieConsequence.GetValue() == 0 || Main.IsLoversDead || (Main.LoversPlayers.FindAll(x => x.IsAlive()).Count != 1 && !force)) return; PlayerControl partnerPlayer = Main.LoversPlayers.FirstOrDefault(player => player.PlayerId != deathId && player.IsAlive()); @@ -2108,7 +2102,7 @@ internal static class EnterVentPatch Drainer.OnAnyoneEnterVent(pc, __instance); Analyst.OnAnyoneEnterVent(pc); - Crewmate.Sentry.OnAnyoneEnterVent(pc); + Roles.Sentry.OnAnyoneEnterVent(pc); switch (pc.GetCustomRole()) { diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index 7114d8776..3e259093f 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -7,11 +7,10 @@ using System.Text.RegularExpressions; using AmongUs.Data; using AmongUs.GameOptions; using AmongUs.InnerNet.GameDataMessages; -using EHR.AddOns.Common; -using EHR.Crewmate; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; +using EHR.Roles; using HarmonyLib; using Hazel; using InnerNet; @@ -185,6 +184,26 @@ internal static class OnGameJoinedPatch } } + if (Options.AutoReadyCheckCommandAfterJoin.GetBool()) + { + Main.Instance.StartCoroutine(CoRoutine()); + + IEnumerator CoRoutine() + { + float timer = Options.AutoReadyCheckCommandCooldown.GetInt(); + + while (timer > 0) + { + if (!GameStates.IsLobby) yield break; + timer -= Time.deltaTime; + yield return null; + } + + if (Options.AutoReadyCheckCommandAfterJoin.GetBool()) + ChatCommands.ReadyCheckCommand(PlayerControl.LocalPlayer, "Command.ReadyCheck", "/readycheck", ["/readycheck"]); + } + } + if (Options.AutoGMRotationEnabled) { Main.Instance.StartCoroutine(CoRoutine()); @@ -533,12 +552,14 @@ internal static class OnPlayerLeftPatch { if (AmongUsClient.Instance.AmHost && GameStates.IsInGame && data != null && data.Character != null) { - ExtendedPlayerControl.TempExiled.Remove(data.Character.PlayerId); + byte id = data.Character.PlayerId; + + ExtendedPlayerControl.TempExiled.Remove(id); switch (Options.CurrentGameMode) { case CustomGameMode.HideAndSeek: - CustomHnS.PlayerRoles.Remove(data.Character.PlayerId); + CustomHnS.PlayerRoles.Remove(id); break; case CustomGameMode.Mingle when data.Character.IsAlive(): Mingle.HandleDisconnect(); @@ -556,13 +577,13 @@ internal static class OnPlayerLeftPatch Main.PlayerStates[lovers.PlayerId].RemoveSubRole(CustomRoles.Lovers); } - Main.LoversPlayers.RemoveAll(x => x.PlayerId == data.Character.PlayerId); + Main.LoversPlayers.RemoveAll(x => x.PlayerId == id); } switch (data.Character.GetCustomRole()) { case CustomRoles.Pelican: - Pelican.OnPelicanDied(data.Character.PlayerId); + Pelican.OnPelicanDied(id); break; case CustomRoles.Markseeker: Markseeker.OnDeath(data.Character); @@ -572,23 +593,29 @@ internal static class OnPlayerLeftPatch break; } - if (Executioner.Target.ContainsValue(data.Character.PlayerId)) Executioner.ChangeRoleByTarget(data.Character); + if (Executioner.Target.ContainsValue(id)) + Executioner.ChangeRoleByTarget(data.Character); - if (Lawyer.Target.ContainsValue(data.Character.PlayerId)) Lawyer.ChangeRoleByTarget(data.Character); + if (Lawyer.Target.ContainsValue(id)) + Lawyer.ChangeRoleByTarget(data.Character); - if (Spiritualist.SpiritualistTarget == data.Character.PlayerId) Spiritualist.RemoveTarget(); + if (Spiritualist.SpiritualistTarget == id) + Spiritualist.RemoveTarget(); + + if (CopyCat.PlayerIdList.Remove(id)) + CopyCat.Instances.RemoveAll(x => x.CopyCatPC == null); Postman.CheckAndResetTargets(data.Character); - GhostRolesManager.AssignedGhostRoles.Remove(data.Character.PlayerId); + GhostRolesManager.AssignedGhostRoles.Remove(id); - PlayerState state = Main.PlayerStates[data.Character.PlayerId]; + PlayerState state = Main.PlayerStates[id]; if (state.deathReason == PlayerState.DeathReason.etc) state.deathReason = PlayerState.DeathReason.Disconnected; if (!state.IsDead) state.SetDead(); Utils.AfterPlayerDeathTasks(data.Character, GameStates.IsMeeting, true); - NameNotifyManager.Notifies.Remove(data.Character.PlayerId); + NameNotifyManager.Notifies.Remove(id); data.Character.RpcSetName(data.Character.GetRealName(true)); PlayerGameOptionsSender.RemoveSender(data.Character); } @@ -895,4 +922,5 @@ internal static class NetworkedPlayerInfoInitPatch } } } -} \ No newline at end of file + +} diff --git a/Patches/RandomSpawnPatch.cs b/Patches/RandomSpawnPatch.cs index 726c87b15..51a2b7677 100644 --- a/Patches/RandomSpawnPatch.cs +++ b/Patches/RandomSpawnPatch.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.Impostor; +using EHR.Roles; using HarmonyLib; using Hazel; using UnityEngine; diff --git a/Patches/SabotageSystemPatch.cs b/Patches/SabotageSystemPatch.cs index c9348ac71..7ae037a63 100644 --- a/Patches/SabotageSystemPatch.cs +++ b/Patches/SabotageSystemPatch.cs @@ -1,10 +1,8 @@ using System; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Impostor; using EHR.Modules; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using Hazel; @@ -407,6 +405,8 @@ public static class SabotageSystemTypeRepairDamagePatch public static bool CheckSabotage(SabotageSystemType __instance, PlayerControl player, SystemTypes systemTypes) { + if (__instance is { Timer: > 0f }) return false; + if (Options.DisableSabotage.GetBool()) { switch (systemTypes) diff --git a/Patches/ShipStatusPatch.cs b/Patches/ShipStatusPatch.cs index 79c781e7b..b6d95b893 100644 --- a/Patches/ShipStatusPatch.cs +++ b/Patches/ShipStatusPatch.cs @@ -3,14 +3,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using BepInEx; -using EHR.AddOns.Crewmate; -using EHR.AddOns.Impostor; -using EHR.Crewmate; -using EHR.Neutral; +using EHR.Roles; using EHR.Patches; using HarmonyLib; using Hazel; using UnityEngine; +using EHR.Gamemodes; namespace EHR; diff --git a/Patches/TaskAssignPatch.cs b/Patches/TaskAssignPatch.cs index 34551706d..dbe81aecf 100644 --- a/Patches/TaskAssignPatch.cs +++ b/Patches/TaskAssignPatch.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.AddOns.Crewmate; -using EHR.AddOns.GhostRoles; -using EHR.Impostor; +using EHR.Roles; using EHR.Modules; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; diff --git a/Patches/UsablesPatch.cs b/Patches/UsablesPatch.cs index f92d53d13..7359c6a68 100644 --- a/Patches/UsablesPatch.cs +++ b/Patches/UsablesPatch.cs @@ -1,6 +1,5 @@ using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Neutral; +using EHR.Roles; using HarmonyLib; using UnityEngine; diff --git a/README.md b/README.md index ea96f1c80..6ba233c93 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ You can also report bugs and suggest features in the #bug-reports and #suggestio | /afkexempt | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | /os | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | /unmute | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | -| /readycheck | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | +| /readycheck | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | /end | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | Lobby tag | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | @@ -364,7 +364,7 @@ Click this badge to view our translation project: | /draftstart
/ds | Start drafting, where players may choose their roles for the next game | – | :red_circle: Host, Moderators, And Admins | :green_square: In Lobby | :x: | | /dd
/draftdesc
/draftdescription | View the description of one of the roles you got in the draft. | 🔸 **index** – The number in the drafting message of the role to view the description of
| :purple_circle: Everyone | :green_square: In Lobby | :x: | | /draft | Choose a role in the draft | 🔸 **number** – The number of the role to choose
| :purple_circle: Everyone | :green_square: In Lobby | :x: | -| /rc
/readycheck | Start a ready check (check who is AFK) (results displayed after 30s) | – | :white_circle: Host And Admins | :green_square: In Lobby | :x: | +| /rc
/readycheck | Start a ready check (check who is AFK) (results displayed after 30s) | – | :red_circle: Host, Moderators, And Admins | :green_square: In Lobby | :x: | | /ready | Mark yourself as ready | – | :purple_circle: Everyone | :green_square: In Lobby | :x: | | /enableallroles | Enables all roles and add-ons | – | :yellow_circle: Host | :green_square: In Lobby | :x: | | /achievements | See which achievements you have unlocked and which you haven't | – | :green_circle: Modded Clients | :purple_square: Always | :x: | @@ -703,5 +703,3 @@ If you have any questions about this Privacy Policy or how your data is handled, ------------------------------------------------------------------------------------------------------------ By using the Endless Host Roles mod, you agree to the terms outlined in this Privacy Policy. - - diff --git a/Resources/Config/EACList.txt b/Resources/Config/EACList.txt index eba86282e..e4cf61687 100644 --- a/Resources/Config/EACList.txt +++ b/Resources/Config/EACList.txt @@ -90,12 +90,16 @@ woveelixir#4088 | 42044d211 | DMD 3CD | Cheating | Cheater and probably Boomplay tenpalace#1924 | 6a259fcd9 | Goaty | Cheating | pinbrittle#1538 | 4955c179f | Moralmaser | Cheating | Cheating and disrupting lobbies dollfly#4791 | 5ba449454 | Mari | Cheating | Spamming RPCs to crash lobbies - byechic#6270 | 91e0145f1 | (Contains n word) | Harassing a streamer with a slur in the IGN | waiverfore#0496 | b493df896 | | Cheating in Syl's lobby | whaleutter#4768 | 9e04dc5d5 | | Cheating in Syl's lobby | No name cheater -whimrecent#6558 | f8452a9d1 | | Cheating | no name cheater -## Griefers, Toxic, harrasing, morons +whimrecent#6558 | f8452a9d1 | | Cheating | No name cheater +pureplot#2423 | ed4c7bdf6 | hdrzz | Cheater | Cheated in Sarha's lobby +wackytext#6530 | 825431910 | | Disrupting lobbies | Cheating in Dora Chan's Livestream +waistaxial#2305 | 2476a9933 | | Cheater | Disrupting Dora Chan's lobby +mindfecund#4895 | 0589ce12b | Fortegreen | Cheater | Using lobby ss cheat + +## Griefers, Toxic, Harrasing, Racist setmolar#4374 | | 藏族顶针 | Toxic | overtfeast#5802 | | 黑影 | Toxic | roomybump#8560 | | 中国国民党 | Toxic | @@ -121,6 +125,7 @@ gougesole#0734 | ed140c20d | | Toxic | Pedophile Behaviour deltamalty#8755 | | Nggeereee | Toxic | polarsail#2468 | | hatenggers | Toxic | primesnow#4272 | 65b98a6de | HiverXM | Toxic | The n word +todayside#9634 | 4e44cffe6 | | Racist | Joined a lobby with racial slur in name ## Other tenthrope#3476 | | Oldishwire | Other | diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json index 3a7e755b8..b318ab679 100644 --- a/Resources/Lang/en_US.json +++ b/Resources/Lang/en_US.json @@ -346,7 +346,7 @@ "Stained": "Stained", "Clumsy": "Clumsy", "Mischievous": "Mischievous", - "Flashman": "Flash", + "Flash": "Flash", "Undead": "Undead", "Busy": "Busy", "Truant": "Truant", @@ -404,7 +404,7 @@ "Prefix.Stained": "Stained", "Prefix.Clumsy": "Clumsy", "Prefix.Mischievous": "Mischievous", - "Prefix.Flashman": "Flash", + "Prefix.Flash": "Flash", "Prefix.Undead": "Undead", "Prefix.Busy": "Busy", "Prefix.Truant": "Truant", @@ -456,7 +456,7 @@ "ScientistEHRInfo": "Access portable vitals from anywhere", "ShapeshifterEHRInfo": "Disguise as crewmates to frame them", "GuardianAngelEHRInfo": "Protect the crewmates from the Impostors", - "ImpostorEHRInfo": "Kill and sabotage", + "ImpostorEHRInfo": "Kill & Sabotage", "CrewmateEHRInfo": "Do your tasks", "NoisemakerEHRInfo": "Alert the crewmates when you die", "TrackerEHRInfo": "Track players", @@ -466,13 +466,13 @@ "FireworkerInfo": "Go out with a BANG", "MercenaryInfo": "Keep killing, else you suicide", "VampireInfo": "Your kills are delayed", - "WarlockInfo": "Curse crewmates & shift to make them kill", - "NinjaInfo": "Mark a target, then shift to kill them", + "WarlockInfo": "Curse crewmates & Shift to make them kill", + "NinjaInfo": "Mark a target, then Shift to kill them", "ZombieInfo": "You're very slow, but can't be ejected", "AnonymousInfo": "Force a player to report a body", "MinerInfo": "Warp to your last used vent by shifting", "KillingMachineInfo": "You can ONLY kill, but low cooldown and bypass shields", - "EscapistInfo": "Shift to mark places and warp back to them", + "EscapistInfo": "Shift/Vanish to mark places and warp back to them", "WitchInfo": "Spell crewmates to kill them in meetings", "NemesisInfo": "Revenge After Death", "GodfatherInfo": "Recruit players by voting them", @@ -482,7 +482,7 @@ "EvilTrackerInfo": "Track players by shifting", "AntiAdminerInfo": "Track device usage", "ArroganceInfo": "Your cooldown decreases with each kill you make", - "BomberInfo": "Shapeshift to explode", + "BomberInfo": "Shift/Vanish to explode", "TrapsterInfo": "Start a killing chain", "ScavengerInfo": "Your kills are unreportable", "EvilGuesserInfo": "Guess roles in meetings to kill", @@ -504,7 +504,7 @@ "TricksterInfo": "Kill and trick the crew", "VindicatorInfo": "Use your extra votes to kill everyone", "ParasiteInfo": "Help the Impostors kill the crew", - "DisperserInfo": "Shift to teleport everyone to a random vent", + "DisperserInfo": "Shift/Vanish to teleport everyone to a random vent", "InhibitorInfo": "You cannot kill during sabotages", "SaboteurInfo": "Kill to call and stack sabotages. You can only kill during a sabotage", "CouncillorInfo": "Kill crewmates during meetings", @@ -554,7 +554,7 @@ "MorticianInfo": "Report a body to know who interacted with them last", "MediumInfo": "Talk with ghosts", "ObserverInfo": "You can see all shield-animations", - "PacifistInfo": "Vent to reset kill cooldowns", + "PacifistInfo": "Vent/Pet to reset kill cooldowns", "MonarchInfo": "Give your crew extra voting power!", "InvestigatorInfo": "Reveal roles of other players", "CoronerInfo": "Find corpses and their killers", @@ -566,7 +566,7 @@ "TracefinderInfo": "Locate dead bodies", "OracleInfo": "Vote a player to see their alignment", "SpiritualistInfo": "You see where a ghost is", - "ChameleonInfo": "Vent to disguise into your surroundings", + "ChameleonInfo": "Vent/Pet to disguise into your surroundings", "InspectorInfo": "Validate the alignments of two players", "TimeMasterInfo": "Rewind time to dodge attacks!", "CrusaderInfo": "Kill a player's attacker", @@ -577,7 +577,7 @@ "ExecutionerInfo": "Get your target voted out", "LawyerInfo": "Help your target win!", "VectorInfo": "Jump in, jump out, win!", - "JackalInfo": "Murder everyone", + "JackalInfo": "Convert & Murder Everyone", "GodInfo": "Everything is under your control", "InnocentInfo": "Get someone ejected by making them kill you", "PelicanInfo": "Eat all players", @@ -596,7 +596,7 @@ "FollowerInfo": "Follow a player and help them", "CultistInfo": "Charm everyone", "HexMasterInfo": "Hex players to kill them in meetings", - "WraithInfo": "Vent to go invisible temporarily", + "WraithInfo": "Vent/Vanish to go invisible temporarily", "SerialKillerInfo": "Kill everyone to win!", "JuggernautInfo": "Your cooldown decreases with each kill you get", "InfectiousInfo": "Infect everyone", @@ -604,7 +604,7 @@ "PursuerInfo": "Protect yourself and live to the end!", "SpecterInfo": "Get killed and finish your tasks to win!", "JinxInfo": "Reflect attacks onto your attackers", - "MaverickInfo": "Survive until the end to win", + "MaverickInfo": "Kill & Survive until the end to win", "CursedSoulInfo": "Snatch souls and steal the win", "RitualistInfo": "Kill and reveal the roles of your enemies", "PickpocketInfo": "Steal votes from your kills", @@ -621,7 +621,7 @@ "NtrInfo": "Everyone sees you as their Lover", "WatcherInfo": "You see vote colors", "LastImpostorInfo": "Lower kill cooldown", - "FlashmanInfo": "You're faster", + "FlashInfo": "You're faster", "GiantInfo": "You're slower", "TruantInfo": "You freeze after meetings for some time", "TorchInfo": "You have a higher vision!", @@ -656,7 +656,7 @@ "BloodlustInfo": "You can kill", "StainedInfo": "Your killer gets a violet name for 3s", "ClumsyInfo": "You trip while walking", - "MischievousInfo": "You can sabotage", + "MischievousInfo": "You can Sabotage", "DisregardedInfo": "Your body can't be reported", "LuckyInfo": "Dodge attackers", "DoubleShotInfo": "You have an extra life when guessing", @@ -680,7 +680,7 @@ "NotAssignedInfo": "Error, report to host!!", "SunnyboyInfo": "Shine, shine my sunshine!", "BardInfo": "Poem's grace, murder's trace, a rhythmic dance in a dark embrace.", - "NukerInfo": "Shapeshift to nuke everyone", + "NukerInfo": "Shift/Vanish to nuke everyone", "EngineerEHRInfoLong": "(Crewmates):\\nAs the Engineer, you may access the vents while comms are not sabotaged. Vents are disabled when they are sabotaged.", "ScientistEHRInfoLong": "(Crewmates):\\nAs the Scientist, you have a portable tablet with the crew's vitals on it. Use this any way you'd like. Catching self-reports, extra intel on body age, etc.", "ShapeshifterEHRInfoLong": "(Impostors):\\nAs the Shapeshifter, you have a shapeshifting ability that you may use to frame other crewmates. Just be aware that there is an egg while shifting, and the disguise is temporary.", @@ -852,8 +852,8 @@ "BloodlustInfoLong": "(Add-ons):\\nYou can kill. You are a neutral killer while keeping your role's ability (as much as host-only limitations allow).\\nIf your role has an ability to be used through the kill button, you can single-click to use your ability and double-click the kill button to kill.", "StainedInfoLong": "(Add-ons):\\nYour killer gets a violet name for 3 seconds.", "ClumsyInfoLong": "(Add-ons):\\nWhile walking, you have a small chance of tripping, meaning you freeze for a few seconds.", - "MischievousInfoLong": "(Add-ons):\\nYou can sabotage.", - "FlashmanInfoLong": "(Add-ons):\\nThe Flash is faster by default.", + "MischievousInfoLong": "(Add-ons):\\nYou can Sabotage.", + "FlashInfoLong": "(Add-ons):\\nThe Flash is faster by default.", "GiantInfoLong": "(Add-ons):\\nThe Giant is slower by default.", "BusyInfoLong": "(Add-ons):\\nYou have more tasks.", "DiscoInfoLong": "(Add-ons):\\nYou change your skin color every few seconds.", @@ -865,7 +865,7 @@ "BewilderInfoLong": "(Add-ons):\\nBewilder's vision changes killer's vision on death.", "TruantInfoLong": "(Add-ons):\\nAfter each meeting, you freeze in place for a set amount of seconds.", "WorkhorseInfoLong": "(Add-ons):\\nComplete all tasks to become Workhorse and get extra tasks set by the host.", - "FoolInfoLong": "(Add-ons):\\nYou can't fix Lights and Comms sabotages.", + "FoolInfoLong": "(Add-ons):\\nYou can't fix Lights and Comms sabotages. Note: Technician can't be Fool.", "AvengerInfoLong": "(Add-ons):\\nHost can allow Impostor to become Avenger. If Avenger dies, they'll revenge a random player.", "YoutuberInfoLong": "(Add-ons):\\nIf the YouTuber is the first player killed, they win. If not, they follow the Crewmate to win. Note: Indirect killing methods don't trigger the YouTuber's skills.", "EgoistInfoLong": "(Add-ons):\\nOnly impostors can get Egoist. If the impostor team wins while there's at least one Impostor alive who isn't an Egoist, the Egoist loses.\\nIn order for the Egoist to win, they must eject all other impostors and stay alive.", @@ -933,8 +933,8 @@ "DisablePlayerVotedMessage": "Disable 'X has voted. Y remaining.' Message in Meetings", "LadderDeath": "Fall From Ladders", "LadderDeathChance": "Fall To Death Chance", - "GuesserDoesntDieOnMisguess": "Guesser Doesn't Die on Misguess", - "CanGuessDuringDiscussionTime": "Guessers Can Guess During Discussion Time", + "GuesserDoesntDieOnMisguess": "Guesser Doesn't Die on Misguess", + "CanGuessDuringDiscussionTime": "Guessers Can Guess During Discussion Time", "MisguessDeathReason": "'Misguess' Death Reason", "YouCanGuessTitle": "<#00ffff>You can Guess!", "YouCanGuess": "Use the /bt [player id] [role] command to guess someone's role. You can see everyone's IDs next to their name, or type /id.", @@ -1091,6 +1091,8 @@ "AutoMPollCommandCooldown": "Delay Before Auto Executing /mpoll (After Joining The Lobby)", "AutoDraftStartCommandAfterJoin": "Auto Execute /draftstart After Joining The Lobby", "AutoDraftStartCommandCooldown": "Delay Before Auto Executing /draftstart (After Joining The Lobby)", + "AutoReadyCheckCommandAfterJoin": "Auto Execute /readycheck After Joining The Lobby", + "AutoReadyCheckCommandCooldown": "Delay Before Auto Executing /readycheck (After Joining The Lobby)", "EnterKeyToStartGame": "Begin the starting countdown by pressing the Enter key", "RemovePetsAtDeadPlayers": "Remove pets from dead players", "SeeEjectedRolesInMeeting": "See ejected roles in meetings", @@ -1266,7 +1268,7 @@ "MenuTitle.Guessers": "★ Guesser Mode ★", "MenuTitle.CTA": "★ Custom Team Assignment ★", "MenuTitle.AFKDetection": "★ AFK Detection ★", - "ReadyCheckMessage": "The Host/an Admin is checking how many players are ready to start the game.\\nPlease type /ready to let the Host/Admins know you're not AFK.", + "ReadyCheckMessage": "The Host/a Staff is checking how many players are ready to start the game.\\nPlease type /ready to let the Host/Staff know you're not AFK.", "ReadyCheckTitle": "<#ffff00>★ Ready Check ★", "EveryoneReadyTitle": "<#00ff00>Everyone is ready!", "PlayersNotReadyTitle": "<#ffff00><#ffab1b>{0} players are not ready! They are:", @@ -1497,7 +1499,7 @@ "BewilderVision": "Bewilder Vision", "JesterVision": "Jester Vision", "LawyerVision": "Lawyer Vision", - "FlashmanSpeed": "Flash Speed", + "FlashSpeed": "Flash Speed", "GiantSpeed": "Giant Speed", "NeutralsKnowEachOther": "Neutrals know each other", "LoverDieConsequence": "Consequence for Second Lover, When First One Dies", @@ -2159,7 +2161,7 @@ "GuessImpRole": "Unfortunately, the Host's settings do not allow Impostors to guess Impostor roles.", "GuessCrewRole": "Unfortunately, the Host's settings do not allow crewmates to guess crewmate roles.", "GuessMarkseekerTarget": "You can't guess the target of the Markseeker", - "GuessKill": "{0} was guessed", + "GuessKill": "{0} was guessed (or they misguessed)", "GuessNull": "Please select an ID of a living player to guess their role", "GuessHelp": "Instructions: /bt [Player ID] [Role Name] \\nExample: /bt 3 Bait \\nYou can see the player IDs before everyone's names \\n or use the /id command to list the player IDs", "GGGuessMax": "You've reached the limit of maximum guesses, you can't guess anymore!", @@ -2353,7 +2355,7 @@ "Message.NoDescription": "No description", "Message.KickedByDenyName": "{0} was kicked because their name matched {1}", "Message.BanedByBanList": "{0} was banned because they were banned in the past.", - "Message.BanedByEACList": "{0} has been banned because he is in EAC list of Banned people.", + "Message.BanedByEACList": "{0} has been banned because they're in the EAC list of Banned people.", "Message.InvalidFriendCode": "{0} has been banned because they have an invalid friend code.", "Message.DumpfileSaved": "The log file was successfully saved to the desktop, filename: {0}", "Message.KickedByNoFriendCode": "{0} was kicked because their friend code does not exist.", @@ -3219,7 +3221,7 @@ "AbilityButtonText.Impostor": "Haunt", "AbilityButtonText.Shapeshifter": "Shift", "AbilityButtonText.Phantom": "Vanish", - "AbilityButtonText.Viper": "Acid", + "KillButtonText.Viper": "Acid", "AbilityButtonText.Detective": "Notes", "SecondaryAbilityButtonText.Detective": "Interrogate", "GauloisKillButtonText": "Speed Up", @@ -3641,7 +3643,7 @@ "ReportBaitAtAllCost": "Report <#00f7ff>Bait at All Cost", "Jailor": "Jailor", "JailorInfo": "Lock up your target in Jail", - "JailorInfoLong": "(Crewmates):\\nAs the Jailor, use your kill button to lock a player in jail. Jailed players cannot be guessed or judged and jailed players can only guess Jailor.", + "JailorInfoLong": "(Crewmates):\\nAs the Jailor, use your kill button to lock a player in jail. Jailed players cannot be guessed or judged and jailed players can only guess Jailor.\\nWhile in jail, jailed players can privately communicate with the Jailor using /jailtalk.", "JailorJailCooldown": "Jail cooldown", "JailorTargetAlreadySelected": "You have already selected a target", "SuccessfullyJailed": "Target successfully Jailed", @@ -3836,12 +3838,11 @@ "Samurai.KillDelay": "Kill Delay", "Overheat": "Overheat", "OverheatInfo": "Hot = Low Kill Cooldown", - "OverheatInfoLong": "(Impostors):\\nAs the Overheat, your kill cooldown is based on your temperature. The more you wait, the hotter you get, and the lower your kill cooldown becomes, but your chance of overheating is also increasing. You can shapeshift or pet to cool down to reset your temperature. This freezes you in place for a few seconds.", + "OverheatInfoLong": "(Impostors):\\nAs the Overheat, your kill cooldown is based on your temperature. The more you wait, the hotter you get, and the lower your kill cooldown becomes, but your chance of overheating is also increasing. You can shapeshift or pet to cool down to reset your temperature.", "Overheat.Suffix": "Temperature: {0}", "Overheat.ChanceIncrease": "Temperature Increase Rate", "Overheat.ChanceIncreaseFrequency": "Temperature Increase Frequency", "Overheat.RollChanceFrequency": "Frequency of Rolling for Overheat", - "Overheat.CoolDownTime": "Cool Down Time", "Overheat.KCDDecreasePerIncreasedTemperature": "Kill Cooldown Decrease per Increased Temperature", "QuizMaster": "Quiz Master", "QuizMasterInfo": "Ask Questions to Players", @@ -4422,7 +4423,7 @@ "HitmanLowKCD": "Lower Kill Cooldown", "Sapper": "Sapper", "SapperInfo": "Blow up Everyone with Timed Bombs!", - "SapperInfoLong": "(Impostors):\\nAs the Sapper, you can not kill with your kill button. Instead, you can pet/vanish to plant time bombs which explode after a specified delay (set by host), killing everyone nearby.\\n\\nNote: If you're in the radius of the explosion, you will die too!", + "SapperInfoLong": "(Impostors):\\nAs the Sapper, you can pet/vanish to plant time bombs which explode after a specified delay (set by host), killing everyone nearby.\\n\\nNote: If you're in the radius of the explosion, you will die too!", "SapperRadius": "Bomb Explosion Radius", "SapperCD": "Bomb Place Cooldown", "SapperDelay": "Bomb Explode Delay", @@ -4498,7 +4499,7 @@ "MagicianBombExlodesIn": "Bomb explodes in {0}s", "MagicianCardUsed": "Card used", "Necromancer": "Necromancer", - "NecromancerInfo": "Recruit Everyone", + "NecromancerInfo": "Recruit Everyone to the Undead", "NecromancerInfoLong": "(Neutrals):\\nThe Necromancer is the main recruiter for the Undead faction. The first person it kills will become a Deathknight. With the help of the Deathknight, they must work together to convert others to the Undead. If the Necromancer were to die, The Deathknight would turn into Necromancer.", "Deathknight": "Deathknight", "DeathknightInfo": "Help the Necromancer Recruit", @@ -4778,6 +4779,7 @@ "CancelSwap2": "Second Swap Target Cancelled", "SwapHelp": "Use /sw [ID] to choose a player to swap votes with.", "SwapNull": "No alive player with that ID", + "SwapperManipulatedEjection": "Thanks to the {0}", "SecurityGuard": "Security Guard", "SecurityGuardInfo": "Prevent Impostors from Sabotaging", "SecurityGuardInfoLong": "(Crewmates):\\nAs the Security Guard, you can vent/pet to activate your ability, which prevents everyone from calling any sabotages and closing doors while your ability is active. This affects the doors sabotage and neutrals as well.", @@ -4922,8 +4924,8 @@ "SoloPVP": "SOLO PVP", "ModeSoloPVP": "Gamemode: Solo PVP", "ModeDescribe.SoloPVP": "In the Solo PVP game mode, everyone has HP and can use their kill button to cause damage on other players. When a player's health reaches 0, they 'die' and respawn after a few seconds. The player(s) with the highest number of kills win(s) at the end of the game.", - "SoloPVP_Player": "SOLO PVP", - "SoloPVP_PlayerInfo": "DEFEAT OPPONENTS TO WIN", + "Challenger": "SOLO PVP", + "ChallengerInfo": "DEFEAT OPPONENTS TO WIN", "SoloPVP_GameTime": "Game duration", "SoloPVP_HPMax": "Default HP", "SoloPVP_ATK": "Default Attack", @@ -4971,7 +4973,7 @@ "FFA_ShieldIsOneTimeUse": "Shields break after 1 kill attempt", "FFA_ShieldBroken": "Someone tried to kill you, your shield is now broken!", "FFA_ChatDuringGame": "Chat During Game", - "FFAChatMessageNotify": "[Chat] {0}: {1}", + "FFAChatMessageNotify": "<#ffffff><#00ffff>[Chat] {0}: {1}", "Killer": "FREE FOR ALL", "KillerInfo": "KILL EVERYONE TO WIN", "KillerInfoLong": "KILL EVERYONE TO WIN", @@ -9390,12 +9392,14 @@ "CleanserInfo": "Erase All Addons of your vote target", "CleanserInfoLong": "(Crewmates):\\nCleanser can vote for any target at the meeting to erase the target's Add-ons, and the erasure will take effect after the meeting ends. Depending on the settings cleansed player may never get add on in future", "CleansedInfoLong": "(Add-ons):\\nCleansed Add-on can only be obtained if cleanser erases all your Add-ons. Depending on the cleanser settings, you may not be able to obtain any more Add-ons in the future.", + "TimeMasterCanRevive": "Can Revive", "TimeMasterCanUseVitals": "Can Use Vitals", "TimeMasterRewindTimeLength": "Rewind Time Length", "TimeMasterVentButtonText": "Rewind Time", "TimeMasterMaxUses": "(Initial) Max Amount of Ability Uses", "TimeMasterRewindStart": "The {0} is rewinding time!", "RevivedByTimeMaster": "<#ffff00>You were revived during the rewind!", + "TimeMasterKillerAlert": "<#ffff00>A player you killed was revived during the rewind!", "UnderdogMaximumPlayersNeededToKill": "Maximum players needed for low cooldown", "UnderdogKillCooldownWithMorePlayersAlive": "Kill Cooldown when more players are alive", "UnluckyTaskSuicideChance": "Chance to suicide from doing tasks", @@ -9960,6 +9964,8 @@ "PlagueBearerToPestilence": "You have turned into Pestilence!!", "PestilenceCanVent": "Pestilence Can Vent", "PestilenceHasImpostorVision": "Pestilence Has Impostor Vision", + "AnnounceTransformation": "Announce Transformation (from <#e5f6b4>Plaguebearer to Pestilence)", + "TransformationAnnouncementMessage": "The ship has been infected with a powerful disease, turning the <#e5f6b4>Plaguebearer into Pestilence!", "GuessPestilence": "You just tried to guess Pestilence!\\n\\nSorry, Pestilence killed you.", "PestilenceImmune": "You can't kill Pestilence.", "DoomsayerAmountOfGuessesToWin": "Amount of Guesses to win", @@ -10201,7 +10207,7 @@ "ForceEnd": "Aborted", "EveryoneDied": "Everyone died", "GameTimerEnded": "Game Time Limit Ended", - "ForceEndText": "The Host/an Admin has aborted the game", + "ForceEndText": "The Host/a Staff has aborted the game", "BlackScreenFixCompleteNotify": "<#00ff00>Black Screen Fix Code Executed", "MinMaxModdedImpCountsSettingsChangedAuto": "<#ffff00>Modded Min/Max Impostors Automatically Set To <#ffffff>{0}\\nBecause you only changed the vanilla setting, which gets overridden by the modded ones.", "DiscoChangeInterval": "Disco Change Color Interval", diff --git a/Roles/AddOns/Common/Flash.cs b/Roles/AddOns/Common/Flash.cs deleted file mode 100644 index 81a367a74..000000000 --- a/Roles/AddOns/Common/Flash.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace EHR.AddOns.Common; - -internal class Flashman : IAddon -{ - public AddonTypes Type => AddonTypes.Helpful; - - public void SetupCustomOption() - { - Options.SetupAdtRoleOptions(18700, CustomRoles.Flashman, canSetNum: true, tab: TabGroup.Addons, teamSpawnOptions: true); - - Options.FlashmanSpeed = new FloatOptionItem(18708, "FlashmanSpeed", new(0.25f, 3f, 0.05f), 2.5f, TabGroup.Addons) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Flashman]) - .SetValueFormat(OptionFormat.Multiplier); - } -} \ No newline at end of file diff --git a/GameMode/HideAndSeekRoles/Agent.cs b/Roles/HideAndSeek/Agent.cs similarity index 97% rename from GameMode/HideAndSeekRoles/Agent.cs rename to Roles/HideAndSeek/Agent.cs index ccb05f90f..3f2449856 100644 --- a/GameMode/HideAndSeekRoles/Agent.cs +++ b/Roles/HideAndSeek/Agent.cs @@ -1,4 +1,4 @@ -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Agent : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Dasher.cs b/Roles/HideAndSeek/Dasher.cs similarity index 99% rename from GameMode/HideAndSeekRoles/Dasher.cs rename to Roles/HideAndSeek/Dasher.cs index 1e4759456..adb4e7bdd 100644 --- a/GameMode/HideAndSeekRoles/Dasher.cs +++ b/Roles/HideAndSeek/Dasher.cs @@ -1,6 +1,7 @@ using AmongUs.GameOptions; +using EHR.Gamemodes; -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Dasher : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Detector.cs b/Roles/HideAndSeek/Detector.cs similarity index 98% rename from GameMode/HideAndSeekRoles/Detector.cs rename to Roles/HideAndSeek/Detector.cs index 36f686ae3..f8a1dd27a 100644 --- a/GameMode/HideAndSeekRoles/Detector.cs +++ b/Roles/HideAndSeek/Detector.cs @@ -1,6 +1,7 @@ using System.Linq; +using EHR.Gamemodes; -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Detector : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Fox.cs b/Roles/HideAndSeek/Fox.cs similarity index 97% rename from GameMode/HideAndSeekRoles/Fox.cs rename to Roles/HideAndSeek/Fox.cs index 658a3a096..c198cf0e8 100644 --- a/GameMode/HideAndSeekRoles/Fox.cs +++ b/Roles/HideAndSeek/Fox.cs @@ -1,4 +1,4 @@ -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; internal class Fox : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Hider.cs b/Roles/HideAndSeek/Hider.cs similarity index 98% rename from GameMode/HideAndSeekRoles/Hider.cs rename to Roles/HideAndSeek/Hider.cs index 7c2df66ec..e6e2a481b 100644 --- a/GameMode/HideAndSeekRoles/Hider.cs +++ b/Roles/HideAndSeek/Hider.cs @@ -1,4 +1,6 @@ -namespace EHR.GameMode.HideAndSeekRoles; +using EHR.Gamemodes; + +namespace EHR.Roles; internal class Hider : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/IHideAndSeekRole.cs b/Roles/HideAndSeek/IHideAndSeekRole.cs similarity index 90% rename from GameMode/HideAndSeekRoles/IHideAndSeekRole.cs rename to Roles/HideAndSeek/IHideAndSeekRole.cs index 89d343c49..9c8c8329a 100644 --- a/GameMode/HideAndSeekRoles/IHideAndSeekRole.cs +++ b/Roles/HideAndSeek/IHideAndSeekRole.cs @@ -1,4 +1,4 @@ -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; internal interface IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Jet.cs b/Roles/HideAndSeek/Jet.cs similarity index 99% rename from GameMode/HideAndSeekRoles/Jet.cs rename to Roles/HideAndSeek/Jet.cs index c086d4858..30b6a8e50 100644 --- a/GameMode/HideAndSeekRoles/Jet.cs +++ b/Roles/HideAndSeek/Jet.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Jet : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Jumper.cs b/Roles/HideAndSeek/Jumper.cs similarity index 98% rename from GameMode/HideAndSeekRoles/Jumper.cs rename to Roles/HideAndSeek/Jumper.cs index 5a7e6d293..995c71f4f 100644 --- a/GameMode/HideAndSeekRoles/Jumper.cs +++ b/Roles/HideAndSeek/Jumper.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Jumper : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Locator.cs b/Roles/HideAndSeek/Locator.cs similarity index 99% rename from GameMode/HideAndSeekRoles/Locator.cs rename to Roles/HideAndSeek/Locator.cs index 416e13d89..fdd44e868 100644 --- a/GameMode/HideAndSeekRoles/Locator.cs +++ b/Roles/HideAndSeek/Locator.cs @@ -1,6 +1,7 @@ using System.Linq; +using EHR.Gamemodes; -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Locator : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Seeker.cs b/Roles/HideAndSeek/Seeker.cs similarity index 98% rename from GameMode/HideAndSeekRoles/Seeker.cs rename to Roles/HideAndSeek/Seeker.cs index 49a98f874..e5c071dad 100644 --- a/GameMode/HideAndSeekRoles/Seeker.cs +++ b/Roles/HideAndSeek/Seeker.cs @@ -1,4 +1,6 @@ -namespace EHR.GameMode.HideAndSeekRoles; +using EHR.Gamemodes; + +namespace EHR.Roles; internal class Seeker : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Taskinator.cs b/Roles/HideAndSeek/Taskinator.cs similarity index 98% rename from GameMode/HideAndSeekRoles/Taskinator.cs rename to Roles/HideAndSeek/Taskinator.cs index cf08b2e83..62fe7dddf 100644 --- a/GameMode/HideAndSeekRoles/Taskinator.cs +++ b/Roles/HideAndSeek/Taskinator.cs @@ -1,4 +1,6 @@ -namespace EHR.GameMode.HideAndSeekRoles; +using EHR.Gamemodes; + +namespace EHR.Roles; public class Taskinator : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Troll.cs b/Roles/HideAndSeek/Troll.cs similarity index 97% rename from GameMode/HideAndSeekRoles/Troll.cs rename to Roles/HideAndSeek/Troll.cs index b222024c7..cb13d8909 100644 --- a/GameMode/HideAndSeekRoles/Troll.cs +++ b/Roles/HideAndSeek/Troll.cs @@ -1,4 +1,4 @@ -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; internal class Troll : RoleBase, IHideAndSeekRole { diff --git a/GameMode/HideAndSeekRoles/Venter.cs b/Roles/HideAndSeek/Venter.cs similarity index 98% rename from GameMode/HideAndSeekRoles/Venter.cs rename to Roles/HideAndSeek/Venter.cs index fd338af84..84ff2e739 100644 --- a/GameMode/HideAndSeekRoles/Venter.cs +++ b/Roles/HideAndSeek/Venter.cs @@ -1,4 +1,4 @@ -namespace EHR.GameMode.HideAndSeekRoles; +namespace EHR.Roles; public class Venter : RoleBase, IHideAndSeekRole { diff --git a/Roles/RoleBase.cs b/Roles/RoleBase.cs index 8b80ab9b0..d03b18c13 100644 --- a/Roles/RoleBase.cs +++ b/Roles/RoleBase.cs @@ -11,12 +11,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using AmongUs.GameOptions; -using EHR.AddOns.Crewmate; -using EHR.AddOns.Impostor; -using EHR.Crewmate; - - -namespace EHR; +namespace EHR.Roles; public abstract class RoleBase : IComparable { diff --git a/Roles/AddOns/Common/Allergic.cs b/Roles/Standard/Addons/Common/Allergic.cs similarity index 99% rename from Roles/AddOns/Common/Allergic.cs rename to Roles/Standard/Addons/Common/Allergic.cs index 5191b4264..c4efca714 100644 --- a/Roles/AddOns/Common/Allergic.cs +++ b/Roles/Standard/Addons/Common/Allergic.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using EHR.Modules; using Hazel; -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Allergic : IAddon { diff --git a/Roles/AddOns/Common/Anchor.cs b/Roles/Standard/Addons/Common/Anchor.cs similarity index 88% rename from Roles/AddOns/Common/Anchor.cs rename to Roles/Standard/Addons/Common/Anchor.cs index 167665278..06ee034aa 100644 --- a/Roles/AddOns/Common/Anchor.cs +++ b/Roles/Standard/Addons/Common/Anchor.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Anchor : IAddon { diff --git a/Roles/AddOns/Common/AntiTP.cs b/Roles/Standard/Addons/Common/AntiTP.cs similarity index 88% rename from Roles/AddOns/Common/AntiTP.cs rename to Roles/Standard/Addons/Common/AntiTP.cs index b841657cd..75f08355e 100644 --- a/Roles/AddOns/Common/AntiTP.cs +++ b/Roles/Standard/Addons/Common/AntiTP.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class AntiTP : IAddon { diff --git a/Roles/AddOns/Common/Antidote.cs b/Roles/Standard/Addons/Common/Antidote.cs similarity index 95% rename from Roles/AddOns/Common/Antidote.cs rename to Roles/Standard/Addons/Common/Antidote.cs index 94f21b6e7..3082fd55e 100644 --- a/Roles/AddOns/Common/Antidote.cs +++ b/Roles/Standard/Addons/Common/Antidote.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Antidote : IAddon { diff --git a/Roles/AddOns/Common/Asthmatic.cs b/Roles/Standard/Addons/Common/Asthmatic.cs similarity index 99% rename from Roles/AddOns/Common/Asthmatic.cs rename to Roles/Standard/Addons/Common/Asthmatic.cs index a1c76d39e..7b72f1a89 100644 --- a/Roles/AddOns/Common/Asthmatic.cs +++ b/Roles/Standard/Addons/Common/Asthmatic.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; using System.Linq; +using EHR.Gamemodes; using EHR.Modules; using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Asthmatic : IAddon { diff --git a/Roles/AddOns/Common/Autopsy.cs b/Roles/Standard/Addons/Common/Autopsy.cs similarity index 90% rename from Roles/AddOns/Common/Autopsy.cs rename to Roles/Standard/Addons/Common/Autopsy.cs index 6cfbd4a8d..c464998f0 100644 --- a/Roles/AddOns/Common/Autopsy.cs +++ b/Roles/Standard/Addons/Common/Autopsy.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Autopsy : IAddon { diff --git a/Roles/AddOns/Common/Avenger.cs b/Roles/Standard/Addons/Common/Avenger.cs similarity index 88% rename from Roles/AddOns/Common/Avenger.cs rename to Roles/Standard/Addons/Common/Avenger.cs index 4d1004c4b..d64eb6f70 100644 --- a/Roles/AddOns/Common/Avenger.cs +++ b/Roles/Standard/Addons/Common/Avenger.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Avenger : IAddon { diff --git a/Roles/AddOns/Common/Bait.cs b/Roles/Standard/Addons/Common/Bait.cs similarity index 97% rename from Roles/AddOns/Common/Bait.cs rename to Roles/Standard/Addons/Common/Bait.cs index c5ddf5ca4..4a6949392 100644 --- a/Roles/AddOns/Common/Bait.cs +++ b/Roles/Standard/Addons/Common/Bait.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Bait : IAddon { diff --git a/Roles/AddOns/Common/BananaMan.cs b/Roles/Standard/Addons/Common/BananaMan.cs similarity index 93% rename from Roles/AddOns/Common/BananaMan.cs rename to Roles/Standard/Addons/Common/BananaMan.cs index 0c1af38ee..43f6eb2d4 100644 --- a/Roles/AddOns/Common/BananaMan.cs +++ b/Roles/Standard/Addons/Common/BananaMan.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class BananaMan : IAddon { diff --git a/Roles/AddOns/Common/Beartrap.cs b/Roles/Standard/Addons/Common/Beartrap.cs similarity index 94% rename from Roles/AddOns/Common/Beartrap.cs rename to Roles/Standard/Addons/Common/Beartrap.cs index 8b492d99c..9311b05d6 100644 --- a/Roles/AddOns/Common/Beartrap.cs +++ b/Roles/Standard/Addons/Common/Beartrap.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Beartrap : IAddon { diff --git a/Roles/AddOns/Common/Bewilder.cs b/Roles/Standard/Addons/Common/Bewilder.cs similarity index 94% rename from Roles/AddOns/Common/Bewilder.cs rename to Roles/Standard/Addons/Common/Bewilder.cs index b5c47ca98..ab228052d 100644 --- a/Roles/AddOns/Common/Bewilder.cs +++ b/Roles/Standard/Addons/Common/Bewilder.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Bewilder : IAddon { diff --git a/Roles/AddOns/Common/Blind.cs b/Roles/Standard/Addons/Common/Blind.cs similarity index 88% rename from Roles/AddOns/Common/Blind.cs rename to Roles/Standard/Addons/Common/Blind.cs index b954e5d72..659846703 100644 --- a/Roles/AddOns/Common/Blind.cs +++ b/Roles/Standard/Addons/Common/Blind.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Blind : IAddon { diff --git a/Roles/AddOns/Common/Blocked.cs b/Roles/Standard/Addons/Common/Blocked.cs similarity index 88% rename from Roles/AddOns/Common/Blocked.cs rename to Roles/Standard/Addons/Common/Blocked.cs index 6155e87ee..bf5bb405c 100644 --- a/Roles/AddOns/Common/Blocked.cs +++ b/Roles/Standard/Addons/Common/Blocked.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Blocked : IAddon { diff --git a/Roles/AddOns/Common/Busy.cs b/Roles/Standard/Addons/Common/Busy.cs similarity index 95% rename from Roles/AddOns/Common/Busy.cs rename to Roles/Standard/Addons/Common/Busy.cs index 778b7a558..6153b71b1 100644 --- a/Roles/AddOns/Common/Busy.cs +++ b/Roles/Standard/Addons/Common/Busy.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Busy : IAddon { diff --git a/Roles/AddOns/Common/Clumsy.cs b/Roles/Standard/Addons/Common/Clumsy.cs similarity index 96% rename from Roles/AddOns/Common/Clumsy.cs rename to Roles/Standard/Addons/Common/Clumsy.cs index 3593b7ade..a141d4efc 100644 --- a/Roles/AddOns/Common/Clumsy.cs +++ b/Roles/Standard/Addons/Common/Clumsy.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Clumsy : IAddon { diff --git a/Roles/AddOns/Common/Commited.cs b/Roles/Standard/Addons/Common/Commited.cs similarity index 98% rename from Roles/AddOns/Common/Commited.cs rename to Roles/Standard/Addons/Common/Commited.cs index f1d13efdb..2d75fa9d2 100644 --- a/Roles/AddOns/Common/Commited.cs +++ b/Roles/Standard/Addons/Common/Commited.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; - -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Commited : IAddon { diff --git a/Roles/AddOns/Compelled.cs b/Roles/Standard/Addons/Common/Compelled.cs similarity index 90% rename from Roles/AddOns/Compelled.cs rename to Roles/Standard/Addons/Common/Compelled.cs index d6ea1089b..f2ee27d64 100644 --- a/Roles/AddOns/Compelled.cs +++ b/Roles/Standard/Addons/Common/Compelled.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns; +namespace EHR.Roles; public class Compelled : IAddon { diff --git a/Roles/AddOns/Common/Composter.cs b/Roles/Standard/Addons/Common/Composter.cs similarity index 94% rename from Roles/AddOns/Common/Composter.cs rename to Roles/Standard/Addons/Common/Composter.cs index 79bdddd1a..dbece014c 100644 --- a/Roles/AddOns/Common/Composter.cs +++ b/Roles/Standard/Addons/Common/Composter.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Composter : IAddon { diff --git a/Roles/AddOns/Common/Deadlined.cs b/Roles/Standard/Addons/Common/Deadlined.cs similarity index 98% rename from Roles/AddOns/Common/Deadlined.cs rename to Roles/Standard/Addons/Common/Deadlined.cs index 26f95d6fb..d8dd1da27 100644 --- a/Roles/AddOns/Common/Deadlined.cs +++ b/Roles/Standard/Addons/Common/Deadlined.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; - -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Deadlined : IAddon { diff --git a/Roles/AddOns/Common/Disco.cs b/Roles/Standard/Addons/Common/Disco.cs similarity index 98% rename from Roles/AddOns/Common/Disco.cs rename to Roles/Standard/Addons/Common/Disco.cs index c3bcc7b37..2b2fb1c1a 100644 --- a/Roles/AddOns/Common/Disco.cs +++ b/Roles/Standard/Addons/Common/Disco.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Disco : IAddon { diff --git a/Roles/AddOns/Common/Diseased.cs b/Roles/Standard/Addons/Common/Diseased.cs similarity index 95% rename from Roles/AddOns/Common/Diseased.cs rename to Roles/Standard/Addons/Common/Diseased.cs index 19d468458..ebb2a2385 100644 --- a/Roles/AddOns/Common/Diseased.cs +++ b/Roles/Standard/Addons/Common/Diseased.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Diseased : IAddon { diff --git a/Roles/AddOns/Common/Disregarded.cs b/Roles/Standard/Addons/Common/Disregarded.cs similarity index 90% rename from Roles/AddOns/Common/Disregarded.cs rename to Roles/Standard/Addons/Common/Disregarded.cs index ad2cf7b01..573b232fc 100644 --- a/Roles/AddOns/Common/Disregarded.cs +++ b/Roles/Standard/Addons/Common/Disregarded.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Disregarded : IAddon { diff --git a/Roles/AddOns/Common/DoubleShot.cs b/Roles/Standard/Addons/Common/DoubleShot.cs similarity index 94% rename from Roles/AddOns/Common/DoubleShot.cs rename to Roles/Standard/Addons/Common/DoubleShot.cs index aa2a6353a..4c99d7cd5 100644 --- a/Roles/AddOns/Common/DoubleShot.cs +++ b/Roles/Standard/Addons/Common/DoubleShot.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using EHR.Modules; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class DoubleShot : IAddon { diff --git a/Roles/AddOns/Common/Dynamo.cs b/Roles/Standard/Addons/Common/Dynamo.cs similarity index 99% rename from Roles/AddOns/Common/Dynamo.cs rename to Roles/Standard/Addons/Common/Dynamo.cs index 4679d0376..0530ee303 100644 --- a/Roles/AddOns/Common/Dynamo.cs +++ b/Roles/Standard/Addons/Common/Dynamo.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using UnityEngine; -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Dynamo : IAddon { diff --git a/Roles/AddOns/Common/Energetic.cs b/Roles/Standard/Addons/Common/Energetic.cs similarity index 88% rename from Roles/AddOns/Common/Energetic.cs rename to Roles/Standard/Addons/Common/Energetic.cs index 9bea923ab..2bb4d771a 100644 --- a/Roles/AddOns/Common/Energetic.cs +++ b/Roles/Standard/Addons/Common/Energetic.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Energetic : IAddon { diff --git a/Roles/Standard/Addons/Common/Flash.cs b/Roles/Standard/Addons/Common/Flash.cs new file mode 100644 index 000000000..151b827d1 --- /dev/null +++ b/Roles/Standard/Addons/Common/Flash.cs @@ -0,0 +1,15 @@ +namespace EHR.Roles; + +internal class Flash : IAddon +{ + public AddonTypes Type => AddonTypes.Helpful; + + public void SetupCustomOption() + { + Options.SetupAdtRoleOptions(18700, CustomRoles.Flash, canSetNum: true, tab: TabGroup.Addons, teamSpawnOptions: true); + + Options.FlashSpeed = new FloatOptionItem(18708, "FlashSpeed", new(0.25f, 3f, 0.05f), 2.5f, TabGroup.Addons) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Flash]) + .SetValueFormat(OptionFormat.Multiplier); + } +} diff --git a/Roles/AddOns/Common/Fool.cs b/Roles/Standard/Addons/Common/Fool.cs similarity index 89% rename from Roles/AddOns/Common/Fool.cs rename to Roles/Standard/Addons/Common/Fool.cs index 2779fc1a2..c3db70b7f 100644 --- a/Roles/AddOns/Common/Fool.cs +++ b/Roles/Standard/Addons/Common/Fool.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Fool : IAddon { diff --git a/Roles/AddOns/Common/Fragile.cs b/Roles/Standard/Addons/Common/Fragile.cs similarity index 88% rename from Roles/AddOns/Common/Fragile.cs rename to Roles/Standard/Addons/Common/Fragile.cs index 666ef14b0..862d7982d 100644 --- a/Roles/AddOns/Common/Fragile.cs +++ b/Roles/Standard/Addons/Common/Fragile.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Fragile : IAddon { diff --git a/Roles/AddOns/Common/Giant.cs b/Roles/Standard/Addons/Common/Giant.cs similarity index 94% rename from Roles/AddOns/Common/Giant.cs rename to Roles/Standard/Addons/Common/Giant.cs index 5adc092e5..6245307a0 100644 --- a/Roles/AddOns/Common/Giant.cs +++ b/Roles/Standard/Addons/Common/Giant.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Giant : IAddon { diff --git a/Roles/AddOns/Common/Glow.cs b/Roles/Standard/Addons/Common/Glow.cs similarity index 89% rename from Roles/AddOns/Common/Glow.cs rename to Roles/Standard/Addons/Common/Glow.cs index 1339c9949..f79767b2c 100644 --- a/Roles/AddOns/Common/Glow.cs +++ b/Roles/Standard/Addons/Common/Glow.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Glow : IAddon { diff --git a/Roles/AddOns/Common/Gravestone.cs b/Roles/Standard/Addons/Common/Gravestone.cs similarity index 90% rename from Roles/AddOns/Common/Gravestone.cs rename to Roles/Standard/Addons/Common/Gravestone.cs index 1cd8f5f5a..32b4dea40 100644 --- a/Roles/AddOns/Common/Gravestone.cs +++ b/Roles/Standard/Addons/Common/Gravestone.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Gravestone : IAddon { diff --git a/Roles/AddOns/Common/Guesser.cs b/Roles/Standard/Addons/Common/Guesser.cs similarity index 96% rename from Roles/AddOns/Common/Guesser.cs rename to Roles/Standard/Addons/Common/Guesser.cs index 504d3ab5f..b791c919f 100644 --- a/Roles/AddOns/Common/Guesser.cs +++ b/Roles/Standard/Addons/Common/Guesser.cs @@ -1,7 +1,7 @@ using UnityEngine; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Guesser : IAddon { diff --git a/Roles/AddOns/Common/Haste.cs b/Roles/Standard/Addons/Common/Haste.cs similarity index 88% rename from Roles/AddOns/Common/Haste.cs rename to Roles/Standard/Addons/Common/Haste.cs index 5a1f97c88..4721b5df5 100644 --- a/Roles/AddOns/Common/Haste.cs +++ b/Roles/Standard/Addons/Common/Haste.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Haste : IAddon { diff --git a/Roles/AddOns/Common/Hidden.cs b/Roles/Standard/Addons/Common/Hidden.cs similarity index 88% rename from Roles/AddOns/Common/Hidden.cs rename to Roles/Standard/Addons/Common/Hidden.cs index 38c21e2fb..6aba98ba3 100644 --- a/Roles/AddOns/Common/Hidden.cs +++ b/Roles/Standard/Addons/Common/Hidden.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Hidden : IAddon { diff --git a/Roles/AddOns/Common/Introvert.cs b/Roles/Standard/Addons/Common/Introvert.cs similarity index 99% rename from Roles/AddOns/Common/Introvert.cs rename to Roles/Standard/Addons/Common/Introvert.cs index 33db36064..ba3493b40 100644 --- a/Roles/AddOns/Common/Introvert.cs +++ b/Roles/Standard/Addons/Common/Introvert.cs @@ -3,7 +3,7 @@ using System.Linq; using EHR.Modules; using Hazel; -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Introvert : IAddon { diff --git a/Roles/AddOns/Common/Lazy.cs b/Roles/Standard/Addons/Common/Lazy.cs similarity index 92% rename from Roles/AddOns/Common/Lazy.cs rename to Roles/Standard/Addons/Common/Lazy.cs index 3a77b373e..ce5464d6c 100644 --- a/Roles/AddOns/Common/Lazy.cs +++ b/Roles/Standard/Addons/Common/Lazy.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Lazy : IAddon { diff --git a/Roles/AddOns/Common/Listener.cs b/Roles/Standard/Addons/Common/Listener.cs similarity index 96% rename from Roles/AddOns/Common/Listener.cs rename to Roles/Standard/Addons/Common/Listener.cs index d8bb0a6e4..109d02063 100644 --- a/Roles/AddOns/Common/Listener.cs +++ b/Roles/Standard/Addons/Common/Listener.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Listener : IAddon { diff --git a/Roles/AddOns/Common/Looter.cs b/Roles/Standard/Addons/Common/Looter.cs similarity index 88% rename from Roles/AddOns/Common/Looter.cs rename to Roles/Standard/Addons/Common/Looter.cs index a564604bc..4557fe1ba 100644 --- a/Roles/AddOns/Common/Looter.cs +++ b/Roles/Standard/Addons/Common/Looter.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Looter : IAddon { diff --git a/Roles/AddOns/Common/Lovers.cs b/Roles/Standard/Addons/Common/Lovers.cs similarity index 99% rename from Roles/AddOns/Common/Lovers.cs rename to Roles/Standard/Addons/Common/Lovers.cs index e789853b5..7fec74af3 100644 --- a/Roles/AddOns/Common/Lovers.cs +++ b/Roles/Standard/Addons/Common/Lovers.cs @@ -1,8 +1,9 @@ using System; using System.Linq; +using EHR.Gamemodes; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Lovers : IAddon { diff --git a/Roles/AddOns/Common/Loyal.cs b/Roles/Standard/Addons/Common/Loyal.cs similarity index 95% rename from Roles/AddOns/Common/Loyal.cs rename to Roles/Standard/Addons/Common/Loyal.cs index fd5c10640..3563920e1 100644 --- a/Roles/AddOns/Common/Loyal.cs +++ b/Roles/Standard/Addons/Common/Loyal.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Loyal : IAddon { diff --git a/Roles/AddOns/Common/Lucky.cs b/Roles/Standard/Addons/Common/Lucky.cs similarity index 94% rename from Roles/AddOns/Common/Lucky.cs rename to Roles/Standard/Addons/Common/Lucky.cs index 4410aaa5c..07f4c8410 100644 --- a/Roles/AddOns/Common/Lucky.cs +++ b/Roles/Standard/Addons/Common/Lucky.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Lucky : IAddon { diff --git a/Roles/AddOns/Common/Magnet.cs b/Roles/Standard/Addons/Common/Magnet.cs similarity index 88% rename from Roles/AddOns/Common/Magnet.cs rename to Roles/Standard/Addons/Common/Magnet.cs index 0b4a0a2d6..fae0b49cd 100644 --- a/Roles/AddOns/Common/Magnet.cs +++ b/Roles/Standard/Addons/Common/Magnet.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Magnet : IAddon { diff --git a/Roles/AddOns/Common/Messenger.cs b/Roles/Standard/Addons/Common/Messenger.cs similarity index 91% rename from Roles/AddOns/Common/Messenger.cs rename to Roles/Standard/Addons/Common/Messenger.cs index 0cfa0eb2b..7f0a3be83 100644 --- a/Roles/AddOns/Common/Messenger.cs +++ b/Roles/Standard/Addons/Common/Messenger.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; - -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Messenger : IAddon { diff --git a/Roles/AddOns/Common/Mischievous.cs b/Roles/Standard/Addons/Common/Mischievous.cs similarity index 87% rename from Roles/AddOns/Common/Mischievous.cs rename to Roles/Standard/Addons/Common/Mischievous.cs index 8ecf56f43..2a0742b39 100644 --- a/Roles/AddOns/Common/Mischievous.cs +++ b/Roles/Standard/Addons/Common/Mischievous.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Mischievous : IAddon { diff --git a/Roles/AddOns/Common/Necroview.cs b/Roles/Standard/Addons/Common/Necroview.cs similarity index 90% rename from Roles/AddOns/Common/Necroview.cs rename to Roles/Standard/Addons/Common/Necroview.cs index 6a733f22d..977ee0585 100644 --- a/Roles/AddOns/Common/Necroview.cs +++ b/Roles/Standard/Addons/Common/Necroview.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Necroview : IAddon { diff --git a/Roles/AddOns/Common/Oblivious.cs b/Roles/Standard/Addons/Common/Oblivious.cs similarity index 93% rename from Roles/AddOns/Common/Oblivious.cs rename to Roles/Standard/Addons/Common/Oblivious.cs index ee6a65ad2..efab52f36 100644 --- a/Roles/AddOns/Common/Oblivious.cs +++ b/Roles/Standard/Addons/Common/Oblivious.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Oblivious : IAddon { diff --git a/Roles/AddOns/Common/Onbound.cs b/Roles/Standard/Addons/Common/Onbound.cs similarity index 94% rename from Roles/AddOns/Common/Onbound.cs rename to Roles/Standard/Addons/Common/Onbound.cs index f26cecdbb..6c7b5c8fb 100644 --- a/Roles/AddOns/Common/Onbound.cs +++ b/Roles/Standard/Addons/Common/Onbound.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Onbound : IAddon { diff --git a/Roles/AddOns/Common/Rascal.cs b/Roles/Standard/Addons/Common/Rascal.cs similarity index 94% rename from Roles/AddOns/Common/Rascal.cs rename to Roles/Standard/Addons/Common/Rascal.cs index 5876de8dd..bcf0188d3 100644 --- a/Roles/AddOns/Common/Rascal.cs +++ b/Roles/Standard/Addons/Common/Rascal.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Rascal : IAddon { diff --git a/Roles/AddOns/Common/Reach.cs b/Roles/Standard/Addons/Common/Reach.cs similarity index 88% rename from Roles/AddOns/Common/Reach.cs rename to Roles/Standard/Addons/Common/Reach.cs index e794ab0f2..71c3f5533 100644 --- a/Roles/AddOns/Common/Reach.cs +++ b/Roles/Standard/Addons/Common/Reach.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Reach : IAddon { diff --git a/Roles/AddOns/Common/Rookie.cs b/Roles/Standard/Addons/Common/Rookie.cs similarity index 88% rename from Roles/AddOns/Common/Rookie.cs rename to Roles/Standard/Addons/Common/Rookie.cs index e5043ec4a..b8c2156a2 100644 --- a/Roles/AddOns/Common/Rookie.cs +++ b/Roles/Standard/Addons/Common/Rookie.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Rookie : IAddon { diff --git a/Roles/AddOns/Common/Schizophrenic.cs b/Roles/Standard/Addons/Common/Schizophrenic.cs similarity index 93% rename from Roles/AddOns/Common/Schizophrenic.cs rename to Roles/Standard/Addons/Common/Schizophrenic.cs index c78fcb07f..e01b43b65 100644 --- a/Roles/AddOns/Common/Schizophrenic.cs +++ b/Roles/Standard/Addons/Common/Schizophrenic.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Schizophrenic : IAddon { diff --git a/Roles/AddOns/Common/Seer.cs b/Roles/Standard/Addons/Common/Seer.cs similarity index 89% rename from Roles/AddOns/Common/Seer.cs rename to Roles/Standard/Addons/Common/Seer.cs index d7c2e2e07..38ebaabdd 100644 --- a/Roles/AddOns/Common/Seer.cs +++ b/Roles/Standard/Addons/Common/Seer.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Seer : IAddon { diff --git a/Roles/AddOns/Common/Shy.cs b/Roles/Standard/Addons/Common/Shy.cs similarity index 87% rename from Roles/AddOns/Common/Shy.cs rename to Roles/Standard/Addons/Common/Shy.cs index 93d54ee66..8feaa51ce 100644 --- a/Roles/AddOns/Common/Shy.cs +++ b/Roles/Standard/Addons/Common/Shy.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Shy : IAddon { diff --git a/Roles/AddOns/Common/Sleep.cs b/Roles/Standard/Addons/Common/Sleep.cs similarity index 96% rename from Roles/AddOns/Common/Sleep.cs rename to Roles/Standard/Addons/Common/Sleep.cs index fe7e43d6e..fcb341208 100644 --- a/Roles/AddOns/Common/Sleep.cs +++ b/Roles/Standard/Addons/Common/Sleep.cs @@ -1,7 +1,6 @@ using System.Linq; using EHR.Modules; - -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Sleep : IAddon { diff --git a/Roles/AddOns/Common/Sleuth.cs b/Roles/Standard/Addons/Common/Sleuth.cs similarity index 88% rename from Roles/AddOns/Common/Sleuth.cs rename to Roles/Standard/Addons/Common/Sleuth.cs index 0dd980649..b51aa9400 100644 --- a/Roles/AddOns/Common/Sleuth.cs +++ b/Roles/Standard/Addons/Common/Sleuth.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Sleuth : IAddon { diff --git a/Roles/AddOns/Common/Sonar.cs b/Roles/Standard/Addons/Common/Sonar.cs similarity index 98% rename from Roles/AddOns/Common/Sonar.cs rename to Roles/Standard/Addons/Common/Sonar.cs index 89380d3be..69762e246 100644 --- a/Roles/AddOns/Common/Sonar.cs +++ b/Roles/Standard/Addons/Common/Sonar.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; - -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Sonar : IAddon { diff --git a/Roles/AddOns/Common/Spurt.cs b/Roles/Standard/Addons/Common/Spurt.cs similarity index 99% rename from Roles/AddOns/Common/Spurt.cs rename to Roles/Standard/Addons/Common/Spurt.cs index a5322ac9a..fd0b94c0b 100644 --- a/Roles/AddOns/Common/Spurt.cs +++ b/Roles/Standard/Addons/Common/Spurt.cs @@ -3,7 +3,7 @@ using System.Linq; using UnityEngine; using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Spurt : IAddon { diff --git a/Roles/AddOns/Common/Stained.cs b/Roles/Standard/Addons/Common/Stained.cs similarity index 96% rename from Roles/AddOns/Common/Stained.cs rename to Roles/Standard/Addons/Common/Stained.cs index 3a74a10d5..2d970f786 100644 --- a/Roles/AddOns/Common/Stained.cs +++ b/Roles/Standard/Addons/Common/Stained.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; - -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Stained : IAddon { diff --git a/Roles/AddOns/Common/Sunglasses.cs b/Roles/Standard/Addons/Common/Sunglasses.cs similarity index 94% rename from Roles/AddOns/Common/Sunglasses.cs rename to Roles/Standard/Addons/Common/Sunglasses.cs index bb23a2d2f..13ff58493 100644 --- a/Roles/AddOns/Common/Sunglasses.cs +++ b/Roles/Standard/Addons/Common/Sunglasses.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Sunglasses : IAddon { diff --git a/Roles/AddOns/Common/Tiebreaker.cs b/Roles/Standard/Addons/Common/Tiebreaker.cs similarity index 90% rename from Roles/AddOns/Common/Tiebreaker.cs rename to Roles/Standard/Addons/Common/Tiebreaker.cs index d03108df8..d2e74f3bb 100644 --- a/Roles/AddOns/Common/Tiebreaker.cs +++ b/Roles/Standard/Addons/Common/Tiebreaker.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Tiebreaker : IAddon { diff --git a/Roles/AddOns/Common/Torch.cs b/Roles/Standard/Addons/Common/Torch.cs similarity index 95% rename from Roles/AddOns/Common/Torch.cs rename to Roles/Standard/Addons/Common/Torch.cs index e94b8d728..2876944ad 100644 --- a/Roles/AddOns/Common/Torch.cs +++ b/Roles/Standard/Addons/Common/Torch.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Torch : IAddon { diff --git a/Roles/AddOns/Common/Trainee.cs b/Roles/Standard/Addons/Common/Trainee.cs similarity index 88% rename from Roles/AddOns/Common/Trainee.cs rename to Roles/Standard/Addons/Common/Trainee.cs index b18bd45c1..7ddf99d12 100644 --- a/Roles/AddOns/Common/Trainee.cs +++ b/Roles/Standard/Addons/Common/Trainee.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Trainee : IAddon { diff --git a/Roles/AddOns/Common/Truant.cs b/Roles/Standard/Addons/Common/Truant.cs similarity index 94% rename from Roles/AddOns/Common/Truant.cs rename to Roles/Standard/Addons/Common/Truant.cs index b910c86f1..a2aa397e4 100644 --- a/Roles/AddOns/Common/Truant.cs +++ b/Roles/Standard/Addons/Common/Truant.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Truant : IAddon { diff --git a/Roles/AddOns/Common/Unbound.cs b/Roles/Standard/Addons/Common/Unbound.cs similarity index 88% rename from Roles/AddOns/Common/Unbound.cs rename to Roles/Standard/Addons/Common/Unbound.cs index 18c44f1c3..9129dd5f9 100644 --- a/Roles/AddOns/Common/Unbound.cs +++ b/Roles/Standard/Addons/Common/Unbound.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; public class Unbound : IAddon { diff --git a/Roles/AddOns/Common/Unlucky.cs b/Roles/Standard/Addons/Common/Unlucky.cs similarity index 98% rename from Roles/AddOns/Common/Unlucky.cs rename to Roles/Standard/Addons/Common/Unlucky.cs index d569befc7..7ff75bbe3 100644 --- a/Roles/AddOns/Common/Unlucky.cs +++ b/Roles/Standard/Addons/Common/Unlucky.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Unlucky : IAddon { diff --git a/Roles/AddOns/Common/Watcher.cs b/Roles/Standard/Addons/Common/Watcher.cs similarity index 90% rename from Roles/AddOns/Common/Watcher.cs rename to Roles/Standard/Addons/Common/Watcher.cs index 35b522ecc..c02ca499e 100644 --- a/Roles/AddOns/Common/Watcher.cs +++ b/Roles/Standard/Addons/Common/Watcher.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class Watcher : IAddon { diff --git a/Roles/AddOns/Common/YouTuber.cs b/Roles/Standard/Addons/Common/YouTuber.cs similarity index 89% rename from Roles/AddOns/Common/YouTuber.cs rename to Roles/Standard/Addons/Common/YouTuber.cs index 5de44a00b..df721f465 100644 --- a/Roles/AddOns/Common/YouTuber.cs +++ b/Roles/Standard/Addons/Common/YouTuber.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Common; +namespace EHR.Roles; internal class YouTuber : IAddon { diff --git a/Roles/AddOns/Crewmate/Bloodlust.cs b/Roles/Standard/Addons/Crewmate/Bloodlust.cs similarity index 96% rename from Roles/AddOns/Crewmate/Bloodlust.cs rename to Roles/Standard/Addons/Crewmate/Bloodlust.cs index f2e56f0b6..8ea99ce8b 100644 --- a/Roles/AddOns/Crewmate/Bloodlust.cs +++ b/Roles/Standard/Addons/Crewmate/Bloodlust.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; internal class Bloodlust : IAddon { diff --git a/Roles/AddOns/Crewmate/Examiner.cs b/Roles/Standard/Addons/Crewmate/Examiner.cs similarity index 94% rename from Roles/AddOns/Crewmate/Examiner.cs rename to Roles/Standard/Addons/Crewmate/Examiner.cs index e98fd1c38..2e4cde648 100644 --- a/Roles/AddOns/Crewmate/Examiner.cs +++ b/Roles/Standard/Addons/Crewmate/Examiner.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; public class Examiner : IAddon { diff --git a/Roles/AddOns/Crewmate/Finder.cs b/Roles/Standard/Addons/Crewmate/Finder.cs similarity index 96% rename from Roles/AddOns/Crewmate/Finder.cs rename to Roles/Standard/Addons/Crewmate/Finder.cs index 9981b9ff3..7389355be 100644 --- a/Roles/AddOns/Crewmate/Finder.cs +++ b/Roles/Standard/Addons/Crewmate/Finder.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; public class Finder : IAddon { diff --git a/Roles/AddOns/Crewmate/Nimble.cs b/Roles/Standard/Addons/Crewmate/Nimble.cs similarity index 96% rename from Roles/AddOns/Crewmate/Nimble.cs rename to Roles/Standard/Addons/Crewmate/Nimble.cs index 2670e9021..d8e4b8678 100644 --- a/Roles/AddOns/Crewmate/Nimble.cs +++ b/Roles/Standard/Addons/Crewmate/Nimble.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; internal class Nimble : IAddon { diff --git a/Roles/AddOns/Crewmate/Noisy.cs b/Roles/Standard/Addons/Crewmate/Noisy.cs similarity index 95% rename from Roles/AddOns/Crewmate/Noisy.cs rename to Roles/Standard/Addons/Crewmate/Noisy.cs index a4c30a827..0542618d5 100644 --- a/Roles/AddOns/Crewmate/Noisy.cs +++ b/Roles/Standard/Addons/Crewmate/Noisy.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; public class Noisy : IAddon { diff --git a/Roles/AddOns/Crewmate/Physicist.cs b/Roles/Standard/Addons/Crewmate/Physicist.cs similarity index 96% rename from Roles/AddOns/Crewmate/Physicist.cs rename to Roles/Standard/Addons/Crewmate/Physicist.cs index 0f12955f7..4f7911b5f 100644 --- a/Roles/AddOns/Crewmate/Physicist.cs +++ b/Roles/Standard/Addons/Crewmate/Physicist.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; internal class Physicist : IAddon { diff --git a/Roles/AddOns/Crewmate/Stressed.cs b/Roles/Standard/Addons/Crewmate/Stressed.cs similarity index 99% rename from Roles/AddOns/Crewmate/Stressed.cs rename to Roles/Standard/Addons/Crewmate/Stressed.cs index cae68f9c4..418afe73e 100644 --- a/Roles/AddOns/Crewmate/Stressed.cs +++ b/Roles/Standard/Addons/Crewmate/Stressed.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; public class Stressed : IAddon { diff --git a/Roles/AddOns/Crewmate/TaskMaster.cs b/Roles/Standard/Addons/Crewmate/TaskMaster.cs similarity index 97% rename from Roles/AddOns/Crewmate/TaskMaster.cs rename to Roles/Standard/Addons/Crewmate/TaskMaster.cs index e8a0658eb..1a7d3ff78 100644 --- a/Roles/AddOns/Crewmate/TaskMaster.cs +++ b/Roles/Standard/Addons/Crewmate/TaskMaster.cs @@ -2,7 +2,7 @@ using Il2CppSystem; using Exception = System.Exception; -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; public class TaskMaster : IAddon { diff --git a/Roles/AddOns/Crewmate/Workhorse.cs b/Roles/Standard/Addons/Crewmate/Workhorse.cs similarity index 96% rename from Roles/AddOns/Crewmate/Workhorse.cs rename to Roles/Standard/Addons/Crewmate/Workhorse.cs index 525904bd0..b79c0d172 100644 --- a/Roles/AddOns/Crewmate/Workhorse.cs +++ b/Roles/Standard/Addons/Crewmate/Workhorse.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using UnityEngine; using static EHR.Options; -namespace EHR.AddOns.Crewmate; +namespace EHR.Roles; public class Workhorse : IAddon { diff --git a/Roles/AddOns/IAddon.cs b/Roles/Standard/Addons/IAddon.cs similarity index 80% rename from Roles/AddOns/IAddon.cs rename to Roles/Standard/Addons/IAddon.cs index 97545e35c..7184146e9 100644 --- a/Roles/AddOns/IAddon.cs +++ b/Roles/Standard/Addons/IAddon.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns; +namespace EHR.Roles; internal interface IAddon { diff --git a/Roles/AddOns/Impostor/Aide.cs b/Roles/Standard/Addons/Impostor/Aide.cs similarity index 86% rename from Roles/AddOns/Impostor/Aide.cs rename to Roles/Standard/Addons/Impostor/Aide.cs index 141eaee30..afd21da5e 100644 --- a/Roles/AddOns/Impostor/Aide.cs +++ b/Roles/Standard/Addons/Impostor/Aide.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class Aide : IAddon { diff --git a/Roles/AddOns/Impostor/Circumvent.cs b/Roles/Standard/Addons/Impostor/Circumvent.cs similarity index 98% rename from Roles/AddOns/Impostor/Circumvent.cs rename to Roles/Standard/Addons/Impostor/Circumvent.cs index 9d7d82b33..037f1f7d0 100644 --- a/Roles/AddOns/Impostor/Circumvent.cs +++ b/Roles/Standard/Addons/Impostor/Circumvent.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; - -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Circumvent : IAddon { diff --git a/Roles/AddOns/Impostor/Concealer.cs b/Roles/Standard/Addons/Impostor/Concealer.cs similarity index 86% rename from Roles/AddOns/Impostor/Concealer.cs rename to Roles/Standard/Addons/Impostor/Concealer.cs index fdc61b34a..7ba2243bd 100644 --- a/Roles/AddOns/Impostor/Concealer.cs +++ b/Roles/Standard/Addons/Impostor/Concealer.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class Concealer : IAddon { diff --git a/Roles/AddOns/Impostor/Damocles.cs b/Roles/Standard/Addons/Impostor/Damocles.cs similarity index 99% rename from Roles/AddOns/Impostor/Damocles.cs rename to Roles/Standard/Addons/Impostor/Damocles.cs index 3228e7b00..5633b0418 100644 --- a/Roles/AddOns/Impostor/Damocles.cs +++ b/Roles/Standard/Addons/Impostor/Damocles.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class Damocles : IAddon { diff --git a/Roles/AddOns/Impostor/DeadlyQuota.cs b/Roles/Standard/Addons/Impostor/DeadlyQuota.cs similarity index 92% rename from Roles/AddOns/Impostor/DeadlyQuota.cs rename to Roles/Standard/Addons/Impostor/DeadlyQuota.cs index aa1dfbe77..87fb0172f 100644 --- a/Roles/AddOns/Impostor/DeadlyQuota.cs +++ b/Roles/Standard/Addons/Impostor/DeadlyQuota.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class DeadlyQuota : IAddon { diff --git a/Roles/AddOns/Impostor/Egoist.cs b/Roles/Standard/Addons/Impostor/Egoist.cs similarity index 92% rename from Roles/AddOns/Impostor/Egoist.cs rename to Roles/Standard/Addons/Impostor/Egoist.cs index f6b065032..86e0a2749 100644 --- a/Roles/AddOns/Impostor/Egoist.cs +++ b/Roles/Standard/Addons/Impostor/Egoist.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Egoist : IAddon { diff --git a/Roles/AddOns/Impostor/LastImpostor.cs b/Roles/Standard/Addons/Impostor/LastImpostor.cs similarity index 96% rename from Roles/AddOns/Impostor/LastImpostor.cs rename to Roles/Standard/Addons/Impostor/LastImpostor.cs index 6ac9f16d8..3ca614d01 100644 --- a/Roles/AddOns/Impostor/LastImpostor.cs +++ b/Roles/Standard/Addons/Impostor/LastImpostor.cs @@ -1,6 +1,6 @@ using Hazel; -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class LastImpostor : IAddon { diff --git a/Roles/AddOns/Impostor/Madmate.cs b/Roles/Standard/Addons/Impostor/Madmate.cs similarity index 98% rename from Roles/AddOns/Impostor/Madmate.cs rename to Roles/Standard/Addons/Impostor/Madmate.cs index d5ee994d8..7549759ca 100644 --- a/Roles/AddOns/Impostor/Madmate.cs +++ b/Roles/Standard/Addons/Impostor/Madmate.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Madmate : IAddon { diff --git a/Roles/AddOns/Impostor/Mare.cs b/Roles/Standard/Addons/Impostor/Mare.cs similarity index 97% rename from Roles/AddOns/Impostor/Mare.cs rename to Roles/Standard/Addons/Impostor/Mare.cs index b7f1526e9..060a09169 100644 --- a/Roles/AddOns/Impostor/Mare.cs +++ b/Roles/Standard/Addons/Impostor/Mare.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Mare : IAddon { diff --git a/Roles/AddOns/Impostor/Mimic.cs b/Roles/Standard/Addons/Impostor/Mimic.cs similarity index 92% rename from Roles/AddOns/Impostor/Mimic.cs rename to Roles/Standard/Addons/Impostor/Mimic.cs index 978c445ff..f81ca5c8f 100644 --- a/Roles/AddOns/Impostor/Mimic.cs +++ b/Roles/Standard/Addons/Impostor/Mimic.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Mimic : IAddon { diff --git a/Roles/AddOns/Impostor/Stealer.cs b/Roles/Standard/Addons/Impostor/Stealer.cs similarity index 92% rename from Roles/AddOns/Impostor/Stealer.cs rename to Roles/Standard/Addons/Impostor/Stealer.cs index b9a2a86da..78440e10d 100644 --- a/Roles/AddOns/Impostor/Stealer.cs +++ b/Roles/Standard/Addons/Impostor/Stealer.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Stealer : IAddon { diff --git a/Roles/AddOns/Impostor/Swift.cs b/Roles/Standard/Addons/Impostor/Swift.cs similarity index 87% rename from Roles/AddOns/Impostor/Swift.cs rename to Roles/Standard/Addons/Impostor/Swift.cs index 9f1fbee56..decac296b 100644 --- a/Roles/AddOns/Impostor/Swift.cs +++ b/Roles/Standard/Addons/Impostor/Swift.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Swift : IAddon { diff --git a/Roles/AddOns/Impostor/Taskcounter.cs b/Roles/Standard/Addons/Impostor/Taskcounter.cs similarity index 86% rename from Roles/AddOns/Impostor/Taskcounter.cs rename to Roles/Standard/Addons/Impostor/Taskcounter.cs index 299151b19..22eba7b81 100644 --- a/Roles/AddOns/Impostor/Taskcounter.cs +++ b/Roles/Standard/Addons/Impostor/Taskcounter.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; internal class Taskcounter : IAddon { diff --git a/Roles/AddOns/Impostor/Tired.cs b/Roles/Standard/Addons/Impostor/Tired.cs similarity index 97% rename from Roles/AddOns/Impostor/Tired.cs rename to Roles/Standard/Addons/Impostor/Tired.cs index 5129605cd..454eb6618 100644 --- a/Roles/AddOns/Impostor/Tired.cs +++ b/Roles/Standard/Addons/Impostor/Tired.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; - -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class Tired : IAddon { diff --git a/Roles/AddOns/Impostor/Underdog.cs b/Roles/Standard/Addons/Impostor/Underdog.cs similarity index 97% rename from Roles/AddOns/Impostor/Underdog.cs rename to Roles/Standard/Addons/Impostor/Underdog.cs index eafe3ca42..956324a3d 100644 --- a/Roles/AddOns/Impostor/Underdog.cs +++ b/Roles/Standard/Addons/Impostor/Underdog.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class Underdog : IAddon { diff --git a/Roles/AddOns/Impostor/Venom.cs b/Roles/Standard/Addons/Impostor/Venom.cs similarity index 93% rename from Roles/AddOns/Impostor/Venom.cs rename to Roles/Standard/Addons/Impostor/Venom.cs index 331b98bbe..b15fe8773 100644 --- a/Roles/AddOns/Impostor/Venom.cs +++ b/Roles/Standard/Addons/Impostor/Venom.cs @@ -1,4 +1,4 @@ -namespace EHR.AddOns.Impostor; +namespace EHR.Roles; public class Venom : IAddon { diff --git a/Roles/Coven/Augur.cs b/Roles/Standard/Coven/Augur.cs similarity index 96% rename from Roles/Coven/Augur.cs rename to Roles/Standard/Coven/Augur.cs index 80d3c5736..5fb245635 100644 --- a/Roles/Coven/Augur.cs +++ b/Roles/Standard/Coven/Augur.cs @@ -1,8 +1,8 @@ using AmongUs.GameOptions; -namespace EHR.Coven; +namespace EHR.Roles; -public class Augur : Coven +public class Augur : CovenBase { public static bool On; diff --git a/Roles/Coven/Banshee.cs b/Roles/Standard/Coven/Banshee.cs similarity index 98% rename from Roles/Coven/Banshee.cs rename to Roles/Standard/Coven/Banshee.cs index 002648f74..9c1c077f4 100644 --- a/Roles/Coven/Banshee.cs +++ b/Roles/Standard/Coven/Banshee.cs @@ -4,9 +4,9 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Banshee : Coven +public class Banshee : CovenBase { public static bool On; public static List Instances = []; diff --git a/Roles/Coven/Coven.cs b/Roles/Standard/Coven/CovenBase.cs similarity index 78% rename from Roles/Coven/Coven.cs rename to Roles/Standard/Coven/CovenBase.cs index bc48281d9..8c83bd749 100644 --- a/Roles/Coven/Coven.cs +++ b/Roles/Standard/Coven/CovenBase.cs @@ -2,9 +2,9 @@ using System.Linq; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public abstract class Coven : RoleBase +public abstract class CovenBase : RoleBase { public enum NecronomiconReceivePriorities { @@ -21,19 +21,19 @@ public abstract class Coven : RoleBase private static void GiveNecronomicon() { - Dictionary psDict = Main.PlayerStates.Where(x => x.Value.Role is Coven { HasNecronomicon: false } coven && coven.NecronomiconReceivePriority != NecronomiconReceivePriorities.Never).ToDictionary(x => x.Key, x => x.Value); + Dictionary psDict = Main.PlayerStates.Where(x => x.Value.Role is CovenBase { HasNecronomicon: false } coven && coven.NecronomiconReceivePriority != NecronomiconReceivePriorities.Never).ToDictionary(x => x.Key, x => x.Value); if (psDict.Count == 0) return; - KeyValuePair receiver = psDict.Shuffle().OrderBy(x => ((Coven)x.Value.Role).NecronomiconReceivePriority).ThenByDescending(x => !x.Value.IsDead).First(); + KeyValuePair receiver = psDict.Shuffle().OrderBy(x => ((CovenBase)x.Value.Role).NecronomiconReceivePriority).ThenByDescending(x => !x.Value.IsDead).First(); - var covenRole = (Coven)receiver.Value.Role; + var covenRole = (CovenBase)receiver.Value.Role; covenRole.HasNecronomicon = true; covenRole.OnReceiveNecronomicon(); LateTask.New(() => { var sender = CustomRpcSender.Create("CovenGiveNecronomicon", SendOption.Reliable); - string[] holders = Main.PlayerStates.Where(s => s.Value.Role is Coven { HasNecronomicon: true }).Select(s => s.Key.ColoredPlayerName()).ToArray(); + string[] holders = Main.PlayerStates.Where(s => s.Value.Role is CovenBase { HasNecronomicon: true }).Select(s => s.Key.ColoredPlayerName()).ToArray(); Main.AllPlayerControls.Where(x => x.Is(Team.Coven)).Select(x => x.PlayerId).Without(receiver.Key).Do(x => sender = Utils.SendMessage("\n", x, string.Format(Translator.GetString("PlayerReceivedTheNecronomicon"), receiver.Key.ColoredPlayerName(), Main.CovenColor, holders.Length, string.Join(", ", holders)), writer: sender, multiple: true)); sender = Utils.SendMessage("\n", receiver.Key, string.Format(Translator.GetString("YouReceivedTheNecronomicon"), Main.CovenColor), writer: sender, multiple: true); sender.SendMessage(dispose: sender.stream.Length <= 3); diff --git a/Roles/Coven/CovenLeader.cs b/Roles/Standard/Coven/CovenLeader.cs similarity index 96% rename from Roles/Coven/CovenLeader.cs rename to Roles/Standard/Coven/CovenLeader.cs index 916c7616e..858822376 100644 --- a/Roles/Coven/CovenLeader.cs +++ b/Roles/Standard/Coven/CovenLeader.cs @@ -1,8 +1,8 @@ using AmongUs.GameOptions; -namespace EHR.Coven; +namespace EHR.Roles; -public class CovenLeader : Coven +public class CovenLeader : CovenBase { public static bool On; diff --git a/Roles/Coven/CovenMember.cs b/Roles/Standard/Coven/CovenMember.cs similarity index 93% rename from Roles/Coven/CovenMember.cs rename to Roles/Standard/Coven/CovenMember.cs index 790c8ef63..35e11c936 100644 --- a/Roles/Coven/CovenMember.cs +++ b/Roles/Standard/Coven/CovenMember.cs @@ -1,6 +1,6 @@ -namespace EHR.Coven; +namespace EHR.Roles; -public class CovenMember : Coven +public class CovenMember : CovenBase { public static bool On; diff --git a/Roles/Coven/Dreamweaver.cs b/Roles/Standard/Coven/Dreamweaver.cs similarity index 96% rename from Roles/Coven/Dreamweaver.cs rename to Roles/Standard/Coven/Dreamweaver.cs index 82181d3cc..73ea547db 100644 --- a/Roles/Coven/Dreamweaver.cs +++ b/Roles/Standard/Coven/Dreamweaver.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using System.Linq; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Dreamweaver : Coven +public class Dreamweaver : CovenBase { public static bool On; @@ -28,7 +27,7 @@ public class Dreamweaver : Coven { StartSetup(650080) .AutoSetupOption(ref AbilityCooldown, 30f, new FloatValueRule(0f, 120f, 0.5f), OptionFormat.Seconds) - .AutoSetupOption(ref AbilityUseLimit, 5f, new FloatValueRule(0, 20, 0.05f), OptionFormat.Times) + .AutoSetupOption(ref AbilityUseLimit, 5f, new FloatValueRule(0, 20, 1f), OptionFormat.Times) .AutoSetupOption(ref CanVentBeforeNecronomicon, false) .AutoSetupOption(ref CanVentAfterNecronomicon, false); } @@ -114,4 +113,4 @@ public class Dreamweaver : Coven break; } } -} \ No newline at end of file +} diff --git a/Roles/Coven/Enchanter.cs b/Roles/Standard/Coven/Enchanter.cs similarity index 97% rename from Roles/Coven/Enchanter.cs rename to Roles/Standard/Coven/Enchanter.cs index 82920d752..05e494406 100644 --- a/Roles/Coven/Enchanter.cs +++ b/Roles/Standard/Coven/Enchanter.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using EHR.Modules; -namespace EHR.Coven; +namespace EHR.Roles; -public class Enchanter : Coven +public class Enchanter : CovenBase { public static bool On; diff --git a/Roles/Coven/Goddess.cs b/Roles/Standard/Coven/Goddess.cs similarity index 98% rename from Roles/Coven/Goddess.cs rename to Roles/Standard/Coven/Goddess.cs index 7c7eada30..1df4da0fb 100644 --- a/Roles/Coven/Goddess.cs +++ b/Roles/Standard/Coven/Goddess.cs @@ -2,9 +2,9 @@ using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Goddess : Coven +public class Goddess : CovenBase { public static bool On; diff --git a/Roles/Coven/Illusionist.cs b/Roles/Standard/Coven/Illusionist.cs similarity index 98% rename from Roles/Coven/Illusionist.cs rename to Roles/Standard/Coven/Illusionist.cs index 4e9edf061..b2447f2e0 100644 --- a/Roles/Coven/Illusionist.cs +++ b/Roles/Standard/Coven/Illusionist.cs @@ -3,9 +3,9 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Illusionist : Coven +public class Illusionist : CovenBase { public static bool On; diff --git a/Roles/Coven/MoonDancer.cs b/Roles/Standard/Coven/MoonDancer.cs similarity index 98% rename from Roles/Coven/MoonDancer.cs rename to Roles/Standard/Coven/MoonDancer.cs index 756428572..b4e633361 100644 --- a/Roles/Coven/MoonDancer.cs +++ b/Roles/Standard/Coven/MoonDancer.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -namespace EHR.Coven; +namespace EHR.Roles; -public class MoonDancer : Coven +public class MoonDancer : CovenBase { public static bool On; diff --git a/Roles/Coven/Poache.cs b/Roles/Standard/Coven/Poache.cs similarity index 98% rename from Roles/Coven/Poache.cs rename to Roles/Standard/Coven/Poache.cs index b1a024af6..7c702785b 100644 --- a/Roles/Coven/Poache.cs +++ b/Roles/Standard/Coven/Poache.cs @@ -2,9 +2,9 @@ using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Poache : Coven +public class Poache : CovenBase { public static bool On; diff --git a/Roles/Coven/PotionMaster.cs b/Roles/Standard/Coven/PotionMaster.cs similarity index 98% rename from Roles/Coven/PotionMaster.cs rename to Roles/Standard/Coven/PotionMaster.cs index b526ff0e8..f33744058 100644 --- a/Roles/Coven/PotionMaster.cs +++ b/Roles/Standard/Coven/PotionMaster.cs @@ -3,9 +3,9 @@ using System.Linq; using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class PotionMaster : Coven +public class PotionMaster : CovenBase { public static bool On; private static List Instances = []; diff --git a/Roles/Coven/Reaper.cs b/Roles/Standard/Coven/Reaper.cs similarity index 97% rename from Roles/Coven/Reaper.cs rename to Roles/Standard/Coven/Reaper.cs index e6a0203b3..cd3d379a9 100644 --- a/Roles/Coven/Reaper.cs +++ b/Roles/Standard/Coven/Reaper.cs @@ -3,9 +3,9 @@ using System.Linq; using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Reaper : Coven +public class Reaper : CovenBase { public static bool On; private static List Instances = []; @@ -107,7 +107,7 @@ public class Reaper : Coven } } -public class Death : Coven +public class Death : CovenBase { public static bool On; diff --git a/Roles/Coven/Siren.cs b/Roles/Standard/Coven/Siren.cs similarity index 99% rename from Roles/Coven/Siren.cs rename to Roles/Standard/Coven/Siren.cs index c652a89c7..136ff6526 100644 --- a/Roles/Coven/Siren.cs +++ b/Roles/Standard/Coven/Siren.cs @@ -2,9 +2,9 @@ using System.Linq; using AmongUs.GameOptions; -namespace EHR.Coven; +namespace EHR.Roles; -public class Siren : Coven +public class Siren : CovenBase { public static bool On; private static List Instances = []; diff --git a/Roles/Coven/SpellCaster.cs b/Roles/Standard/Coven/SpellCaster.cs similarity index 98% rename from Roles/Coven/SpellCaster.cs rename to Roles/Standard/Coven/SpellCaster.cs index 878ff9a3c..022ca6283 100644 --- a/Roles/Coven/SpellCaster.cs +++ b/Roles/Standard/Coven/SpellCaster.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using EHR.Patches; -namespace EHR.Coven; +namespace EHR.Roles; -public class SpellCaster : Coven +public class SpellCaster : CovenBase { public static bool On; diff --git a/Roles/Coven/Timelord.cs b/Roles/Standard/Coven/Timelord.cs similarity index 95% rename from Roles/Coven/Timelord.cs rename to Roles/Standard/Coven/Timelord.cs index 7a538dfd9..089f17b0e 100644 --- a/Roles/Coven/Timelord.cs +++ b/Roles/Standard/Coven/Timelord.cs @@ -1,8 +1,8 @@ using System.Linq; -namespace EHR.Coven; +namespace EHR.Roles; -public class Timelord : Coven +public class Timelord : CovenBase { public static bool On; @@ -19,7 +19,7 @@ public class Timelord : Coven { StartSetup(650110) .AutoSetupOption(ref KillCooldown, 30f, new FloatValueRule(0f, 120f, 0.5f), OptionFormat.Seconds) - .AutoSetupOption(ref TimeStolenWithEachKill, 10, new IntegerValueRule(0, 60, 1), OptionFormat.Seconds) + .AutoSetupOption(ref TimeStolenWithEachKill, 10, new IntegerValueRule(1, 60, 1), OptionFormat.Seconds) .AutoSetupOption(ref CanVentBeforeNecronomicon, false) .AutoSetupOption(ref CanVentAfterNecronomicon, true); } @@ -71,4 +71,4 @@ public class Timelord : Coven string stolen = Utils.ColorString(Team.Coven.GetColor().ShadeColor(0.25f), $" -{GetTotalStolenTime()}s"); return baseText + stolen; } -} \ No newline at end of file +} diff --git a/Roles/Coven/VoodooMaster.cs b/Roles/Standard/Coven/VoodooMaster.cs similarity index 94% rename from Roles/Coven/VoodooMaster.cs rename to Roles/Standard/Coven/VoodooMaster.cs index 3561d72f1..b38c9b580 100644 --- a/Roles/Coven/VoodooMaster.cs +++ b/Roles/Standard/Coven/VoodooMaster.cs @@ -1,9 +1,7 @@ using System; -using EHR.Neutral; +namespace EHR.Roles; -namespace EHR.Coven; - -public class VoodooMaster : Coven +public class VoodooMaster : CovenBase { public static bool On; @@ -20,7 +18,7 @@ public class VoodooMaster : Coven { StartSetup(650050) .AutoSetupOption(ref AbilityCooldown, 30f, new FloatValueRule(0f, 120f, 0.5f), OptionFormat.Seconds) - .AutoSetupOption(ref AbilityUseLimit, 5f, new FloatValueRule(0, 20, 0.05f), OptionFormat.Times) + .AutoSetupOption(ref AbilityUseLimit, 5f, new FloatValueRule(0, 20, 1f), OptionFormat.Times) .AutoSetupOption(ref CanVentBeforeNecronomicon, false) .AutoSetupOption(ref CanVentAfterNecronomicon, true); } @@ -70,4 +68,4 @@ public class VoodooMaster : Coven return HasNecronomicon; } -} \ No newline at end of file +} diff --git a/Roles/Coven/Wyrd.cs b/Roles/Standard/Coven/Wyrd.cs similarity index 98% rename from Roles/Coven/Wyrd.cs rename to Roles/Standard/Coven/Wyrd.cs index 76c410ff7..2c8896240 100644 --- a/Roles/Coven/Wyrd.cs +++ b/Roles/Standard/Coven/Wyrd.cs @@ -2,14 +2,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Impostor; using EHR.Modules; using Hazel; -namespace EHR.Coven; +namespace EHR.Roles; -public class Wyrd : Coven +public class Wyrd : CovenBase { public enum Action { diff --git a/Roles/Crewmate/Ankylosaurus.cs b/Roles/Standard/Crewmate/Chaos/Ankylosaurus.cs similarity index 98% rename from Roles/Crewmate/Ankylosaurus.cs rename to Roles/Standard/Crewmate/Chaos/Ankylosaurus.cs index e9adc41c7..b416a9ba6 100644 --- a/Roles/Crewmate/Ankylosaurus.cs +++ b/Roles/Standard/Crewmate/Chaos/Ankylosaurus.cs @@ -2,7 +2,7 @@ using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Ankylosaurus : RoleBase { diff --git a/Roles/Crewmate/Car.cs b/Roles/Standard/Crewmate/Chaos/Car.cs similarity index 99% rename from Roles/Crewmate/Car.cs rename to Roles/Standard/Crewmate/Chaos/Car.cs index 2f2b4e091..1f22ba1f6 100644 --- a/Roles/Crewmate/Car.cs +++ b/Roles/Standard/Crewmate/Chaos/Car.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using EHR.Modules; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Car : RoleBase { diff --git a/Roles/Crewmate/Dad.cs b/Roles/Standard/Crewmate/Chaos/Dad.cs similarity index 98% rename from Roles/Crewmate/Dad.cs rename to Roles/Standard/Crewmate/Chaos/Dad.cs index db3476d4f..ad53551cf 100644 --- a/Roles/Crewmate/Dad.cs +++ b/Roles/Standard/Crewmate/Chaos/Dad.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; +using EHR.Gamemodes; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Dad : RoleBase { @@ -484,7 +484,9 @@ public class Dad : RoleBase return; } - keepGameGoing = true; - countsAs = 1; + bool wentForMilk = UsingAbilities.Contains(Ability.GoForMilk); + + keepGameGoing = !wentForMilk; + countsAs = wentForMilk ? 0 : 1; } } \ No newline at end of file diff --git a/Roles/Crewmate/Goose.cs b/Roles/Standard/Crewmate/Chaos/Goose.cs similarity index 98% rename from Roles/Crewmate/Goose.cs rename to Roles/Standard/Crewmate/Chaos/Goose.cs index 8e12897c5..7e1ff6236 100644 --- a/Roles/Crewmate/Goose.cs +++ b/Roles/Standard/Crewmate/Chaos/Goose.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; public class Goose : RoleBase { diff --git a/Roles/Crewmate/Randomizer.cs b/Roles/Standard/Crewmate/Chaos/Randomizer.cs similarity index 99% rename from Roles/Crewmate/Randomizer.cs rename to Roles/Standard/Crewmate/Chaos/Randomizer.cs index 9a1df74fd..794f76b03 100644 --- a/Roles/Crewmate/Randomizer.cs +++ b/Roles/Standard/Crewmate/Chaos/Randomizer.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.Impostor; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; -using static EHR.Crewmate.Randomizer; +using static EHR.Roles.Randomizer; -namespace EHR.Crewmate; +namespace EHR.Roles; internal static class EffectExtenstions { @@ -350,7 +348,7 @@ internal static class EffectExtenstions if (allPc.Length == 0) break; PlayerControl target = allPc.RandomElement(); - Impostor.Lightning.CheckLightningMurder(killer, target, true); + Roles.Lightning.CheckLightningMurder(killer, target, true); NotifyAboutRNG(target); } diff --git a/Roles/Crewmate/ToiletMaster.cs b/Roles/Standard/Crewmate/Chaos/ToiletMaster.cs similarity index 99% rename from Roles/Crewmate/ToiletMaster.cs rename to Roles/Standard/Crewmate/Chaos/ToiletMaster.cs index 3e8ab1009..740d24182 100644 --- a/Roles/Crewmate/ToiletMaster.cs +++ b/Roles/Standard/Crewmate/Chaos/ToiletMaster.cs @@ -6,7 +6,7 @@ using EHR.Modules; using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class ToiletMaster : RoleBase { diff --git a/Roles/Crewmate/Tornado.cs b/Roles/Standard/Crewmate/Chaos/Tornado.cs similarity index 99% rename from Roles/Crewmate/Tornado.cs rename to Roles/Standard/Crewmate/Chaos/Tornado.cs index 4390f27a7..4bc127a57 100644 --- a/Roles/Crewmate/Tornado.cs +++ b/Roles/Standard/Crewmate/Chaos/Tornado.cs @@ -7,7 +7,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Tornado : RoleBase { diff --git a/Roles/Crewmate/Tree.cs b/Roles/Standard/Crewmate/Chaos/Tree.cs similarity index 99% rename from Roles/Crewmate/Tree.cs rename to Roles/Standard/Crewmate/Chaos/Tree.cs index 8359432f4..b8507be5e 100644 --- a/Roles/Crewmate/Tree.cs +++ b/Roles/Standard/Crewmate/Chaos/Tree.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Tree : RoleBase { diff --git a/Roles/Crewmate/Analyst.cs b/Roles/Standard/Crewmate/Investigate/Analyst.cs similarity index 99% rename from Roles/Crewmate/Analyst.cs rename to Roles/Standard/Crewmate/Investigate/Analyst.cs index 6d3234b1f..d77a9e124 100644 --- a/Roles/Crewmate/Analyst.cs +++ b/Roles/Standard/Crewmate/Investigate/Analyst.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Analyst : RoleBase { diff --git a/Roles/Crewmate/Captain.cs b/Roles/Standard/Crewmate/Investigate/Captain.cs similarity index 98% rename from Roles/Crewmate/Captain.cs rename to Roles/Standard/Crewmate/Investigate/Captain.cs index 3ff2bec42..e6a26fbbc 100644 --- a/Roles/Crewmate/Captain.cs +++ b/Roles/Standard/Crewmate/Investigate/Captain.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using System.Linq; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Captain : RoleBase { diff --git a/Roles/Crewmate/Catcher.cs b/Roles/Standard/Crewmate/Investigate/Catcher.cs similarity index 99% rename from Roles/Crewmate/Catcher.cs rename to Roles/Standard/Crewmate/Investigate/Catcher.cs index 1feb332c3..a4fe9e7d8 100644 --- a/Roles/Crewmate/Catcher.cs +++ b/Roles/Standard/Crewmate/Investigate/Catcher.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Catcher : RoleBase { diff --git a/Roles/Crewmate/Chameleon.cs b/Roles/Standard/Crewmate/Investigate/Chameleon.cs similarity index 96% rename from Roles/Crewmate/Chameleon.cs rename to Roles/Standard/Crewmate/Investigate/Chameleon.cs index ac855761a..358c654b2 100644 --- a/Roles/Crewmate/Chameleon.cs +++ b/Roles/Standard/Crewmate/Investigate/Chameleon.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Chameleon : RoleBase { diff --git a/Roles/Crewmate/Clairvoyant.cs b/Roles/Standard/Crewmate/Investigate/Clairvoyant.cs similarity index 98% rename from Roles/Crewmate/Clairvoyant.cs rename to Roles/Standard/Crewmate/Investigate/Clairvoyant.cs index c27ce45c4..5c47601c7 100644 --- a/Roles/Crewmate/Clairvoyant.cs +++ b/Roles/Standard/Crewmate/Investigate/Clairvoyant.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Clairvoyant : RoleBase { diff --git a/Roles/Crewmate/Coroner.cs b/Roles/Standard/Crewmate/Investigate/Coroner.cs similarity index 99% rename from Roles/Crewmate/Coroner.cs rename to Roles/Standard/Crewmate/Investigate/Coroner.cs index 967b1454a..f143aed46 100644 --- a/Roles/Crewmate/Coroner.cs +++ b/Roles/Standard/Crewmate/Investigate/Coroner.cs @@ -2,7 +2,7 @@ using System.Linq; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; using static Translator; diff --git a/Roles/Crewmate/Doctor.cs b/Roles/Standard/Crewmate/Investigate/Doctor.cs similarity index 97% rename from Roles/Crewmate/Doctor.cs rename to Roles/Standard/Crewmate/Investigate/Doctor.cs index 1dbbd736d..cf38844bd 100644 --- a/Roles/Crewmate/Doctor.cs +++ b/Roles/Standard/Crewmate/Investigate/Doctor.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Doctor : RoleBase { diff --git a/Roles/Crewmate/DoubleAgent.cs b/Roles/Standard/Crewmate/Investigate/DoubleAgent.cs similarity index 98% rename from Roles/Crewmate/DoubleAgent.cs rename to Roles/Standard/Crewmate/Investigate/DoubleAgent.cs index 6fe9980fd..70771902b 100644 --- a/Roles/Crewmate/DoubleAgent.cs +++ b/Roles/Standard/Crewmate/Investigate/DoubleAgent.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class DoubleAgent : RoleBase { diff --git a/Roles/Crewmate/Druid.cs b/Roles/Standard/Crewmate/Investigate/Druid.cs similarity index 99% rename from Roles/Crewmate/Druid.cs rename to Roles/Standard/Crewmate/Investigate/Druid.cs index 95afd640b..5d1a9a10b 100644 --- a/Roles/Crewmate/Druid.cs +++ b/Roles/Standard/Crewmate/Investigate/Druid.cs @@ -7,7 +7,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Druid : RoleBase { diff --git a/Roles/Crewmate/Enigma.cs b/Roles/Standard/Crewmate/Investigate/Enigma.cs similarity index 99% rename from Roles/Crewmate/Enigma.cs rename to Roles/Standard/Crewmate/Investigate/Enigma.cs index a90016c62..4ecea11e3 100644 --- a/Roles/Crewmate/Enigma.cs +++ b/Roles/Standard/Crewmate/Investigate/Enigma.cs @@ -3,7 +3,7 @@ using System.Linq; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Enigma : RoleBase { diff --git a/Roles/Crewmate/Forensic.cs b/Roles/Standard/Crewmate/Investigate/Forensic.cs similarity index 99% rename from Roles/Crewmate/Forensic.cs rename to Roles/Standard/Crewmate/Investigate/Forensic.cs index 04e05c518..f886460ab 100644 --- a/Roles/Crewmate/Forensic.cs +++ b/Roles/Standard/Crewmate/Investigate/Forensic.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Forensic : RoleBase { diff --git a/Roles/Crewmate/FortuneTeller.cs b/Roles/Standard/Crewmate/Investigate/FortuneTeller.cs similarity index 99% rename from Roles/Crewmate/FortuneTeller.cs rename to Roles/Standard/Crewmate/Investigate/FortuneTeller.cs index 1020e948d..ea57e61f5 100644 --- a/Roles/Crewmate/FortuneTeller.cs +++ b/Roles/Standard/Crewmate/Investigate/FortuneTeller.cs @@ -2,12 +2,11 @@ using System; using System.Collections.Generic; using System.Linq; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class FortuneTeller : RoleBase { diff --git a/Roles/Crewmate/Hacker.cs b/Roles/Standard/Crewmate/Investigate/Hacker.cs similarity index 99% rename from Roles/Crewmate/Hacker.cs rename to Roles/Standard/Crewmate/Investigate/Hacker.cs index 9ea7082ff..ec8e957f2 100644 --- a/Roles/Crewmate/Hacker.cs +++ b/Roles/Standard/Crewmate/Investigate/Hacker.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; using static Translator; @@ -38,7 +38,7 @@ public class Hacker : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Hacker]) .SetValueFormat(OptionFormat.Seconds); - UseLimitOpt = new IntegerOptionItem(Id + 11, "AbilityUseLimit", new(1, 20, 1), 2, TabGroup.CrewmateRoles) + UseLimitOpt = new IntegerOptionItem(Id + 11, "AbilityUseLimit", new(0, 20, 1), 2, TabGroup.CrewmateRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Hacker]) .SetValueFormat(OptionFormat.Times); diff --git a/Roles/Crewmate/Ignitor.cs b/Roles/Standard/Crewmate/Investigate/Ignitor.cs similarity index 99% rename from Roles/Crewmate/Ignitor.cs rename to Roles/Standard/Crewmate/Investigate/Ignitor.cs index 8559c2c86..177b49bff 100644 --- a/Roles/Crewmate/Ignitor.cs +++ b/Roles/Standard/Crewmate/Investigate/Ignitor.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; diff --git a/Roles/Crewmate/Imitator.cs b/Roles/Standard/Crewmate/Investigate/Imitator.cs similarity index 97% rename from Roles/Crewmate/Imitator.cs rename to Roles/Standard/Crewmate/Investigate/Imitator.cs index 403ecaa0f..236da3bf3 100644 --- a/Roles/Crewmate/Imitator.cs +++ b/Roles/Standard/Crewmate/Investigate/Imitator.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Imitator : RoleBase { @@ -70,7 +70,7 @@ public class Imitator : RoleBase { Logger.Msg($"Click: ID {playerId}", "Imitator UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) { diff --git a/Roles/Crewmate/Inquirer.cs b/Roles/Standard/Crewmate/Investigate/Inquirer.cs similarity index 98% rename from Roles/Crewmate/Inquirer.cs rename to Roles/Standard/Crewmate/Investigate/Inquirer.cs index c6e12f534..287b0c4ca 100644 --- a/Roles/Crewmate/Inquirer.cs +++ b/Roles/Standard/Crewmate/Investigate/Inquirer.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; public class Inquirer : RoleBase { diff --git a/Roles/Crewmate/Inquisitor.cs b/Roles/Standard/Crewmate/Investigate/Inquisitor.cs similarity index 98% rename from Roles/Crewmate/Inquisitor.cs rename to Roles/Standard/Crewmate/Investigate/Inquisitor.cs index 5a7e4bc55..366e2dc5a 100644 --- a/Roles/Crewmate/Inquisitor.cs +++ b/Roles/Standard/Crewmate/Investigate/Inquisitor.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using System.Linq; -using EHR.Neutral; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Inquisitor : RoleBase { diff --git a/Roles/Crewmate/Insight.cs b/Roles/Standard/Crewmate/Investigate/Insight.cs similarity index 98% rename from Roles/Crewmate/Insight.cs rename to Roles/Standard/Crewmate/Investigate/Insight.cs index 4b9fa1c9d..929eb6b3b 100644 --- a/Roles/Crewmate/Insight.cs +++ b/Roles/Standard/Crewmate/Investigate/Insight.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Insight : RoleBase { diff --git a/Roles/Crewmate/Inspector.cs b/Roles/Standard/Crewmate/Investigate/Inspector.cs similarity index 99% rename from Roles/Crewmate/Inspector.cs rename to Roles/Standard/Crewmate/Investigate/Inspector.cs index df3c60523..d06f6164e 100644 --- a/Roles/Crewmate/Inspector.cs +++ b/Roles/Standard/Crewmate/Investigate/Inspector.cs @@ -2,14 +2,12 @@ using System; using System.Collections.Generic; using System.Linq; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Options; using static EHR.Translator; - -namespace EHR.Crewmate; +namespace EHR.Roles; public class Inspector : RoleBase { @@ -435,7 +433,7 @@ public class Inspector : RoleBase private static void PickForCompare(byte playerId, byte lpcId) { PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (FirstPick.TryGetValue(lpcId, out byte firstPick)) { diff --git a/Roles/Crewmate/Investigator.cs b/Roles/Standard/Crewmate/Investigate/Investigator.cs similarity index 99% rename from Roles/Crewmate/Investigator.cs rename to Roles/Standard/Crewmate/Investigate/Investigator.cs index 3b11b1ec3..c3e4777c4 100644 --- a/Roles/Crewmate/Investigator.cs +++ b/Roles/Standard/Crewmate/Investigate/Investigator.cs @@ -2,15 +2,13 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Impostor; using EHR.Modules; -using EHR.Neutral; using UnityEngine; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Investigator : RoleBase { diff --git a/Roles/Crewmate/Leery.cs b/Roles/Standard/Crewmate/Investigate/Leery.cs similarity index 99% rename from Roles/Crewmate/Leery.cs rename to Roles/Standard/Crewmate/Investigate/Leery.cs index eac0f4700..3dc3efa1b 100644 --- a/Roles/Crewmate/Leery.cs +++ b/Roles/Standard/Crewmate/Investigate/Leery.cs @@ -3,7 +3,7 @@ using System.Linq; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Leery : RoleBase { diff --git a/Roles/Crewmate/Lighter.cs b/Roles/Standard/Crewmate/Investigate/Lighter.cs similarity index 99% rename from Roles/Crewmate/Lighter.cs rename to Roles/Standard/Crewmate/Investigate/Lighter.cs index b01c4f225..ba06abf01 100644 --- a/Roles/Crewmate/Lighter.cs +++ b/Roles/Standard/Crewmate/Investigate/Lighter.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Lighter : RoleBase { diff --git a/Roles/Crewmate/Lookout.cs b/Roles/Standard/Crewmate/Investigate/Lookout.cs similarity index 98% rename from Roles/Crewmate/Lookout.cs rename to Roles/Standard/Crewmate/Investigate/Lookout.cs index ecb5ba6e8..22d19af8f 100644 --- a/Roles/Crewmate/Lookout.cs +++ b/Roles/Standard/Crewmate/Investigate/Lookout.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Lookout : RoleBase { diff --git a/Roles/Crewmate/Markseeker.cs b/Roles/Standard/Crewmate/Investigate/Markseeker.cs similarity index 97% rename from Roles/Crewmate/Markseeker.cs rename to Roles/Standard/Crewmate/Investigate/Markseeker.cs index 775696d6d..80a66a68b 100644 --- a/Roles/Crewmate/Markseeker.cs +++ b/Roles/Standard/Crewmate/Investigate/Markseeker.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; -using EHR.Neutral; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Markseeker : RoleBase { diff --git a/Roles/Crewmate/Medium.cs b/Roles/Standard/Crewmate/Investigate/Medium.cs similarity index 99% rename from Roles/Crewmate/Medium.cs rename to Roles/Standard/Crewmate/Investigate/Medium.cs index 373d221d2..b5e2e7911 100644 --- a/Roles/Crewmate/Medium.cs +++ b/Roles/Standard/Crewmate/Investigate/Medium.cs @@ -2,7 +2,7 @@ using System.Linq; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Medium : RoleBase { diff --git a/Roles/Crewmate/MeetingManager.cs b/Roles/Standard/Crewmate/Investigate/MeetingManager.cs similarity index 99% rename from Roles/Crewmate/MeetingManager.cs rename to Roles/Standard/Crewmate/Investigate/MeetingManager.cs index 4817d2037..652b88b75 100644 --- a/Roles/Crewmate/MeetingManager.cs +++ b/Roles/Standard/Crewmate/Investigate/MeetingManager.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class MeetingManager : RoleBase { diff --git a/Roles/Crewmate/Mortician.cs b/Roles/Standard/Crewmate/Investigate/Mortician.cs similarity index 96% rename from Roles/Crewmate/Mortician.cs rename to Roles/Standard/Crewmate/Investigate/Mortician.cs index e01496fea..3a027bdf4 100644 --- a/Roles/Crewmate/Mortician.cs +++ b/Roles/Standard/Crewmate/Investigate/Mortician.cs @@ -2,7 +2,7 @@ using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Mortician : RoleBase { diff --git a/Roles/Crewmate/Observer.cs b/Roles/Standard/Crewmate/Investigate/Observer.cs similarity index 92% rename from Roles/Crewmate/Observer.cs rename to Roles/Standard/Crewmate/Investigate/Observer.cs index a624fb640..2cd89cae1 100644 --- a/Roles/Crewmate/Observer.cs +++ b/Roles/Standard/Crewmate/Investigate/Observer.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Observer : RoleBase { diff --git a/Roles/Crewmate/Oracle.cs b/Roles/Standard/Crewmate/Investigate/Oracle.cs similarity index 96% rename from Roles/Crewmate/Oracle.cs rename to Roles/Standard/Crewmate/Investigate/Oracle.cs index a8120ab66..00fc4d5d9 100644 --- a/Roles/Crewmate/Oracle.cs +++ b/Roles/Standard/Crewmate/Investigate/Oracle.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Oracle : RoleBase { diff --git a/Roles/Crewmate/Perceiver.cs b/Roles/Standard/Crewmate/Investigate/Perceiver.cs similarity index 99% rename from Roles/Crewmate/Perceiver.cs rename to Roles/Standard/Crewmate/Investigate/Perceiver.cs index 288ddc484..42493722b 100644 --- a/Roles/Crewmate/Perceiver.cs +++ b/Roles/Standard/Crewmate/Investigate/Perceiver.cs @@ -3,7 +3,7 @@ using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Perceiver : RoleBase { diff --git a/Roles/Crewmate/Psychic.cs b/Roles/Standard/Crewmate/Investigate/Psychic.cs similarity index 96% rename from Roles/Crewmate/Psychic.cs rename to Roles/Standard/Crewmate/Investigate/Psychic.cs index 26a7ceb70..6bc6c9c7f 100644 --- a/Roles/Crewmate/Psychic.cs +++ b/Roles/Standard/Crewmate/Investigate/Psychic.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.Coven; -using EHR.Impostor; using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Psychic : RoleBase { diff --git a/Roles/Crewmate/Rabbit.cs b/Roles/Standard/Crewmate/Investigate/Rabbit.cs similarity index 99% rename from Roles/Crewmate/Rabbit.cs rename to Roles/Standard/Crewmate/Investigate/Rabbit.cs index 7cccc3fc5..f2f4da0af 100644 --- a/Roles/Crewmate/Rabbit.cs +++ b/Roles/Standard/Crewmate/Investigate/Rabbit.cs @@ -3,7 +3,7 @@ using System.Linq; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Rabbit : RoleBase { diff --git a/Roles/Crewmate/Scout.cs b/Roles/Standard/Crewmate/Investigate/Scout.cs similarity index 99% rename from Roles/Crewmate/Scout.cs rename to Roles/Standard/Crewmate/Investigate/Scout.cs index 31cddf0d3..597850deb 100644 --- a/Roles/Crewmate/Scout.cs +++ b/Roles/Standard/Crewmate/Investigate/Scout.cs @@ -1,13 +1,12 @@ using System.Collections.Generic; using System.Linq; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Scout : RoleBase { diff --git a/Roles/Crewmate/Sensor.cs b/Roles/Standard/Crewmate/Investigate/Sensor.cs similarity index 98% rename from Roles/Crewmate/Sensor.cs rename to Roles/Standard/Crewmate/Investigate/Sensor.cs index 00690e569..d73fdcd17 100644 --- a/Roles/Crewmate/Sensor.cs +++ b/Roles/Standard/Crewmate/Investigate/Sensor.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; public class Sensor : RoleBase { diff --git a/Roles/Crewmate/Sentry.cs b/Roles/Standard/Crewmate/Investigate/Sentry.cs similarity index 99% rename from Roles/Crewmate/Sentry.cs rename to Roles/Standard/Crewmate/Investigate/Sentry.cs index 1b5cc6494..d2235c433 100644 --- a/Roles/Crewmate/Sentry.cs +++ b/Roles/Standard/Crewmate/Investigate/Sentry.cs @@ -4,7 +4,7 @@ using System.Linq; using EHR.Modules; using HarmonyLib; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Sentry : RoleBase { diff --git a/Roles/Crewmate/Shiftguard.cs b/Roles/Standard/Crewmate/Investigate/Shiftguard.cs similarity index 92% rename from Roles/Crewmate/Shiftguard.cs rename to Roles/Standard/Crewmate/Investigate/Shiftguard.cs index f9148e759..88a953594 100644 --- a/Roles/Crewmate/Shiftguard.cs +++ b/Roles/Standard/Crewmate/Investigate/Shiftguard.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Shiftguard : RoleBase { diff --git a/Roles/Crewmate/Snitch.cs b/Roles/Standard/Crewmate/Investigate/Snitch.cs similarity index 97% rename from Roles/Crewmate/Snitch.cs rename to Roles/Standard/Crewmate/Investigate/Snitch.cs index 38258d4ef..37f1e19f8 100644 --- a/Roles/Crewmate/Snitch.cs +++ b/Roles/Standard/Crewmate/Investigate/Snitch.cs @@ -3,7 +3,7 @@ using System.Linq; using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Snitch : RoleBase { diff --git a/Roles/Crewmate/Socialite.cs b/Roles/Standard/Crewmate/Investigate/Socialite.cs similarity index 99% rename from Roles/Crewmate/Socialite.cs rename to Roles/Standard/Crewmate/Investigate/Socialite.cs index 00cf4fb86..1c2bee6b8 100644 --- a/Roles/Crewmate/Socialite.cs +++ b/Roles/Standard/Crewmate/Investigate/Socialite.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Socialite : RoleBase { diff --git a/Roles/Crewmate/Soothsayer.cs b/Roles/Standard/Crewmate/Investigate/Soothsayer.cs similarity index 97% rename from Roles/Crewmate/Soothsayer.cs rename to Roles/Standard/Crewmate/Investigate/Soothsayer.cs index 15594f154..151666af9 100644 --- a/Roles/Crewmate/Soothsayer.cs +++ b/Roles/Standard/Crewmate/Investigate/Soothsayer.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; -using EHR.Neutral; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Soothsayer : RoleBase { diff --git a/Roles/Crewmate/Spiritualist.cs b/Roles/Standard/Crewmate/Investigate/Spiritualist.cs similarity index 96% rename from Roles/Crewmate/Spiritualist.cs rename to Roles/Standard/Crewmate/Investigate/Spiritualist.cs index 4bd425278..5917cc5b6 100644 --- a/Roles/Crewmate/Spiritualist.cs +++ b/Roles/Standard/Crewmate/Investigate/Spiritualist.cs @@ -4,7 +4,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Spiritualist : RoleBase { diff --git a/Roles/Crewmate/Spy.cs b/Roles/Standard/Crewmate/Investigate/Spy.cs similarity index 98% rename from Roles/Crewmate/Spy.cs rename to Roles/Standard/Crewmate/Investigate/Spy.cs index 2eee2cf78..5f572db59 100644 --- a/Roles/Crewmate/Spy.cs +++ b/Roles/Standard/Crewmate/Investigate/Spy.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; using static Utils; @@ -30,7 +30,7 @@ public class Spy : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Spy]) .SetValueFormat(OptionFormat.Times); - SpyRedNameDur = new FloatOptionItem(Id + 11, "SpyRedNameDur", new(0f, 70f, 1f), 3f, TabGroup.CrewmateRoles) + SpyRedNameDur = new FloatOptionItem(Id + 11, "SpyRedNameDur", new(0f, 70f, 0.5f), 3f, TabGroup.CrewmateRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Spy]) .SetValueFormat(OptionFormat.Seconds); @@ -134,4 +134,4 @@ public class Spy : RoleBase } } } -} \ No newline at end of file +} diff --git a/Roles/Crewmate/TaskManager.cs b/Roles/Standard/Crewmate/Investigate/TaskManager.cs similarity index 97% rename from Roles/Crewmate/TaskManager.cs rename to Roles/Standard/Crewmate/Investigate/TaskManager.cs index f6541be5c..8a8384e58 100644 --- a/Roles/Crewmate/TaskManager.cs +++ b/Roles/Standard/Crewmate/Investigate/TaskManager.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class TaskManager : RoleBase { diff --git a/Roles/Crewmate/Telecommunication.cs b/Roles/Standard/Crewmate/Investigate/Telecommunication.cs similarity index 98% rename from Roles/Crewmate/Telecommunication.cs rename to Roles/Standard/Crewmate/Investigate/Telecommunication.cs index 6f9720c26..856f93a8c 100644 --- a/Roles/Crewmate/Telecommunication.cs +++ b/Roles/Standard/Crewmate/Investigate/Telecommunication.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Telecommunication : RoleBase { diff --git a/Roles/Crewmate/Whisperer.cs b/Roles/Standard/Crewmate/Investigate/Whisperer.cs similarity index 99% rename from Roles/Crewmate/Whisperer.cs rename to Roles/Standard/Crewmate/Investigate/Whisperer.cs index 12b595563..99c3ad4ce 100644 --- a/Roles/Crewmate/Whisperer.cs +++ b/Roles/Standard/Crewmate/Investigate/Whisperer.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Whisperer : RoleBase { diff --git a/Roles/Crewmate/Witness.cs b/Roles/Standard/Crewmate/Investigate/Witness.cs similarity index 98% rename from Roles/Crewmate/Witness.cs rename to Roles/Standard/Crewmate/Investigate/Witness.cs index 7e1bab7ae..db054d943 100644 --- a/Roles/Crewmate/Witness.cs +++ b/Roles/Standard/Crewmate/Investigate/Witness.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Witness : RoleBase { diff --git a/Roles/Crewmate/Drainer.cs b/Roles/Standard/Crewmate/Killing/Drainer.cs similarity index 99% rename from Roles/Crewmate/Drainer.cs rename to Roles/Standard/Crewmate/Killing/Drainer.cs index eb4168bae..6211ab0b1 100644 --- a/Roles/Crewmate/Drainer.cs +++ b/Roles/Standard/Crewmate/Killing/Drainer.cs @@ -3,7 +3,7 @@ using System.Linq; using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Drainer : RoleBase { diff --git a/Roles/Crewmate/Judge.cs b/Roles/Standard/Crewmate/Killing/Judge.cs similarity index 96% rename from Roles/Crewmate/Judge.cs rename to Roles/Standard/Crewmate/Killing/Judge.cs index 1132ef4b0..4a3e7dcb4 100644 --- a/Roles/Crewmate/Judge.cs +++ b/Roles/Standard/Crewmate/Killing/Judge.cs @@ -3,12 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Judge : RoleBase { @@ -39,7 +38,7 @@ public class Judge : RoleBase Options.SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.Judge); TrialLimitPerMeeting = new FloatOptionItem(Id + 10, "TrialLimitPerMeeting", new(0f, 15f, 1f), 1f, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]).SetValueFormat(OptionFormat.Times); TrialLimitPerGame = new FloatOptionItem(Id + 9, "TrialLimitPerGame", new(0f, 30f, 1f), 3f, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]).SetValueFormat(OptionFormat.Times); - AbilityUseLimit = new FloatOptionItem(Id + 18, "AbilityUseLimit", new(0f, 30f, 1f), 1f, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]).SetValueFormat(OptionFormat.Times); + AbilityUseLimit = new FloatOptionItem(Id + 18, "AbilityUseLimit", new(0f, 30f, 0.5f), 1f, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]).SetValueFormat(OptionFormat.Times); CanTrialMadmate = new BooleanOptionItem(Id + 12, "JudgeCanTrialMadmate", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]); CanTrialConverted = new BooleanOptionItem(Id + 16, "JudgeCanTrialConverted", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]); CanTrialCrewKilling = new BooleanOptionItem(Id + 13, "JudgeCanTrialnCrewKilling", false, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Judge]); @@ -287,7 +286,7 @@ public class Judge : RoleBase { Logger.Msg($"Click: ID {playerId}", "Judge UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) TrialMsg(PlayerControl.LocalPlayer, $"/tl {playerId}", true); @@ -336,3 +335,4 @@ public class Judge : RoleBase countsAs = 1; } } + diff --git a/Roles/Crewmate/NiceGuesser.cs b/Roles/Standard/Crewmate/Killing/NiceGuesser.cs similarity index 98% rename from Roles/Crewmate/NiceGuesser.cs rename to Roles/Standard/Crewmate/Killing/NiceGuesser.cs index 320269895..92f90eeac 100644 --- a/Roles/Crewmate/NiceGuesser.cs +++ b/Roles/Standard/Crewmate/Killing/NiceGuesser.cs @@ -1,7 +1,7 @@ using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class NiceGuesser : RoleBase { diff --git a/Roles/Crewmate/Retributionist.cs b/Roles/Standard/Crewmate/Killing/Retributionist.cs similarity index 97% rename from Roles/Crewmate/Retributionist.cs rename to Roles/Standard/Crewmate/Killing/Retributionist.cs index 507233453..6f05ca6c1 100644 --- a/Roles/Crewmate/Retributionist.cs +++ b/Roles/Standard/Crewmate/Killing/Retributionist.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Retributionist : RoleBase { @@ -119,7 +119,7 @@ public class Retributionist : RoleBase { Logger.Msg($"Click: ID {playerId}", "Retributionist UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) { diff --git a/Roles/Crewmate/Sentinel.cs b/Roles/Standard/Crewmate/Killing/Sentinel.cs similarity index 99% rename from Roles/Crewmate/Sentinel.cs rename to Roles/Standard/Crewmate/Killing/Sentinel.cs index a34462b14..c513f2f89 100644 --- a/Roles/Crewmate/Sentinel.cs +++ b/Roles/Standard/Crewmate/Killing/Sentinel.cs @@ -5,7 +5,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Crewmate; +namespace EHR.Roles; public class PatrollingState(byte sentinelId, int patrolDuration, float patrolRadius, PlayerControl sentinel = null, bool isPatrolling = false, Vector2? startingPosition = null, long patrolStartTimeStamp = 0) { diff --git a/Roles/Crewmate/Sheriff.cs b/Roles/Standard/Crewmate/Killing/Sheriff.cs similarity index 97% rename from Roles/Crewmate/Sheriff.cs rename to Roles/Standard/Crewmate/Killing/Sheriff.cs index 9ac46cced..201f86b2f 100644 --- a/Roles/Crewmate/Sheriff.cs +++ b/Roles/Standard/Crewmate/Killing/Sheriff.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Sheriff : RoleBase { diff --git a/Roles/Crewmate/Veteran.cs b/Roles/Standard/Crewmate/Killing/Veteran.cs similarity index 99% rename from Roles/Crewmate/Veteran.cs rename to Roles/Standard/Crewmate/Killing/Veteran.cs index 12b370678..34d7e0803 100644 --- a/Roles/Crewmate/Veteran.cs +++ b/Roles/Standard/Crewmate/Killing/Veteran.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Veteran : RoleBase { diff --git a/Roles/Crewmate/Vigilante.cs b/Roles/Standard/Crewmate/Killing/Vigilante.cs similarity index 87% rename from Roles/Crewmate/Vigilante.cs rename to Roles/Standard/Crewmate/Killing/Vigilante.cs index 5a56caa2b..74d8d4c25 100644 --- a/Roles/Crewmate/Vigilante.cs +++ b/Roles/Standard/Crewmate/Killing/Vigilante.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Vigilante : RoleBase { @@ -13,6 +13,7 @@ public class Vigilante : RoleBase public static List Killed = []; private static OptionItem CanVent; private static OptionItem KCD; + public static OptionItem CanKillRound1; public static OptionItem UsePet; public override bool IsEnable => PlayerIdList.Count > 0; @@ -27,8 +28,13 @@ public class Vigilante : RoleBase KCD = new FloatOptionItem(Id + 9, "KillCooldown", new(0f, 120f, 0.5f), 15f, TabGroup.CrewmateRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Vigilante]) .SetValueFormat(OptionFormat.Seconds); + + CanKillRound1 = new BooleanOptionItem(Id + 8, "Thief.CanKillRound1", false, TabGroup.CrewmateRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Vigilante]); UsePet = Options.CreatePetUseSetting(Id + 10, CustomRoles.Vigilante); + + Options.OverrideTasksData.Create(Id + 12, TabGroup.CrewmateRoles, CustomRoles.Vigilante); } public override void Init() @@ -64,8 +70,7 @@ public class Vigilante : RoleBase public override bool CanUseKillButton(PlayerControl pc) { - return !Main.PlayerStates[pc.PlayerId].IsDead - && !IsKilled(pc.PlayerId); + return !IsKilled(pc.PlayerId) && (!MeetingStates.FirstMeeting || CanKillRound1.GetBool()); } private static bool IsKilled(byte playerId) @@ -105,6 +110,7 @@ public class Vigilante : RoleBase SendRPC(killer.PlayerId); Killed.Add(killer.PlayerId); SetKillCooldown(killer.PlayerId); + if (UsePet.GetBool()) return; killer.RpcChangeRoleBasis(CustomRoles.CrewmateEHR); killer.RpcResetTasks(); Utils.NotifyRoles(SpecifySeer: killer, SpecifyTarget: killer); diff --git a/Roles/Crewmate/Addict.cs b/Roles/Standard/Crewmate/Miscellaneous/Addict.cs similarity index 96% rename from Roles/Crewmate/Addict.cs rename to Roles/Standard/Crewmate/Miscellaneous/Addict.cs index 50f5aa736..0977e0cb2 100644 --- a/Roles/Crewmate/Addict.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Addict.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; diff --git a/Roles/Crewmate/CameraMan.cs b/Roles/Standard/Crewmate/Miscellaneous/CameraMan.cs similarity index 99% rename from Roles/Crewmate/CameraMan.cs rename to Roles/Standard/Crewmate/Miscellaneous/CameraMan.cs index 534814efc..911ed7ab8 100644 --- a/Roles/Crewmate/CameraMan.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/CameraMan.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; diff --git a/Roles/Crewmate/Carrier.cs b/Roles/Standard/Crewmate/Miscellaneous/Carrier.cs similarity index 99% rename from Roles/Crewmate/Carrier.cs rename to Roles/Standard/Crewmate/Miscellaneous/Carrier.cs index 0bf9e7a97..1bc6ce394 100644 --- a/Roles/Crewmate/Carrier.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Carrier.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Carrier : RoleBase { diff --git a/Roles/Crewmate/Demolitionist.cs b/Roles/Standard/Crewmate/Miscellaneous/Demolitionist.cs similarity index 98% rename from Roles/Crewmate/Demolitionist.cs rename to Roles/Standard/Crewmate/Miscellaneous/Demolitionist.cs index 09e1b596a..4b846dfd2 100644 --- a/Roles/Crewmate/Demolitionist.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Demolitionist.cs @@ -2,7 +2,7 @@ using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Demolitionist : RoleBase { diff --git a/Roles/Crewmate/Express.cs b/Roles/Standard/Crewmate/Miscellaneous/Express.cs similarity index 98% rename from Roles/Crewmate/Express.cs rename to Roles/Standard/Crewmate/Miscellaneous/Express.cs index fca37094f..a210fb740 100644 --- a/Roles/Crewmate/Express.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Express.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Express : RoleBase { diff --git a/Roles/Crewmate/Journalist.cs b/Roles/Standard/Crewmate/Miscellaneous/Journalist.cs similarity index 99% rename from Roles/Crewmate/Journalist.cs rename to Roles/Standard/Crewmate/Miscellaneous/Journalist.cs index 5aa5e1762..564613bb9 100644 --- a/Roles/Crewmate/Journalist.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Journalist.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Journalist : RoleBase { diff --git a/Roles/Crewmate/LazyGuy.cs b/Roles/Standard/Crewmate/Miscellaneous/LazyGuy.cs similarity index 92% rename from Roles/Crewmate/LazyGuy.cs rename to Roles/Standard/Crewmate/Miscellaneous/LazyGuy.cs index ff253280a..c6843f6c9 100644 --- a/Roles/Crewmate/LazyGuy.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/LazyGuy.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class LazyGuy : RoleBase { diff --git a/Roles/Crewmate/Luckey.cs b/Roles/Standard/Crewmate/Miscellaneous/Luckey.cs similarity index 97% rename from Roles/Crewmate/Luckey.cs rename to Roles/Standard/Crewmate/Miscellaneous/Luckey.cs index 60f0fbdde..f25743b19 100644 --- a/Roles/Crewmate/Luckey.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Luckey.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Luckey : RoleBase { diff --git a/Roles/Crewmate/Mole.cs b/Roles/Standard/Crewmate/Miscellaneous/Mole.cs similarity index 98% rename from Roles/Crewmate/Mole.cs rename to Roles/Standard/Crewmate/Miscellaneous/Mole.cs index 473271353..21ec039c1 100644 --- a/Roles/Crewmate/Mole.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Mole.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Mole : RoleBase { diff --git a/Roles/Crewmate/Nightmare.cs b/Roles/Standard/Crewmate/Miscellaneous/Nightmare.cs similarity index 95% rename from Roles/Crewmate/Nightmare.cs rename to Roles/Standard/Crewmate/Miscellaneous/Nightmare.cs index 1ce181e87..7a53635df 100644 --- a/Roles/Crewmate/Nightmare.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Nightmare.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; public class Nightmare : RoleBase { diff --git a/Roles/Crewmate/Paranoid.cs b/Roles/Standard/Crewmate/Miscellaneous/Paranoid.cs similarity index 99% rename from Roles/Crewmate/Paranoid.cs rename to Roles/Standard/Crewmate/Miscellaneous/Paranoid.cs index 3da9f062d..4958008a1 100644 --- a/Roles/Crewmate/Paranoid.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Paranoid.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Paranoid : RoleBase { diff --git a/Roles/Crewmate/PortalMaker.cs b/Roles/Standard/Crewmate/Miscellaneous/PortalMaker.cs similarity index 98% rename from Roles/Crewmate/PortalMaker.cs rename to Roles/Standard/Crewmate/Miscellaneous/PortalMaker.cs index 4036d19f9..e6857cd1c 100644 --- a/Roles/Crewmate/PortalMaker.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/PortalMaker.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using Color = UnityEngine.Color; -namespace EHR.Crewmate; +namespace EHR.Roles; public class PortalMaker : RoleBase { diff --git a/Roles/Crewmate/Ricochet.cs b/Roles/Standard/Crewmate/Miscellaneous/Ricochet.cs similarity index 99% rename from Roles/Crewmate/Ricochet.cs rename to Roles/Standard/Crewmate/Miscellaneous/Ricochet.cs index a2bcdc629..f281e9623 100644 --- a/Roles/Crewmate/Ricochet.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Ricochet.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; diff --git a/Roles/Crewmate/Safeguard.cs b/Roles/Standard/Crewmate/Miscellaneous/Safeguard.cs similarity index 99% rename from Roles/Crewmate/Safeguard.cs rename to Roles/Standard/Crewmate/Miscellaneous/Safeguard.cs index bc1a82300..407f5e03d 100644 --- a/Roles/Crewmate/Safeguard.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Safeguard.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Safeguard : RoleBase { diff --git a/Roles/Crewmate/SuperStar.cs b/Roles/Standard/Crewmate/Miscellaneous/SuperStar.cs similarity index 98% rename from Roles/Crewmate/SuperStar.cs rename to Roles/Standard/Crewmate/Miscellaneous/SuperStar.cs index 66dbf7276..04f074312 100644 --- a/Roles/Crewmate/SuperStar.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/SuperStar.cs @@ -1,7 +1,7 @@ using System.Linq; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class SuperStar : RoleBase { diff --git a/Roles/Crewmate/Tether.cs b/Roles/Standard/Crewmate/Miscellaneous/Tether.cs similarity index 99% rename from Roles/Crewmate/Tether.cs rename to Roles/Standard/Crewmate/Miscellaneous/Tether.cs index 95fbf6c2a..a2802c46e 100644 --- a/Roles/Crewmate/Tether.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Tether.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; diff --git a/Roles/Crewmate/Tracefinder.cs b/Roles/Standard/Crewmate/Miscellaneous/Tracefinder.cs similarity index 96% rename from Roles/Crewmate/Tracefinder.cs rename to Roles/Standard/Crewmate/Miscellaneous/Tracefinder.cs index 959d4ee38..af62612a9 100644 --- a/Roles/Crewmate/Tracefinder.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Tracefinder.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Tracefinder : RoleBase { diff --git a/Roles/Crewmate/Transmitter.cs b/Roles/Standard/Crewmate/Miscellaneous/Transmitter.cs similarity index 96% rename from Roles/Crewmate/Transmitter.cs rename to Roles/Standard/Crewmate/Miscellaneous/Transmitter.cs index fb59cceba..06e36c5fb 100644 --- a/Roles/Crewmate/Transmitter.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Transmitter.cs @@ -1,6 +1,6 @@ using System.Linq; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Transmitter : RoleBase { diff --git a/Roles/Crewmate/Tunneler.cs b/Roles/Standard/Crewmate/Miscellaneous/Tunneler.cs similarity index 97% rename from Roles/Crewmate/Tunneler.cs rename to Roles/Standard/Crewmate/Miscellaneous/Tunneler.cs index b71ca8dcb..14fd08777 100644 --- a/Roles/Crewmate/Tunneler.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Tunneler.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Tunneler : RoleBase { diff --git a/Roles/Crewmate/Vacuum.cs b/Roles/Standard/Crewmate/Miscellaneous/Vacuum.cs similarity index 99% rename from Roles/Crewmate/Vacuum.cs rename to Roles/Standard/Crewmate/Miscellaneous/Vacuum.cs index 95a891693..6785eb3f2 100644 --- a/Roles/Crewmate/Vacuum.cs +++ b/Roles/Standard/Crewmate/Miscellaneous/Vacuum.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Vacuum : RoleBase { diff --git a/Roles/Crewmate/Adrenaline.cs b/Roles/Standard/Crewmate/Power/Adrenaline.cs similarity index 99% rename from Roles/Crewmate/Adrenaline.cs rename to Roles/Standard/Crewmate/Power/Adrenaline.cs index 29f303d45..2cf353726 100644 --- a/Roles/Crewmate/Adrenaline.cs +++ b/Roles/Standard/Crewmate/Power/Adrenaline.cs @@ -1,7 +1,7 @@ using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Adrenaline : RoleBase { diff --git a/Roles/Crewmate/Adventurer.cs b/Roles/Standard/Crewmate/Power/Adventurer.cs similarity index 99% rename from Roles/Crewmate/Adventurer.cs rename to Roles/Standard/Crewmate/Power/Adventurer.cs index a662497bc..b9e89ad1b 100644 --- a/Roles/Crewmate/Adventurer.cs +++ b/Roles/Standard/Crewmate/Power/Adventurer.cs @@ -7,7 +7,7 @@ using EHR.Patches; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Adventurer : RoleBase { diff --git a/Roles/Crewmate/Alchemist.cs b/Roles/Standard/Crewmate/Power/Alchemist.cs similarity index 96% rename from Roles/Crewmate/Alchemist.cs rename to Roles/Standard/Crewmate/Power/Alchemist.cs index cb4026151..85ba99fe1 100644 --- a/Roles/Crewmate/Alchemist.cs +++ b/Roles/Standard/Crewmate/Power/Alchemist.cs @@ -2,10 +2,9 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; using static Options; using static Translator; @@ -316,7 +315,7 @@ public class Alchemist : RoleBase public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false) { - if (!hud || seer == null || seer.PlayerId != target.PlayerId || !GameStates.IsInTask || seer.PlayerId != AlchemistId) return string.Empty; + if (!hud || seer.PlayerId != target.PlayerId || !GameStates.IsInTask || seer.PlayerId != AlchemistId) return string.Empty; var sb = new StringBuilder(); diff --git a/Roles/Crewmate/Astral.cs b/Roles/Standard/Crewmate/Power/Astral.cs similarity index 98% rename from Roles/Crewmate/Astral.cs rename to Roles/Standard/Crewmate/Power/Astral.cs index 8b6b70af4..2fdda777b 100644 --- a/Roles/Crewmate/Astral.cs +++ b/Roles/Standard/Crewmate/Power/Astral.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Astral : RoleBase { @@ -26,7 +26,7 @@ public class Astral : RoleBase { StartSetup(651400) .AutoSetupOption(ref AbilityCooldown, 30, new IntegerValueRule(0, 120, 1), OptionFormat.Seconds) - .AutoSetupOption(ref AbilityDuration, 10, new IntegerValueRule(0, 30, 1), OptionFormat.Seconds) + .AutoSetupOption(ref AbilityDuration, 10, new IntegerValueRule(1, 30, 1), OptionFormat.Seconds) .AutoSetupOption(ref AbilityUseLimit, 1f, new FloatValueRule(0, 20, 0.05f), OptionFormat.Times) .AutoSetupOption(ref AbilityUseGainWithEachTaskCompleted, 0.3f, new FloatValueRule(0f, 5f, 0.05f), OptionFormat.Times) .AutoSetupOption(ref AbilityChargesWhenFinishedTasks, 0.2f, new FloatValueRule(0f, 5f, 0.05f), OptionFormat.Times); @@ -144,4 +144,4 @@ public class Astral : RoleBase if (seer.PlayerId != AstralId || seer.PlayerId != target.PlayerId || hud || meeting || BackTS == 0) return string.Empty; return string.Format(Translator.GetString("AstralSuffix"), BackTS - Utils.TimeStamp - 1); } -} \ No newline at end of file +} diff --git a/Roles/Crewmate/CopyCat.cs b/Roles/Standard/Crewmate/Power/CopyCat.cs similarity index 96% rename from Roles/Crewmate/CopyCat.cs rename to Roles/Standard/Crewmate/Power/CopyCat.cs index 8cf80d6f6..49e311dde 100644 --- a/Roles/Crewmate/CopyCat.cs +++ b/Roles/Standard/Crewmate/Power/CopyCat.cs @@ -2,12 +2,13 @@ using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class CopyCat : RoleBase { private const int Id = 666420; public static List Instances = []; + public static List PlayerIdList = []; private static bool Resetting; private static OptionItem KillCooldown; @@ -55,6 +56,7 @@ public class CopyCat : RoleBase { if (Resetting) return; Instances = []; + PlayerIdList = []; CurrentKillCooldown = AdjustedDefaultKillCooldown; } @@ -62,6 +64,7 @@ public class CopyCat : RoleBase { if (Resetting) return; Instances.Add(this); + PlayerIdList.Add(playerId); CopyCatPC = Utils.GetPlayerById(playerId); CurrentKillCooldown = KillCooldown.GetFloat(); int limit = MiscopyLimitOpt.GetInt(); @@ -197,6 +200,4 @@ public class CopyCat : RoleBase SetKillCooldown(pc.PlayerId); return false; } - -} - +} \ No newline at end of file diff --git a/Roles/Crewmate/Decryptor.cs b/Roles/Standard/Crewmate/Power/Decryptor.cs similarity index 96% rename from Roles/Crewmate/Decryptor.cs rename to Roles/Standard/Crewmate/Power/Decryptor.cs index 514a96e2e..6cdc3dd7e 100644 --- a/Roles/Crewmate/Decryptor.cs +++ b/Roles/Standard/Crewmate/Power/Decryptor.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Decryptor : RoleBase { @@ -107,7 +107,12 @@ public class Decryptor : RoleBase private void RevealLetter() { - Dictionary nextLetters = AllRoleNames.ToDictionary(x => x.Key, x => x.Value.Except(KnownCharacters[x.Key]).RandomElement()); + Dictionary nextLetters = AllRoleNames.ToDictionary(x => x.Key, x => + { + List list = x.Value.ToList(); + KnownCharacters[x.Key].ForEach(kc => list.Remove(kc)); + return list.RandomElement(); + }); KnownCharacters.Do(x => { diff --git a/Roles/Crewmate/Detour.cs b/Roles/Standard/Crewmate/Power/Detour.cs similarity index 93% rename from Roles/Crewmate/Detour.cs rename to Roles/Standard/Crewmate/Power/Detour.cs index 7d03b1395..558b993b7 100644 --- a/Roles/Crewmate/Detour.cs +++ b/Roles/Standard/Crewmate/Power/Detour.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Detour : RoleBase { diff --git a/Roles/Crewmate/Dictator.cs b/Roles/Standard/Crewmate/Power/Dictator.cs similarity index 97% rename from Roles/Crewmate/Dictator.cs rename to Roles/Standard/Crewmate/Power/Dictator.cs index f476203e3..255d244bd 100644 --- a/Roles/Crewmate/Dictator.cs +++ b/Roles/Standard/Crewmate/Power/Dictator.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Dictator : RoleBase { diff --git a/Roles/Crewmate/Guardian.cs b/Roles/Standard/Crewmate/Power/Guardian.cs similarity index 95% rename from Roles/Crewmate/Guardian.cs rename to Roles/Standard/Crewmate/Power/Guardian.cs index 8c2d747a8..5d5d800ef 100644 --- a/Roles/Crewmate/Guardian.cs +++ b/Roles/Standard/Crewmate/Power/Guardian.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Guardian : RoleBase { diff --git a/Roles/Crewmate/Marshall.cs b/Roles/Standard/Crewmate/Power/Marshall.cs similarity index 88% rename from Roles/Crewmate/Marshall.cs rename to Roles/Standard/Crewmate/Power/Marshall.cs index ee5c85d79..522698b80 100644 --- a/Roles/Crewmate/Marshall.cs +++ b/Roles/Standard/Crewmate/Power/Marshall.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Marshall : RoleBase { @@ -47,7 +47,7 @@ public class Marshall : RoleBase public static string GetWarningMark(PlayerControl seer, PlayerControl target) { - return CanSeeMarshall(seer) && PlayerIdList.Contains(target.PlayerId) && target.IsAlive() && target.GetTaskState().IsTaskFinished ? Utils.ColorString(Utils.GetRoleColor(CustomRoles.Marshall), "★") : string.Empty; + return PlayerIdList.Contains(target.PlayerId) && target.GetTaskState().IsTaskFinished && target.IsAlive() && CanSeeMarshall(seer) ? Utils.ColorString(Utils.GetRoleColor(CustomRoles.Marshall), "★") : string.Empty; } public static bool CanSeeMarshall(PlayerControl seer) diff --git a/Roles/Crewmate/Mayor.cs b/Roles/Standard/Crewmate/Power/Mayor.cs similarity index 99% rename from Roles/Crewmate/Mayor.cs rename to Roles/Standard/Crewmate/Power/Mayor.cs index 56fc11c17..9733896f0 100644 --- a/Roles/Crewmate/Mayor.cs +++ b/Roles/Standard/Crewmate/Power/Mayor.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Mayor : RoleBase { diff --git a/Roles/Crewmate/NiceEraser.cs b/Roles/Standard/Crewmate/Power/NiceEraser.cs similarity index 96% rename from Roles/Crewmate/NiceEraser.cs rename to Roles/Standard/Crewmate/Power/NiceEraser.cs index 9f2d3defc..39418667b 100644 --- a/Roles/Crewmate/NiceEraser.cs +++ b/Roles/Standard/Crewmate/Power/NiceEraser.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using EHR.Neutral; using Hazel; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class NiceEraser : RoleBase { diff --git a/Roles/Crewmate/Oxyman.cs b/Roles/Standard/Crewmate/Power/Oxyman.cs similarity index 97% rename from Roles/Crewmate/Oxyman.cs rename to Roles/Standard/Crewmate/Power/Oxyman.cs index 4eb5bb90e..081533328 100644 --- a/Roles/Crewmate/Oxyman.cs +++ b/Roles/Standard/Crewmate/Power/Oxyman.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Oxyman : RoleBase { @@ -19,7 +19,6 @@ public class Oxyman : RoleBase private long LastUpdate; private int OxygenLevel; private byte OxymanId; - private float StartingSpeed; public override bool IsEnable => On; @@ -65,7 +64,6 @@ public class Oxyman : RoleBase OxymanId = playerId; OxygenLevel = 59; LastUpdate = Utils.TimeStamp; - StartingSpeed = Main.AllPlayerSpeed[playerId]; } public override void ApplyGameOptions(IGameOptions opt, byte playerId) @@ -90,11 +88,10 @@ public class Oxyman : RoleBase public override void OnFixedUpdate(PlayerControl pc) { - if (!pc.IsAlive() || !GameStates.IsInTask || ExileController.Instance) return; + if (!pc.IsAlive() || !GameStates.IsInTask || ExileController.Instance || !Main.IntroDestroyed) return; long now = Utils.TimeStamp; if (now == LastUpdate) return; - LastUpdate = now; if (OxygenLevel <= 0) @@ -130,7 +127,7 @@ public class Oxyman : RoleBase break; case Level.None: Main.PlayerStates[pc.PlayerId].IsBlackOut = false; - Main.AllPlayerSpeed[pc.PlayerId] = StartingSpeed; + Main.AllPlayerSpeed[pc.PlayerId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod); pc.MarkDirtySettings(); break; case Level.Invulnerable: @@ -151,13 +148,9 @@ public class Oxyman : RoleBase { // ReSharper disable ConvertIfStatementToReturnStatement if (OxygenLevel <= LevelSettings[Level.Blind].GetInt()) return Level.Blind; - if (OxygenLevel <= LevelSettings[Level.Slow].GetInt()) return Level.Slow; - if (OxygenLevel >= LevelSettings[Level.Invulnerable].GetInt()) return Level.Invulnerable; - if (OxygenLevel >= LevelSettings[Level.Fast].GetInt()) return Level.Fast; - return Level.None; // ReSharper restore ConvertIfStatementToReturnStatement } diff --git a/Roles/Crewmate/President.cs b/Roles/Standard/Crewmate/Power/President.cs similarity index 99% rename from Roles/Crewmate/President.cs rename to Roles/Standard/Crewmate/Power/President.cs index e52ab1fbb..49c3cf119 100644 --- a/Roles/Crewmate/President.cs +++ b/Roles/Standard/Crewmate/Power/President.cs @@ -2,10 +2,9 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Neutral; using EHR.Patches; -namespace EHR.Crewmate; +namespace EHR.Roles; internal static class DecreeExtension { diff --git a/Roles/Crewmate/Speedrunner.cs b/Roles/Standard/Crewmate/Power/Speedrunner.cs similarity index 97% rename from Roles/Crewmate/Speedrunner.cs rename to Roles/Standard/Crewmate/Power/Speedrunner.cs index 4a21d6e9e..85c55d033 100644 --- a/Roles/Crewmate/Speedrunner.cs +++ b/Roles/Standard/Crewmate/Power/Speedrunner.cs @@ -2,7 +2,7 @@ using EHR.Modules; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Speedrunner : RoleBase { @@ -37,7 +37,7 @@ internal class Speedrunner : RoleBase SpeedrunnerNotifyAtXTasksLeft = new IntegerOptionItem(652511, "SpeedrunnerNotifyAtXTasksLeft", new(0, 90, 1), 3, TabGroup.CrewmateRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Speedrunner]); - SpeedrunnerSpeed = new FloatOptionItem(652512, "SpeedrunnerSpeed", new(0.1f, 3f, 0.1f), 1.5f, TabGroup.CrewmateRoles) + SpeedrunnerSpeed = new FloatOptionItem(652512, "SpeedrunnerSpeed", new(0.1f, 3f, 0.05f), 1.5f, TabGroup.CrewmateRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Speedrunner]) .SetValueFormat(OptionFormat.Multiplier); diff --git a/Roles/Crewmate/Swapper.cs b/Roles/Standard/Crewmate/Power/Swapper.cs similarity index 99% rename from Roles/Crewmate/Swapper.cs rename to Roles/Standard/Crewmate/Power/Swapper.cs index e4bfcdcdb..20a9cb99b 100644 --- a/Roles/Crewmate/Swapper.cs +++ b/Roles/Standard/Crewmate/Power/Swapper.cs @@ -2,13 +2,11 @@ using System.Collections.Generic; using System.Linq; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Translator; - -namespace EHR.Crewmate; +namespace EHR.Roles; public class Swapper : RoleBase { @@ -280,7 +278,7 @@ public class Swapper : RoleBase Logger.Msg($"Click: ID {playerId}", "Swapper UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) SwapMsg(PlayerControl.LocalPlayer, $"/sw {playerId}", true); @@ -345,4 +343,4 @@ public class Swapper : RoleBase keepGameGoing = true; countsAs = 1; } -} \ No newline at end of file +} diff --git a/Roles/Crewmate/Telekinetic.cs b/Roles/Standard/Crewmate/Power/Telekinetic.cs similarity index 99% rename from Roles/Crewmate/Telekinetic.cs rename to Roles/Standard/Crewmate/Power/Telekinetic.cs index 338867c85..f3fa7e973 100644 --- a/Roles/Crewmate/Telekinetic.cs +++ b/Roles/Standard/Crewmate/Power/Telekinetic.cs @@ -1,11 +1,10 @@ using System; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Telekinetic : RoleBase { diff --git a/Roles/Crewmate/Aid.cs b/Roles/Standard/Crewmate/Support/Aid.cs similarity index 99% rename from Roles/Crewmate/Aid.cs rename to Roles/Standard/Crewmate/Support/Aid.cs index 1de15fbb4..a8bd387b3 100644 --- a/Roles/Crewmate/Aid.cs +++ b/Roles/Standard/Crewmate/Support/Aid.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Aid : RoleBase { diff --git a/Roles/Crewmate/Altruist.cs b/Roles/Standard/Crewmate/Support/Altruist.cs similarity index 97% rename from Roles/Crewmate/Altruist.cs rename to Roles/Standard/Crewmate/Support/Altruist.cs index 615b875d5..ca6b97711 100644 --- a/Roles/Crewmate/Altruist.cs +++ b/Roles/Standard/Crewmate/Support/Altruist.cs @@ -5,7 +5,7 @@ using EHR.Modules; // ReSharper disable ConvertIfStatementToReturnStatement -namespace EHR.Crewmate; +namespace EHR.Roles; public class Altruist : RoleBase { @@ -109,7 +109,7 @@ public class Altruist : RoleBase if (ReviveTargetsKillerGetsArrow.GetBool()) TargetArrow.Add(killer.PlayerId, ReviveTarget); killer.KillFlash(); - killer.Notify(string.Format(Translator.GetString("AltruistKillerAlert"), ReviveTarget.ColoredPlayerName()), 10f); + killer.Notify(Translator.GetString("AltruistKillerAlert"), 10f); } ReviveTarget = byte.MaxValue; diff --git a/Roles/Crewmate/Autocrat.cs b/Roles/Standard/Crewmate/Support/Autocrat.cs similarity index 96% rename from Roles/Crewmate/Autocrat.cs rename to Roles/Standard/Crewmate/Support/Autocrat.cs index 838a1e454..35f830205 100644 --- a/Roles/Crewmate/Autocrat.cs +++ b/Roles/Standard/Crewmate/Support/Autocrat.cs @@ -1,6 +1,6 @@ using System.Linq; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Autocrat : RoleBase { diff --git a/Roles/Crewmate/Bane.cs b/Roles/Standard/Crewmate/Support/Bane.cs similarity index 96% rename from Roles/Crewmate/Bane.cs rename to Roles/Standard/Crewmate/Support/Bane.cs index d6e87bc45..28abf0e9d 100644 --- a/Roles/Crewmate/Bane.cs +++ b/Roles/Standard/Crewmate/Support/Bane.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; public class Bane : RoleBase { diff --git a/Roles/Crewmate/Battery.cs b/Roles/Standard/Crewmate/Support/Battery.cs similarity index 97% rename from Roles/Crewmate/Battery.cs rename to Roles/Standard/Crewmate/Support/Battery.cs index 8b218ec2e..d1cb665ef 100644 --- a/Roles/Crewmate/Battery.cs +++ b/Roles/Standard/Crewmate/Support/Battery.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; public class Battery : RoleBase { diff --git a/Roles/Crewmate/Beacon.cs b/Roles/Standard/Crewmate/Support/Beacon.cs similarity index 99% rename from Roles/Crewmate/Beacon.cs rename to Roles/Standard/Crewmate/Support/Beacon.cs index e051b53f0..8db623684 100644 --- a/Roles/Crewmate/Beacon.cs +++ b/Roles/Standard/Crewmate/Support/Beacon.cs @@ -2,7 +2,7 @@ using System.Linq; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Beacon : RoleBase { diff --git a/Roles/Crewmate/Benefactor.cs b/Roles/Standard/Crewmate/Support/Benefactor.cs similarity index 99% rename from Roles/Crewmate/Benefactor.cs rename to Roles/Standard/Crewmate/Support/Benefactor.cs index 4e75f1ff6..083559a36 100644 --- a/Roles/Crewmate/Benefactor.cs +++ b/Roles/Standard/Crewmate/Support/Benefactor.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Benefactor : RoleBase { diff --git a/Roles/Crewmate/Bestower.cs b/Roles/Standard/Crewmate/Support/Bestower.cs similarity index 98% rename from Roles/Crewmate/Bestower.cs rename to Roles/Standard/Crewmate/Support/Bestower.cs index 884d12d59..a304aff21 100644 --- a/Roles/Crewmate/Bestower.cs +++ b/Roles/Standard/Crewmate/Support/Bestower.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Bestower : RoleBase { diff --git a/Roles/Crewmate/Bodyguard.cs b/Roles/Standard/Crewmate/Support/Bodyguard.cs similarity index 99% rename from Roles/Crewmate/Bodyguard.cs rename to Roles/Standard/Crewmate/Support/Bodyguard.cs index df02bc1e0..f9db5c10f 100644 --- a/Roles/Crewmate/Bodyguard.cs +++ b/Roles/Standard/Crewmate/Support/Bodyguard.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using EHR.Modules; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Bodyguard : RoleBase { diff --git a/Roles/Crewmate/Chef.cs b/Roles/Standard/Crewmate/Support/Chef.cs similarity index 99% rename from Roles/Crewmate/Chef.cs rename to Roles/Standard/Crewmate/Support/Chef.cs index 3e87aa248..36d8d3df4 100644 --- a/Roles/Crewmate/Chef.cs +++ b/Roles/Standard/Crewmate/Support/Chef.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Chef : RoleBase { diff --git a/Roles/Crewmate/Cleanser.cs b/Roles/Standard/Crewmate/Support/Cleanser.cs similarity index 96% rename from Roles/Crewmate/Cleanser.cs rename to Roles/Standard/Crewmate/Support/Cleanser.cs index c04d8fd48..a335d0797 100644 --- a/Roles/Crewmate/Cleanser.cs +++ b/Roles/Standard/Crewmate/Support/Cleanser.cs @@ -1,11 +1,10 @@ using System.Collections.Generic; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Cleanser : RoleBase { diff --git a/Roles/Crewmate/Convener.cs b/Roles/Standard/Crewmate/Support/Convener.cs similarity index 99% rename from Roles/Crewmate/Convener.cs rename to Roles/Standard/Crewmate/Support/Convener.cs index 595459997..94335e8bc 100644 --- a/Roles/Crewmate/Convener.cs +++ b/Roles/Standard/Crewmate/Support/Convener.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Convener : RoleBase { diff --git a/Roles/Crewmate/Crusader.cs b/Roles/Standard/Crewmate/Support/Crusader.cs similarity index 92% rename from Roles/Crewmate/Crusader.cs rename to Roles/Standard/Crewmate/Support/Crusader.cs index 51490e67c..3b56c7861 100644 --- a/Roles/Crewmate/Crusader.cs +++ b/Roles/Standard/Crewmate/Support/Crusader.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Crusader : RoleBase { @@ -93,7 +93,7 @@ public class Crusader : RoleBase return; } - keepGameGoing = false; - countsAs = 2; + keepGameGoing = ForCrusade.ToValidPlayers().Exists(x => x.IsAlive()); + countsAs = 1; } } \ No newline at end of file diff --git a/Roles/Crewmate/Deputy.cs b/Roles/Standard/Crewmate/Support/Deputy.cs similarity index 96% rename from Roles/Crewmate/Deputy.cs rename to Roles/Standard/Crewmate/Support/Deputy.cs index 48775e731..e878519bc 100644 --- a/Roles/Crewmate/Deputy.cs +++ b/Roles/Standard/Crewmate/Support/Deputy.cs @@ -4,7 +4,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Deputy : RoleBase { diff --git a/Roles/Crewmate/DonutDelivery.cs b/Roles/Standard/Crewmate/Support/DonutDelivery.cs similarity index 99% rename from Roles/Crewmate/DonutDelivery.cs rename to Roles/Standard/Crewmate/Support/DonutDelivery.cs index 845e8c3f5..a988b5da8 100644 --- a/Roles/Crewmate/DonutDelivery.cs +++ b/Roles/Standard/Crewmate/Support/DonutDelivery.cs @@ -5,7 +5,7 @@ using EHR.Modules; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class DonutDelivery : RoleBase { diff --git a/Roles/Crewmate/Doorjammer.cs b/Roles/Standard/Crewmate/Support/Doorjammer.cs similarity index 99% rename from Roles/Crewmate/Doorjammer.cs rename to Roles/Standard/Crewmate/Support/Doorjammer.cs index cb428d328..e9cced17e 100644 --- a/Roles/Crewmate/Doorjammer.cs +++ b/Roles/Standard/Crewmate/Support/Doorjammer.cs @@ -2,7 +2,7 @@ using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Doorjammer : RoleBase { diff --git a/Roles/Crewmate/Electric.cs b/Roles/Standard/Crewmate/Support/Electric.cs similarity index 98% rename from Roles/Crewmate/Electric.cs rename to Roles/Standard/Crewmate/Support/Electric.cs index e5fc86ab7..d85685e73 100644 --- a/Roles/Crewmate/Electric.cs +++ b/Roles/Standard/Crewmate/Support/Electric.cs @@ -3,7 +3,7 @@ using System.Linq; using EHR.Modules; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Electric : RoleBase { diff --git a/Roles/Crewmate/Escort.cs b/Roles/Standard/Crewmate/Support/Escort.cs similarity index 99% rename from Roles/Crewmate/Escort.cs rename to Roles/Standard/Crewmate/Support/Escort.cs index e053a4123..d3fc7144a 100644 --- a/Roles/Crewmate/Escort.cs +++ b/Roles/Standard/Crewmate/Support/Escort.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Escort : RoleBase { diff --git a/Roles/Crewmate/Farmer.cs b/Roles/Standard/Crewmate/Support/Farmer.cs similarity index 99% rename from Roles/Crewmate/Farmer.cs rename to Roles/Standard/Crewmate/Support/Farmer.cs index ac5f51e1c..b37366558 100644 --- a/Roles/Crewmate/Farmer.cs +++ b/Roles/Standard/Crewmate/Support/Farmer.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Farmer : RoleBase { diff --git a/Roles/Crewmate/Gardener.cs b/Roles/Standard/Crewmate/Support/Gardener.cs similarity index 99% rename from Roles/Crewmate/Gardener.cs rename to Roles/Standard/Crewmate/Support/Gardener.cs index 30a857dc4..82b36720f 100644 --- a/Roles/Crewmate/Gardener.cs +++ b/Roles/Standard/Crewmate/Support/Gardener.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Gardener : RoleBase { diff --git a/Roles/Crewmate/Gaulois.cs b/Roles/Standard/Crewmate/Support/Gaulois.cs similarity index 99% rename from Roles/Crewmate/Gaulois.cs rename to Roles/Standard/Crewmate/Support/Gaulois.cs index b1bca442d..70a4713e0 100644 --- a/Roles/Crewmate/Gaulois.cs +++ b/Roles/Standard/Crewmate/Support/Gaulois.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Gaulois : RoleBase { diff --git a/Roles/Crewmate/Grappler.cs b/Roles/Standard/Crewmate/Support/Grappler.cs similarity index 99% rename from Roles/Crewmate/Grappler.cs rename to Roles/Standard/Crewmate/Support/Grappler.cs index 32c8fd647..721d13700 100644 --- a/Roles/Crewmate/Grappler.cs +++ b/Roles/Standard/Crewmate/Support/Grappler.cs @@ -2,7 +2,7 @@ using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Grappler : RoleBase { diff --git a/Roles/Crewmate/Grenadier.cs b/Roles/Standard/Crewmate/Support/Grenadier.cs similarity index 99% rename from Roles/Crewmate/Grenadier.cs rename to Roles/Standard/Crewmate/Support/Grenadier.cs index e85ef8178..0d6e0e6b6 100644 --- a/Roles/Crewmate/Grenadier.cs +++ b/Roles/Standard/Crewmate/Support/Grenadier.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Grenadier : RoleBase { diff --git a/Roles/Crewmate/Helper.cs b/Roles/Standard/Crewmate/Support/Helper.cs similarity index 98% rename from Roles/Crewmate/Helper.cs rename to Roles/Standard/Crewmate/Support/Helper.cs index f29f61ac5..a6106846f 100644 --- a/Roles/Crewmate/Helper.cs +++ b/Roles/Standard/Crewmate/Support/Helper.cs @@ -2,7 +2,7 @@ using EHR.Modules; using Il2CppSystem; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Helper : RoleBase { diff --git a/Roles/Crewmate/Jailor.cs b/Roles/Standard/Crewmate/Support/Jailor.cs similarity index 99% rename from Roles/Crewmate/Jailor.cs rename to Roles/Standard/Crewmate/Support/Jailor.cs index 15611e135..af4f356c3 100644 --- a/Roles/Crewmate/Jailor.cs +++ b/Roles/Standard/Crewmate/Support/Jailor.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Jailor : RoleBase { diff --git a/Roles/Crewmate/Mathematician.cs b/Roles/Standard/Crewmate/Support/Mathematician.cs similarity index 99% rename from Roles/Crewmate/Mathematician.cs rename to Roles/Standard/Crewmate/Support/Mathematician.cs index fafc7c8a8..c97887532 100644 --- a/Roles/Crewmate/Mathematician.cs +++ b/Roles/Standard/Crewmate/Support/Mathematician.cs @@ -1,7 +1,7 @@ using System; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Mathematician : RoleBase { diff --git a/Roles/Crewmate/Mechanic.cs b/Roles/Standard/Crewmate/Support/Mechanic.cs similarity index 99% rename from Roles/Crewmate/Mechanic.cs rename to Roles/Standard/Crewmate/Support/Mechanic.cs index 3d87a4e50..66169ef80 100644 --- a/Roles/Crewmate/Mechanic.cs +++ b/Roles/Standard/Crewmate/Support/Mechanic.cs @@ -6,7 +6,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Mechanic : RoleBase { diff --git a/Roles/Crewmate/Medic.cs b/Roles/Standard/Crewmate/Support/Medic.cs similarity index 97% rename from Roles/Crewmate/Medic.cs rename to Roles/Standard/Crewmate/Support/Medic.cs index b81172a29..28f5ea658 100644 --- a/Roles/Crewmate/Medic.cs +++ b/Roles/Standard/Crewmate/Support/Medic.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Medic : RoleBase { diff --git a/Roles/Crewmate/Merchant.cs b/Roles/Standard/Crewmate/Support/Merchant.cs similarity index 97% rename from Roles/Crewmate/Merchant.cs rename to Roles/Standard/Crewmate/Support/Merchant.cs index b4c907640..34f5e60c3 100644 --- a/Roles/Crewmate/Merchant.cs +++ b/Roles/Standard/Crewmate/Support/Merchant.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using System.Linq; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Merchant : RoleBase { diff --git a/Roles/Crewmate/Monarch.cs b/Roles/Standard/Crewmate/Support/Monarch.cs similarity index 96% rename from Roles/Crewmate/Monarch.cs rename to Roles/Standard/Crewmate/Support/Monarch.cs index 830558868..3ae826591 100644 --- a/Roles/Crewmate/Monarch.cs +++ b/Roles/Standard/Crewmate/Support/Monarch.cs @@ -4,7 +4,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Monarch : RoleBase { diff --git a/Roles/Crewmate/Negotiator.cs b/Roles/Standard/Crewmate/Support/Negotiator.cs similarity index 99% rename from Roles/Crewmate/Negotiator.cs rename to Roles/Standard/Crewmate/Support/Negotiator.cs index 6666efb20..170d495cd 100644 --- a/Roles/Crewmate/Negotiator.cs +++ b/Roles/Standard/Crewmate/Support/Negotiator.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Negotiator : RoleBase { diff --git a/Roles/Crewmate/Pacifist.cs b/Roles/Standard/Crewmate/Support/Pacifist.cs similarity index 97% rename from Roles/Crewmate/Pacifist.cs rename to Roles/Standard/Crewmate/Support/Pacifist.cs index 6a9806ea4..2059428ef 100644 --- a/Roles/Crewmate/Pacifist.cs +++ b/Roles/Standard/Crewmate/Support/Pacifist.cs @@ -1,10 +1,9 @@ using System.Linq; using AmongUs.GameOptions; -using EHR.Impostor; using EHR.Modules; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Pacifist : RoleBase { @@ -15,7 +14,7 @@ internal class Pacifist : RoleBase { SetupRoleOptions(7700, TabGroup.CrewmateRoles, CustomRoles.Pacifist); - PacifistCooldown = new FloatOptionItem(7710, "PacifistCooldown", new(0f, 180f, 1f), 7f, TabGroup.CrewmateRoles) + PacifistCooldown = new FloatOptionItem(7710, "PacifistCooldown", new(0f, 180f, 0.5f), 7f, TabGroup.CrewmateRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Pacifist]) .SetValueFormat(OptionFormat.Seconds); @@ -102,4 +101,4 @@ internal class Pacifist : RoleBase { return !IsThisRole(pc) || pc.Is(CustomRoles.Nimble) || pc.GetClosestVent()?.Id == ventId; } -} \ No newline at end of file +} diff --git a/Roles/Crewmate/Rhapsode.cs b/Roles/Standard/Crewmate/Support/Rhapsode.cs similarity index 99% rename from Roles/Crewmate/Rhapsode.cs rename to Roles/Standard/Crewmate/Support/Rhapsode.cs index c3547ebee..e94da9587 100644 --- a/Roles/Crewmate/Rhapsode.cs +++ b/Roles/Standard/Crewmate/Support/Rhapsode.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Rhapsode : RoleBase { diff --git a/Roles/Crewmate/SecurityGuard.cs b/Roles/Standard/Crewmate/Support/SecurityGuard.cs similarity index 99% rename from Roles/Crewmate/SecurityGuard.cs rename to Roles/Standard/Crewmate/Support/SecurityGuard.cs index 915e3ea82..316707e7d 100644 --- a/Roles/Crewmate/SecurityGuard.cs +++ b/Roles/Standard/Crewmate/Support/SecurityGuard.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class SecurityGuard : RoleBase { diff --git a/Roles/Crewmate/SpeedBooster.cs b/Roles/Standard/Crewmate/Support/SpeedBooster.cs similarity index 97% rename from Roles/Crewmate/SpeedBooster.cs rename to Roles/Standard/Crewmate/Support/SpeedBooster.cs index af1d3a649..be6c1d8ab 100644 --- a/Roles/Crewmate/SpeedBooster.cs +++ b/Roles/Standard/Crewmate/Support/SpeedBooster.cs @@ -1,4 +1,4 @@ -namespace EHR.Crewmate; +namespace EHR.Roles; internal class SpeedBooster : RoleBase { diff --git a/Roles/Crewmate/TimeManager.cs b/Roles/Standard/Crewmate/Support/TimeManager.cs similarity index 96% rename from Roles/Crewmate/TimeManager.cs rename to Roles/Standard/Crewmate/Support/TimeManager.cs index 154edbfb7..dcefa8e7b 100644 --- a/Roles/Crewmate/TimeManager.cs +++ b/Roles/Standard/Crewmate/Support/TimeManager.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace EHR.Crewmate; +namespace EHR.Roles; public class TimeManager : RoleBase { diff --git a/Roles/Crewmate/TimeMaster.cs b/Roles/Standard/Crewmate/Support/TimeMaster.cs similarity index 77% rename from Roles/Crewmate/TimeMaster.cs rename to Roles/Standard/Crewmate/Support/TimeMaster.cs index 03911a0d3..79771a5ee 100644 --- a/Roles/Crewmate/TimeMaster.cs +++ b/Roles/Standard/Crewmate/Support/TimeMaster.cs @@ -8,12 +8,15 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class TimeMaster : RoleBase { public static bool On; + public static OptionItem TimeMasterCanRevive; + public static OptionItem TimeMasterRevivedKillerAlert; + public static OptionItem TimeMasterRevivedCanReportTheirOwnBody; public static OptionItem TimeMasterCanUseVitals; public static OptionItem TimeMasterRewindTimeLength; public static OptionItem TimeMasterSkillCooldown; @@ -22,6 +25,7 @@ internal class TimeMaster : RoleBase public static OptionItem TimeMasterAbilityUseGainWithEachTaskCompleted; private static Dictionary> BackTrack = []; + private static List RevivedPlayers = []; public static bool Rewinding; public override bool IsEnable => On; @@ -32,6 +36,15 @@ internal class TimeMaster : RoleBase { SetupRoleOptions(652100, TabGroup.CrewmateRoles, CustomRoles.TimeMaster); + TimeMasterCanRevive = new BooleanOptionItem(652106, "TimeMasterCanRevive", true, TabGroup.CrewmateRoles) + .SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster]); + + TimeMasterRevivedKillerAlert = new BooleanOptionItem(652107, "Altruist.ReviveTargetsKillerGetsAlert", true, TabGroup.CrewmateRoles) + .SetParent(TimeMasterCanRevive); + + TimeMasterRevivedCanReportTheirOwnBody = new BooleanOptionItem(652108, "Altruist.ReviveTargetCanReportTheirOwnBody", false, TabGroup.CrewmateRoles) + .SetParent(TimeMasterCanRevive); + TimeMasterCanUseVitals = new BooleanOptionItem(652109, "TimeMasterCanUseVitals", true, TabGroup.CrewmateRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster]); @@ -68,6 +81,7 @@ internal class TimeMaster : RoleBase { On = false; Rewinding = false; + RevivedPlayers = []; } public override void ApplyGameOptions(IGameOptions opt, byte playerId) @@ -86,6 +100,12 @@ internal class TimeMaster : RoleBase hud.AbilityButton.buttonLabelText.text = Translator.GetString("TimeMasterVentButtonText"); } + public static bool OnAnyoneCheckReportDeadBody(PlayerControl reporter, NetworkedPlayerInfo target) + { + if (TimeMasterRevivedCanReportTheirOwnBody.GetBool()) return true; + return !RevivedPlayers.Contains(reporter.PlayerId) || target.PlayerId != reporter.PlayerId; + } + public override void OnPet(PlayerControl pc) { if (pc.GetAbilityUseLimit() < 1) return; @@ -149,15 +169,29 @@ internal class TimeMaster : RoleBase yield return new WaitForSeconds(delay); } - foreach (DeadBody deadBody in Object.FindObjectsOfType()) + if (TimeMasterCanRevive.GetBool()) { - if (!Main.PlayerStates.TryGetValue(deadBody.ParentId, out PlayerState ps)) continue; - - if (ps.RealKiller.TimeStamp.AddSeconds(length) >= DateTime.Now) + foreach (DeadBody deadBody in Object.FindObjectsOfType()) { - ps.Player.RpcRevive(); - ps.Player.TP(deadBody.TruePosition); - ps.Player.Notify(Translator.GetString("RevivedByTimeMaster"), 15f); + if (!Main.PlayerStates.TryGetValue(deadBody.ParentId, out PlayerState ps)) continue; + + if (ps.RealKiller.TimeStamp.AddSeconds(length) >= DateTime.Now) + { + ps.Player.RpcRevive(); + ps.Player.TP(deadBody.TruePosition); + ps.Player.Notify(Translator.GetString("RevivedByTimeMaster"), 15f); + } + + if (TimeMasterRevivedKillerAlert.GetBool()) + { + var killer = ps.RealKiller.ID.GetPlayer(); + + if (killer != null && killer.IsAlive()) + { + killer.KillFlash(); + killer.Notify(Translator.GetString("TimeMasterKillerAlert"), 10f); + } + } } } @@ -233,6 +267,9 @@ internal class TimeMaster : RoleBase return !IsThisRole(pc) || pc.Is(CustomRoles.Nimble) || pc.GetClosestVent()?.Id == ventId; } + private bool KeepGameGoingCache; + private long KeepGameGoingCacheLastUpdate; + public override void ManipulateGameEndCheckCrew(PlayerState playerState, out bool keepGameGoing, out int countsAs) { if (playerState.IsDead) @@ -241,8 +278,14 @@ internal class TimeMaster : RoleBase return; } - keepGameGoing = false; + long now = Utils.TimeStamp; + bool cacheUpToDate = KeepGameGoingCacheLastUpdate == now; + + keepGameGoing = cacheUpToDate && KeepGameGoingCache; countsAs = 1; + + if (cacheUpToDate) return; + int length = TimeMasterRewindTimeLength.GetInt(); foreach (DeadBody deadBody in Object.FindObjectsOfType()) @@ -252,8 +295,13 @@ internal class TimeMaster : RoleBase if (ps.RealKiller.TimeStamp.AddSeconds(length) >= DateTime.Now) { keepGameGoing = true; + KeepGameGoingCache = keepGameGoing; + KeepGameGoingCacheLastUpdate = now; return; } } + + KeepGameGoingCache = keepGameGoing; + KeepGameGoingCacheLastUpdate = now; } } \ No newline at end of file diff --git a/Roles/Crewmate/Transporter.cs b/Roles/Standard/Crewmate/Support/Transporter.cs similarity index 99% rename from Roles/Crewmate/Transporter.cs rename to Roles/Standard/Crewmate/Support/Transporter.cs index bc71d8762..6e18478f2 100644 --- a/Roles/Crewmate/Transporter.cs +++ b/Roles/Standard/Crewmate/Support/Transporter.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Transporter : RoleBase { diff --git a/Roles/Crewmate/Ventguard.cs b/Roles/Standard/Crewmate/Support/Ventguard.cs similarity index 99% rename from Roles/Crewmate/Ventguard.cs rename to Roles/Standard/Crewmate/Support/Ventguard.cs index 9f46cc8f8..d590841da 100644 --- a/Roles/Crewmate/Ventguard.cs +++ b/Roles/Standard/Crewmate/Support/Ventguard.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class Ventguard : RoleBase { diff --git a/Roles/Crewmate/Wizard.cs b/Roles/Standard/Crewmate/Support/Wizard.cs similarity index 99% rename from Roles/Crewmate/Wizard.cs rename to Roles/Standard/Crewmate/Support/Wizard.cs index 8dee25456..001418fa5 100644 --- a/Roles/Crewmate/Wizard.cs +++ b/Roles/Standard/Crewmate/Support/Wizard.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Crewmate; +namespace EHR.Roles; public class Wizard : RoleBase { diff --git a/Roles/Crewmate/CrewmateVanillaRoles.cs b/Roles/Standard/Crewmate/Vanilla/CrewmateVanillaRoles.cs similarity index 99% rename from Roles/Crewmate/CrewmateVanillaRoles.cs rename to Roles/Standard/Crewmate/Vanilla/CrewmateVanillaRoles.cs index 05a72cf76..7fa166271 100644 --- a/Roles/Crewmate/CrewmateVanillaRoles.cs +++ b/Roles/Standard/Crewmate/Vanilla/CrewmateVanillaRoles.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Crewmate; +namespace EHR.Roles; internal class CrewmateVanillaRoles : IVanillaSettingHolder { diff --git a/Roles/AddOns/GhostRoles/Bloodmoon.cs b/Roles/Standard/Ghost/Bloodmoon.cs similarity index 99% rename from Roles/AddOns/GhostRoles/Bloodmoon.cs rename to Roles/Standard/Ghost/Bloodmoon.cs index 5af40645b..04495566a 100644 --- a/Roles/AddOns/GhostRoles/Bloodmoon.cs +++ b/Roles/Standard/Ghost/Bloodmoon.cs @@ -3,7 +3,7 @@ using System.Linq; using AmongUs.GameOptions; using Hazel; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; internal class Bloodmoon : IGhostRole { diff --git a/Roles/AddOns/GhostRoles/Facilitator.cs b/Roles/Standard/Ghost/Facilitator.cs similarity index 89% rename from Roles/AddOns/GhostRoles/Facilitator.cs rename to Roles/Standard/Ghost/Facilitator.cs index e795a13c7..a5098c4f4 100644 --- a/Roles/AddOns/GhostRoles/Facilitator.cs +++ b/Roles/Standard/Ghost/Facilitator.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; public class Facilitator : IGhostRole { @@ -12,7 +12,7 @@ public class Facilitator : IGhostRole public void OnProtect(PlayerControl pc, PlayerControl target) { - if (!Main.PlayerStates.TryGetValue(target.PlayerId, out PlayerState state) || state.Role is not Coven.Coven covenRole) return; + if (!Main.PlayerStates.TryGetValue(target.PlayerId, out PlayerState state) || state.Role is not CovenBase covenRole) return; covenRole.HasNecronomicon = true; covenRole.OnReceiveNecronomicon(); diff --git a/Roles/AddOns/GhostRoles/GA.cs b/Roles/Standard/Ghost/GA.cs similarity index 97% rename from Roles/AddOns/GhostRoles/GA.cs rename to Roles/Standard/Ghost/GA.cs index b48df1024..41f8a9b8b 100644 --- a/Roles/AddOns/GhostRoles/GA.cs +++ b/Roles/Standard/Ghost/GA.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; internal class GA : IGhostRole { diff --git a/Roles/AddOns/GhostRoles/Haunter.cs b/Roles/Standard/Ghost/Haunter.cs similarity index 99% rename from Roles/AddOns/GhostRoles/Haunter.cs rename to Roles/Standard/Ghost/Haunter.cs index f01465947..d33c3df6d 100644 --- a/Roles/AddOns/GhostRoles/Haunter.cs +++ b/Roles/Standard/Ghost/Haunter.cs @@ -3,7 +3,7 @@ using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; internal class Haunter : IGhostRole { diff --git a/Roles/AddOns/GhostRoles/IGhostRole.cs b/Roles/Standard/Ghost/IGhostRole.cs similarity index 90% rename from Roles/AddOns/GhostRoles/IGhostRole.cs rename to Roles/Standard/Ghost/IGhostRole.cs index b4e0a77f6..a111e9b9c 100644 --- a/Roles/AddOns/GhostRoles/IGhostRole.cs +++ b/Roles/Standard/Ghost/IGhostRole.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; public interface IGhostRole { diff --git a/Roles/AddOns/GhostRoles/Minion.cs b/Roles/Standard/Ghost/Minion.cs similarity index 97% rename from Roles/AddOns/GhostRoles/Minion.cs rename to Roles/Standard/Ghost/Minion.cs index 6dda8c7d6..422d575dc 100644 --- a/Roles/AddOns/GhostRoles/Minion.cs +++ b/Roles/Standard/Ghost/Minion.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; internal class Minion : IGhostRole { diff --git a/Roles/AddOns/GhostRoles/Phantasm.cs b/Roles/Standard/Ghost/Phantasm.cs similarity index 98% rename from Roles/AddOns/GhostRoles/Phantasm.cs rename to Roles/Standard/Ghost/Phantasm.cs index 001b36518..34c42508e 100644 --- a/Roles/AddOns/GhostRoles/Phantasm.cs +++ b/Roles/Standard/Ghost/Phantasm.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; // TOU Phantom internal class Phantasm : IGhostRole diff --git a/Roles/AddOns/GhostRoles/Shade.cs b/Roles/Standard/Ghost/Shade.cs similarity index 96% rename from Roles/AddOns/GhostRoles/Shade.cs rename to Roles/Standard/Ghost/Shade.cs index 53edb8ef0..6d504d135 100644 --- a/Roles/AddOns/GhostRoles/Shade.cs +++ b/Roles/Standard/Ghost/Shade.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; public class Shade : IGhostRole { diff --git a/Roles/AddOns/GhostRoles/Warden.cs b/Roles/Standard/Ghost/Warden.cs similarity index 98% rename from Roles/AddOns/GhostRoles/Warden.cs rename to Roles/Standard/Ghost/Warden.cs index e8471a272..84f52f13a 100644 --- a/Roles/AddOns/GhostRoles/Warden.cs +++ b/Roles/Standard/Ghost/Warden.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.AddOns.GhostRoles; +namespace EHR.Roles; internal class Warden : IGhostRole { diff --git a/Roles/Impostor/Ambusher.cs b/Roles/Standard/Impostor/Concealing/Ambusher.cs similarity index 99% rename from Roles/Impostor/Ambusher.cs rename to Roles/Standard/Impostor/Concealing/Ambusher.cs index e8fc24ad1..92c1facb9 100644 --- a/Roles/Impostor/Ambusher.cs +++ b/Roles/Standard/Impostor/Concealing/Ambusher.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Ambusher : RoleBase { diff --git a/Roles/Impostor/Anonymous.cs b/Roles/Standard/Impostor/Concealing/Anonymous.cs similarity index 98% rename from Roles/Impostor/Anonymous.cs rename to Roles/Standard/Impostor/Concealing/Anonymous.cs index 72f00500e..092634727 100644 --- a/Roles/Impostor/Anonymous.cs +++ b/Roles/Standard/Impostor/Concealing/Anonymous.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Anonymous : RoleBase { diff --git a/Roles/Impostor/Duellist.cs b/Roles/Standard/Impostor/Concealing/Duellist.cs similarity index 98% rename from Roles/Impostor/Duellist.cs rename to Roles/Standard/Impostor/Concealing/Duellist.cs index 76b0bbf60..9185df330 100644 --- a/Roles/Impostor/Duellist.cs +++ b/Roles/Standard/Impostor/Concealing/Duellist.cs @@ -1,13 +1,11 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Duellist : RoleBase { diff --git a/Roles/Impostor/Echo.cs b/Roles/Standard/Impostor/Concealing/Echo.cs similarity index 99% rename from Roles/Impostor/Echo.cs rename to Roles/Standard/Impostor/Concealing/Echo.cs index 2be132550..681ba857d 100644 --- a/Roles/Impostor/Echo.cs +++ b/Roles/Standard/Impostor/Concealing/Echo.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; -namespace EHR.Impostor; +namespace EHR.Roles; public class Echo : RoleBase { diff --git a/Roles/Impostor/Escapist.cs b/Roles/Standard/Impostor/Concealing/Escapist.cs similarity index 99% rename from Roles/Impostor/Escapist.cs rename to Roles/Standard/Impostor/Concealing/Escapist.cs index 667ce9acb..1ca328cdf 100644 --- a/Roles/Impostor/Escapist.cs +++ b/Roles/Standard/Impostor/Concealing/Escapist.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Escapist : RoleBase { diff --git a/Roles/Impostor/Exclusionary.cs b/Roles/Standard/Impostor/Concealing/Exclusionary.cs similarity index 99% rename from Roles/Impostor/Exclusionary.cs rename to Roles/Standard/Impostor/Concealing/Exclusionary.cs index 8a2559f40..d227dbfe1 100644 --- a/Roles/Impostor/Exclusionary.cs +++ b/Roles/Standard/Impostor/Concealing/Exclusionary.cs @@ -2,7 +2,7 @@ using EHR.Modules; using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; public class Exclusionary : RoleBase { diff --git a/Roles/Impostor/Fabricator.cs b/Roles/Standard/Impostor/Concealing/Fabricator.cs similarity index 98% rename from Roles/Impostor/Fabricator.cs rename to Roles/Standard/Impostor/Concealing/Fabricator.cs index cc299468c..522c7a23e 100644 --- a/Roles/Impostor/Fabricator.cs +++ b/Roles/Standard/Impostor/Concealing/Fabricator.cs @@ -1,6 +1,6 @@ using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; public class Fabricator : RoleBase { diff --git a/Roles/Impostor/Forger.cs b/Roles/Standard/Impostor/Concealing/Forger.cs similarity index 97% rename from Roles/Impostor/Forger.cs rename to Roles/Standard/Impostor/Concealing/Forger.cs index 4712d786c..f050efe30 100644 --- a/Roles/Impostor/Forger.cs +++ b/Roles/Standard/Impostor/Concealing/Forger.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace EHR.Impostor; +namespace EHR.Roles; public class Forger : RoleBase { diff --git a/Roles/Impostor/Hangman.cs b/Roles/Standard/Impostor/Concealing/Hangman.cs similarity index 96% rename from Roles/Impostor/Hangman.cs rename to Roles/Standard/Impostor/Concealing/Hangman.cs index bf5ecc0d4..2e674cfcd 100644 --- a/Roles/Impostor/Hangman.cs +++ b/Roles/Standard/Impostor/Concealing/Hangman.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Hangman : RoleBase { diff --git a/Roles/Impostor/Kidnapper.cs b/Roles/Standard/Impostor/Concealing/Kidnapper.cs similarity index 98% rename from Roles/Impostor/Kidnapper.cs rename to Roles/Standard/Impostor/Concealing/Kidnapper.cs index 31d75ccea..b9ce884f7 100644 --- a/Roles/Impostor/Kidnapper.cs +++ b/Roles/Standard/Impostor/Concealing/Kidnapper.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Kidnapper : RoleBase { diff --git a/Roles/Impostor/Lightning.cs b/Roles/Standard/Impostor/Concealing/Lightning.cs similarity index 99% rename from Roles/Impostor/Lightning.cs rename to Roles/Standard/Impostor/Concealing/Lightning.cs index 696ad9f90..a61b6148f 100644 --- a/Roles/Impostor/Lightning.cs +++ b/Roles/Standard/Impostor/Concealing/Lightning.cs @@ -1,13 +1,11 @@ using System.Collections.Generic; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Lightning : RoleBase { diff --git a/Roles/Impostor/Mastermind.cs b/Roles/Standard/Impostor/Concealing/Mastermind.cs similarity index 99% rename from Roles/Impostor/Mastermind.cs rename to Roles/Standard/Impostor/Concealing/Mastermind.cs index 51f9be6ee..3349e2f6f 100644 --- a/Roles/Impostor/Mastermind.cs +++ b/Roles/Standard/Impostor/Concealing/Mastermind.cs @@ -1,12 +1,10 @@ using System.Collections.Generic; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Mastermind : RoleBase { diff --git a/Roles/Impostor/Miner.cs b/Roles/Standard/Impostor/Concealing/Miner.cs similarity index 98% rename from Roles/Impostor/Miner.cs rename to Roles/Standard/Impostor/Concealing/Miner.cs index 70a239565..cca2ffb81 100644 --- a/Roles/Impostor/Miner.cs +++ b/Roles/Standard/Impostor/Concealing/Miner.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Miner : RoleBase { diff --git a/Roles/Impostor/Morphling.cs b/Roles/Standard/Impostor/Concealing/Morphling.cs similarity index 95% rename from Roles/Impostor/Morphling.cs rename to Roles/Standard/Impostor/Concealing/Morphling.cs index 5ef425c46..db8ff371f 100644 --- a/Roles/Impostor/Morphling.cs +++ b/Roles/Standard/Impostor/Concealing/Morphling.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Morphling : RoleBase { diff --git a/Roles/Impostor/Penguin.cs b/Roles/Standard/Impostor/Concealing/Penguin.cs similarity index 99% rename from Roles/Impostor/Penguin.cs rename to Roles/Standard/Impostor/Concealing/Penguin.cs index 71551eb17..da18ba4ad 100644 --- a/Roles/Impostor/Penguin.cs +++ b/Roles/Standard/Impostor/Concealing/Penguin.cs @@ -1,13 +1,11 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Penguin : RoleBase { diff --git a/Roles/Impostor/Postponer.cs b/Roles/Standard/Impostor/Concealing/Postponer.cs similarity index 98% rename from Roles/Impostor/Postponer.cs rename to Roles/Standard/Impostor/Concealing/Postponer.cs index 9748096a3..69d538875 100644 --- a/Roles/Impostor/Postponer.cs +++ b/Roles/Standard/Impostor/Concealing/Postponer.cs @@ -1,7 +1,7 @@ using EHR.Modules; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Postponer : RoleBase { diff --git a/Roles/Impostor/Puppeteer.cs b/Roles/Standard/Impostor/Concealing/Puppeteer.cs similarity index 99% rename from Roles/Impostor/Puppeteer.cs rename to Roles/Standard/Impostor/Concealing/Puppeteer.cs index 2e7eec79b..0cbfd05e4 100644 --- a/Roles/Impostor/Puppeteer.cs +++ b/Roles/Standard/Impostor/Concealing/Puppeteer.cs @@ -1,13 +1,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Puppeteer : RoleBase { diff --git a/Roles/Impostor/RiftMaker.cs b/Roles/Standard/Impostor/Concealing/RiftMaker.cs similarity index 76% rename from Roles/Impostor/RiftMaker.cs rename to Roles/Standard/Impostor/Concealing/RiftMaker.cs index f4640a753..f21ced494 100644 --- a/Roles/Impostor/RiftMaker.cs +++ b/Roles/Standard/Impostor/Concealing/RiftMaker.cs @@ -1,13 +1,12 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class RiftMaker : RoleBase { @@ -16,8 +15,9 @@ public class RiftMaker : RoleBase public static OptionItem KillCooldown; public static OptionItem ShapeshiftCooldown; - public long LastTP = TimeStamp; + public static OptionItem CanVent; + public long LastTP = TimeStamp; public List Marks = []; public override bool IsEnable => PlayerIdList.Count > 0; @@ -26,11 +26,16 @@ public class RiftMaker : RoleBase { SetupRoleOptions(Id, TabGroup.ImpostorRoles, CustomRoles.RiftMaker); - KillCooldown = new FloatOptionItem(Id + 10, "KillCooldown", new(0f, 180f, 0.5f), 25f, TabGroup.ImpostorRoles).SetParent(CustomRoleSpawnChances[CustomRoles.RiftMaker]) + KillCooldown = new FloatOptionItem(Id + 10, "KillCooldown", new(0f, 180f, 0.5f), 25f, TabGroup.ImpostorRoles) + .SetParent(CustomRoleSpawnChances[CustomRoles.RiftMaker]) .SetValueFormat(OptionFormat.Seconds); - ShapeshiftCooldown = new FloatOptionItem(Id + 11, "ShapeshiftCooldown", new(0f, 180f, 0.5f), 10f, TabGroup.ImpostorRoles).SetParent(CustomRoleSpawnChances[CustomRoles.RiftMaker]) + ShapeshiftCooldown = new FloatOptionItem(Id + 11, "ShapeshiftCooldown", new(0f, 180f, 0.5f), 10f, TabGroup.ImpostorRoles) + .SetParent(CustomRoleSpawnChances[CustomRoles.RiftMaker]) .SetValueFormat(OptionFormat.Seconds); + + CanVent = new BooleanOptionItem(Id + 12, "CanVent", true, TabGroup.ImpostorRoles) + .SetParent(CustomRoleSpawnChances[CustomRoles.RiftMaker]); } public override void Init() @@ -56,6 +61,11 @@ public class RiftMaker : RoleBase Main.AllPlayerKillCooldown[id] = KillCooldown.GetFloat(); } + public override bool CanUseImpostorVentButton(PlayerControl pc) + { + return CanVent.GetBool(); + } + public override void ApplyGameOptions(IGameOptions opt, byte playerId) { if (UsePhantomBasis.GetBool()) @@ -73,11 +83,8 @@ public class RiftMaker : RoleBase public override void OnFixedUpdate(PlayerControl player) { if (!GameStates.IsInTask || ExileController.Instance || AntiBlackout.SkipTasks) return; - if (Pelican.IsEaten(player.PlayerId) || !player.IsAlive()) return; - if (!player.Is(CustomRoles.RiftMaker)) return; - if (Marks.Count != 2) return; if (Vector2.Distance(Marks[0], Marks[1]) <= 4f) @@ -92,7 +99,7 @@ public class RiftMaker : RoleBase Vector2 position = player.Pos(); - var isTP = false; + var tp = false; Vector2 from = Marks[0]; foreach (Vector2 mark in Marks) @@ -100,11 +107,11 @@ public class RiftMaker : RoleBase float dis = Vector2.Distance(mark, position); if (dis > 2f) continue; - isTP = true; + tp = true; from = mark; } - if (isTP) + if (tp) { LastTP = TimeStamp; @@ -122,54 +129,45 @@ public class RiftMaker : RoleBase LastTP = TimeStamp; } - public override void OnEnterVent(PlayerControl player, Vent vent) + public override void AfterMeetingTasks() { - Marks.Clear(); - SendRPC(CustomRPC.SyncRoleData, player.PlayerId, 2); - player.Notify(GetString("MarksCleared")); - player.MyPhysics?.RpcExitVent(vent.Id); + LastTP = TimeStamp; } public override bool OnShapeshift(PlayerControl player, PlayerControl target, bool shapeshifting) { - if (player == null) return false; - if (!shapeshifting) return true; - - if (Marks.Count >= 2) return false; - - Mark(player); - + UseAbility(player); return false; } public override bool OnVanish(PlayerControl pc) { - if (pc == null) return false; - - if (Marks.Count >= 2) return false; - - Mark(pc); - + UseAbility(pc); return false; } public override void OnPet(PlayerControl pc) { - if (pc == null) return; - - if (Marks.Count >= 2) return; - - Mark(pc); + UseAbility(pc); } - private void Mark(PlayerControl player) + private void UseAbility(PlayerControl player) { - Vector2 pos = player.Pos(); - Marks.Add(pos); - SendRPC(CustomRPC.SyncRoleData, player.PlayerId, 1, pos); - if (Marks.Count == 2) LastTP = TimeStamp; - player.Notify(GetString("MarkDone")); + if (Marks.Count < 2) + { + Vector2 pos = player.Pos(); + Marks.Add(pos); + SendRPC(CustomRPC.SyncRoleData, player.PlayerId, 1, pos); + if (Marks.Count == 2) LastTP = TimeStamp; + player.Notify(GetString("MarkDone")); + } + else + { + Marks.Clear(); + SendRPC(CustomRPC.SyncRoleData, player.PlayerId, 2); + player.Notify(GetString("MarksCleared")); + } } public void ReceiveRPC(MessageReader reader) diff --git a/Roles/Impostor/Scavenger.cs b/Roles/Standard/Impostor/Concealing/Scavenger.cs similarity index 98% rename from Roles/Impostor/Scavenger.cs rename to Roles/Standard/Impostor/Concealing/Scavenger.cs index a2821cb7a..2b264786d 100644 --- a/Roles/Impostor/Scavenger.cs +++ b/Roles/Standard/Impostor/Concealing/Scavenger.cs @@ -1,9 +1,8 @@ using EHR.Modules; -using EHR.Neutral; using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Scavenger : RoleBase { diff --git a/Roles/Impostor/SoulCatcher.cs b/Roles/Standard/Impostor/Concealing/SoulCatcher.cs similarity index 98% rename from Roles/Impostor/SoulCatcher.cs rename to Roles/Standard/Impostor/Concealing/SoulCatcher.cs index f71c26035..170f55373 100644 --- a/Roles/Impostor/SoulCatcher.cs +++ b/Roles/Standard/Impostor/Concealing/SoulCatcher.cs @@ -2,7 +2,7 @@ using EHR.Modules; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class SoulCatcher : RoleBase { diff --git a/Roles/Impostor/Stasis.cs b/Roles/Standard/Impostor/Concealing/Stasis.cs similarity index 98% rename from Roles/Impostor/Stasis.cs rename to Roles/Standard/Impostor/Concealing/Stasis.cs index 3888c02c0..09ca677cd 100644 --- a/Roles/Impostor/Stasis.cs +++ b/Roles/Standard/Impostor/Concealing/Stasis.cs @@ -5,7 +5,7 @@ using System.Linq; using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Stasis : RoleBase { @@ -32,7 +32,7 @@ public class Stasis : RoleBase .AutoSetupOption(ref AbilityDuration, 10, new IntegerValueRule(1, 60, 1), OptionFormat.Seconds) .AutoSetupOption(ref AffectsOtherImpostors, true) .AutoSetupOption(ref CanVent, false) - .AutoSetupOption(ref KillCooldown, 30f, new FloatValueRule(0f, 180f, 1f), OptionFormat.Seconds) + .AutoSetupOption(ref KillCooldown, 30f, new FloatValueRule(0f, 180f, 0.5f), OptionFormat.Seconds) .AutoSetupOption(ref CanSabotage, false); } @@ -156,4 +156,4 @@ public class Stasis : RoleBase pc.RpcResetAbilityCooldown(); } } -} \ No newline at end of file +} diff --git a/Roles/Impostor/Stealth.cs b/Roles/Standard/Impostor/Concealing/Stealth.cs similarity index 99% rename from Roles/Impostor/Stealth.cs rename to Roles/Standard/Impostor/Concealing/Stealth.cs index 769301a72..46c793d3a 100644 --- a/Roles/Impostor/Stealth.cs +++ b/Roles/Standard/Impostor/Concealing/Stealth.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public sealed class Stealth : RoleBase { diff --git a/Roles/Impostor/Swiftclaw.cs b/Roles/Standard/Impostor/Concealing/Swiftclaw.cs similarity index 99% rename from Roles/Impostor/Swiftclaw.cs rename to Roles/Standard/Impostor/Concealing/Swiftclaw.cs index 4cb6159a0..a7bcc882b 100644 --- a/Roles/Impostor/Swiftclaw.cs +++ b/Roles/Standard/Impostor/Concealing/Swiftclaw.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Swiftclaw : RoleBase { diff --git a/Roles/Impostor/Swooper.cs b/Roles/Standard/Impostor/Concealing/Swooper.cs similarity index 96% rename from Roles/Impostor/Swooper.cs rename to Roles/Standard/Impostor/Concealing/Swooper.cs index 80013b088..cb65df76e 100644 --- a/Roles/Impostor/Swooper.cs +++ b/Roles/Standard/Impostor/Concealing/Swooper.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Swooper : RoleBase { diff --git a/Roles/Impostor/Trickster.cs b/Roles/Standard/Impostor/Concealing/Trickster.cs similarity index 92% rename from Roles/Impostor/Trickster.cs rename to Roles/Standard/Impostor/Concealing/Trickster.cs index 103f50e60..0232a5319 100644 --- a/Roles/Impostor/Trickster.cs +++ b/Roles/Standard/Impostor/Concealing/Trickster.cs @@ -1,4 +1,4 @@ -namespace EHR.Impostor; +namespace EHR.Roles; internal class Trickster : RoleBase { diff --git a/Roles/Impostor/Undertaker.cs b/Roles/Standard/Impostor/Concealing/Undertaker.cs similarity index 98% rename from Roles/Impostor/Undertaker.cs rename to Roles/Standard/Impostor/Concealing/Undertaker.cs index 626a7cb53..6355f5cd9 100644 --- a/Roles/Impostor/Undertaker.cs +++ b/Roles/Standard/Impostor/Concealing/Undertaker.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Undertaker : RoleBase { diff --git a/Roles/Impostor/Vampire.cs b/Roles/Standard/Impostor/Concealing/Vampire.cs similarity index 96% rename from Roles/Impostor/Vampire.cs rename to Roles/Standard/Impostor/Concealing/Vampire.cs index 630646d3f..86bf06dcf 100644 --- a/Roles/Impostor/Vampire.cs +++ b/Roles/Standard/Impostor/Concealing/Vampire.cs @@ -2,13 +2,11 @@ using System; using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using UnityEngine; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Vampire : RoleBase { diff --git a/Roles/Impostor/Venerer.cs b/Roles/Standard/Impostor/Concealing/Venerer.cs similarity index 99% rename from Roles/Impostor/Venerer.cs rename to Roles/Standard/Impostor/Concealing/Venerer.cs index e0d62e117..16e87f105 100644 --- a/Roles/Impostor/Venerer.cs +++ b/Roles/Standard/Impostor/Concealing/Venerer.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Venerer : RoleBase { diff --git a/Roles/Impostor/Warlock.cs b/Roles/Standard/Impostor/Concealing/Warlock.cs similarity index 99% rename from Roles/Impostor/Warlock.cs rename to Roles/Standard/Impostor/Concealing/Warlock.cs index 2f63363e4..bebde309d 100644 --- a/Roles/Impostor/Warlock.cs +++ b/Roles/Standard/Impostor/Concealing/Warlock.cs @@ -2,13 +2,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Warlock : RoleBase { diff --git a/Roles/Impostor/Abyssbringer.cs b/Roles/Standard/Impostor/Killing/Abyssbringer.cs similarity index 99% rename from Roles/Impostor/Abyssbringer.cs rename to Roles/Standard/Impostor/Killing/Abyssbringer.cs index 6b7ac97da..f4f9028d4 100644 --- a/Roles/Impostor/Abyssbringer.cs +++ b/Roles/Standard/Impostor/Killing/Abyssbringer.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Abyssbringer : RoleBase { diff --git a/Roles/Impostor/Arrogance.cs b/Roles/Standard/Impostor/Killing/Arrogance.cs similarity index 97% rename from Roles/Impostor/Arrogance.cs rename to Roles/Standard/Impostor/Killing/Arrogance.cs index 81edfc6d8..e2736179e 100644 --- a/Roles/Impostor/Arrogance.cs +++ b/Roles/Standard/Impostor/Killing/Arrogance.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Arrogance : RoleBase { @@ -43,7 +42,7 @@ public class Arrogance : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Arrogance]) .SetValueFormat(OptionFormat.Seconds); - ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0f, 30f, 0.5f), 3.5f, TabGroup.ImpostorRoles) + ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0.5f, 30f, 0.5f), 3.5f, TabGroup.ImpostorRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Arrogance]) .SetValueFormat(OptionFormat.Seconds); diff --git a/Roles/Impostor/Assumer.cs b/Roles/Standard/Impostor/Killing/Assumer.cs similarity index 99% rename from Roles/Impostor/Assumer.cs rename to Roles/Standard/Impostor/Killing/Assumer.cs index 51c459649..250fd6f9b 100644 --- a/Roles/Impostor/Assumer.cs +++ b/Roles/Standard/Impostor/Killing/Assumer.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using EHR.Patches; -namespace EHR.Impostor; +namespace EHR.Roles; public class Assumer : RoleBase { diff --git a/Roles/Impostor/Augmenter.cs b/Roles/Standard/Impostor/Killing/Augmenter.cs similarity index 97% rename from Roles/Impostor/Augmenter.cs rename to Roles/Standard/Impostor/Killing/Augmenter.cs index 790655692..cf83ed0d0 100644 --- a/Roles/Impostor/Augmenter.cs +++ b/Roles/Standard/Impostor/Killing/Augmenter.cs @@ -1,4 +1,4 @@ -namespace EHR.Impostor; +namespace EHR.Roles; public class Augmenter : RoleBase { diff --git a/Roles/Impostor/Bard.cs b/Roles/Standard/Impostor/Killing/Bard.cs similarity index 98% rename from Roles/Impostor/Bard.cs rename to Roles/Standard/Impostor/Killing/Bard.cs index 6d651ad66..241442dd9 100644 --- a/Roles/Impostor/Bard.cs +++ b/Roles/Standard/Impostor/Killing/Bard.cs @@ -2,7 +2,7 @@ using System.Diagnostics.CodeAnalysis; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Bard : RoleBase { diff --git a/Roles/Impostor/Bomber.cs b/Roles/Standard/Impostor/Killing/Bomber.cs similarity index 99% rename from Roles/Impostor/Bomber.cs rename to Roles/Standard/Impostor/Killing/Bomber.cs index 82a70818e..b3cdfa4b4 100644 --- a/Roles/Impostor/Bomber.cs +++ b/Roles/Standard/Impostor/Killing/Bomber.cs @@ -1,11 +1,9 @@ using System; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Bomber : RoleBase { diff --git a/Roles/Impostor/BountyHunter.cs b/Roles/Standard/Impostor/Killing/BountyHunter.cs similarity index 97% rename from Roles/Impostor/BountyHunter.cs rename to Roles/Standard/Impostor/Killing/BountyHunter.cs index e1957375f..316398662 100644 --- a/Roles/Impostor/BountyHunter.cs +++ b/Roles/Standard/Impostor/Killing/BountyHunter.cs @@ -5,7 +5,7 @@ using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class BountyHunter : RoleBase { diff --git a/Roles/Impostor/Butcher.cs b/Roles/Standard/Impostor/Killing/Butcher.cs similarity index 99% rename from Roles/Impostor/Butcher.cs rename to Roles/Standard/Impostor/Killing/Butcher.cs index 945225f7d..74200eb9d 100644 --- a/Roles/Impostor/Butcher.cs +++ b/Roles/Standard/Impostor/Killing/Butcher.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using EHR.Modules; using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Butcher : RoleBase { diff --git a/Roles/Impostor/Cantankerous.cs b/Roles/Standard/Impostor/Killing/Cantankerous.cs similarity index 98% rename from Roles/Impostor/Cantankerous.cs rename to Roles/Standard/Impostor/Killing/Cantankerous.cs index aa31f50af..dc9d3f4a0 100644 --- a/Roles/Impostor/Cantankerous.cs +++ b/Roles/Standard/Impostor/Killing/Cantankerous.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Cantankerous : RoleBase { diff --git a/Roles/Impostor/Chronomancer.cs b/Roles/Standard/Impostor/Killing/Chronomancer.cs similarity index 99% rename from Roles/Impostor/Chronomancer.cs rename to Roles/Standard/Impostor/Killing/Chronomancer.cs index 7cd3219b5..5ab8f65ed 100644 --- a/Roles/Impostor/Chronomancer.cs +++ b/Roles/Standard/Impostor/Killing/Chronomancer.cs @@ -3,7 +3,7 @@ using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Chronomancer : RoleBase { diff --git a/Roles/Impostor/Councillor.cs b/Roles/Standard/Impostor/Killing/Councillor.cs similarity index 96% rename from Roles/Impostor/Councillor.cs rename to Roles/Standard/Impostor/Killing/Councillor.cs index b8c94e7db..926f7d30b 100644 --- a/Roles/Impostor/Councillor.cs +++ b/Roles/Standard/Impostor/Killing/Councillor.cs @@ -2,14 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Councillor : RoleBase { @@ -319,7 +317,7 @@ public class Councillor : RoleBase { Logger.Msg($"Click: ID {playerId}", "Councillor UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) MurderMsg(PlayerControl.LocalPlayer, $"/tl {playerId}", true); diff --git a/Roles/Impostor/EvilGuesser.cs b/Roles/Standard/Impostor/Killing/EvilGuesser.cs similarity index 97% rename from Roles/Impostor/EvilGuesser.cs rename to Roles/Standard/Impostor/Killing/EvilGuesser.cs index 2a0d53396..b6b9f3a55 100644 --- a/Roles/Impostor/EvilGuesser.cs +++ b/Roles/Standard/Impostor/Killing/EvilGuesser.cs @@ -1,7 +1,7 @@ using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class EvilGuesser : RoleBase { diff --git a/Roles/Impostor/Fireworker.cs b/Roles/Standard/Impostor/Killing/Fireworker.cs similarity index 99% rename from Roles/Impostor/Fireworker.cs rename to Roles/Standard/Impostor/Killing/Fireworker.cs index 5b334b657..278f7fc2c 100644 --- a/Roles/Impostor/Fireworker.cs +++ b/Roles/Standard/Impostor/Killing/Fireworker.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Fireworker : RoleBase { diff --git a/Roles/Impostor/Greedy.cs b/Roles/Standard/Impostor/Killing/Greedy.cs similarity index 99% rename from Roles/Impostor/Greedy.cs rename to Roles/Standard/Impostor/Killing/Greedy.cs index 98897735d..92544ca7c 100644 --- a/Roles/Impostor/Greedy.cs +++ b/Roles/Standard/Impostor/Killing/Greedy.cs @@ -2,10 +2,9 @@ using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; // Reference: https://github.com/Yumenopai/TownOfHost_Y public class Greedy : RoleBase // Also used for Pulse as the NK version of this diff --git a/Roles/Impostor/Hitman.cs b/Roles/Standard/Impostor/Killing/Hitman.cs similarity index 99% rename from Roles/Impostor/Hitman.cs rename to Roles/Standard/Impostor/Killing/Hitman.cs index dd7281229..e603ed61a 100644 --- a/Roles/Impostor/Hitman.cs +++ b/Roles/Standard/Impostor/Killing/Hitman.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Hitman : RoleBase { diff --git a/Roles/Impostor/Inhibitor.cs b/Roles/Standard/Impostor/Killing/Inhibitor.cs similarity index 99% rename from Roles/Impostor/Inhibitor.cs rename to Roles/Standard/Impostor/Killing/Inhibitor.cs index a4b89a6e2..fec12ebfc 100644 --- a/Roles/Impostor/Inhibitor.cs +++ b/Roles/Standard/Impostor/Killing/Inhibitor.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Inhibitor : RoleBase { diff --git a/Roles/Impostor/Kamikaze.cs b/Roles/Standard/Impostor/Killing/Kamikaze.cs similarity index 98% rename from Roles/Impostor/Kamikaze.cs rename to Roles/Standard/Impostor/Killing/Kamikaze.cs index 8952750ab..2d6d3cd60 100644 --- a/Roles/Impostor/Kamikaze.cs +++ b/Roles/Standard/Impostor/Killing/Kamikaze.cs @@ -1,11 +1,9 @@ using System.Collections.Generic; using System.Linq; -using EHR.AddOns.Impostor; -using EHR.Crewmate; using static EHR.Options; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Kamikaze : RoleBase { diff --git a/Roles/Impostor/KillingMachine.cs b/Roles/Standard/Impostor/Killing/KillingMachine.cs similarity index 99% rename from Roles/Impostor/KillingMachine.cs rename to Roles/Standard/Impostor/Killing/KillingMachine.cs index b87d0360b..a915a40cf 100644 --- a/Roles/Impostor/KillingMachine.cs +++ b/Roles/Standard/Impostor/Killing/KillingMachine.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; internal class KillingMachine : RoleBase { diff --git a/Roles/Impostor/Lurker.cs b/Roles/Standard/Impostor/Killing/Lurker.cs similarity index 92% rename from Roles/Impostor/Lurker.cs rename to Roles/Standard/Impostor/Killing/Lurker.cs index 6122dc664..c5f9b1ccc 100644 --- a/Roles/Impostor/Lurker.cs +++ b/Roles/Standard/Impostor/Killing/Lurker.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Lurker : RoleBase { @@ -21,7 +21,7 @@ public class Lurker : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Lurker]) .SetValueFormat(OptionFormat.Seconds); - ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0f, 10f, 1f), 1f, TabGroup.ImpostorRoles) + ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(1f, 10f, 1f), 1f, TabGroup.ImpostorRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Lurker]) .SetValueFormat(OptionFormat.Seconds); } @@ -61,4 +61,4 @@ public class Lurker : RoleBase { killer.ResetKillCooldown(); } -} \ No newline at end of file +} diff --git a/Roles/Impostor/Mafioso.cs b/Roles/Standard/Impostor/Killing/Mafioso.cs similarity index 99% rename from Roles/Impostor/Mafioso.cs rename to Roles/Standard/Impostor/Killing/Mafioso.cs index dbaf91008..532aa96e1 100644 --- a/Roles/Impostor/Mafioso.cs +++ b/Roles/Standard/Impostor/Killing/Mafioso.cs @@ -7,7 +7,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; /* * Tiers and their perks diff --git a/Roles/Impostor/Mercenary.cs b/Roles/Standard/Impostor/Killing/Mercenary.cs similarity index 52% rename from Roles/Impostor/Mercenary.cs rename to Roles/Standard/Impostor/Killing/Mercenary.cs index df5ee856a..fab4c889c 100644 --- a/Roles/Impostor/Mercenary.cs +++ b/Roles/Standard/Impostor/Killing/Mercenary.cs @@ -1,24 +1,24 @@ -using System.Collections.Generic; +using System.Diagnostics; using EHR.Modules; +using EHR.Modules.Extensions; using Hazel; -using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Mercenary : RoleBase { private const int Id = 1700; - public static List PlayerIdList = []; + public static bool On; private static OptionItem KillCooldown; private static OptionItem TimeLimit; private static OptionItem WaitFor1Kill; - private float SuicideTimer; - private int Timer; + private Stopwatch Timer; + private long LastNotify; private byte MercenaryId; - public override bool IsEnable => PlayerIdList.Count > 0; + public override bool IsEnable => On; public override void SetupCustomOption() { @@ -38,22 +38,15 @@ public class Mercenary : RoleBase public override void Init() { - PlayerIdList = []; - SuicideTimer = 0f; - Timer = TimeLimit.GetInt(); + On = false; } public override void Add(byte serial) { - PlayerIdList.Add(serial); - Timer = TimeLimit.GetInt(); - SuicideTimer = 0f; + On = true; + Timer = new(); MercenaryId = serial; - } - - public override void Remove(byte playerId) - { - PlayerIdList.Remove(playerId); + if (!WaitFor1Kill.GetBool()) LateTask.New(() => Timer.Start(), 10f, log: false); } public override void SetKillCooldown(byte id) @@ -61,77 +54,68 @@ public class Mercenary : RoleBase Main.AllPlayerKillCooldown[id] = KillCooldown.GetFloat(); } - private static bool HasKilled(PlayerControl pc) - { - return pc != null && pc.Is(CustomRoles.Mercenary) && pc.IsAlive() && (Main.PlayerStates[pc.PlayerId].GetKillCount() > 0 || !WaitFor1Kill.GetBool()); - } - public override bool OnCheckMurder(PlayerControl killer, PlayerControl target) { - if (!killer.Is(CustomRoles.Mercenary)) return true; - - SuicideTimer = 0f; - Timer = TimeLimit.GetInt(); - killer.MarkDirtySettings(); + Timer.Restart(); + Utils.SendRPC(CustomRPC.SyncRoleData, MercenaryId, 1); return true; } public override void OnReportDeadBody() { - SuicideTimer = float.NaN; - Timer = TimeLimit.GetInt(); + Timer.Reset(); + Utils.SendRPC(CustomRPC.SyncRoleData, MercenaryId, 2); } public override void OnFixedUpdate(PlayerControl player) { if (!GameStates.IsInTask || !Main.IntroDestroyed || ExileController.Instance || AntiBlackout.SkipTasks) return; - if (!HasKilled(player)) - { - SuicideTimer = float.NaN; - Timer = TimeLimit.GetInt(); - return; - } + if (!Timer.IsRunning || (MeetingStates.FirstMeeting && WaitFor1Kill.GetBool())) return; - if (float.IsNaN(SuicideTimer)) return; + long remainingTime = Timer.GetRemainingTime(TimeLimit.GetInt()); - if (SuicideTimer >= TimeLimit.GetFloat()) + if (remainingTime <= 0) { player.Suicide(); - SuicideTimer = float.NaN; - Timer = TimeLimit.GetInt(); + Timer.Reset(); if (player.AmOwner) Achievements.Type.OutOfTime.Complete(); } else { - SuicideTimer += Time.fixedDeltaTime; - int tempTimer = Timer; - Timer = TimeLimit.GetInt() - (int)SuicideTimer; - - if (Timer != tempTimer && Timer <= 20 && !player.IsModdedClient()) - { - Utils.NotifyRoles(SpecifySeer: player, SpecifyTarget: player); - Utils.SendRPC(CustomRPC.SyncRoleData, MercenaryId, Timer); - } + long now = Utils.TimeStamp; + if (now == LastNotify || remainingTime > 20) return; + LastNotify = now; + Utils.NotifyRoles(SpecifySeer: player, SpecifyTarget: player); + Utils.SendRPC(CustomRPC.SyncRoleData, MercenaryId, Timer); } } public override void AfterMeetingTasks() { - SuicideTimer = 0f; - Timer = TimeLimit.GetInt(); + Timer.Restart(); + Utils.SendRPC(CustomRPC.SyncRoleData, MercenaryId, 1); } public void ReceiveRPC(MessageReader reader) { - Timer = reader.ReadPackedInt32(); + switch (reader.ReadPackedInt32()) + { + case 1: + Timer = Stopwatch.StartNew(); + break; + case 2: + Timer.Reset(); + break; + } } public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false) { - if (seer.PlayerId != MercenaryId || seer.PlayerId != target.PlayerId || (seer.IsModdedClient() && !hud) || meeting || Timer - 1 > 20) return string.Empty; - return string.Format(Translator.GetString("SerialKillerTimeLeft"), Timer - 1); + if (seer.PlayerId != MercenaryId || seer.PlayerId != target.PlayerId || (seer.IsModdedClient() && !hud) || meeting) return string.Empty; + long remainingTime = Timer.GetRemainingTime(TimeLimit.GetInt()); + return !Timer.IsRunning || remainingTime > 20 ? string.Empty : string.Format(Translator.GetString("SerialKillerTimeLeft"), remainingTime - 1); } } \ No newline at end of file diff --git a/Roles/Impostor/Nemesis.cs b/Roles/Standard/Impostor/Killing/Nemesis.cs similarity index 98% rename from Roles/Impostor/Nemesis.cs rename to Roles/Standard/Impostor/Killing/Nemesis.cs index 802f0bb42..972bb6e6e 100644 --- a/Roles/Impostor/Nemesis.cs +++ b/Roles/Standard/Impostor/Killing/Nemesis.cs @@ -8,7 +8,7 @@ using UnityEngine; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Nemesis : RoleBase { @@ -191,7 +191,7 @@ internal class Nemesis : RoleBase { Logger.Msg($"Click: ID {playerId}", "Nemesis UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) NemesisMsgCheck(PlayerControl.LocalPlayer, $"/rv {playerId}", true); diff --git a/Roles/Impostor/Ninja.cs b/Roles/Standard/Impostor/Killing/Ninja.cs similarity index 99% rename from Roles/Impostor/Ninja.cs rename to Roles/Standard/Impostor/Killing/Ninja.cs index 43494dc64..3e4c2ec0f 100644 --- a/Roles/Impostor/Ninja.cs +++ b/Roles/Standard/Impostor/Killing/Ninja.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Ninja : RoleBase { diff --git a/Roles/Impostor/Overheat.cs b/Roles/Standard/Impostor/Killing/Overheat.cs similarity index 85% rename from Roles/Impostor/Overheat.cs rename to Roles/Standard/Impostor/Killing/Overheat.cs index 3861dd4de..24e60cf96 100644 --- a/Roles/Impostor/Overheat.cs +++ b/Roles/Standard/Impostor/Killing/Overheat.cs @@ -2,7 +2,7 @@ using EHR.Modules; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Overheat : RoleBase { @@ -12,7 +12,6 @@ public class Overheat : RoleBase private static OptionItem OverheatChanceIncrease; private static OptionItem OverheatChanceIncreaseFrequency; private static OptionItem OverheatRollChanceFrequency; - private static OptionItem CoolDownTime; private static OptionItem KCDDecreasePerIncreasedTemperature; private float ChanceIncreaseTimer; private float RollChanceTimer; @@ -34,15 +33,11 @@ public class Overheat : RoleBase .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Overheat]) .SetValueFormat(OptionFormat.Seconds); - OverheatRollChanceFrequency = new FloatOptionItem(id + 4, "Overheat.RollChanceFrequency", new(0.5f, 60f, 0.5f), 8f, TabGroup.ImpostorRoles) + OverheatRollChanceFrequency = new FloatOptionItem(id + 4, "Overheat.RollChanceFrequency", new(0.5f, 60f, 0.5f), 30f, TabGroup.ImpostorRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Overheat]) .SetValueFormat(OptionFormat.Seconds); - CoolDownTime = new FloatOptionItem(id + 5, "Overheat.CoolDownTime", new(0.5f, 30f, 0.5f), 4f, TabGroup.ImpostorRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Overheat]) - .SetValueFormat(OptionFormat.Seconds); - - KCDDecreasePerIncreasedTemperature = new FloatOptionItem(id + 6, "Overheat.KCDDecreasePerIncreasedTemperature", new(0.5f, 15f, 0.5f), 3f, TabGroup.ImpostorRoles) + KCDDecreasePerIncreasedTemperature = new FloatOptionItem(id + 6, "Overheat.KCDDecreasePerIncreasedTemperature", new(0.5f, 15f, 0.5f), 5f, TabGroup.ImpostorRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Overheat]) .SetValueFormat(OptionFormat.Seconds); } @@ -101,7 +96,7 @@ public class Overheat : RoleBase public override void OnFixedUpdate(PlayerControl pc) { - if (!GameStates.IsInTask || !pc.IsAlive() || ExileController.Instance != null) return; + if (!GameStates.IsInTask || !pc.IsAlive() || ExileController.Instance || AntiBlackout.SkipTasks || Main.IntroDestroyed) return; ChanceIncreaseTimer += Time.fixedDeltaTime; RollChanceTimer += Time.fixedDeltaTime; @@ -112,7 +107,6 @@ public class Overheat : RoleBase Temperature += OverheatChanceIncrease.GetInt(); SendRPC(pc.PlayerId); pc.ResetKillCooldown(); - pc.MarkDirtySettings(); Utils.NotifyRoles(SpecifySeer: pc, SpecifyTarget: pc); } @@ -128,16 +122,7 @@ public class Overheat : RoleBase Temperature = StartingTemperature; SendRPC(pc.PlayerId); Utils.NotifyRoles(SpecifySeer: pc, SpecifyTarget: pc); - - float speed = Main.AllPlayerSpeed[pc.PlayerId]; - Main.AllPlayerSpeed[pc.PlayerId] = Main.MinSpeed; - pc.MarkDirtySettings(); - - LateTask.New(() => - { - Main.AllPlayerSpeed[pc.PlayerId] = speed; - pc.MarkDirtySettings(); - }, CoolDownTime.GetFloat(), "Overheat Cool Down"); + pc.ResetKillCooldown(); } public override bool OnShapeshift(PlayerControl shapeshifter, PlayerControl target, bool shapeshifting) diff --git a/Roles/Impostor/Psychopath.cs b/Roles/Standard/Impostor/Killing/Psychopath.cs similarity index 98% rename from Roles/Impostor/Psychopath.cs rename to Roles/Standard/Impostor/Killing/Psychopath.cs index 1bbb59a44..7730077d5 100644 --- a/Roles/Impostor/Psychopath.cs +++ b/Roles/Standard/Impostor/Killing/Psychopath.cs @@ -3,7 +3,7 @@ using System.Linq; using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Psychopath : RoleBase { diff --git a/Roles/Impostor/QuickShooter.cs b/Roles/Standard/Impostor/Killing/QuickShooter.cs similarity index 96% rename from Roles/Impostor/QuickShooter.cs rename to Roles/Standard/Impostor/Killing/QuickShooter.cs index 9fc4676e2..2fcbf3906 100644 --- a/Roles/Impostor/QuickShooter.cs +++ b/Roles/Standard/Impostor/Killing/QuickShooter.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; internal class QuickShooter : RoleBase { diff --git a/Roles/Impostor/Saboteur.cs b/Roles/Standard/Impostor/Killing/Saboteur.cs similarity index 99% rename from Roles/Impostor/Saboteur.cs rename to Roles/Standard/Impostor/Killing/Saboteur.cs index 59d24c5bc..6e3451e47 100644 --- a/Roles/Impostor/Saboteur.cs +++ b/Roles/Standard/Impostor/Killing/Saboteur.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Saboteur : RoleBase { diff --git a/Roles/Impostor/Sapper.cs b/Roles/Standard/Impostor/Killing/Sapper.cs similarity index 99% rename from Roles/Impostor/Sapper.cs rename to Roles/Standard/Impostor/Killing/Sapper.cs index cec187d8a..5d7ed7ef1 100644 --- a/Roles/Impostor/Sapper.cs +++ b/Roles/Standard/Impostor/Killing/Sapper.cs @@ -2,12 +2,11 @@ using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Sapper : RoleBase { diff --git a/Roles/Impostor/Sniper.cs b/Roles/Standard/Impostor/Killing/Sniper.cs similarity index 96% rename from Roles/Impostor/Sniper.cs rename to Roles/Standard/Impostor/Killing/Sniper.cs index e11cd0842..be72648d2 100644 --- a/Roles/Impostor/Sniper.cs +++ b/Roles/Standard/Impostor/Killing/Sniper.cs @@ -1,14 +1,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Sniper : RoleBase { diff --git a/Roles/Impostor/Trapster.cs b/Roles/Standard/Impostor/Killing/Trapster.cs similarity index 99% rename from Roles/Impostor/Trapster.cs rename to Roles/Standard/Impostor/Killing/Trapster.cs index 46a8b106e..722f5fdf1 100644 --- a/Roles/Impostor/Trapster.cs +++ b/Roles/Standard/Impostor/Killing/Trapster.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Trapster : RoleBase { diff --git a/Roles/Impostor/Wasp.cs b/Roles/Standard/Impostor/Killing/Wasp.cs similarity index 99% rename from Roles/Impostor/Wasp.cs rename to Roles/Standard/Impostor/Killing/Wasp.cs index ee9bef5cb..4713a0ab9 100644 --- a/Roles/Impostor/Wasp.cs +++ b/Roles/Standard/Impostor/Killing/Wasp.cs @@ -6,7 +6,7 @@ using EHR.Modules; using EHR.Patches; using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; public class Wasp : RoleBase { diff --git a/Roles/Impostor/Wiper.cs b/Roles/Standard/Impostor/Killing/Wiper.cs similarity index 99% rename from Roles/Impostor/Wiper.cs rename to Roles/Standard/Impostor/Killing/Wiper.cs index 3100222da..e0782730a 100644 --- a/Roles/Impostor/Wiper.cs +++ b/Roles/Standard/Impostor/Killing/Wiper.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Wiper : RoleBase { diff --git a/Roles/Impostor/Witch.cs b/Roles/Standard/Impostor/Killing/Witch.cs similarity index 96% rename from Roles/Impostor/Witch.cs rename to Roles/Standard/Impostor/Killing/Witch.cs index 2e5ba9da3..46cbe43cc 100644 --- a/Roles/Impostor/Witch.cs +++ b/Roles/Standard/Impostor/Killing/Witch.cs @@ -2,16 +2,14 @@ using System; using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using EHR.Patches; using Hazel; using UnityEngine; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Witch : RoleBase { diff --git a/Roles/Impostor/Zombie.cs b/Roles/Standard/Impostor/Killing/Zombie.cs similarity index 99% rename from Roles/Impostor/Zombie.cs rename to Roles/Standard/Impostor/Killing/Zombie.cs index fbbc72b7d..e0f3ecf6d 100644 --- a/Roles/Impostor/Zombie.cs +++ b/Roles/Standard/Impostor/Killing/Zombie.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Zombie : RoleBase { diff --git a/Roles/Impostor/Crewpostor.cs b/Roles/Standard/Impostor/Madmate/Crewpostor.cs similarity index 99% rename from Roles/Impostor/Crewpostor.cs rename to Roles/Standard/Impostor/Madmate/Crewpostor.cs index f93dfaf7e..f0f1475d6 100644 --- a/Roles/Impostor/Crewpostor.cs +++ b/Roles/Standard/Impostor/Madmate/Crewpostor.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Crewpostor : RoleBase { diff --git a/Roles/Impostor/Hypocrite.cs b/Roles/Standard/Impostor/Madmate/Hypocrite.cs similarity index 99% rename from Roles/Impostor/Hypocrite.cs rename to Roles/Standard/Impostor/Madmate/Hypocrite.cs index 120d3be5e..4b3c7f586 100644 --- a/Roles/Impostor/Hypocrite.cs +++ b/Roles/Standard/Impostor/Madmate/Hypocrite.cs @@ -1,6 +1,6 @@ using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; public class Hypocrite : RoleBase { diff --git a/Roles/Impostor/Parasite.cs b/Roles/Standard/Impostor/Madmate/Parasite.cs similarity index 98% rename from Roles/Impostor/Parasite.cs rename to Roles/Standard/Impostor/Madmate/Parasite.cs index 748a6cde2..2cb9366f7 100644 --- a/Roles/Impostor/Parasite.cs +++ b/Roles/Standard/Impostor/Madmate/Parasite.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Parasite : RoleBase { diff --git a/Roles/Impostor/Renegade.cs b/Roles/Standard/Impostor/Madmate/Renegade.cs similarity index 96% rename from Roles/Impostor/Renegade.cs rename to Roles/Standard/Impostor/Madmate/Renegade.cs index 3134b53a6..611184d79 100644 --- a/Roles/Impostor/Renegade.cs +++ b/Roles/Standard/Impostor/Madmate/Renegade.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Renegade : RoleBase { diff --git a/Roles/Impostor/AntiAdminer.cs b/Roles/Standard/Impostor/Miscellaneous/AntiAdminer.cs similarity index 97% rename from Roles/Impostor/AntiAdminer.cs rename to Roles/Standard/Impostor/Miscellaneous/AntiAdminer.cs index 738f44e75..bb8237f42 100644 --- a/Roles/Impostor/AntiAdminer.cs +++ b/Roles/Standard/Impostor/Miscellaneous/AntiAdminer.cs @@ -2,10 +2,9 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; // Reference: https://github.com/ykundesu/SuperNewRoles/blob/master/SuperNewRoles/Mode/SuperHostRoles/BlockTool.cs // Reference: https://github.com/Yumenopai/TownOfHost_Y/tree/AntiAdminer diff --git a/Roles/Impostor/Changeling.cs b/Roles/Standard/Impostor/Miscellaneous/Changeling.cs similarity index 99% rename from Roles/Impostor/Changeling.cs rename to Roles/Standard/Impostor/Miscellaneous/Changeling.cs index aabd2bf95..82c976798 100644 --- a/Roles/Impostor/Changeling.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Changeling.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Changeling : RoleBase { diff --git a/Roles/Impostor/Consigliere.cs b/Roles/Standard/Impostor/Miscellaneous/Consigliere.cs similarity index 99% rename from Roles/Impostor/Consigliere.cs rename to Roles/Standard/Impostor/Miscellaneous/Consigliere.cs index a14f9b5d2..23b9739d5 100644 --- a/Roles/Impostor/Consigliere.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Consigliere.cs @@ -1,11 +1,10 @@ using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Consigliere : RoleBase { diff --git a/Roles/Impostor/CursedWolf.cs b/Roles/Standard/Impostor/Miscellaneous/CursedWolf.cs similarity index 98% rename from Roles/Impostor/CursedWolf.cs rename to Roles/Standard/Impostor/Miscellaneous/CursedWolf.cs index 121f2d3ef..267936da4 100644 --- a/Roles/Impostor/CursedWolf.cs +++ b/Roles/Standard/Impostor/Miscellaneous/CursedWolf.cs @@ -1,7 +1,6 @@ using AmongUs.GameOptions; -using EHR.Neutral; -namespace EHR.Impostor; +namespace EHR.Roles; internal class CursedWolf : RoleBase { diff --git a/Roles/Impostor/EvilTracker.cs b/Roles/Standard/Impostor/Miscellaneous/EvilTracker.cs similarity index 97% rename from Roles/Impostor/EvilTracker.cs rename to Roles/Standard/Impostor/Miscellaneous/EvilTracker.cs index f9c3840ea..40fab3b67 100644 --- a/Roles/Impostor/EvilTracker.cs +++ b/Roles/Standard/Impostor/Miscellaneous/EvilTracker.cs @@ -9,7 +9,7 @@ using UnityEngine; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class EvilTracker : RoleBase { diff --git a/Roles/Impostor/Gambler.cs b/Roles/Standard/Impostor/Miscellaneous/Gambler.cs similarity index 99% rename from Roles/Impostor/Gambler.cs rename to Roles/Standard/Impostor/Miscellaneous/Gambler.cs index 4fc2772a5..73f9e28cc 100644 --- a/Roles/Impostor/Gambler.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Gambler.cs @@ -2,13 +2,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Gambler : RoleBase { diff --git a/Roles/Impostor/Generator.cs b/Roles/Standard/Impostor/Miscellaneous/Generator.cs similarity index 99% rename from Roles/Impostor/Generator.cs rename to Roles/Standard/Impostor/Miscellaneous/Generator.cs index d507aaba3..f1f37d710 100644 --- a/Roles/Impostor/Generator.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Generator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; internal static class GeneratorStatic { diff --git a/Roles/Impostor/Loner.cs b/Roles/Standard/Impostor/Miscellaneous/Loner.cs similarity index 97% rename from Roles/Impostor/Loner.cs rename to Roles/Standard/Impostor/Miscellaneous/Loner.cs index a4f7bb681..8f90d2e6e 100644 --- a/Roles/Impostor/Loner.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Loner.cs @@ -1,9 +1,8 @@ using System; using System.Linq; using EHR.Modules; -using EHR.Neutral; -namespace EHR.Impostor; +namespace EHR.Roles; public class Loner : RoleBase { diff --git a/Roles/Impostor/Visionary.cs b/Roles/Standard/Impostor/Miscellaneous/Visionary.cs similarity index 99% rename from Roles/Impostor/Visionary.cs rename to Roles/Standard/Impostor/Miscellaneous/Visionary.cs index 28df9a95a..dde3f11b0 100644 --- a/Roles/Impostor/Visionary.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Visionary.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Visionary : RoleBase { diff --git a/Roles/Impostor/Wildling.cs b/Roles/Standard/Impostor/Miscellaneous/Wildling.cs similarity index 96% rename from Roles/Impostor/Wildling.cs rename to Roles/Standard/Impostor/Miscellaneous/Wildling.cs index e18d92c76..1772155c2 100644 --- a/Roles/Impostor/Wildling.cs +++ b/Roles/Standard/Impostor/Miscellaneous/Wildling.cs @@ -2,11 +2,10 @@ using System; using System.Collections.Generic; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using Hazel; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Wildling : RoleBase { diff --git a/Roles/Impostor/Blackmailer.cs b/Roles/Standard/Impostor/Support/Blackmailer.cs similarity index 99% rename from Roles/Impostor/Blackmailer.cs rename to Roles/Standard/Impostor/Support/Blackmailer.cs index 0be71a9d3..84cb592e4 100644 --- a/Roles/Impostor/Blackmailer.cs +++ b/Roles/Standard/Impostor/Support/Blackmailer.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using EHR.Neutral; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Blackmailer : RoleBase { diff --git a/Roles/Impostor/Camouflager.cs b/Roles/Standard/Impostor/Support/Camouflager.cs similarity index 96% rename from Roles/Impostor/Camouflager.cs rename to Roles/Standard/Impostor/Support/Camouflager.cs index 4d038a026..2bf58f5e8 100644 --- a/Roles/Impostor/Camouflager.cs +++ b/Roles/Standard/Impostor/Support/Camouflager.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; public class Camouflager : RoleBase { diff --git a/Roles/Impostor/Capitalist.cs b/Roles/Standard/Impostor/Support/Capitalist.cs similarity index 98% rename from Roles/Impostor/Capitalist.cs rename to Roles/Standard/Impostor/Support/Capitalist.cs index ab63ddd6a..c2f5bd843 100644 --- a/Roles/Impostor/Capitalist.cs +++ b/Roles/Standard/Impostor/Support/Capitalist.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Capitalist : RoleBase { diff --git a/Roles/Impostor/Catalyst.cs b/Roles/Standard/Impostor/Support/Catalyst.cs similarity index 98% rename from Roles/Impostor/Catalyst.cs rename to Roles/Standard/Impostor/Support/Catalyst.cs index 485e0eb93..7465bc658 100644 --- a/Roles/Impostor/Catalyst.cs +++ b/Roles/Standard/Impostor/Support/Catalyst.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace EHR.Impostor; +namespace EHR.Roles; public class Catalyst : RoleBase { diff --git a/Roles/Impostor/Centralizer.cs b/Roles/Standard/Impostor/Support/Centralizer.cs similarity index 99% rename from Roles/Impostor/Centralizer.cs rename to Roles/Standard/Impostor/Support/Centralizer.cs index 2af46131d..0e17ccc5c 100644 --- a/Roles/Impostor/Centralizer.cs +++ b/Roles/Standard/Impostor/Support/Centralizer.cs @@ -1,7 +1,7 @@ using System.Linq; using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; public class Centralizer : RoleBase { diff --git a/Roles/Impostor/Cleaner.cs b/Roles/Standard/Impostor/Support/Cleaner.cs similarity index 99% rename from Roles/Impostor/Cleaner.cs rename to Roles/Standard/Impostor/Support/Cleaner.cs index aba4784d6..daa54001b 100644 --- a/Roles/Impostor/Cleaner.cs +++ b/Roles/Standard/Impostor/Support/Cleaner.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Neutral; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Cleaner : RoleBase { diff --git a/Roles/Impostor/ClockBlocker.cs b/Roles/Standard/Impostor/Support/ClockBlocker.cs similarity index 98% rename from Roles/Impostor/ClockBlocker.cs rename to Roles/Standard/Impostor/Support/ClockBlocker.cs index def1f5fb7..f013aeda5 100644 --- a/Roles/Impostor/ClockBlocker.cs +++ b/Roles/Standard/Impostor/Support/ClockBlocker.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace EHR.Impostor; +namespace EHR.Roles; public class ClockBlocker : RoleBase { diff --git a/Roles/Impostor/Commander.cs b/Roles/Standard/Impostor/Support/Commander.cs similarity index 99% rename from Roles/Impostor/Commander.cs rename to Roles/Standard/Impostor/Support/Commander.cs index 7146d6b55..aa6b48ac8 100644 --- a/Roles/Impostor/Commander.cs +++ b/Roles/Standard/Impostor/Support/Commander.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Commander : RoleBase { diff --git a/Roles/Impostor/Consort.cs b/Roles/Standard/Impostor/Support/Consort.cs similarity index 98% rename from Roles/Impostor/Consort.cs rename to Roles/Standard/Impostor/Support/Consort.cs index 550e11d51..02430d20f 100644 --- a/Roles/Impostor/Consort.cs +++ b/Roles/Standard/Impostor/Support/Consort.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Consort : RoleBase { diff --git a/Roles/Impostor/Dazzler.cs b/Roles/Standard/Impostor/Support/Dazzler.cs similarity index 95% rename from Roles/Impostor/Dazzler.cs rename to Roles/Standard/Impostor/Support/Dazzler.cs index 17c13dc48..0472a778d 100644 --- a/Roles/Impostor/Dazzler.cs +++ b/Roles/Standard/Impostor/Support/Dazzler.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Dazzler : RoleBase { @@ -38,7 +37,7 @@ public class Dazzler : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Dazzler]) .SetValueFormat(OptionFormat.Multiplier); - DazzleLimitOpt = new IntegerOptionItem(Id + 14, "DazzlerDazzleLimit", new(0, 15, 1), 1, TabGroup.ImpostorRoles) + DazzleLimitOpt = new IntegerOptionItem(Id + 14, "DazzlerDazzleLimit", new(1, 15, 1), 1, TabGroup.ImpostorRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Dazzler]) .SetValueFormat(OptionFormat.Times); @@ -113,4 +112,4 @@ public class Dazzler : RoleBase { hud.AbilityButton?.OverrideText(GetString("DazzleButtonText")); } -} \ No newline at end of file +} diff --git a/Roles/Impostor/Deathpact.cs b/Roles/Standard/Impostor/Support/Deathpact.cs similarity index 97% rename from Roles/Impostor/Deathpact.cs rename to Roles/Standard/Impostor/Support/Deathpact.cs index b9fee6aac..d354705b8 100644 --- a/Roles/Impostor/Deathpact.cs +++ b/Roles/Standard/Impostor/Support/Deathpact.cs @@ -1,15 +1,13 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; -using EHR.Neutral; using UnityEngine; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Deathpact : RoleBase { diff --git a/Roles/Impostor/Devourer.cs b/Roles/Standard/Impostor/Support/Devourer.cs similarity index 96% rename from Roles/Impostor/Devourer.cs rename to Roles/Standard/Impostor/Support/Devourer.cs index 4aeaca361..1a0dec2c5 100644 --- a/Roles/Impostor/Devourer.cs +++ b/Roles/Standard/Impostor/Support/Devourer.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Neutral; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Devourer : RoleBase { diff --git a/Roles/Impostor/Disperser.cs b/Roles/Standard/Impostor/Support/Disperser.cs similarity index 96% rename from Roles/Impostor/Disperser.cs rename to Roles/Standard/Impostor/Support/Disperser.cs index bd267588e..5d2f84892 100644 --- a/Roles/Impostor/Disperser.cs +++ b/Roles/Standard/Impostor/Support/Disperser.cs @@ -4,7 +4,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Disperser : RoleBase { diff --git a/Roles/Impostor/EvilEraser.cs b/Roles/Standard/Impostor/Support/EvilEraser.cs similarity index 99% rename from Roles/Impostor/EvilEraser.cs rename to Roles/Standard/Impostor/Support/EvilEraser.cs index 8fbef5ba1..ee285dc02 100644 --- a/Roles/Impostor/EvilEraser.cs +++ b/Roles/Standard/Impostor/Support/EvilEraser.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using EHR.Neutral; using Hazel; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; internal class EvilEraser : RoleBase { diff --git a/Roles/Impostor/Framer.cs b/Roles/Standard/Impostor/Support/Framer.cs similarity index 98% rename from Roles/Impostor/Framer.cs rename to Roles/Standard/Impostor/Support/Framer.cs index 6cd14578c..120ad83bf 100644 --- a/Roles/Impostor/Framer.cs +++ b/Roles/Standard/Impostor/Support/Framer.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace EHR.Impostor; +namespace EHR.Roles; public class Framer : RoleBase { diff --git a/Roles/Impostor/Freezer.cs b/Roles/Standard/Impostor/Support/Freezer.cs similarity index 98% rename from Roles/Impostor/Freezer.cs rename to Roles/Standard/Impostor/Support/Freezer.cs index 093ea35f8..b56c9900b 100644 --- a/Roles/Impostor/Freezer.cs +++ b/Roles/Standard/Impostor/Support/Freezer.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Freezer : RoleBase { diff --git a/Roles/Impostor/Gangster.cs b/Roles/Standard/Impostor/Support/Gangster.cs similarity index 97% rename from Roles/Impostor/Gangster.cs rename to Roles/Standard/Impostor/Support/Gangster.cs index 4e83373d2..14a7b4a8c 100644 --- a/Roles/Impostor/Gangster.cs +++ b/Roles/Standard/Impostor/Support/Gangster.cs @@ -2,7 +2,7 @@ using Hazel; using static EHR.Translator; -namespace EHR.Impostor; +namespace EHR.Roles; public class Gangster : RoleBase { diff --git a/Roles/Impostor/Godfather.cs b/Roles/Standard/Impostor/Support/Godfather.cs similarity index 96% rename from Roles/Impostor/Godfather.cs rename to Roles/Standard/Impostor/Support/Godfather.cs index 4848bf880..802a09f4b 100644 --- a/Roles/Impostor/Godfather.cs +++ b/Roles/Standard/Impostor/Support/Godfather.cs @@ -1,6 +1,4 @@ -using EHR.Neutral; - -namespace EHR.Impostor; +namespace EHR.Roles; internal class Godfather : RoleBase { diff --git a/Roles/Impostor/Hypnotist.cs b/Roles/Standard/Impostor/Support/Hypnotist.cs similarity index 98% rename from Roles/Impostor/Hypnotist.cs rename to Roles/Standard/Impostor/Support/Hypnotist.cs index 0580cb00d..291f0d280 100644 --- a/Roles/Impostor/Hypnotist.cs +++ b/Roles/Standard/Impostor/Support/Hypnotist.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; public class Hypnotist : RoleBase { @@ -27,7 +27,7 @@ public class Hypnotist : RoleBase { StartSetup(647550) .AutoSetupOption(ref AbilityCooldown, 30, new IntegerValueRule(0, 60, 1), OptionFormat.Seconds) - .AutoSetupOption(ref AbilityDuration, 15, new IntegerValueRule(0, 30, 1), OptionFormat.Seconds) + .AutoSetupOption(ref AbilityDuration, 15, new IntegerValueRule(1, 30, 1), OptionFormat.Seconds) .AutoSetupOption(ref AbilityUseLimit, 1f, new FloatValueRule(0, 20, 0.05f), OptionFormat.Times) .AutoSetupOption(ref AbilityUseGainWithEachKill, 0.8f, new FloatValueRule(0f, 5f, 0.1f), OptionFormat.Times) .AutoSetupOption(ref DoReportAfterHypnosisEnds, true); @@ -127,4 +127,4 @@ public class Hypnotist : RoleBase var timeLeft = (int)(ActivateTS + AbilityDuration.GetInt() - Utils.TimeStamp); return timeLeft <= 5 ? $"\u25a9 ({timeLeft})" : "\u25a9"; } -} \ No newline at end of file +} diff --git a/Roles/Impostor/Librarian.cs b/Roles/Standard/Impostor/Support/Librarian.cs similarity index 99% rename from Roles/Impostor/Librarian.cs rename to Roles/Standard/Impostor/Support/Librarian.cs index 898d98626..43d4186fa 100644 --- a/Roles/Impostor/Librarian.cs +++ b/Roles/Standard/Impostor/Support/Librarian.cs @@ -6,7 +6,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Librarian : RoleBase { diff --git a/Roles/Impostor/Nullifier.cs b/Roles/Standard/Impostor/Support/Nullifier.cs similarity index 98% rename from Roles/Impostor/Nullifier.cs rename to Roles/Standard/Impostor/Support/Nullifier.cs index 68f1a8543..5f94a5f4b 100644 --- a/Roles/Impostor/Nullifier.cs +++ b/Roles/Standard/Impostor/Support/Nullifier.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; -using EHR.Crewmate; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Nullifier : RoleBase { diff --git a/Roles/Impostor/Occultist.cs b/Roles/Standard/Impostor/Support/Occultist.cs similarity index 99% rename from Roles/Impostor/Occultist.cs rename to Roles/Standard/Impostor/Support/Occultist.cs index eb7315259..08a183c5f 100644 --- a/Roles/Impostor/Occultist.cs +++ b/Roles/Standard/Impostor/Support/Occultist.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using EHR.Modules; -namespace EHR.Impostor; +namespace EHR.Roles; public class Occultist : RoleBase { diff --git a/Roles/Impostor/Silencer.cs b/Roles/Standard/Impostor/Support/Silencer.cs similarity index 99% rename from Roles/Impostor/Silencer.cs rename to Roles/Standard/Impostor/Support/Silencer.cs index c2f5633a0..d085d4e48 100644 --- a/Roles/Impostor/Silencer.cs +++ b/Roles/Standard/Impostor/Support/Silencer.cs @@ -1,14 +1,13 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using Epic.OnlineServices.PlayerDataStorage; using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; public class Silencer : RoleBase { diff --git a/Roles/Impostor/Swapster.cs b/Roles/Standard/Impostor/Support/Swapster.cs similarity index 98% rename from Roles/Impostor/Swapster.cs rename to Roles/Standard/Impostor/Support/Swapster.cs index 70a76b68d..f483543d5 100644 --- a/Roles/Impostor/Swapster.cs +++ b/Roles/Standard/Impostor/Support/Swapster.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Swapster : RoleBase { diff --git a/Roles/Impostor/TimeThief.cs b/Roles/Standard/Impostor/Support/TimeThief.cs similarity index 96% rename from Roles/Impostor/TimeThief.cs rename to Roles/Standard/Impostor/Support/TimeThief.cs index 602434d53..2a12d558c 100644 --- a/Roles/Impostor/TimeThief.cs +++ b/Roles/Standard/Impostor/Support/TimeThief.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace EHR.Impostor; +namespace EHR.Roles; public class TimeThief : RoleBase { diff --git a/Roles/Impostor/Twister.cs b/Roles/Standard/Impostor/Support/Twister.cs similarity index 96% rename from Roles/Impostor/Twister.cs rename to Roles/Standard/Impostor/Support/Twister.cs index c6c86a445..af4f5022a 100644 --- a/Roles/Impostor/Twister.cs +++ b/Roles/Standard/Impostor/Support/Twister.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; using EHR.Modules; -using EHR.Neutral; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class Twister : RoleBase { diff --git a/Roles/Impostor/Ventriloquist.cs b/Roles/Standard/Impostor/Support/Ventriloquist.cs similarity index 97% rename from Roles/Impostor/Ventriloquist.cs rename to Roles/Standard/Impostor/Support/Ventriloquist.cs index 58c20a8b9..30ad9947b 100644 --- a/Roles/Impostor/Ventriloquist.cs +++ b/Roles/Standard/Impostor/Support/Ventriloquist.cs @@ -4,7 +4,7 @@ using System.Linq; using Hazel; using UnityEngine; -namespace EHR.Impostor; +namespace EHR.Roles; public class Ventriloquist : RoleBase { @@ -58,7 +58,7 @@ public class Ventriloquist : RoleBase { Logger.Msg($"Click: ID {playerId}", "Ventriloquist UI"); PlayerControl pc = Utils.GetPlayerById(playerId); - if (pc == null || !pc.IsAlive() || !GameStates.IsVoting) return; + if (pc == null || !pc.IsAlive() || !GameStates.IsVoting || Starspawn.IsDayBreak) return; if (AmongUsClient.Instance.AmHost) { diff --git a/Roles/Impostor/Vindicator.cs b/Roles/Standard/Impostor/Support/Vindicator.cs similarity index 96% rename from Roles/Impostor/Vindicator.cs rename to Roles/Standard/Impostor/Support/Vindicator.cs index 9ade25007..cf1d138a1 100644 --- a/Roles/Impostor/Vindicator.cs +++ b/Roles/Standard/Impostor/Support/Vindicator.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class Vindicator : RoleBase { diff --git a/Roles/Impostor/YinYanger.cs b/Roles/Standard/Impostor/Support/YinYanger.cs similarity index 99% rename from Roles/Impostor/YinYanger.cs rename to Roles/Standard/Impostor/Support/YinYanger.cs index 6a453c1f0..2dc8aa2ca 100644 --- a/Roles/Impostor/YinYanger.cs +++ b/Roles/Standard/Impostor/Support/YinYanger.cs @@ -4,7 +4,7 @@ using Hazel; using static EHR.Options; using static EHR.Utils; -namespace EHR.Impostor; +namespace EHR.Roles; public class YinYanger : RoleBase { diff --git a/Roles/Impostor/ImpostorVanillaRoles.cs b/Roles/Standard/Impostor/Vanilla/ImpostorVanillaRoles.cs similarity index 98% rename from Roles/Impostor/ImpostorVanillaRoles.cs rename to Roles/Standard/Impostor/Vanilla/ImpostorVanillaRoles.cs index 4444d1fbf..2f566ef23 100644 --- a/Roles/Impostor/ImpostorVanillaRoles.cs +++ b/Roles/Standard/Impostor/Vanilla/ImpostorVanillaRoles.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Impostor; +namespace EHR.Roles; internal class ImpostorVanillaRoles : IVanillaSettingHolder { diff --git a/Roles/Impostor/PhantomEHR.cs b/Roles/Standard/Impostor/Vanilla/PhantomEHR.cs similarity index 96% rename from Roles/Impostor/PhantomEHR.cs rename to Roles/Standard/Impostor/Vanilla/PhantomEHR.cs index f33da0cfa..ed1065a2e 100644 --- a/Roles/Impostor/PhantomEHR.cs +++ b/Roles/Standard/Impostor/Vanilla/PhantomEHR.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Impostor; +namespace EHR.Roles; public class PhantomEHR : RoleBase { diff --git a/Roles/Neutral/Amnesiac.cs b/Roles/Standard/Neutral/Benign/Amnesiac.cs similarity index 97% rename from Roles/Neutral/Amnesiac.cs rename to Roles/Standard/Neutral/Benign/Amnesiac.cs index 547ca6ccd..01c4241a8 100644 --- a/Roles/Neutral/Amnesiac.cs +++ b/Roles/Standard/Neutral/Benign/Amnesiac.cs @@ -7,7 +7,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Amnesiac : RoleBase { diff --git a/Roles/Neutral/Backstabber.cs b/Roles/Standard/Neutral/Benign/Backstabber.cs similarity index 99% rename from Roles/Neutral/Backstabber.cs rename to Roles/Standard/Neutral/Benign/Backstabber.cs index c58fe27b2..27624cf6c 100644 --- a/Roles/Neutral/Backstabber.cs +++ b/Roles/Standard/Neutral/Benign/Backstabber.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Neutral; +namespace EHR.Roles; public class Backstabber : RoleBase { diff --git a/Roles/Neutral/Dealer.cs b/Roles/Standard/Neutral/Benign/Dealer.cs similarity index 99% rename from Roles/Neutral/Dealer.cs rename to Roles/Standard/Neutral/Benign/Dealer.cs index 0aa2c3c1b..2a1c5cc0c 100644 --- a/Roles/Neutral/Dealer.cs +++ b/Roles/Standard/Neutral/Benign/Dealer.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Dealer : RoleBase { diff --git a/Roles/Neutral/Follower.cs b/Roles/Standard/Neutral/Benign/Follower.cs similarity index 99% rename from Roles/Neutral/Follower.cs rename to Roles/Standard/Neutral/Benign/Follower.cs index c02320075..b6e6554d7 100644 --- a/Roles/Neutral/Follower.cs +++ b/Roles/Standard/Neutral/Benign/Follower.cs @@ -6,7 +6,7 @@ using static EHR.Options; using static EHR.Translator; using Math = System.Math; -namespace EHR.Neutral; +namespace EHR.Roles; public class Follower : RoleBase { diff --git a/Roles/Neutral/Hater.cs b/Roles/Standard/Neutral/Benign/Hater.cs similarity index 99% rename from Roles/Neutral/Hater.cs rename to Roles/Standard/Neutral/Benign/Hater.cs index 6c4c73b47..4e201ff0b 100644 --- a/Roles/Neutral/Hater.cs +++ b/Roles/Standard/Neutral/Benign/Hater.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Hater : RoleBase { diff --git a/Roles/Neutral/Impartial.cs b/Roles/Standard/Neutral/Benign/Impartial.cs similarity index 99% rename from Roles/Neutral/Impartial.cs rename to Roles/Standard/Neutral/Benign/Impartial.cs index 5bdd2e5e8..95dc49d9a 100644 --- a/Roles/Neutral/Impartial.cs +++ b/Roles/Standard/Neutral/Benign/Impartial.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Impartial : RoleBase { diff --git a/Roles/Neutral/Investor.cs b/Roles/Standard/Neutral/Benign/Investor.cs similarity index 98% rename from Roles/Neutral/Investor.cs rename to Roles/Standard/Neutral/Benign/Investor.cs index 9578fa779..6f85c09c1 100644 --- a/Roles/Neutral/Investor.cs +++ b/Roles/Standard/Neutral/Benign/Investor.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Investor : RoleBase { diff --git a/Roles/Neutral/Lawyer.cs b/Roles/Standard/Neutral/Benign/Lawyer.cs similarity index 97% rename from Roles/Neutral/Lawyer.cs rename to Roles/Standard/Neutral/Benign/Lawyer.cs index 357f559e7..245f64bd4 100644 --- a/Roles/Neutral/Lawyer.cs +++ b/Roles/Standard/Neutral/Benign/Lawyer.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Lawyer : RoleBase { diff --git a/Roles/Neutral/Maverick.cs b/Roles/Standard/Neutral/Benign/Maverick.cs similarity index 95% rename from Roles/Neutral/Maverick.cs rename to Roles/Standard/Neutral/Benign/Maverick.cs index 5394cda8d..c8d046396 100644 --- a/Roles/Neutral/Maverick.cs +++ b/Roles/Standard/Neutral/Benign/Maverick.cs @@ -4,7 +4,7 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Maverick : RoleBase { @@ -95,4 +95,6 @@ public class Maverick : RoleBase { NumOfKills = reader.ReadPackedInt32(); } -} \ No newline at end of file + +} + diff --git a/Roles/Neutral/NecroGuesser.cs b/Roles/Standard/Neutral/Benign/NecroGuesser.cs similarity index 95% rename from Roles/Neutral/NecroGuesser.cs rename to Roles/Standard/Neutral/Benign/NecroGuesser.cs index 74d19d379..321742e76 100644 --- a/Roles/Neutral/NecroGuesser.cs +++ b/Roles/Standard/Neutral/Benign/NecroGuesser.cs @@ -1,4 +1,4 @@ -namespace EHR.Neutral; +namespace EHR.Roles; public class NecroGuesser : RoleBase { diff --git a/Roles/Neutral/Opportunist.cs b/Roles/Standard/Neutral/Benign/Opportunist.cs similarity index 98% rename from Roles/Neutral/Opportunist.cs rename to Roles/Standard/Neutral/Benign/Opportunist.cs index 227dd8d7f..30a51f8f6 100644 --- a/Roles/Neutral/Opportunist.cs +++ b/Roles/Standard/Neutral/Benign/Opportunist.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Opportunist : RoleBase { diff --git a/Roles/Neutral/Pawn.cs b/Roles/Standard/Neutral/Benign/Pawn.cs similarity index 97% rename from Roles/Neutral/Pawn.cs rename to Roles/Standard/Neutral/Benign/Pawn.cs index fca988a87..a43a3943b 100644 --- a/Roles/Neutral/Pawn.cs +++ b/Roles/Standard/Neutral/Benign/Pawn.cs @@ -1,6 +1,6 @@ using EHR.Modules; -namespace EHR.Neutral; +namespace EHR.Roles; public class Pawn : RoleBase { diff --git a/Roles/Neutral/Postman.cs b/Roles/Standard/Neutral/Benign/Postman.cs similarity index 99% rename from Roles/Neutral/Postman.cs rename to Roles/Standard/Neutral/Benign/Postman.cs index 0cfd0e81d..9bb179018 100644 --- a/Roles/Neutral/Postman.cs +++ b/Roles/Standard/Neutral/Benign/Postman.cs @@ -4,7 +4,7 @@ using EHR.Modules; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Postman : RoleBase { diff --git a/Roles/Neutral/Predator.cs b/Roles/Standard/Neutral/Benign/Predator.cs similarity index 98% rename from Roles/Neutral/Predator.cs rename to Roles/Standard/Neutral/Benign/Predator.cs index d8db811dc..1e7072533 100644 --- a/Roles/Neutral/Predator.cs +++ b/Roles/Standard/Neutral/Benign/Predator.cs @@ -6,7 +6,7 @@ using EHR.Modules; using HarmonyLib; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Predator : RoleBase { @@ -29,7 +29,7 @@ internal class Predator : RoleBase NumOfRolesToKill = new IntegerOptionItem(Id + 2, "NumOfRolesToKill", new(1, 10, 1), 3, TabGroup.NeutralRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Predator]); - MaxImpRolePicks = new IntegerOptionItem(Id + 3, "MaxImpRolePicks", new(1, 10, 1), 1, TabGroup.NeutralRoles) + MaxImpRolePicks = new IntegerOptionItem(Id + 3, "MaxImpRolePicks", new(0, 10, 1), 1, TabGroup.NeutralRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Predator]); KillCooldown = new FloatOptionItem(Id + 4, "KillCooldown", new(0f, 180f, 0.5f), 15f, TabGroup.NeutralRoles) @@ -166,4 +166,4 @@ internal class Predator : RoleBase string text = pt.RolesToKill.Join(x => x.ToColoredString()); return hud ? text : $"{text}"; } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Provocateur.cs b/Roles/Standard/Neutral/Benign/Provocateur.cs similarity index 98% rename from Roles/Neutral/Provocateur.cs rename to Roles/Standard/Neutral/Benign/Provocateur.cs index 512c0a6c1..f5aefb0a9 100644 --- a/Roles/Neutral/Provocateur.cs +++ b/Roles/Standard/Neutral/Benign/Provocateur.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Provocateur : RoleBase { diff --git a/Roles/Neutral/Pursuer.cs b/Roles/Standard/Neutral/Benign/Pursuer.cs similarity index 96% rename from Roles/Neutral/Pursuer.cs rename to Roles/Standard/Neutral/Benign/Pursuer.cs index 205cafd64..daa67bb70 100644 --- a/Roles/Neutral/Pursuer.cs +++ b/Roles/Standard/Neutral/Benign/Pursuer.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using EHR.Modules; -namespace EHR.Neutral; +namespace EHR.Roles; public class Pursuer : RoleBase { diff --git a/Roles/Neutral/Revolutionist.cs b/Roles/Standard/Neutral/Benign/Revolutionist.cs similarity index 98% rename from Roles/Neutral/Revolutionist.cs rename to Roles/Standard/Neutral/Benign/Revolutionist.cs index d34e97f92..aad440939 100644 --- a/Roles/Neutral/Revolutionist.cs +++ b/Roles/Standard/Neutral/Benign/Revolutionist.cs @@ -4,7 +4,7 @@ using EHR.Modules; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Revolutionist : RoleBase { @@ -36,7 +36,7 @@ internal class Revolutionist : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist]) .SetValueFormat(OptionFormat.Seconds); - RevolutionistDrawCount = new IntegerOptionItem(18412, "RevolutionistDrawCount", new(0, 14, 1), 6, TabGroup.NeutralRoles) + RevolutionistDrawCount = new IntegerOptionItem(18412, "RevolutionistDrawCount", new(1, 14, 1), 6, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist]) .SetValueFormat(OptionFormat.Players); @@ -44,7 +44,7 @@ internal class Revolutionist : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist]) .SetValueFormat(OptionFormat.Percent); - RevolutionistVentCountDown = new FloatOptionItem(18414, "RevolutionistVentCountDown", new(0f, 180f, 1f), 15f, TabGroup.NeutralRoles) + RevolutionistVentCountDown = new FloatOptionItem(18414, "RevolutionistVentCountDown", new(0.5f, 180f, 0.5f), 15f, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist]) .SetValueFormat(OptionFormat.Seconds); } @@ -249,4 +249,4 @@ internal class Revolutionist : RoleBase RevolutionistLastTime.Remove(pc.PlayerId); RevolutionistCountdown.Remove(pc.PlayerId); } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Romantic.cs b/Roles/Standard/Neutral/Benign/Romantic.cs similarity index 97% rename from Roles/Neutral/Romantic.cs rename to Roles/Standard/Neutral/Benign/Romantic.cs index 327631cb0..063bd3c22 100644 --- a/Roles/Neutral/Romantic.cs +++ b/Roles/Standard/Neutral/Benign/Romantic.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Romantic : RoleBase { diff --git a/Roles/Neutral/RoomRusher.cs b/Roles/Standard/Neutral/Benign/RoomRusher.cs similarity index 99% rename from Roles/Neutral/RoomRusher.cs rename to Roles/Standard/Neutral/Benign/RoomRusher.cs index 378ddbb39..13278dd09 100644 --- a/Roles/Neutral/RoomRusher.cs +++ b/Roles/Standard/Neutral/Benign/RoomRusher.cs @@ -2,11 +2,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; +using EHR.Gamemodes; using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class RoomRusher : RoleBase { diff --git a/Roles/Neutral/SchrodingersCat.cs b/Roles/Standard/Neutral/Benign/SchrodingersCat.cs similarity index 98% rename from Roles/Neutral/SchrodingersCat.cs rename to Roles/Standard/Neutral/Benign/SchrodingersCat.cs index 1b8d55ffe..ba0be2a09 100644 --- a/Roles/Neutral/SchrodingersCat.cs +++ b/Roles/Standard/Neutral/Benign/SchrodingersCat.cs @@ -1,6 +1,6 @@ using Hazel; -namespace EHR.Impostor; +namespace EHR.Roles; internal class SchrodingersCat : RoleBase { diff --git a/Roles/Neutral/Shifter.cs b/Roles/Standard/Neutral/Benign/Shifter.cs similarity index 99% rename from Roles/Neutral/Shifter.cs rename to Roles/Standard/Neutral/Benign/Shifter.cs index a2d72680e..f47599452 100644 --- a/Roles/Neutral/Shifter.cs +++ b/Roles/Standard/Neutral/Benign/Shifter.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using EHR.Patches; -namespace EHR.Neutral; +namespace EHR.Roles; public class Shifter : RoleBase { diff --git a/Roles/Neutral/SoulHunter.cs b/Roles/Standard/Neutral/Benign/SoulHunter.cs similarity index 99% rename from Roles/Neutral/SoulHunter.cs rename to Roles/Standard/Neutral/Benign/SoulHunter.cs index 21368d1c9..cdbb917d7 100644 --- a/Roles/Neutral/SoulHunter.cs +++ b/Roles/Standard/Neutral/Benign/SoulHunter.cs @@ -7,7 +7,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; internal class SoulHunter : RoleBase { diff --git a/Roles/Neutral/Specter.cs b/Roles/Standard/Neutral/Benign/Specter.cs similarity index 98% rename from Roles/Neutral/Specter.cs rename to Roles/Standard/Neutral/Benign/Specter.cs index ec14c5a33..fdef8f9b9 100644 --- a/Roles/Neutral/Specter.cs +++ b/Roles/Standard/Neutral/Benign/Specter.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Specter : RoleBase { diff --git a/Roles/Neutral/Tank.cs b/Roles/Standard/Neutral/Benign/Tank.cs similarity index 99% rename from Roles/Neutral/Tank.cs rename to Roles/Standard/Neutral/Benign/Tank.cs index 021dc8b22..868403af8 100644 --- a/Roles/Neutral/Tank.cs +++ b/Roles/Standard/Neutral/Benign/Tank.cs @@ -2,7 +2,7 @@ using System.Linq; using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; public class Tank : RoleBase { diff --git a/Roles/Neutral/Technician.cs b/Roles/Standard/Neutral/Benign/Technician.cs similarity index 99% rename from Roles/Neutral/Technician.cs rename to Roles/Standard/Neutral/Benign/Technician.cs index ac714137b..c92c70920 100644 --- a/Roles/Neutral/Technician.cs +++ b/Roles/Standard/Neutral/Benign/Technician.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Technician : RoleBase { diff --git a/Roles/Neutral/Arsonist.cs b/Roles/Standard/Neutral/Evil/Arsonist.cs similarity index 99% rename from Roles/Neutral/Arsonist.cs rename to Roles/Standard/Neutral/Evil/Arsonist.cs index 3abd542b4..c83e4935a 100644 --- a/Roles/Neutral/Arsonist.cs +++ b/Roles/Standard/Neutral/Evil/Arsonist.cs @@ -5,7 +5,7 @@ using EHR.Modules; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Arsonist : RoleBase { diff --git a/Roles/Neutral/Collector.cs b/Roles/Standard/Neutral/Evil/Collector.cs similarity index 96% rename from Roles/Neutral/Collector.cs rename to Roles/Standard/Neutral/Evil/Collector.cs index 9d152f23d..6f4fa1e32 100644 --- a/Roles/Neutral/Collector.cs +++ b/Roles/Standard/Neutral/Evil/Collector.cs @@ -4,7 +4,7 @@ using EHR.Modules; using EHR.Patches; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Collector : RoleBase { diff --git a/Roles/Neutral/Doomsayer.cs b/Roles/Standard/Neutral/Evil/Doomsayer.cs similarity index 97% rename from Roles/Neutral/Doomsayer.cs rename to Roles/Standard/Neutral/Evil/Doomsayer.cs index bd7552ef3..0cffbc08b 100644 --- a/Roles/Neutral/Doomsayer.cs +++ b/Roles/Standard/Neutral/Evil/Doomsayer.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Doomsayer : RoleBase { diff --git a/Roles/Neutral/Executioner.cs b/Roles/Standard/Neutral/Evil/Executioner.cs similarity index 97% rename from Roles/Neutral/Executioner.cs rename to Roles/Standard/Neutral/Evil/Executioner.cs index c58fe4784..142c88375 100644 --- a/Roles/Neutral/Executioner.cs +++ b/Roles/Standard/Neutral/Evil/Executioner.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Executioner : RoleBase { diff --git a/Roles/Neutral/Gaslighter.cs b/Roles/Standard/Neutral/Evil/Gaslighter.cs similarity index 99% rename from Roles/Neutral/Gaslighter.cs rename to Roles/Standard/Neutral/Evil/Gaslighter.cs index 0cf094ce4..4dbfa388e 100644 --- a/Roles/Neutral/Gaslighter.cs +++ b/Roles/Standard/Neutral/Evil/Gaslighter.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using EHR.Crewmate; using EHR.Modules; using EHR.Patches; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Gaslighter : RoleBase { diff --git a/Roles/Neutral/God.cs b/Roles/Standard/Neutral/Evil/God.cs similarity index 97% rename from Roles/Neutral/God.cs rename to Roles/Standard/Neutral/Evil/God.cs index eef6425cc..b99d6411e 100644 --- a/Roles/Neutral/God.cs +++ b/Roles/Standard/Neutral/Evil/God.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class God : RoleBase { diff --git a/Roles/Neutral/Innocent.cs b/Roles/Standard/Neutral/Evil/Innocent.cs similarity index 98% rename from Roles/Neutral/Innocent.cs rename to Roles/Standard/Neutral/Evil/Innocent.cs index e2b025725..e9aff4e2c 100644 --- a/Roles/Neutral/Innocent.cs +++ b/Roles/Standard/Neutral/Evil/Innocent.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Innocent : RoleBase { diff --git a/Roles/Neutral/Jester.cs b/Roles/Standard/Neutral/Evil/Jester.cs similarity index 99% rename from Roles/Neutral/Jester.cs rename to Roles/Standard/Neutral/Evil/Jester.cs index 3ba1d6ec1..da9360994 100644 --- a/Roles/Neutral/Jester.cs +++ b/Roles/Standard/Neutral/Evil/Jester.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Jester : RoleBase { diff --git a/Roles/Neutral/Terrorist.cs b/Roles/Standard/Neutral/Evil/Terrorist.cs similarity index 98% rename from Roles/Neutral/Terrorist.cs rename to Roles/Standard/Neutral/Evil/Terrorist.cs index ba8623ca0..cee15950d 100644 --- a/Roles/Neutral/Terrorist.cs +++ b/Roles/Standard/Neutral/Evil/Terrorist.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Terrorist : RoleBase { diff --git a/Roles/Neutral/Thief.cs b/Roles/Standard/Neutral/Evil/Thief.cs similarity index 99% rename from Roles/Neutral/Thief.cs rename to Roles/Standard/Neutral/Evil/Thief.cs index 9ab882352..dcccefa96 100644 --- a/Roles/Neutral/Thief.cs +++ b/Roles/Standard/Neutral/Evil/Thief.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; public class Thief : RoleBase { diff --git a/Roles/Neutral/Vector.cs b/Roles/Standard/Neutral/Evil/Vector.cs similarity index 99% rename from Roles/Neutral/Vector.cs rename to Roles/Standard/Neutral/Evil/Vector.cs index 63193b5d4..1655f8b8b 100644 --- a/Roles/Neutral/Vector.cs +++ b/Roles/Standard/Neutral/Evil/Vector.cs @@ -7,7 +7,7 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Vector : RoleBase { diff --git a/Roles/Neutral/Vulture.cs b/Roles/Standard/Neutral/Evil/Vulture.cs similarity index 97% rename from Roles/Neutral/Vulture.cs rename to Roles/Standard/Neutral/Evil/Vulture.cs index 31d0a5c58..a5ba7083b 100644 --- a/Roles/Neutral/Vulture.cs +++ b/Roles/Standard/Neutral/Evil/Vulture.cs @@ -6,7 +6,7 @@ using UnityEngine; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Vulture : RoleBase { diff --git a/Roles/Neutral/Workaholic.cs b/Roles/Standard/Neutral/Evil/Workaholic.cs similarity index 99% rename from Roles/Neutral/Workaholic.cs rename to Roles/Standard/Neutral/Evil/Workaholic.cs index f9fbd4689..9d1a157a1 100644 --- a/Roles/Neutral/Workaholic.cs +++ b/Roles/Standard/Neutral/Evil/Workaholic.cs @@ -5,7 +5,7 @@ using EHR.Modules; using static EHR.Options; // From: TOH_Y -namespace EHR.Neutral; +namespace EHR.Roles; internal class Workaholic : RoleBase { diff --git a/Roles/Neutral/Agitator.cs b/Roles/Standard/Neutral/Killing/Agitator.cs similarity index 99% rename from Roles/Neutral/Agitator.cs rename to Roles/Standard/Neutral/Killing/Agitator.cs index f33be5065..4d7054c29 100644 --- a/Roles/Neutral/Agitator.cs +++ b/Roles/Standard/Neutral/Killing/Agitator.cs @@ -1,13 +1,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using Hazel; using UnityEngine; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Agitator : RoleBase { diff --git a/Roles/Neutral/Amogus.cs b/Roles/Standard/Neutral/Killing/Amogus.cs similarity index 98% rename from Roles/Neutral/Amogus.cs rename to Roles/Standard/Neutral/Killing/Amogus.cs index 5fa98bc98..3f6a82d62 100644 --- a/Roles/Neutral/Amogus.cs +++ b/Roles/Standard/Neutral/Killing/Amogus.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Amogus : RoleBase { @@ -37,7 +37,7 @@ public class Amogus : RoleBase .AutoSetupOption(ref StartingLevel, 0, Enum.GetValues().Select(x => $"Amogus.Levels.{x}").ToArray()) .AutoSetupOption(ref SugomaSpeed, 2f, new FloatValueRule(0.1f, 3f, 0.1f), OptionFormat.Multiplier) .AutoSetupOption(ref SuspiciousSusArrowsToBodies, false) - .AutoSetupOption(ref UltimateSusVotesPerKill, 1, new IntegerValueRule(1, 10, 1), OptionFormat.Votes) + .AutoSetupOption(ref UltimateSusVotesPerKill, 1, new IntegerValueRule(0, 10, 1), OptionFormat.Votes) .AutoSetupOption(ref AbilityCooldown, 20f, new FloatValueRule(0f, 180f, 0.5f), OptionFormat.Seconds) .AutoSetupOption(ref AbilityDuration, 15f, new FloatValueRule(0f, 180f, 0.5f), OptionFormat.Seconds) .AutoSetupOption(ref KillCooldown, 22.5f, new FloatValueRule(0f, 180f, 0.5f), OptionFormat.Seconds) @@ -211,4 +211,4 @@ public class Amogus : RoleBase SuspiciousSus, UltimateSus } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Bandit.cs b/Roles/Standard/Neutral/Killing/Bandit.cs similarity index 97% rename from Roles/Neutral/Bandit.cs rename to Roles/Standard/Neutral/Killing/Bandit.cs index abed7045f..d67713ae9 100644 --- a/Roles/Neutral/Bandit.cs +++ b/Roles/Standard/Neutral/Killing/Bandit.cs @@ -5,7 +5,7 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Bandit : RoleBase { diff --git a/Roles/Neutral/Bargainer.cs b/Roles/Standard/Neutral/Killing/Bargainer.cs similarity index 99% rename from Roles/Neutral/Bargainer.cs rename to Roles/Standard/Neutral/Killing/Bargainer.cs index 09568535c..556a13e99 100644 --- a/Roles/Neutral/Bargainer.cs +++ b/Roles/Standard/Neutral/Killing/Bargainer.cs @@ -9,7 +9,7 @@ using static EHR.Options; // ReSharper disable PossibleMultipleEnumeration -namespace EHR.Neutral; +namespace EHR.Roles; internal class Bargainer : RoleBase { diff --git a/Roles/Neutral/Beehive.cs b/Roles/Standard/Neutral/Killing/Beehive.cs similarity index 98% rename from Roles/Neutral/Beehive.cs rename to Roles/Standard/Neutral/Killing/Beehive.cs index d903d2de2..e48d8b357 100644 --- a/Roles/Neutral/Beehive.cs +++ b/Roles/Standard/Neutral/Killing/Beehive.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Beehive : RoleBase { @@ -29,7 +29,7 @@ public class Beehive : RoleBase var id = 647350; Options.SetupRoleOptions(id++, TabGroup.NeutralRoles, CustomRoles.Beehive); - Distance = new FloatOptionItem(++id, "Beehive.Distance", new(0f, 20f, 0.5f), 15f, TabGroup.NeutralRoles) + Distance = new FloatOptionItem(++id, "Beehive.Distance", new(0.5f, 20f, 0.5f), 15f, TabGroup.NeutralRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Beehive]); Time = new FloatOptionItem(++id, "Beehive.Time", new(0f, 30f, 0.5f), 10f, TabGroup.NeutralRoles) @@ -156,4 +156,4 @@ public class Beehive : RoleBase string color2 = walked >= distance ? "<#00ffff>" : "<#ffff00>"; return $"{color}{walked}{color2}/{distance} <#ffffff>({time}s)"; } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Berserker.cs b/Roles/Standard/Neutral/Killing/Berserker.cs similarity index 99% rename from Roles/Neutral/Berserker.cs rename to Roles/Standard/Neutral/Killing/Berserker.cs index bb97821a0..6d6be35c2 100644 --- a/Roles/Neutral/Berserker.cs +++ b/Roles/Standard/Neutral/Killing/Berserker.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Berserker : RoleBase { diff --git a/Roles/Neutral/BloodKnight.cs b/Roles/Standard/Neutral/Killing/BloodKnight.cs similarity index 96% rename from Roles/Neutral/BloodKnight.cs rename to Roles/Standard/Neutral/Killing/BloodKnight.cs index 53a4f6edb..99604d74a 100644 --- a/Roles/Neutral/BloodKnight.cs +++ b/Roles/Standard/Neutral/Killing/BloodKnight.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class BloodKnight : RoleBase { diff --git a/Roles/Neutral/Bubble.cs b/Roles/Standard/Neutral/Killing/Bubble.cs similarity index 99% rename from Roles/Neutral/Bubble.cs rename to Roles/Standard/Neutral/Killing/Bubble.cs index 70215a200..b3bf93e35 100644 --- a/Roles/Neutral/Bubble.cs +++ b/Roles/Standard/Neutral/Killing/Bubble.cs @@ -6,7 +6,7 @@ using Hazel; using static EHR.Options; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Bubble : RoleBase { diff --git a/Roles/Neutral/Chemist.cs b/Roles/Standard/Neutral/Killing/Chemist.cs similarity index 99% rename from Roles/Neutral/Chemist.cs rename to Roles/Standard/Neutral/Killing/Chemist.cs index 85c837fe2..6575bbcd1 100644 --- a/Roles/Neutral/Chemist.cs +++ b/Roles/Standard/Neutral/Killing/Chemist.cs @@ -7,7 +7,7 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Chemist : RoleBase { diff --git a/Roles/Neutral/Cherokious.cs b/Roles/Standard/Neutral/Killing/Cherokious.cs similarity index 97% rename from Roles/Neutral/Cherokious.cs rename to Roles/Standard/Neutral/Killing/Cherokious.cs index d96ee2efb..b14579900 100644 --- a/Roles/Neutral/Cherokious.cs +++ b/Roles/Standard/Neutral/Killing/Cherokious.cs @@ -1,8 +1,7 @@ using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Patches; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Cherokious : RoleBase { diff --git a/Roles/Neutral/Cultist.cs b/Roles/Standard/Neutral/Killing/Cultist.cs similarity index 99% rename from Roles/Neutral/Cultist.cs rename to Roles/Standard/Neutral/Killing/Cultist.cs index 52ee3c0cd..0859321ea 100644 --- a/Roles/Neutral/Cultist.cs +++ b/Roles/Standard/Neutral/Killing/Cultist.cs @@ -6,7 +6,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Cultist : RoleBase { diff --git a/Roles/Neutral/Demon.cs b/Roles/Standard/Neutral/Killing/Demon.cs similarity index 99% rename from Roles/Neutral/Demon.cs rename to Roles/Standard/Neutral/Killing/Demon.cs index f0dd7ceec..349d99d00 100644 --- a/Roles/Neutral/Demon.cs +++ b/Roles/Standard/Neutral/Killing/Demon.cs @@ -5,7 +5,7 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Demon : RoleBase { diff --git a/Roles/Neutral/Doppelganger.cs b/Roles/Standard/Neutral/Killing/Doppelganger.cs similarity index 99% rename from Roles/Neutral/Doppelganger.cs rename to Roles/Standard/Neutral/Killing/Doppelganger.cs index b3b728afa..f01effa55 100644 --- a/Roles/Neutral/Doppelganger.cs +++ b/Roles/Standard/Neutral/Killing/Doppelganger.cs @@ -2,13 +2,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Impostor; using EHR.Modules; using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Doppelganger : RoleBase { diff --git a/Roles/Neutral/Duality.cs b/Roles/Standard/Neutral/Killing/Duality.cs similarity index 94% rename from Roles/Neutral/Duality.cs rename to Roles/Standard/Neutral/Killing/Duality.cs index efa59d16d..55df2e33c 100644 --- a/Roles/Neutral/Duality.cs +++ b/Roles/Standard/Neutral/Killing/Duality.cs @@ -1,9 +1,10 @@ using System.Diagnostics; using AmongUs.GameOptions; using EHR.Modules; +using EHR.Modules.Extensions; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Duality : RoleBase { @@ -94,7 +95,7 @@ public class Duality : RoleBase if (LastUpdateTS == now) return; LastUpdateTS = now; - if (GetRemainingTime() <= 0) + if (Timer.GetRemainingTime(Time.GetInt()) <= 0) { pc.Suicide(); if (pc.AmOwner) Achievements.Type.OutOfTime.Complete(); @@ -120,8 +121,6 @@ public class Duality : RoleBase Utils.SendRPC(CustomRPC.SyncRoleData, DualityId, KillingPhase); } - long GetRemainingTime() => Time.GetInt() - Timer.Elapsed.Seconds; - public void ReceiveRPC(MessageReader reader) { KillingPhase = reader.ReadBoolean(); @@ -131,6 +130,6 @@ public class Duality : RoleBase public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false) { if (seer.PlayerId != DualityId || seer.PlayerId != target.PlayerId || (!hud && seer.IsModdedClient()) || meeting || !seer.IsAlive()) return string.Empty; - return $"{string.Format(Translator.GetString(KillingPhase ? "Duality.MustKill" : "Duality.MustDoTask"), GetRemainingTime() - 1)}"; + return $"{string.Format(Translator.GetString(KillingPhase ? "Duality.MustKill" : "Duality.MustDoTask"), Timer.GetRemainingTime(Time.GetInt()) - 1)}"; } } \ No newline at end of file diff --git a/Roles/Neutral/Eclipse.cs b/Roles/Standard/Neutral/Killing/Eclipse.cs similarity index 96% rename from Roles/Neutral/Eclipse.cs rename to Roles/Standard/Neutral/Killing/Eclipse.cs index d1cd25468..4ee2bdf81 100644 --- a/Roles/Neutral/Eclipse.cs +++ b/Roles/Standard/Neutral/Killing/Eclipse.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Eclipse : RoleBase { diff --git a/Roles/Neutral/Enderman.cs b/Roles/Standard/Neutral/Killing/Enderman.cs similarity index 99% rename from Roles/Neutral/Enderman.cs rename to Roles/Standard/Neutral/Killing/Enderman.cs index 9541c6f33..bdfd871fa 100644 --- a/Roles/Neutral/Enderman.cs +++ b/Roles/Standard/Neutral/Killing/Enderman.cs @@ -3,7 +3,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Enderman : RoleBase { diff --git a/Roles/Neutral/Evolver.cs b/Roles/Standard/Neutral/Killing/Evolver.cs similarity index 99% rename from Roles/Neutral/Evolver.cs rename to Roles/Standard/Neutral/Killing/Evolver.cs index b8f3b97d8..6ca913de8 100644 --- a/Roles/Neutral/Evolver.cs +++ b/Roles/Standard/Neutral/Killing/Evolver.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Evolver : RoleBase { diff --git a/Roles/Neutral/Explosivist.cs b/Roles/Standard/Neutral/Killing/Explosivist.cs similarity index 99% rename from Roles/Neutral/Explosivist.cs rename to Roles/Standard/Neutral/Killing/Explosivist.cs index 0b4c9c3a3..b020871c4 100644 --- a/Roles/Neutral/Explosivist.cs +++ b/Roles/Standard/Neutral/Killing/Explosivist.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Explosivist : RoleBase { diff --git a/Roles/Neutral/Glitch.cs b/Roles/Standard/Neutral/Killing/Glitch.cs similarity index 96% rename from Roles/Neutral/Glitch.cs rename to Roles/Standard/Neutral/Killing/Glitch.cs index 1dd88f1df..340b73cc0 100644 --- a/Roles/Neutral/Glitch.cs +++ b/Roles/Standard/Neutral/Killing/Glitch.cs @@ -4,7 +4,7 @@ using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Glitch : RoleBase { diff --git a/Roles/Neutral/HeadHunter.cs b/Roles/Standard/Neutral/Killing/HeadHunter.cs similarity index 96% rename from Roles/Neutral/HeadHunter.cs rename to Roles/Standard/Neutral/Killing/HeadHunter.cs index d324d089e..d19b164fb 100644 --- a/Roles/Neutral/HeadHunter.cs +++ b/Roles/Standard/Neutral/Killing/HeadHunter.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class HeadHunter : RoleBase { @@ -186,4 +186,6 @@ public class HeadHunter : RoleBase SendRPC(); Utils.NotifyRoles(SpecifySeer: Utils.GetPlayerById(HeadHunterId)); } -} \ No newline at end of file + +} + diff --git a/Roles/Neutral/HexMaster.cs b/Roles/Standard/Neutral/Killing/HexMaster.cs similarity index 93% rename from Roles/Neutral/HexMaster.cs rename to Roles/Standard/Neutral/Killing/HexMaster.cs index 4cfad0de6..9d1178ca9 100644 --- a/Roles/Neutral/HexMaster.cs +++ b/Roles/Standard/Neutral/Killing/HexMaster.cs @@ -1,8 +1,7 @@ using AmongUs.GameOptions; -using EHR.Impostor; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class HexMaster : RoleBase { diff --git a/Roles/Neutral/Hookshot.cs b/Roles/Standard/Neutral/Killing/Hookshot.cs similarity index 99% rename from Roles/Neutral/Hookshot.cs rename to Roles/Standard/Neutral/Killing/Hookshot.cs index c0f0d854a..46794e4bc 100644 --- a/Roles/Neutral/Hookshot.cs +++ b/Roles/Standard/Neutral/Killing/Hookshot.cs @@ -4,7 +4,7 @@ using Hazel; using static EHR.Options; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Hookshot : RoleBase { diff --git a/Roles/Neutral/Infection.cs b/Roles/Standard/Neutral/Killing/Infection.cs similarity index 99% rename from Roles/Neutral/Infection.cs rename to Roles/Standard/Neutral/Killing/Infection.cs index 7c7c2db00..f56d961ff 100644 --- a/Roles/Neutral/Infection.cs +++ b/Roles/Standard/Neutral/Killing/Infection.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Infection : RoleBase { diff --git a/Roles/Neutral/Jackal.cs b/Roles/Standard/Neutral/Killing/Jackal.cs similarity index 97% rename from Roles/Neutral/Jackal.cs rename to Roles/Standard/Neutral/Killing/Jackal.cs index 1cb396e69..174960339 100644 --- a/Roles/Neutral/Jackal.cs +++ b/Roles/Standard/Neutral/Killing/Jackal.cs @@ -7,7 +7,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Jackal : RoleBase { diff --git a/Roles/Neutral/Jinx.cs b/Roles/Standard/Neutral/Killing/Jinx.cs similarity index 92% rename from Roles/Neutral/Jinx.cs rename to Roles/Standard/Neutral/Killing/Jinx.cs index cedf89d00..dce66668d 100644 --- a/Roles/Neutral/Jinx.cs +++ b/Roles/Standard/Neutral/Killing/Jinx.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Jinx : RoleBase { @@ -24,7 +24,7 @@ public class Jinx : RoleBase CanVent = new BooleanOptionItem(Id + 11, "CanVent", true, TabGroup.NeutralRoles).SetParent(CustomRoleSpawnChances[CustomRoles.Jinx]); HasImpostorVision = new BooleanOptionItem(Id + 13, "ImpostorVision", true, TabGroup.NeutralRoles).SetParent(CustomRoleSpawnChances[CustomRoles.Jinx]); - JinxSpellTimes = new IntegerOptionItem(Id + 14, "JinxSpellTimes", new(0, 15, 1), 1, TabGroup.NeutralRoles) + JinxSpellTimes = new IntegerOptionItem(Id + 14, "JinxSpellTimes", new(1, 15, 1), 1, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Jinx]) .SetValueFormat(OptionFormat.Times); @@ -34,4 +34,5 @@ public class Jinx : RoleBase public override void Init() { } public override void Add(byte playerId) { } -} \ No newline at end of file + +} diff --git a/Roles/Neutral/Juggernaut.cs b/Roles/Standard/Neutral/Killing/Juggernaut.cs similarity index 92% rename from Roles/Neutral/Juggernaut.cs rename to Roles/Standard/Neutral/Killing/Juggernaut.cs index 0cef5385e..cfbe30a0c 100644 --- a/Roles/Neutral/Juggernaut.cs +++ b/Roles/Standard/Neutral/Killing/Juggernaut.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Juggernaut : RoleBase { @@ -23,7 +23,7 @@ public class Juggernaut : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Juggernaut]) .SetValueFormat(OptionFormat.Seconds); - ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0f, 30f, 0.5f), 4f, TabGroup.NeutralRoles) + ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0.5f, 30f, 0.5f), 4f, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Juggernaut]) .SetValueFormat(OptionFormat.Seconds); @@ -44,4 +44,4 @@ public class Juggernaut : RoleBase public override void Init() { } public override void Add(byte playerId) { } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Magician.cs b/Roles/Standard/Neutral/Killing/Magician.cs similarity index 99% rename from Roles/Neutral/Magician.cs rename to Roles/Standard/Neutral/Killing/Magician.cs index aadbba15f..7aab6f106 100644 --- a/Roles/Neutral/Magician.cs +++ b/Roles/Standard/Neutral/Killing/Magician.cs @@ -1,14 +1,13 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using UnityEngine; using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; public class Magician : RoleBase { diff --git a/Roles/Neutral/Medusa.cs b/Roles/Standard/Neutral/Killing/Medusa.cs similarity index 96% rename from Roles/Neutral/Medusa.cs rename to Roles/Standard/Neutral/Killing/Medusa.cs index 21d4d302f..452bb3b32 100644 --- a/Roles/Neutral/Medusa.cs +++ b/Roles/Standard/Neutral/Killing/Medusa.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Medusa : RoleBase { diff --git a/Roles/Neutral/Mycologist.cs b/Roles/Standard/Neutral/Killing/Mycologist.cs similarity index 99% rename from Roles/Neutral/Mycologist.cs rename to Roles/Standard/Neutral/Killing/Mycologist.cs index cdd7b1173..9b58c8dd4 100644 --- a/Roles/Neutral/Mycologist.cs +++ b/Roles/Standard/Neutral/Killing/Mycologist.cs @@ -7,7 +7,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Mycologist : RoleBase { diff --git a/Roles/Neutral/Necromancer.cs b/Roles/Standard/Neutral/Killing/Necromancer.cs similarity index 99% rename from Roles/Neutral/Necromancer.cs rename to Roles/Standard/Neutral/Killing/Necromancer.cs index 8343ebe00..a63346cff 100644 --- a/Roles/Neutral/Necromancer.cs +++ b/Roles/Standard/Neutral/Killing/Necromancer.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Necromancer : RoleBase { diff --git a/Roles/Neutral/Nonplus.cs b/Roles/Standard/Neutral/Killing/Nonplus.cs similarity index 99% rename from Roles/Neutral/Nonplus.cs rename to Roles/Standard/Neutral/Killing/Nonplus.cs index 0ee8be183..2eada5f0f 100644 --- a/Roles/Neutral/Nonplus.cs +++ b/Roles/Standard/Neutral/Killing/Nonplus.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; public class Nonplus : RoleBase { diff --git a/Roles/Neutral/NoteKiller.cs b/Roles/Standard/Neutral/Killing/NoteKiller.cs similarity index 99% rename from Roles/Neutral/NoteKiller.cs rename to Roles/Standard/Neutral/Killing/NoteKiller.cs index 4b3c44d57..007ee249b 100644 --- a/Roles/Neutral/NoteKiller.cs +++ b/Roles/Standard/Neutral/Killing/NoteKiller.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class NoteKiller : RoleBase { diff --git a/Roles/Neutral/Patroller.cs b/Roles/Standard/Neutral/Killing/Patroller.cs similarity index 99% rename from Roles/Neutral/Patroller.cs rename to Roles/Standard/Neutral/Killing/Patroller.cs index 4aad55774..60704bb37 100644 --- a/Roles/Neutral/Patroller.cs +++ b/Roles/Standard/Neutral/Killing/Patroller.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; public class Patroller : RoleBase { diff --git a/Roles/Neutral/Pelican.cs b/Roles/Standard/Neutral/Killing/Pelican.cs similarity index 96% rename from Roles/Neutral/Pelican.cs rename to Roles/Standard/Neutral/Killing/Pelican.cs index 3773fb094..6b524f637 100644 --- a/Roles/Neutral/Pelican.cs +++ b/Roles/Standard/Neutral/Killing/Pelican.cs @@ -1,11 +1,10 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Pelican : RoleBase { diff --git a/Roles/Neutral/Pickpocket.cs b/Roles/Standard/Neutral/Killing/Pickpocket.cs similarity index 95% rename from Roles/Neutral/Pickpocket.cs rename to Roles/Standard/Neutral/Killing/Pickpocket.cs index 72f8bbdea..445548943 100644 --- a/Roles/Neutral/Pickpocket.cs +++ b/Roles/Standard/Neutral/Killing/Pickpocket.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Pickpocket : RoleBase { diff --git a/Roles/Neutral/PlagueBearer.cs b/Roles/Standard/Neutral/Killing/PlagueBearer.cs similarity index 87% rename from Roles/Neutral/PlagueBearer.cs rename to Roles/Standard/Neutral/Killing/PlagueBearer.cs index a3664b55c..424dd5fdc 100644 --- a/Roles/Neutral/PlagueBearer.cs +++ b/Roles/Standard/Neutral/Killing/PlagueBearer.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class PlagueBearer : RoleBase { @@ -19,6 +19,7 @@ public class PlagueBearer : RoleBase public static OptionItem PestilenceCanVent; public static OptionItem PestilenceHasImpostorVision; public static OptionItem InfectionSpreads; + public static OptionItem AnnounceTransformation; public override bool IsEnable => PlayerIdList.Count > 0; @@ -42,6 +43,9 @@ public class PlagueBearer : RoleBase InfectionSpreads = new BooleanOptionItem(Id + 14, "InfectionSpreads", false, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.PlagueBearer]); + + AnnounceTransformation = new BooleanOptionItem(Id + 15, "AnnounceTransformation", true, TabGroup.NeutralRoles) + .SetParent(CustomRoleSpawnChances[CustomRoles.PlagueBearer]); } public override void Init() @@ -161,11 +165,14 @@ public class Pestilence : RoleBase public static bool On; public override bool IsEnable => On; + private bool Announced; + public override void SetupCustomOption() { } public override void Add(byte playerId) { On = true; + Announced = false; } public override void Init() @@ -209,4 +216,11 @@ public class Pestilence : RoleBase return false; } + + public override void OnReportDeadBody() + { + if (Announced || !PlagueBearer.AnnounceTransformation.GetBool()) return; + LateTask.New(() => Utils.SendMessage(GetString("TransformationAnnouncementMessage"), title: $"{CustomRoles.PlagueBearer.ToColoredString()} => {CustomRoles.Pestilence.ToColoredString()}"), 12f, "Pb to Pesti transform message"); + Announced = true; + } } \ No newline at end of file diff --git a/Roles/Neutral/Poisoner.cs b/Roles/Standard/Neutral/Killing/Poisoner.cs similarity index 96% rename from Roles/Neutral/Poisoner.cs rename to Roles/Standard/Neutral/Killing/Poisoner.cs index 0dd52fee4..ecf6c560e 100644 --- a/Roles/Neutral/Poisoner.cs +++ b/Roles/Standard/Neutral/Killing/Poisoner.cs @@ -1,4 +1,4 @@ -namespace EHR.Neutral; +namespace EHR.Roles; public class Poisoner : RoleBase { diff --git a/Roles/Neutral/Pulse.cs b/Roles/Standard/Neutral/Killing/Pulse.cs similarity index 98% rename from Roles/Neutral/Pulse.cs rename to Roles/Standard/Neutral/Killing/Pulse.cs index a719a36b2..be9836cee 100644 --- a/Roles/Neutral/Pulse.cs +++ b/Roles/Standard/Neutral/Killing/Pulse.cs @@ -1,4 +1,4 @@ -namespace EHR.Neutral; +namespace EHR.Roles; public class Pulse : RoleBase { diff --git a/Roles/Neutral/Pyromaniac.cs b/Roles/Standard/Neutral/Killing/Pyromaniac.cs similarity index 96% rename from Roles/Neutral/Pyromaniac.cs rename to Roles/Standard/Neutral/Killing/Pyromaniac.cs index fa8b723e0..b56d426d4 100644 --- a/Roles/Neutral/Pyromaniac.cs +++ b/Roles/Standard/Neutral/Killing/Pyromaniac.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Pyromaniac : RoleBase { diff --git a/Roles/Neutral/QuizMaster.cs b/Roles/Standard/Neutral/Killing/QuizMaster.cs similarity index 99% rename from Roles/Neutral/QuizMaster.cs rename to Roles/Standard/Neutral/Killing/QuizMaster.cs index 6287ed011..7f0663117 100644 --- a/Roles/Neutral/QuizMaster.cs +++ b/Roles/Standard/Neutral/Killing/QuizMaster.cs @@ -2,11 +2,12 @@ using System.Collections.Generic; using System.Linq; using AmongUs.GameOptions; +using EHR.Gamemodes; using EHR.Modules; using EHR.Patches; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class QuizMaster : RoleBase { diff --git a/Roles/Neutral/Reckless.cs b/Roles/Standard/Neutral/Killing/Reckless.cs similarity index 95% rename from Roles/Neutral/Reckless.cs rename to Roles/Standard/Neutral/Killing/Reckless.cs index c7d826289..9dff6af02 100644 --- a/Roles/Neutral/Reckless.cs +++ b/Roles/Standard/Neutral/Killing/Reckless.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Reckless : RoleBase { @@ -23,7 +23,7 @@ public class Reckless : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Reckless]) .SetValueFormat(OptionFormat.Seconds); - ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0f, 30f, 0.5f), 5f, TabGroup.NeutralRoles) + ReduceKillCooldown = new FloatOptionItem(Id + 11, "ArroganceReduceKillCooldown", new(0.5f, 30f, 0.5f), 5f, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Reckless]) .SetValueFormat(OptionFormat.Seconds); @@ -44,4 +44,4 @@ public class Reckless : RoleBase public override void Init() { } public override void Add(byte playerId) { } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Ritualist.cs b/Roles/Standard/Neutral/Killing/Ritualist.cs similarity index 91% rename from Roles/Neutral/Ritualist.cs rename to Roles/Standard/Neutral/Killing/Ritualist.cs index a21e1b23d..0dc915c78 100644 --- a/Roles/Neutral/Ritualist.cs +++ b/Roles/Standard/Neutral/Killing/Ritualist.cs @@ -1,6 +1,6 @@ using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Ritualist : RoleBase { @@ -21,7 +21,7 @@ public class Ritualist : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Ritualist]) .SetValueFormat(OptionFormat.Seconds); - RitualMaxCount = new IntegerOptionItem(Id + 11, "RitualMaxCount", new(0, 15, 1), 1, TabGroup.NeutralRoles) + RitualMaxCount = new IntegerOptionItem(Id + 11, "RitualMaxCount", new(1, 15, 1), 1, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Ritualist]) .SetValueFormat(OptionFormat.Times); @@ -35,4 +35,5 @@ public class Ritualist : RoleBase public override void Init() { } public override void Add(byte playerId) { } -} \ No newline at end of file + +} diff --git a/Roles/Neutral/Rogue.cs b/Roles/Standard/Neutral/Killing/Rogue.cs similarity index 99% rename from Roles/Neutral/Rogue.cs rename to Roles/Standard/Neutral/Killing/Rogue.cs index bb111cb42..ccbfc70eb 100644 --- a/Roles/Neutral/Rogue.cs +++ b/Roles/Standard/Neutral/Killing/Rogue.cs @@ -6,7 +6,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Rogue : RoleBase { diff --git a/Roles/Neutral/RouleteGrandeur.cs b/Roles/Standard/Neutral/Killing/RouleteGrandeur.cs similarity index 98% rename from Roles/Neutral/RouleteGrandeur.cs rename to Roles/Standard/Neutral/Killing/RouleteGrandeur.cs index 5f9ec806c..f370e56b8 100644 --- a/Roles/Neutral/RouleteGrandeur.cs +++ b/Roles/Standard/Neutral/Killing/RouleteGrandeur.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class RouleteGrandeur : RoleBase { @@ -37,7 +37,7 @@ public class RouleteGrandeur : RoleBase HasImpostorVision = new BooleanOptionItem(Id + 3, "ImpostorVision", true, TabGroup.NeutralRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.RouleteGrandeur]); - KCDReduction = new FloatOptionItem(Id + 4, "KCDReduction", new(0f, 100f, 0.5f), 3.5f, TabGroup.NeutralRoles) + KCDReduction = new FloatOptionItem(Id + 4, "KCDReduction", new(0.5f, 100f, 0.5f), 3.5f, TabGroup.NeutralRoles) .SetParent(Options.CustomRoleSpawnChances[CustomRoles.RouleteGrandeur]) .SetValueFormat(OptionFormat.Seconds); } @@ -179,4 +179,4 @@ public class RouleteGrandeur : RoleBase return string.Format(Translator.GetString("RG.Suffix"), Bullets); } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Samurai.cs b/Roles/Standard/Neutral/Killing/Samurai.cs similarity index 98% rename from Roles/Neutral/Samurai.cs rename to Roles/Standard/Neutral/Killing/Samurai.cs index 5a950de48..f2b01f533 100644 --- a/Roles/Neutral/Samurai.cs +++ b/Roles/Standard/Neutral/Killing/Samurai.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Samurai : RoleBase { @@ -45,7 +45,7 @@ internal class Samurai : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Samurai]) .SetValueFormat(OptionFormat.Seconds); - KillDelay = new FloatOptionItem(id + 7, "Samurai.KillDelay", new(0f, 60f, 0.5f), 5f, TabGroup.NeutralRoles) + KillDelay = new FloatOptionItem(id + 7, "Samurai.KillDelay", new(0.5f, 60f, 0.5f), 5f, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Samurai]) .SetValueFormat(OptionFormat.Seconds); } @@ -143,4 +143,4 @@ internal class Samurai : RoleBase Delays.Clear(); } -} \ No newline at end of file +} diff --git a/Roles/Neutral/SerialKiller.cs b/Roles/Standard/Neutral/Killing/SerialKiller.cs similarity index 97% rename from Roles/Neutral/SerialKiller.cs rename to Roles/Standard/Neutral/Killing/SerialKiller.cs index 4e978673c..7348759cb 100644 --- a/Roles/Neutral/SerialKiller.cs +++ b/Roles/Standard/Neutral/Killing/SerialKiller.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; public class SerialKiller : RoleBase { diff --git a/Roles/Neutral/Sharpshooter.cs b/Roles/Standard/Neutral/Killing/Sharpshooter.cs similarity index 99% rename from Roles/Neutral/Sharpshooter.cs rename to Roles/Standard/Neutral/Killing/Sharpshooter.cs index e23215b2d..e815735c2 100644 --- a/Roles/Neutral/Sharpshooter.cs +++ b/Roles/Standard/Neutral/Killing/Sharpshooter.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Sharpshooter : RoleBase { diff --git a/Roles/Neutral/Simon.cs b/Roles/Standard/Neutral/Killing/Simon.cs similarity index 99% rename from Roles/Neutral/Simon.cs rename to Roles/Standard/Neutral/Killing/Simon.cs index 27b58f0fa..39a66b727 100644 --- a/Roles/Neutral/Simon.cs +++ b/Roles/Standard/Neutral/Killing/Simon.cs @@ -6,7 +6,7 @@ using Hazel; using UnityEngine; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Simon : RoleBase { diff --git a/Roles/Neutral/Slenderman.cs b/Roles/Standard/Neutral/Killing/Slenderman.cs similarity index 99% rename from Roles/Neutral/Slenderman.cs rename to Roles/Standard/Neutral/Killing/Slenderman.cs index 6797d0515..ec45e575f 100644 --- a/Roles/Neutral/Slenderman.cs +++ b/Roles/Standard/Neutral/Killing/Slenderman.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Slenderman : RoleBase { diff --git a/Roles/Neutral/SoulCollector.cs b/Roles/Standard/Neutral/Killing/SoulCollector.cs similarity index 99% rename from Roles/Neutral/SoulCollector.cs rename to Roles/Standard/Neutral/Killing/SoulCollector.cs index 4d5b57008..add594e5f 100644 --- a/Roles/Neutral/SoulCollector.cs +++ b/Roles/Standard/Neutral/Killing/SoulCollector.cs @@ -2,7 +2,7 @@ using AmongUs.GameOptions; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class SoulCollector : RoleBase { diff --git a/Roles/Neutral/Spider.cs b/Roles/Standard/Neutral/Killing/Spider.cs similarity index 99% rename from Roles/Neutral/Spider.cs rename to Roles/Standard/Neutral/Killing/Spider.cs index d358a5a56..90c90ea0c 100644 --- a/Roles/Neutral/Spider.cs +++ b/Roles/Standard/Neutral/Killing/Spider.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Spider : RoleBase { diff --git a/Roles/Neutral/Spiritcaller.cs b/Roles/Standard/Neutral/Killing/Spiritcaller.cs similarity index 97% rename from Roles/Neutral/Spiritcaller.cs rename to Roles/Standard/Neutral/Killing/Spiritcaller.cs index 9bca915ce..440297f31 100644 --- a/Roles/Neutral/Spiritcaller.cs +++ b/Roles/Standard/Neutral/Killing/Spiritcaller.cs @@ -5,7 +5,7 @@ using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Spiritcaller : RoleBase { diff --git a/Roles/Neutral/Sprayer.cs b/Roles/Standard/Neutral/Killing/Sprayer.cs similarity index 99% rename from Roles/Neutral/Sprayer.cs rename to Roles/Standard/Neutral/Killing/Sprayer.cs index 5d1e15883..5f7d3ff6d 100644 --- a/Roles/Neutral/Sprayer.cs +++ b/Roles/Standard/Neutral/Killing/Sprayer.cs @@ -5,7 +5,7 @@ using static EHR.Options; using static EHR.Translator; using static EHR.Utils; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Sprayer : RoleBase { diff --git a/Roles/Neutral/Stalker.cs b/Roles/Standard/Neutral/Killing/Stalker.cs similarity index 99% rename from Roles/Neutral/Stalker.cs rename to Roles/Standard/Neutral/Killing/Stalker.cs index b6e83f983..d60ce0a7b 100644 --- a/Roles/Neutral/Stalker.cs +++ b/Roles/Standard/Neutral/Killing/Stalker.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; // Credit: https://github.com/Yumenopai/TownOfHost_Y public class Stalker : RoleBase diff --git a/Roles/Neutral/Sunnyboy.cs b/Roles/Standard/Neutral/Killing/Sunnyboy.cs similarity index 95% rename from Roles/Neutral/Sunnyboy.cs rename to Roles/Standard/Neutral/Killing/Sunnyboy.cs index 3272582bb..345e2d1a2 100644 --- a/Roles/Neutral/Sunnyboy.cs +++ b/Roles/Standard/Neutral/Killing/Sunnyboy.cs @@ -1,6 +1,6 @@ using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Sunnyboy : RoleBase { diff --git a/Roles/Neutral/Thanos.cs b/Roles/Standard/Neutral/Killing/Thanos.cs similarity index 99% rename from Roles/Neutral/Thanos.cs rename to Roles/Standard/Neutral/Killing/Thanos.cs index 616f4db2a..6c1538903 100644 --- a/Roles/Neutral/Thanos.cs +++ b/Roles/Standard/Neutral/Killing/Thanos.cs @@ -5,7 +5,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Thanos : RoleBase { diff --git a/Roles/Neutral/Tiger.cs b/Roles/Standard/Neutral/Killing/Tiger.cs similarity index 99% rename from Roles/Neutral/Tiger.cs rename to Roles/Standard/Neutral/Killing/Tiger.cs index 71af461e0..e13b1ba71 100644 --- a/Roles/Neutral/Tiger.cs +++ b/Roles/Standard/Neutral/Killing/Tiger.cs @@ -3,7 +3,7 @@ using AmongUs.GameOptions; using EHR.Modules; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; internal class Tiger : RoleBase { diff --git a/Roles/Neutral/Traitor.cs b/Roles/Standard/Neutral/Killing/Traitor.cs similarity index 96% rename from Roles/Neutral/Traitor.cs rename to Roles/Standard/Neutral/Killing/Traitor.cs index c30153103..5e3f11d46 100644 --- a/Roles/Neutral/Traitor.cs +++ b/Roles/Standard/Neutral/Killing/Traitor.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using AmongUs.GameOptions; using static EHR.Options; -namespace EHR.Neutral; +namespace EHR.Roles; public class Traitor : RoleBase { diff --git a/Roles/Neutral/Tremor.cs b/Roles/Standard/Neutral/Killing/Tremor.cs similarity index 99% rename from Roles/Neutral/Tremor.cs rename to Roles/Standard/Neutral/Killing/Tremor.cs index c1b51db26..8df8fa474 100644 --- a/Roles/Neutral/Tremor.cs +++ b/Roles/Standard/Neutral/Killing/Tremor.cs @@ -5,7 +5,7 @@ using EHR.Modules; using Hazel; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Tremor : RoleBase { diff --git a/Roles/Neutral/Vengeance.cs b/Roles/Standard/Neutral/Killing/Vengeance.cs similarity index 96% rename from Roles/Neutral/Vengeance.cs rename to Roles/Standard/Neutral/Killing/Vengeance.cs index f6217e09f..68023f97c 100644 --- a/Roles/Neutral/Vengeance.cs +++ b/Roles/Standard/Neutral/Killing/Vengeance.cs @@ -4,7 +4,7 @@ using EHR.Modules; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Vengeance : RoleBase { diff --git a/Roles/Neutral/Virus.cs b/Roles/Standard/Neutral/Killing/Virus.cs similarity index 97% rename from Roles/Neutral/Virus.cs rename to Roles/Standard/Neutral/Killing/Virus.cs index 2fa7ca214..052178674 100644 --- a/Roles/Neutral/Virus.cs +++ b/Roles/Standard/Neutral/Killing/Virus.cs @@ -7,7 +7,7 @@ using EHR.Patches; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Virus : RoleBase { diff --git a/Roles/Neutral/Vortex.cs b/Roles/Standard/Neutral/Killing/Vortex.cs similarity index 99% rename from Roles/Neutral/Vortex.cs rename to Roles/Standard/Neutral/Killing/Vortex.cs index fa0d70be1..9273a54f1 100644 --- a/Roles/Neutral/Vortex.cs +++ b/Roles/Standard/Neutral/Killing/Vortex.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Neutral; +namespace EHR.Roles; public class Vortex : RoleBase { diff --git a/Roles/Neutral/WeaponMaster.cs b/Roles/Standard/Neutral/Killing/WeaponMaster.cs similarity index 99% rename from Roles/Neutral/WeaponMaster.cs rename to Roles/Standard/Neutral/Killing/WeaponMaster.cs index 6c8fa5aa9..7fff2cacc 100644 --- a/Roles/Neutral/WeaponMaster.cs +++ b/Roles/Standard/Neutral/Killing/WeaponMaster.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class WeaponMaster : RoleBase { diff --git a/Roles/Neutral/Weatherman.cs b/Roles/Standard/Neutral/Killing/Weatherman.cs similarity index 98% rename from Roles/Neutral/Weatherman.cs rename to Roles/Standard/Neutral/Killing/Weatherman.cs index 8396dbda6..7fd996cc5 100644 --- a/Roles/Neutral/Weatherman.cs +++ b/Roles/Standard/Neutral/Killing/Weatherman.cs @@ -1,7 +1,8 @@ using System; using AmongUs.GameOptions; +using EHR.Gamemodes; -namespace EHR.Neutral; +namespace EHR.Roles; public class Weatherman : RoleBase { diff --git a/Roles/Neutral/Werewolf.cs b/Roles/Standard/Neutral/Killing/Werewolf.cs similarity index 96% rename from Roles/Neutral/Werewolf.cs rename to Roles/Standard/Neutral/Killing/Werewolf.cs index e0c8ab2d1..b28f76e0b 100644 --- a/Roles/Neutral/Werewolf.cs +++ b/Roles/Standard/Neutral/Killing/Werewolf.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using Hazel; using static EHR.Options; using static EHR.Translator; -namespace EHR.Neutral; +namespace EHR.Roles; public class Werewolf : RoleBase { @@ -50,7 +49,7 @@ public class Werewolf : RoleBase .SetParent(CustomRoleSpawnChances[CustomRoles.Werewolf]) .SetValueFormat(OptionFormat.Seconds); - RampageDur = new FloatOptionItem(Id + 13, "WWRampageDur", new(0f, 180f, 1f), 12f, TabGroup.NeutralRoles) + RampageDur = new FloatOptionItem(Id + 13, "WWRampageDur", new(0.5f, 180f, 0.5f), 12f, TabGroup.NeutralRoles) .SetParent(CustomRoleSpawnChances[CustomRoles.Werewolf]) .SetValueFormat(OptionFormat.Seconds); @@ -285,4 +284,5 @@ public class Werewolf : RoleBase return true; } -} \ No newline at end of file + +} diff --git a/Roles/Neutral/Wraith.cs b/Roles/Standard/Neutral/Killing/Wraith.cs similarity index 91% rename from Roles/Neutral/Wraith.cs rename to Roles/Standard/Neutral/Killing/Wraith.cs index 2be0d4a37..864f4d2a5 100644 --- a/Roles/Neutral/Wraith.cs +++ b/Roles/Standard/Neutral/Killing/Wraith.cs @@ -1,4 +1,4 @@ -namespace EHR.Neutral; +namespace EHR.Roles; public class Wraith : RoleBase { @@ -15,7 +15,7 @@ public class Wraith : RoleBase { StartSetup(13300) .AutoSetupOption(ref WraithCooldown, 20f, new FloatValueRule(0f, 60f, 0.5f), OptionFormat.Seconds) - .AutoSetupOption(ref WraithDuration, 10f, new FloatValueRule(0f, 30f, 0.5f), OptionFormat.Seconds) + .AutoSetupOption(ref WraithDuration, 10f, new FloatValueRule(0.5f, 30f, 0.5f), OptionFormat.Seconds) .AutoSetupOption(ref WraithVentNormallyOnCooldown, true) .AutoSetupOption(ref WraithCanVent, true, overrideName: "CanVent") .AutoSetupOption(ref ImpostorVision, true) @@ -25,4 +25,4 @@ public class Wraith : RoleBase public override void Init() { } public override void Add(byte playerId) { } -} \ No newline at end of file +} diff --git a/Roles/Neutral/Auditor.cs b/Roles/Standard/Neutral/Pariah/Auditor.cs similarity index 99% rename from Roles/Neutral/Auditor.cs rename to Roles/Standard/Neutral/Pariah/Auditor.cs index 2660bcd39..d2991f2df 100644 --- a/Roles/Neutral/Auditor.cs +++ b/Roles/Standard/Neutral/Pariah/Auditor.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Auditor : RoleBase { diff --git a/Roles/Neutral/Clerk.cs b/Roles/Standard/Neutral/Pariah/Clerk.cs similarity index 98% rename from Roles/Neutral/Clerk.cs rename to Roles/Standard/Neutral/Pariah/Clerk.cs index a4898e5db..ab5b6309a 100644 --- a/Roles/Neutral/Clerk.cs +++ b/Roles/Standard/Neutral/Pariah/Clerk.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using AmongUs.GameOptions; -using EHR.Crewmate; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Clerk : RoleBase { diff --git a/Roles/Neutral/Curser.cs b/Roles/Standard/Neutral/Pariah/Curser.cs similarity index 99% rename from Roles/Neutral/Curser.cs rename to Roles/Standard/Neutral/Pariah/Curser.cs index eebb85576..0d740ef3a 100644 --- a/Roles/Neutral/Curser.cs +++ b/Roles/Standard/Neutral/Pariah/Curser.cs @@ -2,7 +2,7 @@ using System.Linq; using AmongUs.GameOptions; -namespace EHR.Neutral; +namespace EHR.Roles; public class Curser : RoleBase { diff --git a/Roles/Neutral/Magistrate.cs b/Roles/Standard/Neutral/Pariah/Magistrate.cs similarity index 99% rename from Roles/Neutral/Magistrate.cs rename to Roles/Standard/Neutral/Pariah/Magistrate.cs index cee0a84f2..2fcbcb797 100644 --- a/Roles/Neutral/Magistrate.cs +++ b/Roles/Standard/Neutral/Pariah/Magistrate.cs @@ -1,7 +1,7 @@ using AmongUs.GameOptions; using EHR.Modules; -namespace EHR.Neutral; +namespace EHR.Roles; public class Magistrate : RoleBase { diff --git a/Roles/Neutral/Seamstress.cs b/Roles/Standard/Neutral/Pariah/Seamstress.cs similarity index 99% rename from Roles/Neutral/Seamstress.cs rename to Roles/Standard/Neutral/Pariah/Seamstress.cs index 12f09622d..aa5c697b7 100644 --- a/Roles/Neutral/Seamstress.cs +++ b/Roles/Standard/Neutral/Pariah/Seamstress.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Seamstress : RoleBase { diff --git a/Roles/Neutral/Spirit.cs b/Roles/Standard/Neutral/Pariah/Spirit.cs similarity index 99% rename from Roles/Neutral/Spirit.cs rename to Roles/Standard/Neutral/Pariah/Spirit.cs index 47e91f865..9e630867f 100644 --- a/Roles/Neutral/Spirit.cs +++ b/Roles/Standard/Neutral/Pariah/Spirit.cs @@ -4,7 +4,7 @@ using AmongUs.GameOptions; using EHR.Modules; using Hazel; -namespace EHR.Neutral; +namespace EHR.Roles; public class Spirit : RoleBase { diff --git a/Roles/Neutral/Starspawn.cs b/Roles/Standard/Neutral/Pariah/Starspawn.cs similarity index 99% rename from Roles/Neutral/Starspawn.cs rename to Roles/Standard/Neutral/Pariah/Starspawn.cs index b9b295523..446243c22 100644 --- a/Roles/Neutral/Starspawn.cs +++ b/Roles/Standard/Neutral/Pariah/Starspawn.cs @@ -6,7 +6,7 @@ using Hazel; using TMPro; using UnityEngine; -namespace EHR.Neutral; +namespace EHR.Roles; public class Starspawn : RoleBase { diff --git a/Roles/VanillaRole.cs b/Roles/VanillaRole.cs index 7d9c05bee..c19914d38 100644 --- a/Roles/VanillaRole.cs +++ b/Roles/VanillaRole.cs @@ -1,4 +1,4 @@ -namespace EHR; +namespace EHR.Roles; internal class VanillaRole : RoleBase { diff --git a/local.props.example b/local.props.example new file mode 100644 index 000000000..103972f64 --- /dev/null +++ b/local.props.example @@ -0,0 +1,5 @@ + + + D:\SteamLibrary\steamapps\common\Among Us + + \ No newline at end of file