diff --git a/CTA/CustomTeamAssigner/CustomRoles.cs b/CTA/CustomTeamAssigner/CustomRoles.cs
index 948b0fc1b..c9cedb3eb 100644
--- a/CTA/CustomTeamAssigner/CustomRoles.cs
+++ b/CTA/CustomTeamAssigner/CustomRoles.cs
@@ -11,8 +11,8 @@ public enum CustomRoles
Shapeshifter,
// Vanilla Remakes
- ImpostorTOHE,
- ShapeshifterTOHE,
+ ImpostorEHR,
+ ShapeshifterEHR,
//Impostors
@@ -106,10 +106,10 @@ public enum CustomRoles
Scientist,
// Vanilla Remakes
- CrewmateTOHE,
- EngineerTOHE,
- GuardianAngelTOHE,
- ScientistTOHE,
+ CrewmateEHR,
+ EngineerEHR,
+ GuardianAngelEHR,
+ ScientistEHR,
// Crewmate
diff --git a/CTA/CustomTeamAssigner/MainWindow.xaml.cs b/CTA/CustomTeamAssigner/MainWindow.xaml.cs
index 7685900f2..31d1d6b66 100644
--- a/CTA/CustomTeamAssigner/MainWindow.xaml.cs
+++ b/CTA/CustomTeamAssigner/MainWindow.xaml.cs
@@ -24,6 +24,7 @@ namespace CustomTeamAssigner
if (ofd.ShowDialog() == true)
{
+ Utils.Teams.Clear();
File.ReadAllLines(ofd.FileName).Do(line => new Team(line.Split(';')[0]).Import(line));
Navigator.NavigationService.Navigate(new PlaySetListerPage());
diff --git a/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs b/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs
index 9d335d19e..5c58e80db 100644
--- a/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs
+++ b/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs
@@ -17,9 +17,20 @@ namespace CustomTeamAssigner
EditingTeamMembers = team.TeamMembers;
InitializeMembersGrid();
InitializeComboBox();
+ InitializeEditorFields();
+ }
+
+ void InitializeEditorFields()
+ {
OverrideColorCheckBox.IsChecked = EditingTeam.RoleRevealScreenBackgroundColor != "*";
OverrideTitleCheckBox.IsChecked = EditingTeam.RoleRevealScreenTitle != "*";
OverrideSubTitleCheckBox.IsChecked = EditingTeam.RoleRevealScreenSubtitle != "*";
+
+ TeamNameTextBox.Text = EditingTeam.TeamName;
+
+ if (OverrideColorCheckBox.IsChecked == true) TeamColorTextBox.Text = EditingTeam.RoleRevealScreenBackgroundColor;
+ if (OverrideTitleCheckBox.IsChecked == true) TeamTitleTextBox.Text = EditingTeam.RoleRevealScreenTitle;
+ if (OverrideSubTitleCheckBox.IsChecked == true) TeamSubTitleTextBox.Text = EditingTeam.RoleRevealScreenSubtitle;
}
void InitializeMembersGrid()
diff --git a/CTA/CustomTeamAssigner/Utils.cs b/CTA/CustomTeamAssigner/Utils.cs
index 914c69d06..a8d8c7c59 100644
--- a/CTA/CustomTeamAssigner/Utils.cs
+++ b/CTA/CustomTeamAssigner/Utils.cs
@@ -94,6 +94,7 @@ namespace CustomTeamAssigner
public static CustomRoles GetInternalRoleName(this string roleName)
{
+ if (roleName == "Guess Manager") return CustomRoles.GuessManagerRole;
var role = RoleNames.FirstOrDefault(x => x.Value == roleName).Key;
return role != default ? role : Enum.Parse(roleName.Replace(" ", string.Empty));
}
diff --git a/CustomRoles.cs b/CustomRoles.cs
index 948b0fc1b..c9cedb3eb 100644
--- a/CustomRoles.cs
+++ b/CustomRoles.cs
@@ -11,8 +11,8 @@ public enum CustomRoles
Shapeshifter,
// Vanilla Remakes
- ImpostorTOHE,
- ShapeshifterTOHE,
+ ImpostorEHR,
+ ShapeshifterEHR,
//Impostors
@@ -106,10 +106,10 @@ public enum CustomRoles
Scientist,
// Vanilla Remakes
- CrewmateTOHE,
- EngineerTOHE,
- GuardianAngelTOHE,
- ScientistTOHE,
+ CrewmateEHR,
+ EngineerEHR,
+ GuardianAngelEHR,
+ ScientistEHR,
// Crewmate
diff --git a/EHR.csproj b/EHR.csproj
index 1a48036ce..dd0d268b9 100644
--- a/EHR.csproj
+++ b/EHR.csproj
@@ -7,7 +7,7 @@
EHR
Gurge44
preview
- E:\Program Files\AmongUs
+ D:\Epic Games\AmongUs
true
True
$(MSBuildProjectName)
diff --git a/EHR.sln.DotSettings b/EHR.sln.DotSettings
index ba9e1fc22..0d2b9f60d 100644
--- a/EHR.sln.DotSettings
+++ b/EHR.sln.DotSettings
@@ -2,6 +2,7 @@
AU
CD
DLL
+ DY
EHR
FFA
FFF
@@ -11,5 +12,5 @@
RPC
SK
TMP
- TOHE
+ EHR
VN
\ No newline at end of file
diff --git a/GameMode/FFAManager.cs b/GameMode/FFAManager.cs
index 052751567..8993336f9 100644
--- a/GameMode/FFAManager.cs
+++ b/GameMode/FFAManager.cs
@@ -22,7 +22,6 @@ internal static class FFAManager
public static string LatestChatMessage = string.Empty;
- //Options
public static OptionItem FFAGameTime;
public static OptionItem FFAKcd;
public static OptionItem FFALowerVision;
@@ -104,8 +103,6 @@ internal static class FFAManager
{
KillCount[pc.PlayerId] = 0;
}
-
- if (FFAChatDuringGame.GetBool()) _ = new LateTask(Utils.SetChatVisible, 12f, "Set Chat Visible for Everyone");
}
private static void SendRPCSyncFFAPlayer(byte playerId)
@@ -126,9 +123,7 @@ internal static class FFAManager
{
if (pc.AmOwner || !pc.IsModClient()) return;
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SyncFFANameNotify, SendOption.Reliable, pc.GetClientId());
- if (NameNotify.TryGetValue(pc.PlayerId, out (string TEXT, long TIMESTAMP) value))
- writer.Write(value.TEXT);
- else writer.Write(string.Empty);
+ writer.Write(NameNotify.TryGetValue(pc.PlayerId, out (string TEXT, long TIMESTAMP) value) ? value.TEXT : string.Empty);
AmongUsClient.Instance.FinishRpcImmediately(writer);
}
@@ -136,7 +131,7 @@ internal static class FFAManager
{
var name = reader.ReadString();
NameNotify.Remove(PlayerControl.LocalPlayer.PlayerId);
- if (name != null && name != string.Empty)
+ if (!string.IsNullOrEmpty(name))
NameNotify.Add(PlayerControl.LocalPlayer.PlayerId, (name, 0));
}
@@ -165,7 +160,7 @@ internal static class FFAManager
try
{
int ms = KillCount[playerId];
- int rank = 1 + KillCount.Values.Where(x => x > ms).Count();
+ int rank = 1 + KillCount.Values.Count(x => x > ms);
rank += KillCount.Where(x => x.Value == ms).ToList().IndexOf(new(playerId, ms));
return rank;
}
@@ -313,7 +308,7 @@ internal static class FFAManager
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
}
- if (sync || nowKCD != Main.AllPlayerKillCooldown[killer.PlayerId])
+ if (sync || Math.Abs(nowKCD - Main.AllPlayerKillCooldown[killer.PlayerId]) > 0.1f)
{
mark = false;
killer.SyncSettings();
@@ -343,12 +338,7 @@ internal static class FFAManager
if (Main.AllAlivePlayerControls.Length != 2) return string.Empty;
string arrows = string.Empty;
- PlayerControl otherPlayer = null;
- foreach (var pc in Main.AllAlivePlayerControls.Where(pc => pc.IsAlive() && pc.PlayerId != seer.PlayerId).ToArray())
- {
- otherPlayer = pc;
- break;
- }
+ PlayerControl otherPlayer = Main.AllAlivePlayerControls.FirstOrDefault(pc => pc.IsAlive() && pc.PlayerId != seer.PlayerId);
if (otherPlayer == null) return string.Empty;
diff --git a/GameMode/HotPotatoManager.cs b/GameMode/HotPotatoManager.cs
index 9dbd4e84d..6752f4be0 100644
--- a/GameMode/HotPotatoManager.cs
+++ b/GameMode/HotPotatoManager.cs
@@ -19,6 +19,8 @@ namespace EHR
public static (byte HolderID, byte LastHolderID, int TimeLeft, int RoundNum) GetState() => HotPotatoState;
+ public static bool IsChatDuringGame => Chat.GetBool();
+
public static void SetupCustomOption()
{
Time = IntegerOptionItem.Create(69_213_001, "HotPotato_Time", new(1, 90, 1), 20, TabGroup.GameSettings, false)
@@ -48,8 +50,6 @@ namespace EHR
foreach (var pc in Main.AllPlayerControls) SurvivalTimes[pc.PlayerId] = 0;
DefaultSpeed = Main.AllPlayerSpeed[0];
-
- if (Chat.GetBool()) _ = new LateTask(Utils.SetChatVisible, 12f, "Set Chat Visible for Everyone");
}
public static void OnGameStart()
diff --git a/Modules/ClientOptionItem.cs b/Modules/ClientOptionItem.cs
index 64adbe88f..041ae292a 100644
--- a/Modules/ClientOptionItem.cs
+++ b/Modules/ClientOptionItem.cs
@@ -66,8 +66,8 @@ public class ClientOptionItem
var modOptionsButton = Object.Instantiate(mouseMoveToggle, generalTab);
modOptionsButton.transform.localPosition = leaveButton?.transform?.localPosition ?? new(0f, -2.4f, 1f);
- modOptionsButton.name = "TOHEOptions";
- modOptionsButton.Text.text = Translator.GetString("TOHEOptions");
+ modOptionsButton.name = "EHROptions";
+ modOptionsButton.Text.text = Translator.GetString("EHROptions");
modOptionsButton.Background.color = new Color32(255, 192, 203, byte.MaxValue);
var modOptionsPassiveButton = modOptionsButton.GetComponent();
modOptionsPassiveButton.OnClick = new();
diff --git a/Modules/CustomRoleSelector.cs b/Modules/CustomRoleSelector.cs
index 67fad67ed..24a9444e5 100644
--- a/Modules/CustomRoleSelector.cs
+++ b/Modules/CustomRoleSelector.cs
@@ -172,7 +172,7 @@ internal static class CustomRoleSelector
if (Roles[RoleAssignType.Impostor].Count == 0 && !Main.SetRoles.Values.Any(x => x.IsImpostor()))
{
- Roles[RoleAssignType.Impostor].Add(new(CustomRoles.ImpostorTOHE, 100, optImpNum));
+ Roles[RoleAssignType.Impostor].Add(new(CustomRoles.ImpostorEHR, 100, optImpNum));
Logger.Warn("Adding Vanilla Impostor", "CustomRoleSelector");
}
diff --git a/Modules/CustomRolesHelper.cs b/Modules/CustomRolesHelper.cs
index 2bd574789..e055d913a 100644
--- a/Modules/CustomRolesHelper.cs
+++ b/Modules/CustomRolesHelper.cs
@@ -54,10 +54,11 @@ internal static class CustomRolesHelper
return Activator.CreateInstance(roleClass.GetType()) as RoleBase;
}
- public static CustomRoles GetVNRole(this CustomRoles role)
+ public static CustomRoles GetVNRole(this CustomRoles role, bool checkDesyncRole = false)
{
if (role.IsGhostRole()) return CustomRoles.GuardianAngel;
if (role.IsVanilla()) return role;
+ if (checkDesyncRole && role.GetDYRole() == RoleTypes.Impostor) return CustomRoles.Impostor;
bool UsePets = Options.UsePets.GetBool();
return role switch
{
@@ -74,7 +75,7 @@ internal static class CustomRolesHelper
CustomRoles.SabotageMaster => CustomRoles.Engineer,
CustomRoles.Mafia => Options.LegacyMafia.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Terrorist => CustomRoles.Engineer,
- CustomRoles.Executioner => CustomRoles.Crewmate,
+ CustomRoles.Executioner => Executioner.CRoleChangeRoles[Executioner.ChangeRolesAfterTargetKilled.GetValue()].GetVNRole(checkDesyncRole: true),
CustomRoles.Lawyer => CustomRoles.Crewmate,
CustomRoles.NiceSwapper => CustomRoles.Crewmate,
CustomRoles.Ignitor => CustomRoles.Crewmate,
@@ -83,9 +84,9 @@ internal static class CustomRolesHelper
CustomRoles.BountyHunter => CustomRoles.Impostor,
CustomRoles.Trickster => CustomRoles.Impostor,
CustomRoles.Witch => CustomRoles.Impostor,
- CustomRoles.ShapeshifterTOHE => CustomRoles.Shapeshifter,
+ CustomRoles.ShapeshifterEHR => CustomRoles.Shapeshifter,
CustomRoles.Agitater => CustomRoles.Impostor,
- CustomRoles.ImpostorTOHE => CustomRoles.Impostor,
+ CustomRoles.ImpostorEHR => CustomRoles.Impostor,
CustomRoles.EvilDiviner => CustomRoles.Impostor,
CustomRoles.Wildling => Wildling.CanShapeshiftOpt.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Morphling => CustomRoles.Shapeshifter,
@@ -120,15 +121,15 @@ internal static class CustomRolesHelper
CustomRoles.Hitman => CustomRoles.Shapeshifter,
CustomRoles.Saboteur => CustomRoles.Impostor,
CustomRoles.Doctor => CustomRoles.Scientist,
- CustomRoles.ScientistTOHE => CustomRoles.Scientist,
+ CustomRoles.ScientistEHR => CustomRoles.Scientist,
CustomRoles.Tracefinder => CustomRoles.Scientist,
CustomRoles.Puppeteer => CustomRoles.Impostor,
CustomRoles.TimeThief => CustomRoles.Impostor,
CustomRoles.EvilTracker => CustomRoles.Shapeshifter,
CustomRoles.Paranoia => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
- CustomRoles.EngineerTOHE => CustomRoles.Engineer,
+ CustomRoles.EngineerEHR => CustomRoles.Engineer,
CustomRoles.TimeMaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
- CustomRoles.CrewmateTOHE => CustomRoles.Crewmate,
+ CustomRoles.CrewmateEHR => CustomRoles.Crewmate,
CustomRoles.Cleanser => CustomRoles.Crewmate,
CustomRoles.Miner => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Psychic => CustomRoles.Crewmate,
@@ -150,7 +151,7 @@ internal static class CustomRolesHelper
CustomRoles.Beacon => CustomRoles.Crewmate,
CustomRoles.Rabbit => CustomRoles.Crewmate,
CustomRoles.Shiftguard => CustomRoles.Crewmate,
- CustomRoles.Mole => CustomRoles.Engineer,
+ CustomRoles.Mole => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Markseeker => CustomRoles.Crewmate,
CustomRoles.Sentinel => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Electric => CustomRoles.Crewmate,
@@ -185,7 +186,7 @@ internal static class CustomRolesHelper
CustomRoles.EvilGuesser => CustomRoles.Impostor,
CustomRoles.Detective => CustomRoles.Crewmate,
CustomRoles.God => CustomRoles.Crewmate,
- CustomRoles.GuardianAngelTOHE => CustomRoles.GuardianAngel,
+ CustomRoles.GuardianAngelEHR => CustomRoles.GuardianAngel,
CustomRoles.Zombie => CustomRoles.Impostor,
CustomRoles.Mario => CustomRoles.Engineer,
CustomRoles.AntiAdminer => AntiAdminer.EnableExtraAbility.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
@@ -259,13 +260,13 @@ internal static class CustomRolesHelper
if (role.GetDYRole() == RoleTypes.Impostor) vnRole = CustomRoles.Impostor;
return vnRole switch
{
- CustomRoles.Crewmate => CustomRoles.CrewmateTOHE,
- CustomRoles.Engineer => CustomRoles.EngineerTOHE,
- CustomRoles.Scientist => CustomRoles.ScientistTOHE,
- CustomRoles.Impostor when role.IsCrewmate() => CustomRoles.CrewmateTOHE,
- CustomRoles.Impostor => CustomRoles.ImpostorTOHE,
- CustomRoles.Shapeshifter => CustomRoles.ShapeshifterTOHE,
- _ => role.IsImpostor() ? CustomRoles.ImpostorTOHE : CustomRoles.CrewmateTOHE
+ CustomRoles.Crewmate => CustomRoles.CrewmateEHR,
+ CustomRoles.Engineer => CustomRoles.EngineerEHR,
+ CustomRoles.Scientist => CustomRoles.ScientistEHR,
+ CustomRoles.Impostor when role.IsCrewmate() => CustomRoles.CrewmateEHR,
+ CustomRoles.Impostor => CustomRoles.ImpostorEHR,
+ CustomRoles.Shapeshifter => CustomRoles.ShapeshifterEHR,
+ _ => role.IsImpostor() ? CustomRoles.ImpostorEHR : CustomRoles.CrewmateEHR
};
}
@@ -288,6 +289,7 @@ internal static class CustomRolesHelper
CustomRoles.Fox => RoleTypes.Crewmate,
CustomRoles.Troll => RoleTypes.Crewmate,
//Standard
+ CustomRoles.Executioner => Executioner.CRoleChangeRoles[Executioner.ChangeRolesAfterTargetKilled.GetValue()].GetDYRole(),
CustomRoles.Sheriff => UsePets && Sheriff.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor,
CustomRoles.Crusader => UsePets && Crusader.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor,
CustomRoles.CopyCat => UsePets && CopyCat.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor,
@@ -506,8 +508,8 @@ internal static class CustomRolesHelper
CustomRoles.Impostor or
CustomRoles.Godfather or
CustomRoles.Shapeshifter or
- CustomRoles.ShapeshifterTOHE or
- CustomRoles.ImpostorTOHE or
+ CustomRoles.ShapeshifterEHR or
+ CustomRoles.ImpostorEHR or
CustomRoles.EvilDiviner or
CustomRoles.Wildling or
CustomRoles.Silencer or
@@ -731,9 +733,9 @@ internal static class CustomRolesHelper
CustomRoles.Pickpocket or
CustomRoles.TicketsStealer;
- public static bool CheckAddonConflictV2(CustomRoles addon, CustomRoles mainRole) => addon.IsAdditionRole() && mainRole is not CustomRoles.GuardianAngelTOHE and not CustomRoles.God and not CustomRoles.GM && addon switch
+ public static bool CheckAddonConflictV2(CustomRoles addon, CustomRoles mainRole) => addon.IsAdditionRole() && mainRole is not CustomRoles.GuardianAngelEHR and not CustomRoles.God and not CustomRoles.GM && addon switch
{
- CustomRoles.Autopsy when mainRole is CustomRoles.Doctor or CustomRoles.Tracefinder or CustomRoles.Scientist or CustomRoles.ScientistTOHE or CustomRoles.Sunnyboy => false,
+ CustomRoles.Autopsy when mainRole is CustomRoles.Doctor or CustomRoles.Tracefinder or CustomRoles.Scientist or CustomRoles.ScientistEHR or CustomRoles.Sunnyboy => false,
CustomRoles.Necroview when mainRole is CustomRoles.Doctor => false,
CustomRoles.Lazy when mainRole is CustomRoles.Speedrunner => false,
CustomRoles.Mischievous when mainRole.Is(Team.Impostor) || mainRole.GetDYRole() != RoleTypes.Impostor || !mainRole.IsNK() => false,
@@ -746,13 +748,13 @@ internal static class CustomRolesHelper
CustomRoles.Lazy when mainRole.IsNeutral() || mainRole.IsImpostor() || (mainRole.IsTasklessCrewmate() && !Options.TasklessCrewCanBeLazy.GetBool()) || (mainRole.IsTaskBasedCrewmate() && !Options.TaskBasedCrewCanBeLazy.GetBool()) => false,
CustomRoles.TicketsStealer or CustomRoles.Swift or CustomRoles.DeadlyQuota or CustomRoles.Damocles or CustomRoles.Mare when mainRole is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.BoobyTrap or CustomRoles.Capitalism => false,
CustomRoles.TicketsStealer or CustomRoles.Mimic or CustomRoles.Swift or CustomRoles.DeadlyQuota or CustomRoles.Circumvent or CustomRoles.Damocles or CustomRoles.Mare when !mainRole.IsImpostor() => false,
- CustomRoles.Torch when !mainRole.IsCrewmate() || mainRole is CustomRoles.Bewilder or CustomRoles.Sunglasses or CustomRoles.GuardianAngelTOHE => false,
- CustomRoles.Bewilder when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelTOHE or CustomRoles.Sunglasses => false,
- CustomRoles.Sunglasses when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelTOHE or CustomRoles.Bewilder => false,
- CustomRoles.Guesser when (mainRole.IsCrewmate() && (!Options.CrewCanBeGuesser.GetBool() || mainRole is CustomRoles.NiceGuesser)) || (mainRole.IsNeutral() && !Options.NeutralCanBeGuesser.GetBool()) || (mainRole.IsImpostor() && !Options.ImpCanBeGuesser.GetBool()) || mainRole is CustomRoles.EvilGuesser or CustomRoles.GuardianAngelTOHE => false,
+ CustomRoles.Torch when !mainRole.IsCrewmate() || mainRole is CustomRoles.Bewilder or CustomRoles.Sunglasses or CustomRoles.GuardianAngelEHR => false,
+ CustomRoles.Bewilder when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelEHR or CustomRoles.Sunglasses => false,
+ CustomRoles.Sunglasses when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelEHR or CustomRoles.Bewilder => false,
+ CustomRoles.Guesser when (mainRole.IsCrewmate() && (!Options.CrewCanBeGuesser.GetBool() || mainRole is CustomRoles.NiceGuesser)) || (mainRole.IsNeutral() && !Options.NeutralCanBeGuesser.GetBool()) || (mainRole.IsImpostor() && !Options.ImpCanBeGuesser.GetBool()) || mainRole is CustomRoles.EvilGuesser or CustomRoles.GuardianAngelEHR => false,
CustomRoles.Madmate when mainRole is CustomRoles.Egoist or CustomRoles.Rascal => false,
- CustomRoles.Oblivious when mainRole is CustomRoles.Detective or CustomRoles.Cleaner or CustomRoles.Medusa or CustomRoles.Mortician or CustomRoles.Mediumshiper or CustomRoles.GuardianAngelTOHE => false,
- CustomRoles.Youtuber when !mainRole.IsCrewmate() || mainRole is CustomRoles.Madmate or CustomRoles.Sheriff or CustomRoles.GuardianAngelTOHE => false,
+ CustomRoles.Oblivious when mainRole is CustomRoles.Detective or CustomRoles.Cleaner or CustomRoles.Medusa or CustomRoles.Mortician or CustomRoles.Mediumshiper or CustomRoles.GuardianAngelEHR => false,
+ CustomRoles.Youtuber when !mainRole.IsCrewmate() || mainRole is CustomRoles.Madmate or CustomRoles.Sheriff or CustomRoles.GuardianAngelEHR => false,
CustomRoles.Egoist when !mainRole.IsImpostor() => false,
CustomRoles.Damocles when mainRole is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.SerialKiller or CustomRoles.Cantankerous or CustomRoles.Sapper => false,
CustomRoles.Necroview when mainRole is CustomRoles.Visionary => false,
@@ -847,7 +849,7 @@ internal static class CustomRolesHelper
CustomRoles.Unlucky when mainRole is CustomRoles.Luckey => false,
CustomRoles.Unlucky when mainRole is CustomRoles.Lucky => false,
CustomRoles.Lucky when mainRole is CustomRoles.Unlucky => false,
- CustomRoles.Fool when (mainRole.IsCrewmate() && !Options.CrewCanBeFool.GetBool()) || (mainRole.IsNeutral() && !Options.NeutralCanBeFool.GetBool()) || (mainRole.IsImpostor() && !Options.ImpCanBeFool.GetBool()) || mainRole is CustomRoles.SabotageMaster or CustomRoles.GuardianAngelTOHE => false,
+ CustomRoles.Fool when (mainRole.IsCrewmate() && !Options.CrewCanBeFool.GetBool()) || (mainRole.IsNeutral() && !Options.NeutralCanBeFool.GetBool()) || (mainRole.IsImpostor() && !Options.ImpCanBeFool.GetBool()) || mainRole is CustomRoles.SabotageMaster or CustomRoles.GuardianAngelEHR => false,
CustomRoles.Bloodhound when mainRole is CustomRoles.Oblivious => false,
CustomRoles.DoubleShot when (mainRole.GetCustomRoleTypes() is CustomRoleTypes.Impostor && !Options.ImpCanBeDoubleShot.GetBool()) || (mainRole.GetCustomRoleTypes() is CustomRoleTypes.Crewmate && !Options.CrewCanBeDoubleShot.GetBool()) || (mainRole.GetCustomRoleTypes() is CustomRoleTypes.Neutral && !Options.NeutralCanBeDoubleShot.GetBool()) => false,
CustomRoles.DoubleShot when mainRole is not CustomRoles.EvilGuesser && mainRole is not CustomRoles.NiceGuesser && !Options.GuesserMode.GetBool() => false,
@@ -857,12 +859,12 @@ internal static class CustomRolesHelper
_ => true
};
- public static bool CheckAddonConflict(CustomRoles role, PlayerControl pc) => role.IsAdditionRole() && pc.GetCustomRole() is not CustomRoles.GuardianAngelTOHE and not CustomRoles.God && !pc.Is(CustomRoles.Madmate) && !pc.Is(CustomRoles.Egoist) && !pc.Is(CustomRoles.GM) && role is not CustomRoles.Lovers && !pc.Is(CustomRoles.Needy) && (!pc.HasSubRole() || pc.GetCustomSubRoles().Count < Options.NoLimitAddonsNumMax.GetInt()) && role switch
+ public static bool CheckAddonConflict(CustomRoles role, PlayerControl pc) => role.IsAdditionRole() && pc.GetCustomRole() is not CustomRoles.GuardianAngelEHR and not CustomRoles.God && !pc.Is(CustomRoles.Madmate) && !pc.Is(CustomRoles.Egoist) && !pc.Is(CustomRoles.GM) && role is not CustomRoles.Lovers && !pc.Is(CustomRoles.Needy) && (!pc.HasSubRole() || pc.GetCustomSubRoles().Count < Options.NoLimitAddonsNumMax.GetInt()) && role switch
{
CustomRoles.Sidekick when pc.Is(CustomRoles.Madmate) => false,
CustomRoles.Madmate when pc.Is(CustomRoles.Sidekick) => false,
CustomRoles.Egoist when pc.Is(CustomRoles.Sidekick) => false,
- CustomRoles.Autopsy when pc.Is(CustomRoles.Doctor) || pc.Is(CustomRoles.Tracefinder) || pc.Is(CustomRoles.Scientist) || pc.Is(CustomRoles.ScientistTOHE) || pc.Is(CustomRoles.Sunnyboy) => false,
+ CustomRoles.Autopsy when pc.Is(CustomRoles.Doctor) || pc.Is(CustomRoles.Tracefinder) || pc.Is(CustomRoles.Scientist) || pc.Is(CustomRoles.ScientistEHR) || pc.Is(CustomRoles.Sunnyboy) => false,
CustomRoles.Necroview when pc.Is(CustomRoles.Doctor) => false,
CustomRoles.Lazy when pc.Is(CustomRoles.Speedrunner) => false,
CustomRoles.Mischievous when pc.Is(Team.Impostor) || pc.GetCustomRole().GetDYRole() != RoleTypes.Impostor || !pc.IsNeutralKiller() => false,
@@ -875,13 +877,13 @@ internal static class CustomRolesHelper
CustomRoles.Lazy when pc.GetCustomRole().IsNeutral() || pc.GetCustomRole().IsImpostor() || (pc.GetCustomRole().IsTasklessCrewmate() && !Options.TasklessCrewCanBeLazy.GetBool()) || (pc.GetCustomRole().IsTaskBasedCrewmate() && !Options.TaskBasedCrewCanBeLazy.GetBool()) => false,
CustomRoles.TicketsStealer or CustomRoles.Swift or CustomRoles.DeadlyQuota or CustomRoles.Damocles or CustomRoles.Mare when pc.Is(CustomRoles.Bomber) || pc.Is(CustomRoles.Nuker) || pc.Is(CustomRoles.BoobyTrap) || pc.Is(CustomRoles.Capitalism) => false,
CustomRoles.TicketsStealer or CustomRoles.Mimic or CustomRoles.Swift or CustomRoles.DeadlyQuota or CustomRoles.Circumvent or CustomRoles.Damocles or CustomRoles.Mare when !pc.GetCustomRole().IsImpostor() => false,
- CustomRoles.Torch when !pc.IsCrewmate() || pc.Is(CustomRoles.Bewilder) || pc.Is(CustomRoles.Sunglasses) || pc.Is(CustomRoles.GuardianAngelTOHE) => false,
- CustomRoles.Bewilder when pc.Is(CustomRoles.Torch) || pc.Is(CustomRoles.GuardianAngelTOHE) || pc.Is(CustomRoles.Sunglasses) => false,
- CustomRoles.Sunglasses when pc.Is(CustomRoles.Torch) || pc.Is(CustomRoles.GuardianAngelTOHE) || pc.Is(CustomRoles.Bewilder) => false,
- CustomRoles.Guesser when (pc.IsCrewmate() && (!Options.CrewCanBeGuesser.GetBool() || pc.Is(CustomRoles.NiceGuesser))) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeGuesser.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeGuesser.GetBool()) || pc.Is(CustomRoles.EvilGuesser) || pc.Is(CustomRoles.GuardianAngelTOHE) => false,
+ 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.Sunglasses when pc.Is(CustomRoles.Torch) || pc.Is(CustomRoles.GuardianAngelEHR) || pc.Is(CustomRoles.Bewilder) => false,
+ CustomRoles.Guesser when (pc.IsCrewmate() && (!Options.CrewCanBeGuesser.GetBool() || pc.Is(CustomRoles.NiceGuesser))) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeGuesser.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeGuesser.GetBool()) || pc.Is(CustomRoles.EvilGuesser) || pc.Is(CustomRoles.GuardianAngelEHR) => false,
CustomRoles.Madmate when !pc.CanBeMadmate() || pc.Is(CustomRoles.Egoist) || pc.Is(CustomRoles.Rascal) => false,
- CustomRoles.Oblivious when pc.Is(CustomRoles.Detective) || pc.Is(CustomRoles.Cleaner) || pc.Is(CustomRoles.Medusa) || pc.Is(CustomRoles.Mortician) || pc.Is(CustomRoles.Mediumshiper) || pc.Is(CustomRoles.GuardianAngelTOHE) => false,
- CustomRoles.Youtuber when !pc.IsCrewmate() || pc.Is(CustomRoles.Madmate) || pc.Is(CustomRoles.Sheriff) || pc.Is(CustomRoles.GuardianAngelTOHE) => false,
+ CustomRoles.Oblivious when pc.Is(CustomRoles.Detective) || pc.Is(CustomRoles.Cleaner) || pc.Is(CustomRoles.Medusa) || pc.Is(CustomRoles.Mortician) || pc.Is(CustomRoles.Mediumshiper) || pc.Is(CustomRoles.GuardianAngelEHR) => false,
+ CustomRoles.Youtuber when !pc.IsCrewmate() || pc.Is(CustomRoles.Madmate) || pc.Is(CustomRoles.Sheriff) || pc.Is(CustomRoles.GuardianAngelEHR) => false,
CustomRoles.Egoist when !pc.GetCustomRole().IsImpostor() => false,
CustomRoles.Damocles when pc.GetCustomRole() is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.SerialKiller or CustomRoles.Cantankerous => false,
CustomRoles.Damocles when !pc.CanUseKillButton() => false,
@@ -916,7 +918,7 @@ internal static class CustomRolesHelper
CustomRoles.DualPersonality when pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeDualPersonality.GetBool() => false,
CustomRoles.Loyal when (!pc.GetCustomRole().IsImpostor() && !pc.IsCrewmate()) || pc.Is(CustomRoles.Madmate) => false,
CustomRoles.Loyal when pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeLoyal.GetBool() => false,
- CustomRoles.Seer when (pc.IsCrewmate() && (!Options.CrewCanBeSeer.GetBool() || pc.Is(CustomRoles.Mortician))) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeSeer.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeSeer.GetBool()) || pc.Is(CustomRoles.GuardianAngelTOHE) => false,
+ CustomRoles.Seer when (pc.IsCrewmate() && (!Options.CrewCanBeSeer.GetBool() || pc.Is(CustomRoles.Mortician))) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeSeer.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeSeer.GetBool()) || pc.Is(CustomRoles.GuardianAngelEHR) => false,
CustomRoles.Bait when (pc.IsCrewmate() && !Options.CrewCanBeBait.GetBool()) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeBait.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeBait.GetBool()) => false,
CustomRoles.Bewilder when (pc.IsCrewmate() && !Options.CrewCanBeBewilder.GetBool()) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeBewilder.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeBewilder.GetBool()) => false,
CustomRoles.Sunglasses when (pc.IsCrewmate() && !Options.CrewCanBeSunglasses.GetBool()) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeSunglasses.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeSunglasses.GetBool()) => false,
@@ -933,7 +935,7 @@ internal static class CustomRolesHelper
CustomRoles.Sidekick when pc.GetCustomRole().IsImpostor() && !Options.ImpostorCanBeSidekick.GetBool() => false,
CustomRoles.Sidekick when pc.Is(CustomRoles.Jackal) => false,
CustomRoles.Lucky when pc.Is(CustomRoles.Guardian) => false,
- CustomRoles.Bait when pc.Is(CustomRoles.GuardianAngelTOHE) => false,
+ CustomRoles.Bait when pc.Is(CustomRoles.GuardianAngelEHR) => false,
CustomRoles.Bait when pc.Is(CustomRoles.Trapper) => false,
CustomRoles.Trapper when pc.Is(CustomRoles.Bait) => false,
CustomRoles.DualPersonality when pc.Is(CustomRoles.Dictator) => false,
@@ -946,7 +948,7 @@ internal static class CustomRolesHelper
CustomRoles.Swift when pc.Is(CustomRoles.Witch) => false,
CustomRoles.Swift when pc.Is(CustomRoles.Mafia) => false,
CustomRoles.Reach when pc.Is(CustomRoles.Mafioso) => false,
- CustomRoles.Trapper when pc.Is(CustomRoles.GuardianAngelTOHE) => false,
+ CustomRoles.Trapper when pc.Is(CustomRoles.GuardianAngelEHR) => false,
CustomRoles.Reach when !pc.CanUseKillButton() => false,
CustomRoles.Magnet when !pc.CanUseKillButton() => false,
CustomRoles.Haste when !pc.CanUseKillButton() => false,
@@ -984,7 +986,7 @@ internal static class CustomRolesHelper
CustomRoles.Unlucky when pc.Is(CustomRoles.Luckey) => false,
CustomRoles.Unlucky when pc.Is(CustomRoles.Lucky) => false,
CustomRoles.Lucky when pc.Is(CustomRoles.Unlucky) => false,
- CustomRoles.Fool when (pc.IsCrewmate() && !Options.CrewCanBeFool.GetBool()) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeFool.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeFool.GetBool()) || pc.Is(CustomRoles.SabotageMaster) || pc.Is(CustomRoles.GuardianAngelTOHE) => false,
+ CustomRoles.Fool when (pc.IsCrewmate() && !Options.CrewCanBeFool.GetBool()) || (pc.GetCustomRole().IsNeutral() && !Options.NeutralCanBeFool.GetBool()) || (pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeFool.GetBool()) || pc.Is(CustomRoles.SabotageMaster) || pc.Is(CustomRoles.GuardianAngelEHR) => false,
CustomRoles.Bloodhound when pc.Is(CustomRoles.Oblivious) => false,
CustomRoles.DoubleShot when (pc.Is(CustomRoleTypes.Impostor) && !Options.ImpCanBeDoubleShot.GetBool()) || (pc.Is(CustomRoleTypes.Crewmate) && !Options.CrewCanBeDoubleShot.GetBool()) || (pc.Is(CustomRoleTypes.Neutral) && !Options.NeutralCanBeDoubleShot.GetBool()) => false,
CustomRoles.DoubleShot when !pc.Is(CustomRoles.EvilGuesser) && !pc.Is(CustomRoles.NiceGuesser) && !Options.GuesserMode.GetBool() => false,
@@ -1224,6 +1226,8 @@ internal static class CustomRolesHelper
AddonTypes.Mixed => Utils.GetRoleColor(CustomRoles.TaskManager),
_ => Palette.CrewmateBlue
};
+
+ public static string ToColoredString(this CustomRoles role) => Utils.ColorString(Utils.GetRoleColor(role), Translator.GetString($"{role}"));
}
public enum RoleOptionType
diff --git a/Modules/CustomTeamManager.cs b/Modules/CustomTeamManager.cs
index c8ec8b458..d421c9b04 100644
--- a/Modules/CustomTeamManager.cs
+++ b/Modules/CustomTeamManager.cs
@@ -51,6 +51,7 @@ namespace EHR.Modules
public static HashSet CustomTeams = [];
public static CustomTeam WinnerTeam;
+ public static Dictionary> CustomTeamPlayerIds = [];
public static void LoadCustomTeams()
{
@@ -70,23 +71,31 @@ namespace EHR.Modules
}
}
+ public static void InitializeCustomTeamPlayers()
+ {
+ if (CustomTeams.Count == 0) return;
+
+ CustomTeamPlayerIds = Main.PlayerStates
+ .IntersectBy(Main.AllAlivePlayerControls.Select(x => x.PlayerId), x => x.Key)
+ .GroupBy(x => CustomTeams.FirstOrDefault(t => t.TeamMembers.Contains(x.Value.MainRole)), x => x.Key)
+ .ToDictionary(x => x.Key, x => x.ToHashSet());
+ }
+
public static bool CheckCustomTeamGameEnd()
{
- if (CustomTeams.Count == 0) return false;
+ if (CustomTeams.Count == 0 || CustomTeamPlayerIds.Count == 0) return false;
- var alivePlayerRoles = Main.PlayerStates
- .IntersectBy(Main.AllAlivePlayerControls.Select(x => x.PlayerId), x => x.Key)
- .ToDictionary(x => x.Key, x => x.Value.MainRole);
-
- var customTeams = alivePlayerRoles
- .GroupBy(x => CustomTeams.FirstOrDefault(t => t.TeamMembers.Contains(alivePlayerRoles[x.Key])), x => x.Key)
- .ToDictionary(x => x.Key, x => x.ToHashSet());
-
- if (customTeams.Count == 1)
+ CustomTeamPlayerIds.Values.Do(x => x.RemoveWhere(p =>
{
- WinnerTeam = customTeams.Keys.First();
+ var pc = Utils.GetPlayerById(p);
+ return pc == null || !pc.IsAlive() || pc.Data.Disconnected;
+ }));
+
+ if (CustomTeamPlayerIds.Count == 1)
+ {
+ WinnerTeam = CustomTeamPlayerIds.Keys.First();
CustomWinnerHolder.ResetAndSetWinner(CustomWinner.CustomTeam);
- CustomWinnerHolder.WinnerIds = customTeams.Values.First();
+ CustomWinnerHolder.WinnerIds = CustomTeamPlayerIds.Values.First();
return true;
}
diff --git a/Modules/DevManager.cs b/Modules/DevManager.cs
index 4a8398d43..79967b91b 100644
--- a/Modules/DevManager.cs
+++ b/Modules/DevManager.cs
@@ -101,7 +101,7 @@ public static class DevManager
DevUserList.Add(new(code: "twainrobin#8089", color: "#0000FF", tag: "啊哈修maker", isUp: false, isDev: false, colorCmd: false, deBug: false, upName: null));
DevUserList.Add(new(code: "mallcasual#6075", color: "#f89ccb", tag: "波奇酱", isUp: false, isDev: false, colorCmd: false, deBug: false, upName: null));
DevUserList.Add(new(code: "beamelfin#9478", color: "#6495ED", tag: "Amaster-1111", isUp: false, isDev: false, colorCmd: false, deBug: false, upName: null));
- DevUserList.Add(new(code: "lordcosy#8966", color: "#FFD6EC", tag: "HostTOHE", isUp: false, isDev: false, colorCmd: false, deBug: false, upName: null)); //K
+ DevUserList.Add(new(code: "lordcosy#8966", color: "#FFD6EC", tag: "HostEHR", isUp: false, isDev: false, colorCmd: false, deBug: false, upName: null)); //K
DevUserList.Add(new(code: "honestsofa#2870", color: "#D381D9", tag: "Discord: SolarFlare#0700", isUp: true, isDev: false, colorCmd: false, deBug: false, upName: "SolarFlare")); //SolarFlare
DevUserList.Add(new(code: "caseeast#7194", color: "#1c2451", tag: "disc.gg/maul", isUp: false, isDev: false, colorCmd: false, deBug: false, upName: null)); //laikrai
// lol hi go away
diff --git a/Modules/GameOptionsSender/PlayerGameOptionsSender.cs b/Modules/GameOptionsSender/PlayerGameOptionsSender.cs
index 1f02807b4..52e8f5ac4 100644
--- a/Modules/GameOptionsSender/PlayerGameOptionsSender.cs
+++ b/Modules/GameOptionsSender/PlayerGameOptionsSender.cs
@@ -166,11 +166,11 @@ public class PlayerGameOptionsSender(PlayerControl player) : GameOptionsSender
switch (role)
{
- case CustomRoles.ShapeshifterTOHE:
+ case CustomRoles.ShapeshifterEHR:
AURoleOptions.ShapeshifterCooldown = Options.ShapeshiftCD.GetFloat();
AURoleOptions.ShapeshifterDuration = Options.ShapeshiftDur.GetFloat();
break;
- case CustomRoles.ScientistTOHE:
+ case CustomRoles.ScientistEHR:
AURoleOptions.ScientistCooldown = Options.ScientistCD.GetFloat();
AURoleOptions.ScientistBatteryCharge = Options.ScientistDur.GetFloat();
break;
diff --git a/Modules/GuessManager.cs b/Modules/GuessManager.cs
index cb22f8cbe..6148b4295 100644
--- a/Modules/GuessManager.cs
+++ b/Modules/GuessManager.cs
@@ -1067,7 +1067,7 @@ public static class GuessManager
or CustomRoles.SuperStar
or CustomRoles.Konan
or CustomRoles.Oblivious
- or CustomRoles.GuardianAngelTOHE
+ or CustomRoles.GuardianAngelEHR
) continue;
if (!role.IsEnable() && !role.RoleExist(countDead: true) && !role.IsConverted()) continue;
diff --git a/Modules/NameColorManager.cs b/Modules/NameColorManager.cs
index 142c05555..70803f7f9 100644
--- a/Modules/NameColorManager.cs
+++ b/Modules/NameColorManager.cs
@@ -128,7 +128,7 @@ public static class NameColorManager
CustomRoles.Sidekick when target.Is(CustomRoles.Sidekick) && Options.SidekickKnowOtherSidekick.GetBool() => Main.RoleColors[CustomRoles.Jackal],
CustomRoles.Sidekick when target.Is(CustomRoles.Recruit) && Options.SidekickKnowOtherSidekick.GetBool() => Main.RoleColors[CustomRoles.Jackal],
CustomRoles.Jackal when target.Is(CustomRoles.Recruit) => Main.RoleColors[CustomRoles.Jackal],
- CustomRoles.Refugee when target.Is(CustomRoleTypes.Impostor) => Main.RoleColors[CustomRoles.ImpostorTOHE],
+ CustomRoles.Refugee when target.Is(CustomRoleTypes.Impostor) => Main.RoleColors[CustomRoles.ImpostorEHR],
CustomRoles.HeadHunter when ((HeadHunter)Main.PlayerStates[seer.PlayerId].Role).Targets.Contains(target.PlayerId) => "000000",
CustomRoles.BountyHunter when (Main.PlayerStates[seer.PlayerId].Role as BountyHunter)?.GetTarget(seer) == target.PlayerId => "000000",
CustomRoles.Pyromaniac when ((Pyromaniac)Main.PlayerStates[seer.PlayerId].Role).DousedList.Contains(target.PlayerId) => "#BA4A00",
diff --git a/Modules/OptionHolder.cs b/Modules/OptionHolder.cs
index 044da6b28..621803121 100644
--- a/Modules/OptionHolder.cs
+++ b/Modules/OptionHolder.cs
@@ -27,6 +27,7 @@ public enum CustomGameMode
public static class Options
{
static Task taskOptionsLoad;
+ public static Dictionary GroupedOptions = [];
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.Initialize)), HarmonyPostfix]
public static void OptionsLoadStart()
@@ -34,7 +35,19 @@ public static class Options
Logger.Info("Options.Load Start", "Options");
Main.LoadRoleClasses();
taskOptionsLoad = Task.Run(Load);
- taskOptionsLoad.ContinueWith(t => { Logger.Info("Options.Load End", "Load Options"); });
+ taskOptionsLoad.ContinueWith(_ =>
+ {
+ Logger.Info("Options.Load End", "Load Options");
+ GroupOptions();
+ });
+ }
+
+ public static void GroupOptions()
+ {
+ GroupedOptions = OptionItem.AllOptions
+ .GroupBy(x => x.Tab)
+ .OrderBy(x => (int)x.Key)
+ .ToDictionary(x => x.Key, x => x.ToArray());
}
//[HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start)), HarmonyPostfix]
//public static void WaitOptionsLoad()
@@ -44,7 +57,6 @@ public static class Options
// //Logger.Info("Options.Load End", "Options");
//}
- // プリセット
//private static readonly string[] presets =
//[
// Main.Preset1.Value,
@@ -54,7 +66,6 @@ public static class Options
// Main.Preset5.Value
//];
- // ゲームモード
public static OptionItem GameMode;
public static CustomGameMode CurrentGameMode
@@ -68,7 +79,7 @@ public static class Options
_ => CustomGameMode.Standard
};
- public static readonly string[] gameModes =
+ public static readonly string[] GameModes =
[
"Standard",
"SoloKombat",
@@ -78,14 +89,13 @@ public static class Options
"HideAndSeek"
];
- // 役職数・確率
public static Dictionary roleCounts;
public static Dictionary roleSpawnChances;
public static Dictionary CustomRoleCounts;
public static Dictionary CustomRoleSpawnChances;
public static Dictionary CustomAdtRoleSpawnRate;
- public static readonly string[] rates =
+ public static readonly string[] Rates =
[
"Rate0",
"Rate5",
@@ -110,7 +120,7 @@ public static class Options
"Rate100",
];
- public static readonly string[] ratesZeroOne =
+ public static readonly string[] RatesZeroOne =
[
"RoleOff", /*"Rate10", "Rate20", "Rate30", "Rate40", "Rate50",
"Rate60", "Rate70", "Rate80", "Rate90", */
@@ -723,7 +733,7 @@ public static class Options
public static OptionItem DisableAirshipGapRoomLightsPanel;
public static OptionItem DisableAirshipCargoLightsPanel;
- //Guesser Mode//
+ // Guesser Mode
public static OptionItem GuesserMode;
public static OptionItem CrewmatesCanGuess;
public static OptionItem ImpostorsCanGuess;
@@ -745,7 +755,7 @@ public static class Options
public static OptionItem AprilFoolsMode;
- // 投票モード
+ // Voting Modes
public static OptionItem VoteMode;
public static OptionItem WhenSkipVote;
public static OptionItem WhenSkipVoteIgnoreFirstMeeting;
@@ -754,7 +764,7 @@ public static class Options
public static OptionItem WhenNonVote;
public static OptionItem WhenTie;
- public static readonly string[] voteModes =
+ public static readonly string[] VoteModes =
[
"Default",
"Suicide",
@@ -762,7 +772,7 @@ public static class Options
"Skip"
];
- public static readonly string[] tieModes =
+ public static readonly string[] TieModes =
[
"TieMode.Default",
"TieMode.All",
@@ -773,21 +783,21 @@ public static class Options
{
"GuesserMode.All", "GuesserMode.Harmful", "GuesserMode.Random"
}; */
- public static readonly string[] madmateSpawnMode =
+ public static readonly string[] MadmateSpawnModeStrings =
[
"MadmateSpawnMode.Assign",
"MadmateSpawnMode.FirstKill",
"MadmateSpawnMode.SelfVote",
];
- public static readonly string[] madmateCountMode =
+ public static readonly string[] MadmateCountModeStrings =
[
"MadmateCountMode.None",
"MadmateCountMode.Imp",
"MadmateCountMode.Crew",
];
- public static readonly string[] sidekickCountMode =
+ public static readonly string[] SidekickCountMode =
[
"SidekickCountMode.Jackal",
"SidekickCountMode.None",
@@ -925,7 +935,7 @@ public static class Options
public static OptionItem DumpLogAfterGameEnd;
- public static readonly string[] suffixModes =
+ public static readonly string[] SuffixModes =
[
"SuffixMode.None",
"SuffixMode.Version",
@@ -938,7 +948,7 @@ public static class Options
"SuffixMode.AutoHost"
];
- public static readonly string[] roleAssigningAlgorithms =
+ public static readonly string[] RoleAssigningAlgorithms =
[
"RoleAssigningAlgorithm.Default",
"RoleAssigningAlgorithm.NetRandom",
@@ -947,7 +957,7 @@ public static class Options
"RoleAssigningAlgorithm.MersenneTwister",
];
- public static readonly string[] formatNameModes =
+ public static readonly string[] FormatNameModes =
[
"FormatNameModes.None",
"FormatNameModes.Color",
@@ -1019,7 +1029,7 @@ public static class Options
.SetColor(new Color32(255, 235, 4, byte.MaxValue))
.SetHeader(true);
- GameMode = StringOptionItem.Create(1, "GameMode", gameModes, 0, TabGroup.GameSettings, false)
+ GameMode = StringOptionItem.Create(1, "GameMode", GameModes, 0, TabGroup.GameSettings, false)
.SetHeader(true);
#region Settings
@@ -1236,17 +1246,13 @@ public static class Options
#endregion
- #region TOHESettings
+ #region EHRSettings
MainLoadingText = "Building EHR settings";
KickLowLevelPlayer = IntegerOptionItem.Create(19300, "KickLowLevelPlayer", new(0, 100, 1), 0, TabGroup.SystemSettings, false)
.SetValueFormat(OptionFormat.Level)
.SetHeader(true);
- EnableKillerLeftCommand = BooleanOptionItem.Create(44428, "EnableKillerLeftCommand", true, TabGroup.SystemSettings, false)
- .SetColor(Color.green);
- SeeEjectedRolesInMeeting = BooleanOptionItem.Create(44429, "SeeEjectedRolesInMeeting", true, TabGroup.SystemSettings, false)
- .SetColor(Color.green);
KickAndroidPlayer = BooleanOptionItem.Create(19301, "KickAndroidPlayer", false, TabGroup.SystemSettings, false);
KickPlayerFriendCodeNotExist = BooleanOptionItem.Create(19302, "KickPlayerFriendCodeNotExist", false, TabGroup.SystemSettings, true);
ApplyDenyNameList = BooleanOptionItem.Create(19303, "ApplyDenyNameList", true, TabGroup.SystemSettings, true);
@@ -1315,14 +1321,14 @@ public static class Options
AutoDisplayLastAddOns = BooleanOptionItem.Create(19328, "AutoDisplayLastAddOns", true, TabGroup.SystemSettings, false);
AutoDisplayLastResult = BooleanOptionItem.Create(19323, "AutoDisplayLastResult", true, TabGroup.SystemSettings, false);
- SuffixMode = StringOptionItem.Create(19324, "SuffixMode", suffixModes, 0, TabGroup.SystemSettings, true)
+ SuffixMode = StringOptionItem.Create(19324, "SuffixMode", SuffixModes, 0, TabGroup.SystemSettings, true)
.SetHeader(true);
HideGameSettings = BooleanOptionItem.Create(19400, "HideGameSettings", false, TabGroup.SystemSettings, false);
DIYGameSettings = BooleanOptionItem.Create(19401, "DIYGameSettings", false, TabGroup.SystemSettings, false);
PlayerCanSetColor = BooleanOptionItem.Create(19402, "PlayerCanSetColor", false, TabGroup.SystemSettings, false);
PlayerCanSetName = BooleanOptionItem.Create(19410, "PlayerCanSetName", false, TabGroup.SystemSettings, false);
PlayerCanTPInAndOut = BooleanOptionItem.Create(19411, "PlayerCanTPInAndOut", false, TabGroup.SystemSettings, false);
- FormatNameMode = StringOptionItem.Create(19403, "FormatNameMode", formatNameModes, 0, TabGroup.SystemSettings, false);
+ FormatNameMode = StringOptionItem.Create(19403, "FormatNameMode", FormatNameModes, 0, TabGroup.SystemSettings, false);
DisableEmojiName = BooleanOptionItem.Create(19404, "DisableEmojiName", true, TabGroup.SystemSettings, false);
ChangeNameToRoleInfo = BooleanOptionItem.Create(19405, "ChangeNameToRoleInfo", true, TabGroup.SystemSettings, false);
SendRoleDescriptionFirstMeeting = BooleanOptionItem.Create(19406, "SendRoleDescriptionFirstMeeting", true, TabGroup.SystemSettings, false);
@@ -1330,7 +1336,7 @@ public static class Options
.SetColor(Color.red);
AllowConsole = BooleanOptionItem.Create(19408, "AllowConsole", false, TabGroup.SystemSettings, false)
.SetColor(Color.red);
- RoleAssigningAlgorithm = StringOptionItem.Create(19409, "RoleAssigningAlgorithm", roleAssigningAlgorithms, 4, TabGroup.SystemSettings, true)
+ RoleAssigningAlgorithm = StringOptionItem.Create(19409, "RoleAssigningAlgorithm", RoleAssigningAlgorithms, 4, TabGroup.SystemSettings, true)
.RegisterUpdateValueEvent((_, args) => IRandom.SetInstanceById(args.CurrentValue));
KPDCamouflageMode = StringOptionItem.Create(19500, "KPDCamouflageMode", CamouflageMode, 0, TabGroup.SystemSettings, false)
.SetHeader(true)
@@ -1999,7 +2005,7 @@ public static class Options
LoadingPercentage = 89;
- //Disable Divert Power, Weather Nodes and etc. situational Tasks
+ //Disable Divert Power, Weather Nodes etc. situational Tasks
DisableOtherTasks = BooleanOptionItem.Create(23200, "DisableOtherTasks", false, TabGroup.TaskSettings, false)
.SetGameMode(CustomGameMode.Standard)
.SetColor(new Color32(239, 89, 175, byte.MaxValue));
@@ -2091,6 +2097,12 @@ public static class Options
.SetParent(AllAliveMeeting)
.SetValueFormat(OptionFormat.Seconds);
+ EnableKillerLeftCommand = BooleanOptionItem.Create(44428, "EnableKillerLeftCommand", true, TabGroup.GameSettings, false)
+ .SetColor(new Color32(147, 241, 240, byte.MaxValue));
+
+ SeeEjectedRolesInMeeting = BooleanOptionItem.Create(44429, "SeeEjectedRolesInMeeting", true, TabGroup.GameSettings, false)
+ .SetColor(new Color32(147, 241, 240, byte.MaxValue));
+
LoadingPercentage = 94;
@@ -2111,7 +2123,7 @@ public static class Options
VoteMode = BooleanOptionItem.Create(23600, "VoteMode", false, TabGroup.GameSettings, false)
.SetColor(new Color32(147, 241, 240, byte.MaxValue))
.SetGameMode(CustomGameMode.Standard);
- WhenSkipVote = StringOptionItem.Create(23610, "WhenSkipVote", voteModes[..3], 0, TabGroup.GameSettings, false)
+ WhenSkipVote = StringOptionItem.Create(23610, "WhenSkipVote", VoteModes[..3], 0, TabGroup.GameSettings, false)
.SetParent(VoteMode)
.SetGameMode(CustomGameMode.Standard);
WhenSkipVoteIgnoreFirstMeeting = BooleanOptionItem.Create(23611, "WhenSkipVoteIgnoreFirstMeeting", false, TabGroup.GameSettings, false)
@@ -2123,10 +2135,10 @@ public static class Options
WhenSkipVoteIgnoreEmergency = BooleanOptionItem.Create(23613, "WhenSkipVoteIgnoreEmergency", false, TabGroup.GameSettings, false)
.SetParent(WhenSkipVote)
.SetGameMode(CustomGameMode.Standard);
- WhenNonVote = StringOptionItem.Create(23700, "WhenNonVote", voteModes, 0, TabGroup.GameSettings, false)
+ WhenNonVote = StringOptionItem.Create(23700, "WhenNonVote", VoteModes, 0, TabGroup.GameSettings, false)
.SetParent(VoteMode)
.SetGameMode(CustomGameMode.Standard);
- WhenTie = StringOptionItem.Create(23750, "WhenTie", tieModes, 0, TabGroup.GameSettings, false)
+ WhenTie = StringOptionItem.Create(23750, "WhenTie", TieModes, 0, TabGroup.GameSettings, false)
.SetParent(VoteMode)
.SetGameMode(CustomGameMode.Standard);
@@ -2139,7 +2151,7 @@ public static class Options
LadderDeath = BooleanOptionItem.Create(23800, "LadderDeath", false, TabGroup.GameSettings, false)
.SetColor(new Color32(193, 255, 209, byte.MaxValue));
- LadderDeathChance = StringOptionItem.Create(23810, "LadderDeathChance", rates[1..], 0, TabGroup.GameSettings, false)
+ LadderDeathChance = StringOptionItem.Create(23810, "LadderDeathChance", Rates[1..], 0, TabGroup.GameSettings, false)
.SetParent(LadderDeath);
LoadingPercentage = 97;
@@ -2200,7 +2212,7 @@ public static class Options
public static void SetupRoleOptions(int id, TabGroup tab, CustomRoles role, CustomGameMode customGameMode = CustomGameMode.Standard, bool zeroOne = false)
{
- var spawnOption = StringOptionItem.Create(id, role.ToString(), zeroOne ? ratesZeroOne : rates, 0, tab, false).SetColor(Utils.GetRoleColor(role))
+ var spawnOption = StringOptionItem.Create(id, role.ToString(), zeroOne ? RatesZeroOne : Rates, 0, tab, false).SetColor(Utils.GetRoleColor(role))
.SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem;
@@ -2216,7 +2228,7 @@ public static class Options
public static void SetupAdtRoleOptions(int id, CustomRoles role, CustomGameMode customGameMode = CustomGameMode.Standard, bool canSetNum = false, TabGroup tab = TabGroup.Addons, bool canSetChance = true)
{
- var spawnOption = StringOptionItem.Create(id, role.ToString(), ratesZeroOne, 0, tab, false).SetColor(Utils.GetRoleColor(role))
+ var spawnOption = StringOptionItem.Create(id, role.ToString(), RatesZeroOne, 0, tab, false).SetColor(Utils.GetRoleColor(role))
.SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem;
@@ -2239,7 +2251,7 @@ public static class Options
public static void SetupSingleRoleOptions(int id, TabGroup tab, CustomRoles role, int count = 1, CustomGameMode customGameMode = CustomGameMode.Standard, bool zeroOne = false, bool hideMaxSetting = true)
{
- var spawnOption = StringOptionItem.Create(id, role.ToString(), zeroOne ? ratesZeroOne : rates, 0, tab, false).SetColor(Utils.GetRoleColor(role))
+ var spawnOption = StringOptionItem.Create(id, role.ToString(), zeroOne ? RatesZeroOne : Rates, 0, tab, false).SetColor(Utils.GetRoleColor(role))
.SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem;
diff --git a/Modules/OptionItem/OptionItem.cs b/Modules/OptionItem/OptionItem.cs
index a37beb9ab..3de4d32d4 100644
--- a/Modules/OptionItem/OptionItem.cs
+++ b/Modules/OptionItem/OptionItem.cs
@@ -247,7 +247,7 @@ public abstract class OptionItem
{
CurrentPreset = Math.Clamp(newPreset, 0, NumPresets - 1);
- foreach (OptionItem op in AllOptions.ToArray())
+ foreach (OptionItem op in AllOptions)
{
op.Refresh();
}
diff --git a/Modules/OptionItem/StringOptionItem.cs b/Modules/OptionItem/StringOptionItem.cs
index eb7375f47..0576b7693 100644
--- a/Modules/OptionItem/StringOptionItem.cs
+++ b/Modules/OptionItem/StringOptionItem.cs
@@ -1,20 +1,23 @@
+using System;
+using System.Linq;
+
namespace EHR;
-public class StringOptionItem(int id, string name, int defaultValue, TabGroup tab, bool isSingleValue, string[] selections) : OptionItem(id, name, defaultValue, tab, isSingleValue)
+public class StringOptionItem(int id, string name, int defaultValue, TabGroup tab, bool isSingleValue, string[] selections, bool noTranslation = false) : OptionItem(id, name, defaultValue, tab, isSingleValue)
{
- // 必須情報
public IntegerValueRule Rule = (0, selections.Length - 1, 1);
public string[] Selections = selections;
- public static StringOptionItem Create(int id, string name, string[] selections, int defaultIndex, TabGroup tab, bool isSingleValue)
- => new(id, name, defaultIndex, tab, isSingleValue, selections);
+ public static StringOptionItem Create(int id, string name, string[] selections, int defaultIndex, TabGroup tab, bool isSingleValue, bool noTranslation = false)
+ => new(id, name, defaultIndex, tab, isSingleValue, selections, noTranslation);
// Getter
public override int GetInt() => Rule.GetValueByIndex(CurrentValue);
public override float GetFloat() => Rule.GetValueByIndex(CurrentValue);
public override string GetString()
{
- return Translator.GetString(Selections[Rule.GetValueByIndex(CurrentValue)]);
+ var str = Selections[Rule.GetValueByIndex(CurrentValue)];
+ return noTranslation ? str : Translator.GetString(str);
}
public int GetChance()
{
@@ -25,7 +28,7 @@ public class StringOptionItem(int id, string name, int defaultValue, TabGroup ta
if (Selections.Length == 3) return CurrentValue;
//For 0% to 100% or 5% to 100%
- var offset = Options.rates.Length - Selections.Length;
+ var offset = Options.Rates.Length - Selections.Length;
var index = CurrentValue + offset;
var rate = index * 5;
return rate;
diff --git a/Modules/OptionSaver.cs b/Modules/OptionSaver.cs
index 221dfd37b..7bf495509 100644
--- a/Modules/OptionSaver.cs
+++ b/Modules/OptionSaver.cs
@@ -45,7 +45,7 @@ public static class OptionSaver
{
Dictionary singleOptions = [];
Dictionary presetOptions = [];
- foreach (OptionItem option in OptionItem.AllOptions.ToArray())
+ foreach (OptionItem option in OptionItem.AllOptions)
{
if (option.IsSingleValue)
{
diff --git a/Modules/OptionShower.cs b/Modules/OptionShower.cs
index b0c846417..17da19e7d 100644
--- a/Modules/OptionShower.cs
+++ b/Modules/OptionShower.cs
@@ -59,12 +59,14 @@ public static class OptionShower
ShowChildren(kvp.Value, ref sb, Utils.GetRoleColor(kvp.Key).ShadeColor(-0.5f), 1);
}
- foreach (var opt in OptionItem.AllOptions.Where(x => x.Id is >= 90000 and (< 600000 or > 700000) && !x.IsHiddenOn(Options.CurrentGameMode) && x.Parent == null && !x.IsText))
+ foreach (var opt in OptionItem.AllOptions)
{
- if (opt.IsHeader) sb.Append('\n');
- sb.Append($"{opt.GetName()}: {opt.GetString()}\n");
- if (opt.GetBool())
- ShowChildren(opt, ref sb, Color.white, 1);
+ if (opt.Id is >= 90000 and (< 600000 or > 700000) && !opt.IsHiddenOn(Options.CurrentGameMode) && opt.Parent == null && !opt.IsText)
+ {
+ if (opt.IsHeader) sb.Append('\n');
+ sb.Append($"{opt.GetName()}: {opt.GetString()}\n");
+ if (opt.GetBool()) ShowChildren(opt, ref sb, Color.white, 1);
+ }
}
}
diff --git a/Modules/RPC.cs b/Modules/RPC.cs
index 912c53c6b..93fca1db7 100644
--- a/Modules/RPC.cs
+++ b/Modules/RPC.cs
@@ -730,15 +730,6 @@ internal static class RPC
}
}
- /*
- public static void SyncCustomSettingsRPCforOneOption(OptionItem option)
- {
- List allOptions = new(OptionItem.AllOptions);
- var placement = allOptions.IndexOf(option);
- if (placement != -1)
- SyncOptionsBetween(placement, placement, OptionItem.AllOptions.Count);
- }
- */
static void SyncOptionsBetween(int startAmount, int lastAmount, int targetId = -1)
{
if (targetId != -1)
diff --git a/Modules/Utils.cs b/Modules/Utils.cs
index 8fb6e47bb..9fb81b8a0 100644
--- a/Modules/Utils.cs
+++ b/Modules/Utils.cs
@@ -1601,6 +1601,7 @@ public static class Utils
if (!AmongUsClient.Instance.AmHost) return;
if (title == "") title = "" + GetString("DefaultSystemMessageTitle") + "";
text = text.Replace("color=", string.Empty);
+
Main.MessagesToSend.Add((text.RemoveHtmlTagsTemplate(), sendTo, title));
}
@@ -2374,6 +2375,7 @@ public static class Utils
int CD = role switch
{
+ CustomRoles.Mole => 5,
CustomRoles.Doormaster => Doormaster.VentCooldown.GetInt(),
CustomRoles.Tether => Tether.VentCooldown.GetInt(),
CustomRoles.Mayor => (int)Math.Round(Options.DefaultKillCooldown),
@@ -2565,6 +2567,7 @@ public static class Utils
Bloodhound.OnPlayerDead(target);
Tracefinder.OnPlayerDead(target);
Vulture.OnPlayerDead(target);
+ Tracker.OnPlayerDeath(target);
FixedUpdatePatch.LoversSuicide(target.PlayerId, onMeeting);
}
diff --git a/Patches/ChatCommandPatch.cs b/Patches/ChatCommandPatch.cs
index 6ec026472..76d5c26a2 100644
--- a/Patches/ChatCommandPatch.cs
+++ b/Patches/ChatCommandPatch.cs
@@ -274,14 +274,14 @@ internal class ChatCommands
if (Main.AlwaysSpawnTogetherCombos.Count > 0)
{
sb.AppendLine(GetString("AlwaysComboListTitle"));
- sb.AppendLine(Main.AlwaysSpawnTogetherCombos.Join(x => $"{Utils.ColorString(Utils.GetRoleColor(x.Key), GetString($"{x.Key}"))} \u00a7 {Utils.ColorString(Utils.GetRoleColor(x.Value), GetString($"{x.Value}"))}", "\n"));
+ sb.AppendLine(Main.AlwaysSpawnTogetherCombos.Join(x => $"{x.Key.ToColoredString()} \u00a7 {x.Value.ToColoredString()}", "\n"));
sb.AppendLine();
}
if (Main.NeverSpawnTogetherCombos.Count > 0)
{
sb.AppendLine(GetString("NeverComboListTitle"));
- sb.AppendLine(Main.NeverSpawnTogetherCombos.Join(x => $"{Utils.ColorString(Utils.GetRoleColor(x.Key), GetString($"{x.Key}"))} \u2194 {Utils.ColorString(Utils.GetRoleColor(x.Value), GetString($"{x.Value}"))}", "\n"));
+ sb.AppendLine(Main.NeverSpawnTogetherCombos.Join(x => $"{x.Key.ToColoredString()} \u2194 {x.Value.ToColoredString()}", "\n"));
sb.AppendLine();
}
@@ -326,10 +326,6 @@ internal class ChatCommands
break;
- case "/xor":
-
- break;
-
case "/eff":
case "/effect":
canceled = true;
diff --git a/Patches/CheckGameEndPatch.cs b/Patches/CheckGameEndPatch.cs
index 8bce68cf7..fbbe4ccb8 100644
--- a/Patches/CheckGameEndPatch.cs
+++ b/Patches/CheckGameEndPatch.cs
@@ -357,7 +357,6 @@ class GameEndChecker
if (Main.AllAlivePlayerControls.All(p => p.Is(CustomRoles.Lovers)))
{
- reason = GameOverReason.ImpostorByKill;
ResetAndSetWinner(CustomWinner.Lovers);
return true;
}
diff --git a/Patches/GameOptionsMenuPatch.cs b/Patches/GameOptionsMenuPatch.cs
index 46ae66c16..a0ecdb061 100644
--- a/Patches/GameOptionsMenuPatch.cs
+++ b/Patches/GameOptionsMenuPatch.cs
@@ -37,29 +37,32 @@ public static class GameOptionsMenuPatch
{
public static void Postfix(GameOptionsMenu __instance)
{
- foreach (OptionBehaviour ob in __instance.Children)
+ _ = new LateTask(() =>
{
- switch (ob.Title)
+ foreach (OptionBehaviour ob in __instance.Children)
{
- case StringNames.GameVotingTime:
- ob.Cast().ValidRange = new(0, 600);
- break;
- case StringNames.GameShortTasks:
- case StringNames.GameLongTasks:
- case StringNames.GameCommonTasks:
- ob.Cast().ValidRange = new(0, 90);
- break;
- case StringNames.GameKillCooldown:
- ob.Cast().ValidRange = new(0, 180);
- ob.Cast().Increment = 0.5f;
- break;
- case StringNames.GamePlayerSpeed:
- case StringNames.GameCrewLight:
- case StringNames.GameImpostorLight:
- ob.Cast().Increment = 0.05f;
- break;
+ switch (ob.Title)
+ {
+ case StringNames.GameVotingTime:
+ ob.Cast().ValidRange = new(0, 600);
+ break;
+ case StringNames.GameShortTasks:
+ case StringNames.GameLongTasks:
+ case StringNames.GameCommonTasks:
+ ob.Cast().ValidRange = new(0, 90);
+ break;
+ case StringNames.GameKillCooldown:
+ ob.Cast().ValidRange = new(0, 180);
+ ob.Cast().Increment = 0.5f;
+ break;
+ case StringNames.GamePlayerSpeed:
+ case StringNames.GameCrewLight:
+ case StringNames.GameImpostorLight:
+ ob.Cast().Increment = 0.05f;
+ break;
+ }
}
- }
+ }, 2f, log: false);
var template = Object.FindObjectsOfType().FirstOrDefault();
if (template == null) return;
@@ -81,7 +84,9 @@ public static class GameOptionsMenuPatch
var gameTab = GameObject.Find("GameTab");
System.Collections.Generic.List tabs = [gameTab, roleTab];
- foreach (var tab in EnumHelper.GetAllValues())
+ float delay = 0f;
+
+ foreach ((TabGroup tab, OptionItem[] optionItems) in Options.GroupedOptions)
{
var obj = gameSettings.transform.parent.Find(tab + "Tab");
if (obj != null)
@@ -92,56 +97,72 @@ public static class GameOptionsMenuPatch
var tohSettings = Object.Instantiate(gameSettings, gameSettings.transform.parent);
tohSettings.name = tab + "Tab";
- tohSettings.transform.FindChild("BackPanel").transform.localScale =
+ var backPanel = tohSettings.transform.FindChild("BackPanel");
+ backPanel.transform.localScale =
tohSettings.transform.FindChild("Bottom Gradient").transform.localScale = new(1.6f, 1f, 1f);
- tohSettings.transform.FindChild("BackPanel").transform.localPosition += new Vector3(0.2f, 0f, 0f);
+ backPanel.transform.localPosition += new Vector3(0.2f, 0f, 0f);
tohSettings.transform.FindChild("Bottom Gradient").transform.localPosition += new Vector3(0.2f, 0f, 0f);
tohSettings.transform.FindChild("Background").transform.localScale = new(1.8f, 1f, 1f);
tohSettings.transform.FindChild("UI_Scrollbar").transform.localPosition += new Vector3(1.4f, 0f, 0f);
tohSettings.transform.FindChild("UI_ScrollbarTrack").transform.localPosition += new Vector3(1.4f, 0f, 0f);
tohSettings.transform.FindChild("GameGroup/SliderInner").transform.localPosition += new Vector3(-0.3f, 0f, 0f);
+
var tohMenu = tohSettings.transform.FindChild("GameGroup/SliderInner").GetComponent();
- tohMenu.GetComponentsInChildren().Do(x => Object.Destroy(x.gameObject));
-
var scOptions = new System.Collections.Generic.List();
- foreach (OptionItem option in OptionItem.AllOptions)
+
+ _ = new LateTask(() =>
{
- if (option.Tab != tab) continue;
- if (option.OptionBehaviour == null)
+ tohMenu.GetComponentsInChildren().Do(x => Object.Destroy(x.gameObject));
+
+ foreach (OptionItem option in optionItems)
{
- float yoffset = option.IsText ? 100f : 0f;
- var stringOption = Object.Instantiate(template, tohMenu.transform);
- scOptions.Add(stringOption);
- stringOption.OnValueChanged = new Action(_ => { });
- stringOption.TitleText.text = option.Name;
- stringOption.Value = stringOption.oldValue = option.CurrentValue;
- stringOption.ValueText.text = option.GetString();
- stringOption.name = option.Name;
- var bg = stringOption.transform.FindChild("Background");
- bg.localScale = new(1.6f, 1f, 1f);
- if (Main.DarkTheme.Value) bg.GetComponent().color = new(0f, 0f, 0f, 1f);
- stringOption.transform.FindChild("Plus_TMP").localPosition += new Vector3(1.4f, yoffset, 0f);
- stringOption.transform.FindChild("Minus_TMP").localPosition += new Vector3(1.0f, yoffset, 0f);
- stringOption.transform.FindChild("Value_TMP").localPosition += new Vector3(1.2f, yoffset, 0f);
- stringOption.transform.FindChild("Value_TMP").GetComponent().sizeDelta = new(1.6f, 0.26f);
- stringOption.transform.FindChild("Title_TMP").localPosition += new Vector3(option.IsText ? 0.25f : 0.1f, option.IsText ? -0.1f : 0f, 0f);
- stringOption.transform.FindChild("Title_TMP").GetComponent().sizeDelta = new(5.5f, 0.37f);
+ if (option.OptionBehaviour == null)
+ {
+ float yoffset = option.IsText ? 100f : 0f;
+ var stringOption = Object.Instantiate(template, tohMenu.transform);
+ scOptions.Add(stringOption);
- option.OptionBehaviour = stringOption;
+ stringOption.OnValueChanged = new Action(_ => { });
+ stringOption.TitleText.text = option.Name;
+ stringOption.Value = stringOption.oldValue = option.CurrentValue;
+ stringOption.ValueText.text = option.GetString();
+ stringOption.name = option.Name;
+
+ var bg = stringOption.transform.FindChild("Background");
+ bg.localScale = new(1.6f, 1f, 1f);
+ if (Main.DarkTheme.Value) bg.GetComponent().color = new(0f, 0f, 0f, 1f);
+
+ stringOption.transform.FindChild("Plus_TMP").localPosition += new Vector3(1.4f, yoffset, 0f);
+ stringOption.transform.FindChild("Minus_TMP").localPosition += new Vector3(1.0f, yoffset, 0f);
+
+ var valueTMP = stringOption.transform.FindChild("Value_TMP");
+ valueTMP.localPosition += new Vector3(1.2f, yoffset, 0f);
+ valueTMP.GetComponent().sizeDelta = new(1.6f, 0.26f);
+
+ var titleTMP = stringOption.transform.FindChild("Title_TMP");
+ titleTMP.localPosition += new Vector3(option.IsText ? 0.25f : 0.1f, option.IsText ? -0.1f : 0f, 0f);
+ titleTMP.GetComponent().sizeDelta = new(5.5f, 0.37f);
+
+ option.OptionBehaviour = stringOption;
+ }
+
+ option.OptionBehaviour.gameObject.SetActive(true);
}
+ }, delay, log: false);
- option.OptionBehaviour.gameObject.SetActive(true);
- }
+ delay += 0.1f;
tohMenu.Children = scOptions.ToArray();
+
tohSettings.gameObject.SetActive(false);
menus.Add(tohSettings.gameObject);
var tohTab = Object.Instantiate(roleTab, roleTab.transform.parent);
- tohTab.transform.FindChild("Hat Button").FindChild("Icon").GetComponent().sprite = Utils.LoadSprite($"EHR.Resources.Images.TabIcon_{tab}.png", 100f);
+ var hatButton = tohTab.transform.FindChild("Hat Button");
+ hatButton.FindChild("Icon").GetComponent().sprite = Utils.LoadSprite($"EHR.Resources.Images.TabIcon_{tab}.png", 100f);
tabs.Add(tohTab);
- var tohTabHighlight = tohTab.transform.FindChild("Hat Button").FindChild("Tab Background").GetComponent();
+ var tohTabHighlight = hatButton.FindChild("Tab Background").GetComponent();
highlights.Add(tohTabHighlight);
}
@@ -176,7 +197,8 @@ public class GameOptionsMenuUpdatePatch
public static void Postfix(GameOptionsMenu __instance)
{
if (__instance.transform.parent.parent.name == "Game Settings") return;
- foreach (var tab in EnumHelper.GetAllValues())
+
+ foreach ((TabGroup tab, OptionItem[] optionItems) in Options.GroupedOptions)
{
string tabcolor = tab switch
{
@@ -199,9 +221,8 @@ public class GameOptionsMenuUpdatePatch
var offset = 2.7f;
- foreach (OptionItem option in OptionItem.AllOptions)
+ foreach (OptionItem option in optionItems)
{
- if (tab != option.Tab) continue;
if (option.OptionBehaviour == null || option.OptionBehaviour.gameObject == null) continue;
var parent = option.Parent;
diff --git a/Patches/GameStartManagerPatch.cs b/Patches/GameStartManagerPatch.cs
index 9ad36a884..f850e4ba1 100644
--- a/Patches/GameStartManagerPatch.cs
+++ b/Patches/GameStartManagerPatch.cs
@@ -65,7 +65,7 @@ public class GameStartManagerPatch
cancelButton.transform.localPosition = new(0f, -0.36f, 0f); //new(0f, 0.1f, 0f);
var buttonComponent = cancelButton.GetComponent();
buttonComponent.OnClick = new();
- buttonComponent.OnClick.AddListener((Action)(() => __instance.ResetStartState()));
+ buttonComponent.OnClick.AddListener((Action)(__instance.ResetStartState));
cancelButton.gameObject.SetActive(false);
if (!AmongUsClient.Instance.AmHost) return;
diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs
index 3436629fd..20edb5453 100644
--- a/Patches/IntroPatch.cs
+++ b/Patches/IntroPatch.cs
@@ -180,7 +180,7 @@ class BeginCrewmatePatch
return true;
}
- public static void Postfix(IntroCutscene __instance /*, ref Il2CppSystem.Collections.Generic.List teamToDisplay*/)
+ public static void Postfix(IntroCutscene __instance, ref List teamToDisplay)
{
CustomRoles role = PlayerControl.LocalPlayer.GetCustomRole();
@@ -306,7 +306,7 @@ class BeginCrewmatePatch
CustomRoles.SabotageMaster or
CustomRoles.Engineer or
- CustomRoles.EngineerTOHE or
+ CustomRoles.EngineerEHR or
CustomRoles.Inhibitor or
CustomRoles.Saboteur or
CustomRoles.SecurityGuard or
@@ -401,6 +401,14 @@ class BeginCrewmatePatch
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = bgColor;
__instance.ImpostorText.gameObject.SetActive(team.RoleRevealScreenSubtitle != "*");
__instance.ImpostorText.text = team.RoleRevealScreenSubtitle;
+
+ foreach (var pc in Main.AllPlayerControls)
+ {
+ if (CustomTeamManager.AreInSameCustomTeam(pc.PlayerId, PlayerControl.LocalPlayer.PlayerId))
+ {
+ teamToDisplay.Add(pc);
+ }
+ }
}
}
@@ -530,9 +538,9 @@ class BeginImpostorPatch
return true;
}
- public static void Postfix(IntroCutscene __instance /*, ref Il2CppSystem.Collections.Generic.List yourTeam*/)
+ public static void Postfix(IntroCutscene __instance, ref List yourTeam)
{
- BeginCrewmatePatch.Postfix(__instance /*, ref yourTeam*/);
+ BeginCrewmatePatch.Postfix(__instance, ref yourTeam);
}
}
@@ -572,6 +580,14 @@ class IntroCutsceneDestroyPatch
}
}
+ bool chat = Options.CurrentGameMode switch
+ {
+ CustomGameMode.FFA => FFAManager.FFAChatDuringGame.GetBool(),
+ CustomGameMode.HotPotato => HotPotatoManager.IsChatDuringGame,
+ _ => false
+ };
+ if (chat) Utils.SetChatVisible();
+
_ = new LateTask(() => Main.AllPlayerControls.Do(pc => pc.RpcSetRoleDesync(RoleTypes.Shapeshifter, -3)), 2f, "SetImpostorForServer");
if (Options.UsePets.GetBool())
diff --git a/Patches/OutroPatch.cs b/Patches/OutroPatch.cs
index 54e89a2bf..772ce82d3 100644
--- a/Patches/OutroPatch.cs
+++ b/Patches/OutroPatch.cs
@@ -50,7 +50,7 @@ class EndGamePatch
SummaryText[id] = Utils.SummaryTexts(id, disableColor: false);
if (state.SubRoles.Count == 0) continue;
- Main.LastAddOns[id] = $"{Utils.ColorString(Main.PlayerColors.GetValueOrDefault(id, Color.white), Main.AllPlayerNames.GetValueOrDefault(id, $"ID {id}"))}: {state.SubRoles.Join(x => Utils.ColorString(Utils.GetRoleColor(x), GetString($"{x}")))}";
+ Main.LastAddOns[id] = $"{Utils.ColorString(Main.PlayerColors.GetValueOrDefault(id, Color.white), Main.AllPlayerNames.GetValueOrDefault(id, $"ID {id}"))}: {state.SubRoles.Join(x => x.ToColoredString())}";
}
if (Options.DumpLogAfterGameEnd.GetBool())
@@ -259,7 +259,7 @@ class SetEverythingUpPatch
CustomWinnerText = string.Format(GetString("CustomWinnerText"), team.TeamName);
CustomWinnerColor = team.RoleRevealScreenBackgroundColor == "*" ? Main.NeutralColor : team.RoleRevealScreenBackgroundColor;
__instance.BackgroundBar.material.color = ColorUtility.TryParseHtmlString(team.RoleRevealScreenBackgroundColor, out var color) ? color : Utils.GetRoleColor(CustomRoles.Sprayer);
- AdditionalWinnerText = team.TeamMembers.Join(x => Utils.ColorString(Utils.GetRoleColor(x), GetString($"{x}"))) + GetString("Win");
+ AdditionalWinnerText = team.TeamMembers.Join(x => x.ToColoredString()) + GetString("Win");
goto Skip;
}
diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs
index dfb2fe898..8bfb5684f 100644
--- a/Patches/PlayerControlPatch.cs
+++ b/Patches/PlayerControlPatch.cs
@@ -2051,11 +2051,11 @@ class PlayerControlLocalSetRolePatch
{
var moddedRole = role switch
{
- RoleTypes.Impostor => CustomRoles.ImpostorTOHE,
- RoleTypes.Shapeshifter => CustomRoles.ShapeshifterTOHE,
- RoleTypes.Crewmate => CustomRoles.CrewmateTOHE,
- RoleTypes.Engineer => CustomRoles.EngineerTOHE,
- RoleTypes.Scientist => CustomRoles.ScientistTOHE,
+ RoleTypes.Impostor => CustomRoles.ImpostorEHR,
+ RoleTypes.Shapeshifter => CustomRoles.ShapeshifterEHR,
+ RoleTypes.Crewmate => CustomRoles.CrewmateEHR,
+ RoleTypes.Engineer => CustomRoles.EngineerEHR,
+ RoleTypes.Scientist => CustomRoles.ScientistEHR,
_ => CustomRoles.NotAssigned,
};
if (moddedRole != CustomRoles.NotAssigned)
diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs
index 3b3912c4c..c2d00df82 100644
--- a/Patches/PlayerJoinAndLeftPatch.cs
+++ b/Patches/PlayerJoinAndLeftPatch.cs
@@ -30,7 +30,7 @@ class OnGameJoinedPatch
GameStates.InGame = false;
ErrorText.Instance?.Clear();
- if (AmongUsClient.Instance.AmHost) //以下、ホストのみ実行
+ if (AmongUsClient.Instance.AmHost)
{
GameStartManagerPatch.GameStartManagerUpdatePatch.exitTimer = -1;
Main.DoBlockNameChange = false;
diff --git a/Patches/TOHEOnlySearch.cs b/Patches/TOHEOnlySearch.cs
index 629f2cbbd..40ca8f928 100644
--- a/Patches/TOHEOnlySearch.cs
+++ b/Patches/TOHEOnlySearch.cs
@@ -4,7 +4,7 @@ using HarmonyLib;
namespace EHR;
// ²ο¼£ºhttps://github.com/ykundesu/SuperNewRoles/blob/master/SuperNewRoles/Patches/SNROnlySearch.cs
-public static class TOHEOnlySearch
+public static class EHROnlySearch
{
public const string FilterText = "EHR";
[HarmonyPatch(typeof(FilterTagManager), nameof(FilterTagManager.RefreshTags))]
diff --git a/Patches/onGameStartedPatch.cs b/Patches/onGameStartedPatch.cs
index ea5855d64..b6ca64f9d 100644
--- a/Patches/onGameStartedPatch.cs
+++ b/Patches/onGameStartedPatch.cs
@@ -542,6 +542,8 @@ internal class SelectRolesPatch
Asthmatic.Add();
Circumvent.Add();
+ _ = new LateTask(CustomTeamManager.InitializeCustomTeamPlayers, 7f, log: false);
+
if (overrideLovers) Logger.Msg(Main.LoversPlayers.Join(x => x?.GetRealName()), "Lovers");
EndOfSelectRolePatch:
diff --git a/README.md b/README.md
index 18d7dd1f9..8a25b1557 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
Endless Host Roles
-Previously known as TOHE+
+Previously known as EHR+
@@ -18,7 +18,7 @@
-
+
@@ -196,13 +196,13 @@
## Credit to these mods and their developers for the code and help:
-### :star: [TOHEN](https://github.com/0xDrMoe/TownofHost-Enhanced) :
+### :star: [EHRN](https://github.com/0xDrMoe/TownofHost-Enhanced) :
>
-> - Our repo is forked from TOHEN
+> - Our repo is forked from EHRN
>
-### :star: [TOHE/TONX](https://github.com/KARPED1EM/TownOfHostEdited) :
+### :star: [EHR/TONX](https://github.com/KARPED1EM/TownOfHostEdited) :
>
-> - Our repo is a continuation of TOHE
+> - Our repo is a continuation of EHR
> - TONX reference: Modify character limit for chat messages
>
### :star: [TOH](https://github.com/tukasa0001/TownOfHost) :
@@ -256,7 +256,7 @@
> - Reference: Some custom button images
>
-### :star: [TOHEX](https://github.com/TOHEX-Official/TownOfHostEdited-Xi) :
+### :star: [EHRX](https://github.com/EHRX-Official/TownOfHostEdited-Xi) :
>
> - Provided role: Swapper
> - Reference: Store message history
diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json
index 687f9eb8c..573ddbd4c 100644
--- a/Resources/Lang/en_US.json
+++ b/Resources/Lang/en_US.json
@@ -87,12 +87,12 @@
"GuardianAngel": "Guardian Angel",
"Impostor": "Impostor",
"Shapeshifter": "Shapeshifter",
- "EngineerTOHE": "Engineer",
- "ScientistTOHE": "Scientist",
- "ShapeshifterTOHE": "Shapeshifter",
- "GuardianAngelTOHE": "Guardian Angel",
- "ImpostorTOHE": "Impostor",
- "CrewmateTOHE": "Crewmate",
+ "EngineerEHR": "Engineer",
+ "ScientistEHR": "Scientist",
+ "ShapeshifterEHR": "Shapeshifter",
+ "GuardianAngelEHR": "Guardian Angel",
+ "ImpostorEHR": "Impostor",
+ "CrewmateEHR": "Crewmate",
"BountyHunter": "Bounty Hunter",
"Mare": "Mare",
"FireWorks": "Fireworker",
@@ -374,12 +374,12 @@
"Prefix.Sunglasses": "Sunglasses",
"Prefix.Mare": "Mare",
"BracketAddons": "Add Brackets To Add-ons",
- "EngineerTOHEInfo": "Use the vents to catch the Impostors",
- "ScientistTOHEInfo": "Access portable vitals from anywhere",
- "ShapeshifterTOHEInfo": "Disguise as crewmates to frame them",
- "GuardianAngelTOHEInfo": "Protect the crewmates from the Impostors",
- "ImpostorTOHEInfo": "Kill and sabotage",
- "CrewmateTOHEInfo": "Do your tasks",
+ "EngineerEHRInfo": "Use the vents to catch the Impostors",
+ "ScientistEHRInfo": "Access portable vitals from anywhere",
+ "ShapeshifterEHRInfo": "Disguise as crewmates to frame them",
+ "GuardianAngelEHRInfo": "Protect the crewmates from the Impostors",
+ "ImpostorEHRInfo": "Kill and sabotage",
+ "CrewmateEHRInfo": "Do your tasks",
"BountyHunterInfo": "Eliminate your target",
"MareInfo": "Kill in the dark",
"FireWorksInfo": "Go out with a BANG",
@@ -608,12 +608,12 @@
"SunnyboyInfo": "Shine, shine my sunshine!",
"BardInfo": "Poem's grace, murder's trace, a rhythmic dance in dark embrace.",
"NukerInfo": "Shapeshift to nuke everyone",
- "EngineerTOHEInfoLong": "(Crewmates):\\nAs the Engineer, you may access the vents while comms are not sabotaged.\\nVents are disabled when they are sabotaged.",
- "ScientistTOHEInfoLong": "(Crewmates):\\nAs the Scientist, you have a portable tablet with the crew's vitals on it.\\nUse this any way you'd like.\\nCatching self-reports, extra intel on body age, etc.",
- "ShapeshifterTOHEInfoLong": "(Impostors):\\nAs the Shapeshifter, you have a shapeshifting ability which you may use to frame other crewmates.\\nJust be aware that there is an egg while shifting and the disguise is temporary.",
- "GuardianAngelTOHEInfoLong": "(Crewmates):\\nAs the Guardian Angel, you spawn as a ghost and must do your job by protecting crewmates from the Impostors.",
- "ImpostorTOHEInfoLong": "(Impostors):\\nAs the Impostor, your goal is to simply kill off the crewmates.\\nYou can sabotage and vent.",
- "CrewmateTOHEInfoLong": "(Crewmates):\\nAs the Crewmate, your goal is quite simple. Find and exile the Impostors.\\n\\nCrewmates win by getting rid of all killers or by finishing all their tasks.",
+ "EngineerEHRInfoLong": "(Crewmates):\\nAs the Engineer, you may access the vents while comms are not sabotaged.\\nVents are disabled when they are sabotaged.",
+ "ScientistEHRInfoLong": "(Crewmates):\\nAs the Scientist, you have a portable tablet with the crew's vitals on it.\\nUse this any way you'd like.\\nCatching self-reports, extra intel on body age, etc.",
+ "ShapeshifterEHRInfoLong": "(Impostors):\\nAs the Shapeshifter, you have a shapeshifting ability which you may use to frame other crewmates.\\nJust be aware that there is an egg while shifting and the disguise is temporary.",
+ "GuardianAngelEHRInfoLong": "(Crewmates):\\nAs the Guardian Angel, you spawn as a ghost and must do your job by protecting crewmates from the Impostors.",
+ "ImpostorEHRInfoLong": "(Impostors):\\nAs the Impostor, your goal is to simply kill off the crewmates.\\nYou can sabotage and vent.",
+ "CrewmateEHRInfoLong": "(Crewmates):\\nAs the Crewmate, your goal is quite simple. Find and exile the Impostors.\\n\\nCrewmates win by getting rid of all killers or by finishing all their tasks.",
"BountyHunterInfoLong": "(Impostors):\\nIf you successfully eliminate your assigned target, your next kill cooldown will be reduced, but if you eliminate anyone else, your next kill cooldown will be lengthened; the target will switch after a predetermined time.",
"FireWorksInfoLong": "(Impostors):\\nAs a Fireworker, you can plant up to three firework bombs using shapeshift/by petting your pet. If you're the last impostor standing, you can use shapeshift/pet to detonate the bombs and cause area damage. But be careful, the bombs can also harm you. If the bombs eliminate all surviving players, it's a victory for the impostors.",
"SerialKillerInfoLong": "(Impostors):\\nYou have a shorter kill cooldown than other impostors, but you will die if you don't kill before the end of your shapeshift cooldown.",
@@ -2310,11 +2310,11 @@
"turnOn": "On",
"turnOff": "Off",
"CancelStartCountDown": "The starting countdown was cancelled",
- "RestTOHESetting": "EHR settings have been restored to default",
+ "RestEHRSetting": "EHR settings have been restored to default",
"FPSSetTo": "FPS Set To: {0}",
"HostKillSelfByCommand": "The lobby Host decided to commit suicide",
"SyncCustomSettingsRPC": "Synchronized RPC",
- "TOHEVisitorCount": "To date EHR has been used {1} times~",
+ "EHRVisitorCount": "To date EHR has been used {1} times~",
"Mode": "Mode",
"Target": "Target",
"PlayerInfo": "Player Info",
@@ -2331,7 +2331,7 @@
"KBTimeRemain": "Time Remaining: {0}s",
"ResetDoorsEveryTurns": "Reset All Doors After Meetings",
"GameOver": "Game Over",
- "TOHEOptions": "EHR Options",
+ "EHROptions": "EHR Options",
"Cancel": "Cancel",
"Back": "Back",
"Yes": "Yes",
@@ -2799,7 +2799,7 @@
"ElectricInfoLong": "(Crewmates):\\nAs the Electric, when you complete a task, a random killer gets frozen for a few seconds.",
"Mole": "Mole",
"MoleInfo": "TP to Random Vents by Entering One",
- "MoleInfoLong": "(Crewmates):\\nAs the Mole, when you vent, you get kicked out and teleport to a random vent on the map.",
+ "MoleInfoLong": "(Crewmates):\\nAs the Mole, when you vent, you get kicked out and teleport to a random vent on the map. / Pet your pet to teleport to a random vent.",
"Tornado": "Tornado",
"TornadoInfo": "Spawn Tornados",
"TornadoInfoLong": "(Crewmates):\\nAs the Tornado, you can spawn tornados by petting your pet. When someone walks close to a tornado, they fly (teleport) to a random place on the ship.",
diff --git a/Resources/Lang/pt_BR.json b/Resources/Lang/pt_BR.json
index e69f849f6..fa9c5f348 100644
--- a/Resources/Lang/pt_BR.json
+++ b/Resources/Lang/pt_BR.json
@@ -87,12 +87,12 @@
"GuardianAngel": "Anjo da Guarda",
"Impostor": "Impostor",
"Shapeshifter": "Metamorfo",
- "EngineerTOHE": "Engenheiro",
- "ScientistTOHE": "Cientista",
- "ShapeshifterTOHE": "Metamorfo",
- "GuardianAngelTOHE": "Anjo da Guarda",
- "ImpostorTOHE": "Impostor",
- "CrewmateTOHE": "Tripulante",
+ "EngineerEHR": "Engenheiro",
+ "ScientistEHR": "Cientista",
+ "ShapeshifterEHR": "Metamorfo",
+ "GuardianAngelEHR": "Anjo da Guarda",
+ "ImpostorEHR": "Impostor",
+ "CrewmateEHR": "Tripulante",
"BountyHunter": "Caçador de Recompensas",
"Mare": "Pesadelo",
"FireWorks": "Artilheiro",
@@ -374,12 +374,12 @@
"Prefix.Sunglasses": "Óculos de Sol",
"Prefix.Mare": "Pesadelo",
"BracketAddons": "Adicionar parênteses para Atributos",
- "EngineerTOHEInfo": "Use ventilações para encontrar os Impostores",
- "ScientistTOHEInfo": "Acesse vitais portáveis de qualquer lugar",
- "ShapeshifterTOHEInfo": "Disfarce-se de Tripulantes para confundi-los",
- "GuardianAngelTOHEInfo": "Proteja os Tripulantes dos Impostores",
- "ImpostorTOHEInfo": "Sabote e mate todos",
- "CrewmateTOHEInfo": "Faça suas tarefas",
+ "EngineerEHRInfo": "Use ventilações para encontrar os Impostores",
+ "ScientistEHRInfo": "Acesse vitais portáveis de qualquer lugar",
+ "ShapeshifterEHRInfo": "Disfarce-se de Tripulantes para confundi-los",
+ "GuardianAngelEHRInfo": "Proteja os Tripulantes dos Impostores",
+ "ImpostorEHRInfo": "Sabote e mate todos",
+ "CrewmateEHRInfo": "Faça suas tarefas",
"BountyHunterInfo": "Elimine seu alvo",
"MareInfo": "Mate na escuridão",
"FireWorksInfo": "Use explosivos a seu favor",
@@ -608,12 +608,12 @@
"SunnyboyInfo": "Brilhe, brilhe meu brilho de sol!",
"BardInfo": "A graça do poema, o rastro do assassinato, uma dança rítmica em um abraço sombrio",
"NukerInfo": "Metamorfe-se para explodir todos",
- "EngineerTOHEInfoLong": "(Tripulantes):\\n★Como um Engenheiro, você pode acessar as tubulações enquanto as comunicações não são sabotadas.",
- "ScientistTOHEInfoLong": "(Tripulantes):\\nComo um Cientista, você tem um tablet portátil com os dados vitais da Tripulação.\\nUse-o da maneira que quiser.",
- "ShapeshifterTOHEInfoLong": "(Impostores):★Como um Metamorfo, você tem uma habilidade de metamorfose que pode usar para incriminar outros Tripulantes.\\n★Apenas esteja ciente de que há um casulo durante a mudança e o disfarce é temporário.",
- "GuardianAngelTOHEInfoLong": "(Tripulantes):★O Anjo Guardião, você aparece como um fantasma e deve fazer o seu trabalho protegendo os Tripulantes dos Impostores.",
- "ImpostorTOHEInfoLong": "(Impostores):\\n★Como um Impostor, seu objetivo é simplesmente matar os Tripulantes.\\n★Você pode sabotar e usar os dutos.",
- "CrewmateTOHEInfoLong": "(Tripulantes):\\n★Como um Tripulante, seu objetivo é bem simples. Descubra e expulse os Impostores. ★Tripulantes ganham se livrando de todos os assassinos ou terminando todas as suas tarefas.",
+ "EngineerEHRInfoLong": "(Tripulantes):\\n★Como um Engenheiro, você pode acessar as tubulações enquanto as comunicações não são sabotadas.",
+ "ScientistEHRInfoLong": "(Tripulantes):\\nComo um Cientista, você tem um tablet portátil com os dados vitais da Tripulação.\\nUse-o da maneira que quiser.",
+ "ShapeshifterEHRInfoLong": "(Impostores):★Como um Metamorfo, você tem uma habilidade de metamorfose que pode usar para incriminar outros Tripulantes.\\n★Apenas esteja ciente de que há um casulo durante a mudança e o disfarce é temporário.",
+ "GuardianAngelEHRInfoLong": "(Tripulantes):★O Anjo Guardião, você aparece como um fantasma e deve fazer o seu trabalho protegendo os Tripulantes dos Impostores.",
+ "ImpostorEHRInfoLong": "(Impostores):\\n★Como um Impostor, seu objetivo é simplesmente matar os Tripulantes.\\n★Você pode sabotar e usar os dutos.",
+ "CrewmateEHRInfoLong": "(Tripulantes):\\n★Como um Tripulante, seu objetivo é bem simples. Descubra e expulse os Impostores. ★Tripulantes ganham se livrando de todos os assassinos ou terminando todas as suas tarefas.",
"BountyHunterInfoLong": "(Impostores):\\n★Você tem um alvo para matar. Se conseguir eliminar o seu alvo, o seu próximo tempo de espera para matar será reduzido.\\n★Porém, se você matar alguém que não seja o seu alvo designado, o seu próximo tempo de espera para matar será aumentado.\\n★ O alvo é trocado após um certo período de tempo.",
"FireWorksInfoLong": "(Impostores):\\n★O Artilheiro pode colocar bombas de fogos de artifício para causar danos à área. \\n★O Artilheiro pode plantar até três bombas de fogos de artifício usando metamorfose. Quando apenas o Artilheiro resta no time dos Impostores, as bombas de fogos de artifício são colocadas. O Artilheiro pode usar metamorfose para colocar a bomba. A bomba do Artilheiro pode matar ele mesmo. \\n★No entanto, se as bombas de fogos de artifício matarem todos os jogadores sobreviventes, será considerada uma vitória para os Impostores.",
"SerialKillerInfoLong": "(Impostores):\\n★Você possui um tempo de matar menor em comparação com os outros Impostores, mas há uma condição: se você não matar ninguém até o final do seu tempo de metamorfose, você morrerá.",
@@ -2305,11 +2305,11 @@
"turnOn": "Ligado",
"turnOff": "Desligado",
"CancelStartCountDown": "A contagem para começar o jogo foi cancelada",
- "RestTOHESetting": "Configurações EHR restauradas ao padrão",
+ "RestEHRSetting": "Configurações EHR restauradas ao padrão",
"FPSSetTo": "FPS definido para: {0}",
"HostKillSelfByCommand": "O anfitrião da sala decidiu cometer suicídio.",
"SyncCustomSettingsRPC": "RPC Sincronizado",
- "TOHEVisitorCount": "Até agora o EHR foi usado {1} vezes~",
+ "EHRVisitorCount": "Até agora o EHR foi usado {1} vezes~",
"Mode": "Modo",
"Target": "Alvo",
"PlayerInfo": "Informações do Jogador",
@@ -2326,7 +2326,7 @@
"KBTimeRemain": "Tempo Restante: {0}s",
"ResetDoorsEveryTurns": "Redefinir Portas Após Reunião (Airship/Polus/Fungle)",
"GameOver": "Fim de Jogo",
- "TOHEOptions": "Opções EHR",
+ "EHROptions": "Opções EHR",
"Cancel": "Cancelar",
"Back": "Voltar",
"Yes": "Sim",
diff --git a/Resources/ModNews/English/TOHE+.v1.1.2.txt b/Resources/ModNews/English/TOHE+.v1.1.2.txt
index c0d6daa56..5b9396e1c 100644
--- a/Resources/ModNews/English/TOHE+.v1.1.2.txt
+++ b/Resources/ModNews/English/TOHE+.v1.1.2.txt
@@ -10,7 +10,7 @@
## Urgent announcement and warning
- With Map 5, The Fungle right around the corner, be sure to make a copy of your current Among Us installation, or you will not be able to play with mods, guaranteed.
-- I will try my hardest to make EHR compatible with the new game version (even if not with the new map yet), but it will take time, and I also want to help TOHEN to get things going, as much as I can.
+- I will try my hardest to make EHR compatible with the new game version (even if not with the new map yet), but it will take time, and I also want to help EHRN to get things going, as much as I can.
## Fixes
- Fixed a lot of minor bugs. There are literally so many that I can't remember them.
diff --git a/Roles/AddOns/Common/Lovers.cs b/Roles/AddOns/Common/Lovers.cs
index 8a55dc239..768380ffa 100644
--- a/Roles/AddOns/Common/Lovers.cs
+++ b/Roles/AddOns/Common/Lovers.cs
@@ -12,7 +12,7 @@ namespace EHR.Roles.AddOns.Common
const int id = 16200;
const CustomGameMode customGameMode = CustomGameMode.Standard;
- var spawnOption = StringOptionItem.Create(id, role.ToString(), ratesZeroOne, 0, TabGroup.Addons, false)
+ var spawnOption = StringOptionItem.Create(id, role.ToString(), RatesZeroOne, 0, TabGroup.Addons, false)
.SetColor(Utils.GetRoleColor(role))
.SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem;
diff --git a/Roles/AddOns/Impostor/Madmate.cs b/Roles/AddOns/Impostor/Madmate.cs
index 5f40dd146..2fe1c29e6 100644
--- a/Roles/AddOns/Impostor/Madmate.cs
+++ b/Roles/AddOns/Impostor/Madmate.cs
@@ -9,9 +9,9 @@ namespace EHR.Roles.AddOns.Impostor
public void SetupCustomOption()
{
SetupAdtRoleOptions(15800, CustomRoles.Madmate, canSetNum: true, canSetChance: false);
- MadmateSpawnMode = StringOptionItem.Create(15810, "MadmateSpawnMode", madmateSpawnMode, 0, TabGroup.Addons, false)
+ MadmateSpawnMode = StringOptionItem.Create(15810, "MadmateSpawnMode", MadmateSpawnModeStrings, 0, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Madmate]);
- MadmateCountMode = StringOptionItem.Create(15811, "MadmateCountMode", madmateCountMode, 0, TabGroup.Addons, false)
+ MadmateCountMode = StringOptionItem.Create(15811, "MadmateCountMode", MadmateCountModeStrings, 0, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Madmate]);
SheriffCanBeMadmate = BooleanOptionItem.Create(15812, "SheriffCanBeMadmate", false, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Madmate]);
diff --git a/Roles/Crewmate/Altruist.cs b/Roles/Crewmate/Altruist.cs
index b525b7cf0..5ae4b8623 100644
--- a/Roles/Crewmate/Altruist.cs
+++ b/Roles/Crewmate/Altruist.cs
@@ -11,7 +11,7 @@ namespace EHR.Roles.Crewmate
if (killer == null) return;
if (!killer.GetCustomRole().IsImpostor()) return;
- killer.RpcSetCustomRole(killer.Is(RoleTypes.Shapeshifter) ? CustomRoles.ShapeshifterTOHE : CustomRoles.ImpostorTOHE);
+ killer.RpcSetCustomRole(killer.Is(RoleTypes.Shapeshifter) ? CustomRoles.ShapeshifterEHR : CustomRoles.ImpostorEHR);
}
}
}
diff --git a/Roles/Crewmate/CrewmateVanillaRoles.cs b/Roles/Crewmate/CrewmateVanillaRoles.cs
index d988a5777..b79e43c90 100644
--- a/Roles/Crewmate/CrewmateVanillaRoles.cs
+++ b/Roles/Crewmate/CrewmateVanillaRoles.cs
@@ -8,14 +8,14 @@ namespace EHR.Roles.Crewmate
public void SetupCustomOption()
{
- SetupRoleOptions(5050, Tab, CustomRoles.CrewmateTOHE);
- SetupRoleOptions(5000, Tab, CustomRoles.EngineerTOHE);
- SetupRoleOptions(5100, Tab, CustomRoles.ScientistTOHE);
+ SetupRoleOptions(5050, Tab, CustomRoles.CrewmateEHR);
+ SetupRoleOptions(5000, Tab, CustomRoles.EngineerEHR);
+ SetupRoleOptions(5100, Tab, CustomRoles.ScientistEHR);
ScientistCD = FloatOptionItem.Create(5110, "VitalsCooldown", new(1f, 250f, 1f), 3f, Tab, false)
- .SetParent(CustomRoleSpawnChances[CustomRoles.ScientistTOHE])
+ .SetParent(CustomRoleSpawnChances[CustomRoles.ScientistEHR])
.SetValueFormat(OptionFormat.Seconds);
ScientistDur = FloatOptionItem.Create(5111, "VitalsDuration", new(1f, 250f, 1f), 15f, Tab, false)
- .SetParent(CustomRoleSpawnChances[CustomRoles.ScientistTOHE])
+ .SetParent(CustomRoleSpawnChances[CustomRoles.ScientistEHR])
.SetValueFormat(OptionFormat.Seconds);
}
}
diff --git a/Roles/Crewmate/Mole.cs b/Roles/Crewmate/Mole.cs
index 4697f2153..4aa724892 100644
--- a/Roles/Crewmate/Mole.cs
+++ b/Roles/Crewmate/Mole.cs
@@ -31,5 +31,10 @@ namespace EHR.Roles.Crewmate
{
_ = new LateTask(() => { pc.TPtoRndVent(); }, 0.5f, "Mole TP");
}
+
+ public override void OnPet(PlayerControl pc)
+ {
+ pc.TPtoRndVent();
+ }
}
}
\ No newline at end of file
diff --git a/Roles/Crewmate/Tracker.cs b/Roles/Crewmate/Tracker.cs
index c61eaf570..a8464653d 100644
--- a/Roles/Crewmate/Tracker.cs
+++ b/Roles/Crewmate/Tracker.cs
@@ -1,6 +1,7 @@
using EHR.Modules;
using Hazel;
using System.Collections.Generic;
+using System.Linq;
using UnityEngine;
using static EHR.Options;
using static EHR.Translator;
@@ -103,20 +104,7 @@ namespace EHR.Roles.Crewmate
if (!TrackerTarget.ContainsKey(seer.PlayerId)) return string.Empty;
if (GameStates.IsMeeting) return string.Empty;
- var arrows = string.Empty;
- var targetList = TrackerTarget[seer.PlayerId];
- foreach (var trackTarget in targetList)
- {
- if (!TrackerTarget[seer.PlayerId].Contains(trackTarget)) continue;
-
- var targetData = Utils.GetPlayerById(trackTarget);
- if (targetData == null) continue;
-
- var arrow = TargetArrow.GetArrows(seer, trackTarget);
- arrows += Utils.ColorString(CanGetColoredArrow.GetBool() ? Palette.PlayerColors[targetData.Data.DefaultOutfit.ColorId] : Color.white, arrow);
- }
-
- return arrows;
+ return TrackerTarget[seer.PlayerId].Aggregate(string.Empty, (current, trackTarget) => current + Utils.ColorString(CanGetColoredArrow.GetBool() ? Main.PlayerColors[trackTarget] : Color.white, TargetArrow.GetArrows(seer, trackTarget) + LocateArrow.GetArrows(seer)));
}
public static bool IsTrackTarget(PlayerControl seer, PlayerControl target)
@@ -127,11 +115,30 @@ namespace EHR.Roles.Crewmate
public static string GetArrowAndLastRoom(PlayerControl seer, PlayerControl target)
{
if (seer == null || target == null) return string.Empty;
- string text = Utils.ColorString(Utils.GetRoleColor(CustomRoles.Tracker), TargetArrow.GetArrows(seer, target.PlayerId));
+
+ var roleColor = Utils.GetRoleColor(CustomRoles.Tracker);
+ string text = Utils.ColorString(roleColor, TargetArrow.GetArrows(seer, target.PlayerId));
+ text += Utils.ColorString(roleColor, LocateArrow.GetArrows(seer));
+
var room = Main.PlayerStates[target.PlayerId].LastRoom;
if (room == null) text += Utils.ColorString(Color.gray, "@" + GetString("FailToTrack"));
- else text += Utils.ColorString(Utils.GetRoleColor(CustomRoles.Tracker), "@" + GetString(room.RoomId.ToString()));
+ else text += Utils.ColorString(roleColor, "@" + GetString(room.RoomId.ToString()));
+
return text;
}
+
+ public static void OnPlayerDeath(PlayerControl player)
+ {
+ if (player == null) return;
+ foreach (var kvp in TrackerTarget)
+ {
+ if (kvp.Value.Contains(player.PlayerId))
+ {
+ kvp.Value.Remove(player.PlayerId);
+ TargetArrow.Remove(kvp.Key, player.PlayerId);
+ LocateArrow.Add(kvp.Key, player.Pos());
+ }
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Roles/Impostor/Changeling.cs b/Roles/Impostor/Changeling.cs
index 7fc1ead2a..33cdfd9ab 100644
--- a/Roles/Impostor/Changeling.cs
+++ b/Roles/Impostor/Changeling.cs
@@ -44,11 +44,11 @@ namespace EHR.Roles.Impostor
IEnumerable result = AvailableRoles.GetValue() switch
{
0 => allRoles,
- 1 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorTOHE),
- 2 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterTOHE),
+ 1 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorEHR),
+ 2 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterEHR),
3 => allRoles.Where(x => x.GetMode() != 0),
- 4 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorTOHE && x.GetMode() != 0),
- 5 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterTOHE && x.GetMode() != 0),
+ 4 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorEHR && x.GetMode() != 0),
+ 5 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterEHR && x.GetMode() != 0),
_ => allRoles
};
@@ -77,7 +77,7 @@ namespace EHR.Roles.Impostor
catch (InvalidOperationException)
{
Logger.Error("No roles for Changeling", "Changeling");
- Utils.GetPlayerById(playerId).RpcSetCustomRole(CustomRoles.ImpostorTOHE);
+ Utils.GetPlayerById(playerId).RpcSetCustomRole(CustomRoles.ImpostorEHR);
}
}
diff --git a/Roles/Impostor/ImpostorVanillaRoles.cs b/Roles/Impostor/ImpostorVanillaRoles.cs
index 2bfbf9764..b05518a6b 100644
--- a/Roles/Impostor/ImpostorVanillaRoles.cs
+++ b/Roles/Impostor/ImpostorVanillaRoles.cs
@@ -8,13 +8,13 @@ namespace EHR.Roles.Impostor
public void SetupCustomOption()
{
- SetupRoleOptions(300, Tab, CustomRoles.ImpostorTOHE);
- SetupRoleOptions(400, Tab, CustomRoles.ShapeshifterTOHE);
+ SetupRoleOptions(300, Tab, CustomRoles.ImpostorEHR);
+ SetupRoleOptions(400, Tab, CustomRoles.ShapeshifterEHR);
ShapeshiftCD = FloatOptionItem.Create(402, "ShapeshiftCooldown", new(1f, 180f, 1f), 30f, Tab, false)
- .SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterTOHE])
+ .SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterEHR])
.SetValueFormat(OptionFormat.Seconds);
ShapeshiftDur = FloatOptionItem.Create(403, "ShapeshiftDuration", new(1f, 60f, 1f), 10f, Tab, false)
- .SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterTOHE])
+ .SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterEHR])
.SetValueFormat(OptionFormat.Seconds);
}
}
diff --git a/Roles/Neutral/Executioner.cs b/Roles/Neutral/Executioner.cs
index ee2d7c105..70a5d348e 100644
--- a/Roles/Neutral/Executioner.cs
+++ b/Roles/Neutral/Executioner.cs
@@ -21,36 +21,19 @@ public class Executioner : RoleBase
public static OptionItem KnowTargetRole;
public static OptionItem ChangeRolesAfterTargetKilled;
-
- ///
- /// Key: エクスキューショナーのPlayerId, Value: ターゲットのPlayerId
- ///
public static Dictionary Target = [];
- public static readonly string[] ChangeRoles =
- [
- "Role.Crewmate",
- "Role.Jester",
- "Role.Opportunist",
- "Role.Convict",
- "Role.Celebrity",
- "Role.Bodyguard",
- "Role.Dictator",
- "Role.Mayor",
- "Role.Doctor",
- // CustomRoles.Crewmate.ToString(), CustomRoles.Jester.ToString(), CustomRoles.Opportunist.ToString(),
- ];
-
public static readonly CustomRoles[] CRoleChangeRoles =
[
- CustomRoles.CrewmateTOHE,
+ CustomRoles.Amnesiac,
+ CustomRoles.Maverick,
+ CustomRoles.CrewmateEHR,
CustomRoles.Jester,
CustomRoles.Opportunist,
CustomRoles.Convict,
CustomRoles.CyberStar,
CustomRoles.Bodyguard,
CustomRoles.Dictator,
- CustomRoles.Mayor,
CustomRoles.Doctor,
];
@@ -63,7 +46,7 @@ public class Executioner : RoleBase
CanTargetNeutralEvil = BooleanOptionItem.Create(Id + 15, "CanTargetNeutralEvil", false, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Executioner]);
CanTargetNeutralChaos = BooleanOptionItem.Create(Id + 16, "CanTargetNeutralChaos", false, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Executioner]);
KnowTargetRole = BooleanOptionItem.Create(Id + 13, "KnowTargetRole", false, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Executioner]);
- ChangeRolesAfterTargetKilled = StringOptionItem.Create(Id + 11, "ExecutionerChangeRolesAfterTargetKilled", ChangeRoles, 1, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Executioner]);
+ ChangeRolesAfterTargetKilled = StringOptionItem.Create(Id + 11, "ExecutionerChangeRolesAfterTargetKilled", CRoleChangeRoles.Select(x => x.ToColoredString()).ToArray(), 1, TabGroup.NeutralRoles, false, noTranslation: true).SetParent(CustomRoleSpawnChances[CustomRoles.Executioner]);
}
public override void Init()
@@ -76,7 +59,6 @@ public class Executioner : RoleBase
{
playerIdList.Add(playerId);
- //ターゲット割り当て
try
{
if (AmongUsClient.Instance.AmHost)
@@ -143,17 +125,13 @@ public class Executioner : RoleBase
public static void ChangeRoleByTarget(PlayerControl target)
{
- byte Executioner = 0x73;
- Target.Do(x =>
- {
- if (x.Value == target.PlayerId)
- Executioner = x.Key;
- });
- Utils.GetPlayerById(Executioner).RpcSetCustomRole(CRoleChangeRoles[ChangeRolesAfterTargetKilled.GetValue()]);
+ byte Executioner = Target.FirstOrDefault(x => x.Value == target.PlayerId).Key;
+ var ExePC = Utils.GetPlayerById(Executioner);
+ ExePC.RpcSetCustomRole(CRoleChangeRoles[ChangeRolesAfterTargetKilled.GetValue()]);
Target.Remove(Executioner);
SendRPC(Executioner);
- Utils.NotifyRoles(SpecifySeer: Utils.GetPlayerById(Executioner), SpecifyTarget: target);
- Utils.NotifyRoles(SpecifySeer: target, SpecifyTarget: Utils.GetPlayerById(Executioner));
+ Utils.NotifyRoles(SpecifySeer: ExePC, SpecifyTarget: target);
+ Utils.NotifyRoles(SpecifySeer: target, SpecifyTarget: ExePC);
}
public static void ChangeRole(PlayerControl executioner)
@@ -199,7 +177,6 @@ public class Executioner : RoleBase
}
else
{
- //CustomWinnerHolder.AdditionalWinnerTeams.Add(AdditionalWinners.Executioner);
CustomWinnerHolder.SetWinnerOrAdditonalWinner(CustomWinner.Executioner);
CustomWinnerHolder.WinnerIds.Add(playerId);
}
diff --git a/Roles/Neutral/Jackal.cs b/Roles/Neutral/Jackal.cs
index 33c75f8fd..ae0be86b3 100644
--- a/Roles/Neutral/Jackal.cs
+++ b/Roles/Neutral/Jackal.cs
@@ -62,7 +62,7 @@ public class Jackal : RoleBase
// SidekickKnowOtherSidekick = BooleanOptionItem.Create(6050585, "SidekickKnowOtherSidekick", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
// SidekickKnowOtherSidekickRole = BooleanOptionItem.Create(6050590, "SidekickKnowOtherSidekickRole", false, TabGroup.NeutralRoles, false).SetParent(SidekickKnowOtherSidekick);
SidekickCanKillSidekick = BooleanOptionItem.Create(Id + 24, "SidekickCanKillSidekick", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
- SidekickCountMode = StringOptionItem.Create(Id + 25, "SidekickCountMode", sidekickCountMode, 0, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
+ SidekickCountMode = StringOptionItem.Create(Id + 25, "SidekickCountMode", Options.SidekickCountMode, 0, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
// SidekickCanWinWithOriginalTeam = BooleanOptionItem.Create(6050795, "SidekickCanWinWithOriginalTeam", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
}
diff --git a/Roles/Neutral/Lawyer.cs b/Roles/Neutral/Lawyer.cs
index 16748e0de..50d44729c 100644
--- a/Roles/Neutral/Lawyer.cs
+++ b/Roles/Neutral/Lawyer.cs
@@ -38,7 +38,7 @@ public class Lawyer : RoleBase
public static readonly CustomRoles[] CRoleChangeRoles =
[
- CustomRoles.CrewmateTOHE,
+ CustomRoles.CrewmateEHR,
CustomRoles.Jester,
CustomRoles.Opportunist,
CustomRoles.Convict,
diff --git a/Roles/Neutral/WeaponMaster.cs b/Roles/Neutral/WeaponMaster.cs
index 28d707e06..e9bfe6988 100644
--- a/Roles/Neutral/WeaponMaster.cs
+++ b/Roles/Neutral/WeaponMaster.cs
@@ -26,7 +26,7 @@ public class WeaponMaster : RoleBase
/*
* 0 = Kill (Sword) ~ Normal Kill
- * 1 = TOHEN Werewolf Kill / Higher KCD (Axe)
+ * 1 = EHRN Werewolf Kill / Higher KCD (Axe)
* 2 = Reach + Swift / Can't Vent (Lance)
* 3 = 1-Time Shield / Can't Kill (Shield)
*/
diff --git a/main.cs b/main.cs
index f956f63af..a6eccea17 100644
--- a/main.cs
+++ b/main.cs
@@ -283,10 +283,10 @@ public class Main : BasePlugin
{ CustomRoles.Scientist, "#8cffff" },
{ CustomRoles.GuardianAngel, "#ffffff" },
// Vanilla Remakes
- { CustomRoles.CrewmateTOHE, "#8cffff" },
- { CustomRoles.EngineerTOHE, "#FF6A00" },
- { CustomRoles.ScientistTOHE, "#8ee98e" },
- { CustomRoles.GuardianAngelTOHE, "#77e6d1" },
+ { CustomRoles.CrewmateEHR, "#8cffff" },
+ { CustomRoles.EngineerEHR, "#FF6A00" },
+ { CustomRoles.ScientistEHR, "#8ee98e" },
+ { CustomRoles.GuardianAngelEHR, "#77e6d1" },
// Crewmates
{ CustomRoles.Luckey, "#b8d7a3" },
{ CustomRoles.Needy, "#a4dffe" },
@@ -724,6 +724,7 @@ public enum AdditionalWinners
// -------------
Lovers = CustomRoles.Lovers,
+ Executioner = CustomRoles.Executioner,
Opportunist = CustomRoles.Opportunist,
Lawyer = CustomRoles.Lawyer,
FFF = CustomRoles.FFF,
@@ -734,6 +735,7 @@ public enum AdditionalWinners
VengefulRomantic = CustomRoles.VengefulRomantic,
Pursuer = CustomRoles.Pursuer,
Phantom = CustomRoles.Phantom,
+ Sidekick = CustomRoles.Sidekick,
Maverick = CustomRoles.Maverick,
Postman = CustomRoles.Postman,
Impartial = CustomRoles.Impartial,