This commit is contained in:
Gurge44 committed 2024-03-31 21:36:07 +02:00
commit 1edf4fb7e5
51 files changed
+397 -344

No files matched your search

+6 -6
View File
@@ -11,8 +11,8 @@ public enum CustomRoles
Shapeshifter, Shapeshifter,
// Vanilla Remakes // Vanilla Remakes
ImpostorTOHE, ImpostorEHR,
ShapeshifterTOHE, ShapeshifterEHR,
//Impostors //Impostors
@@ -106,10 +106,10 @@ public enum CustomRoles
Scientist, Scientist,
// Vanilla Remakes // Vanilla Remakes
CrewmateTOHE, CrewmateEHR,
EngineerTOHE, EngineerEHR,
GuardianAngelTOHE, GuardianAngelEHR,
ScientistTOHE, ScientistEHR,
// Crewmate // Crewmate
@@ -24,6 +24,7 @@ namespace CustomTeamAssigner
if (ofd.ShowDialog() == true) if (ofd.ShowDialog() == true)
{ {
Utils.Teams.Clear();
File.ReadAllLines(ofd.FileName).Do(line => new Team(line.Split(';')[0]).Import(line)); File.ReadAllLines(ofd.FileName).Do(line => new Team(line.Split(';')[0]).Import(line));
Navigator.NavigationService.Navigate(new PlaySetListerPage()); Navigator.NavigationService.Navigate(new PlaySetListerPage());
@@ -17,9 +17,20 @@ namespace CustomTeamAssigner
EditingTeamMembers = team.TeamMembers; EditingTeamMembers = team.TeamMembers;
InitializeMembersGrid(); InitializeMembersGrid();
InitializeComboBox(); InitializeComboBox();
InitializeEditorFields();
}
void InitializeEditorFields()
{
OverrideColorCheckBox.IsChecked = EditingTeam.RoleRevealScreenBackgroundColor != "*"; OverrideColorCheckBox.IsChecked = EditingTeam.RoleRevealScreenBackgroundColor != "*";
OverrideTitleCheckBox.IsChecked = EditingTeam.RoleRevealScreenTitle != "*"; OverrideTitleCheckBox.IsChecked = EditingTeam.RoleRevealScreenTitle != "*";
OverrideSubTitleCheckBox.IsChecked = EditingTeam.RoleRevealScreenSubtitle != "*"; 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() void InitializeMembersGrid()
+1
View File
@@ -94,6 +94,7 @@ namespace CustomTeamAssigner
public static CustomRoles GetInternalRoleName(this string roleName) public static CustomRoles GetInternalRoleName(this string roleName)
{ {
if (roleName == "Guess Manager") return CustomRoles.GuessManagerRole;
var role = RoleNames.FirstOrDefault(x => x.Value == roleName).Key; var role = RoleNames.FirstOrDefault(x => x.Value == roleName).Key;
return role != default ? role : Enum.Parse<CustomRoles>(roleName.Replace(" ", string.Empty)); return role != default ? role : Enum.Parse<CustomRoles>(roleName.Replace(" ", string.Empty));
} }
+6 -6
View File
@@ -11,8 +11,8 @@ public enum CustomRoles
Shapeshifter, Shapeshifter,
// Vanilla Remakes // Vanilla Remakes
ImpostorTOHE, ImpostorEHR,
ShapeshifterTOHE, ShapeshifterEHR,
//Impostors //Impostors
@@ -106,10 +106,10 @@ public enum CustomRoles
Scientist, Scientist,
// Vanilla Remakes // Vanilla Remakes
CrewmateTOHE, CrewmateEHR,
EngineerTOHE, EngineerEHR,
GuardianAngelTOHE, GuardianAngelEHR,
ScientistTOHE, ScientistEHR,
// Crewmate // Crewmate
+1 -1
View File
@@ -7,7 +7,7 @@
<Description>EHR</Description> <Description>EHR</Description>
<Authors>Gurge44</Authors> <Authors>Gurge44</Authors>
<langVersion>preview</langVersion> <langVersion>preview</langVersion>
<AmongUs>E:\Program Files\AmongUs</AmongUs> <AmongUs>D:\Epic Games\AmongUs</AmongUs>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>True</Optimize> <Optimize>True</Optimize>
<AssemblyName>$(MSBuildProjectName)</AssemblyName> <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+2 -1
View File
@@ -2,6 +2,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AU/@EntryIndexedValue">AU</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AU/@EntryIndexedValue">AU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CD/@EntryIndexedValue">CD</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CD/@EntryIndexedValue">CD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DLL/@EntryIndexedValue">DLL</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DLL/@EntryIndexedValue">DLL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DY/@EntryIndexedValue">DY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EHR/@EntryIndexedValue">EHR</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EHR/@EntryIndexedValue">EHR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFA/@EntryIndexedValue">FFA</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFA/@EntryIndexedValue">FFA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFF/@EntryIndexedValue">FFF</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFF/@EntryIndexedValue">FFF</s:String>
@@ -11,5 +12,5 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RPC/@EntryIndexedValue">RPC</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RPC/@EntryIndexedValue">RPC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SK/@EntryIndexedValue">SK</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SK/@EntryIndexedValue">SK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TMP/@EntryIndexedValue">TMP</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TMP/@EntryIndexedValue">TMP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TOHE/@EntryIndexedValue">TOHE</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EHR/@EntryIndexedValue">EHR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VN/@EntryIndexedValue">VN</s:String></wpf:ResourceDictionary> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VN/@EntryIndexedValue">VN</s:String></wpf:ResourceDictionary>
+5 -15
View File
@@ -22,7 +22,6 @@ internal static class FFAManager
public static string LatestChatMessage = string.Empty; public static string LatestChatMessage = string.Empty;
//Options
public static OptionItem FFAGameTime; public static OptionItem FFAGameTime;
public static OptionItem FFAKcd; public static OptionItem FFAKcd;
public static OptionItem FFALowerVision; public static OptionItem FFALowerVision;
@@ -104,8 +103,6 @@ internal static class FFAManager
{ {
KillCount[pc.PlayerId] = 0; KillCount[pc.PlayerId] = 0;
} }
if (FFAChatDuringGame.GetBool()) _ = new LateTask(Utils.SetChatVisible, 12f, "Set Chat Visible for Everyone");
} }
private static void SendRPCSyncFFAPlayer(byte playerId) private static void SendRPCSyncFFAPlayer(byte playerId)
@@ -126,9 +123,7 @@ internal static class FFAManager
{ {
if (pc.AmOwner || !pc.IsModClient()) return; if (pc.AmOwner || !pc.IsModClient()) return;
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SyncFFANameNotify, SendOption.Reliable, pc.GetClientId()); 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(NameNotify.TryGetValue(pc.PlayerId, out (string TEXT, long TIMESTAMP) value) ? value.TEXT : string.Empty);
writer.Write(value.TEXT);
else writer.Write(string.Empty);
AmongUsClient.Instance.FinishRpcImmediately(writer); AmongUsClient.Instance.FinishRpcImmediately(writer);
} }
@@ -136,7 +131,7 @@ internal static class FFAManager
{ {
var name = reader.ReadString(); var name = reader.ReadString();
NameNotify.Remove(PlayerControl.LocalPlayer.PlayerId); NameNotify.Remove(PlayerControl.LocalPlayer.PlayerId);
if (name != null && name != string.Empty) if (!string.IsNullOrEmpty(name))
NameNotify.Add(PlayerControl.LocalPlayer.PlayerId, (name, 0)); NameNotify.Add(PlayerControl.LocalPlayer.PlayerId, (name, 0));
} }
@@ -165,7 +160,7 @@ internal static class FFAManager
try try
{ {
int ms = KillCount[playerId]; 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)); rank += KillCount.Where(x => x.Value == ms).ToList().IndexOf(new(playerId, ms));
return rank; return rank;
} }
@@ -313,7 +308,7 @@ internal static class FFAManager
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat(); 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; mark = false;
killer.SyncSettings(); killer.SyncSettings();
@@ -343,12 +338,7 @@ internal static class FFAManager
if (Main.AllAlivePlayerControls.Length != 2) return string.Empty; if (Main.AllAlivePlayerControls.Length != 2) return string.Empty;
string arrows = string.Empty; string arrows = string.Empty;
PlayerControl otherPlayer = null; PlayerControl otherPlayer = Main.AllAlivePlayerControls.FirstOrDefault(pc => pc.IsAlive() && pc.PlayerId != seer.PlayerId);
foreach (var pc in Main.AllAlivePlayerControls.Where(pc => pc.IsAlive() && pc.PlayerId != seer.PlayerId).ToArray())
{
otherPlayer = pc;
break;
}
if (otherPlayer == null) return string.Empty; if (otherPlayer == null) return string.Empty;
+2 -2
View File
@@ -19,6 +19,8 @@ namespace EHR
public static (byte HolderID, byte LastHolderID, int TimeLeft, int RoundNum) GetState() => HotPotatoState; public static (byte HolderID, byte LastHolderID, int TimeLeft, int RoundNum) GetState() => HotPotatoState;
public static bool IsChatDuringGame => Chat.GetBool();
public static void SetupCustomOption() public static void SetupCustomOption()
{ {
Time = IntegerOptionItem.Create(69_213_001, "HotPotato_Time", new(1, 90, 1), 20, TabGroup.GameSettings, false) 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; foreach (var pc in Main.AllPlayerControls) SurvivalTimes[pc.PlayerId] = 0;
DefaultSpeed = Main.AllPlayerSpeed[0]; DefaultSpeed = Main.AllPlayerSpeed[0];
if (Chat.GetBool()) _ = new LateTask(Utils.SetChatVisible, 12f, "Set Chat Visible for Everyone");
} }
public static void OnGameStart() public static void OnGameStart()
+2 -2
View File
@@ -66,8 +66,8 @@ public class ClientOptionItem
var modOptionsButton = Object.Instantiate(mouseMoveToggle, generalTab); var modOptionsButton = Object.Instantiate(mouseMoveToggle, generalTab);
modOptionsButton.transform.localPosition = leaveButton?.transform?.localPosition ?? new(0f, -2.4f, 1f); modOptionsButton.transform.localPosition = leaveButton?.transform?.localPosition ?? new(0f, -2.4f, 1f);
modOptionsButton.name = "TOHEOptions"; modOptionsButton.name = "EHROptions";
modOptionsButton.Text.text = Translator.GetString("TOHEOptions"); modOptionsButton.Text.text = Translator.GetString("EHROptions");
modOptionsButton.Background.color = new Color32(255, 192, 203, byte.MaxValue); modOptionsButton.Background.color = new Color32(255, 192, 203, byte.MaxValue);
var modOptionsPassiveButton = modOptionsButton.GetComponent<PassiveButton>(); var modOptionsPassiveButton = modOptionsButton.GetComponent<PassiveButton>();
modOptionsPassiveButton.OnClick = new(); modOptionsPassiveButton.OnClick = new();
+1 -1
View File
@@ -172,7 +172,7 @@ internal static class CustomRoleSelector
if (Roles[RoleAssignType.Impostor].Count == 0 && !Main.SetRoles.Values.Any(x => x.IsImpostor())) 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"); Logger.Warn("Adding Vanilla Impostor", "CustomRoleSelector");
} }
+43 -39
View File
@@ -54,10 +54,11 @@ internal static class CustomRolesHelper
return Activator.CreateInstance(roleClass.GetType()) as RoleBase; 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.IsGhostRole()) return CustomRoles.GuardianAngel;
if (role.IsVanilla()) return role; if (role.IsVanilla()) return role;
if (checkDesyncRole && role.GetDYRole() == RoleTypes.Impostor) return CustomRoles.Impostor;
bool UsePets = Options.UsePets.GetBool(); bool UsePets = Options.UsePets.GetBool();
return role switch return role switch
{ {
@@ -74,7 +75,7 @@ internal static class CustomRolesHelper
CustomRoles.SabotageMaster => CustomRoles.Engineer, CustomRoles.SabotageMaster => CustomRoles.Engineer,
CustomRoles.Mafia => Options.LegacyMafia.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor, CustomRoles.Mafia => Options.LegacyMafia.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Terrorist => CustomRoles.Engineer, CustomRoles.Terrorist => CustomRoles.Engineer,
CustomRoles.Executioner => CustomRoles.Crewmate, CustomRoles.Executioner => Executioner.CRoleChangeRoles[Executioner.ChangeRolesAfterTargetKilled.GetValue()].GetVNRole(checkDesyncRole: true),
CustomRoles.Lawyer => CustomRoles.Crewmate, CustomRoles.Lawyer => CustomRoles.Crewmate,
CustomRoles.NiceSwapper => CustomRoles.Crewmate, CustomRoles.NiceSwapper => CustomRoles.Crewmate,
CustomRoles.Ignitor => CustomRoles.Crewmate, CustomRoles.Ignitor => CustomRoles.Crewmate,
@@ -83,9 +84,9 @@ internal static class CustomRolesHelper
CustomRoles.BountyHunter => CustomRoles.Impostor, CustomRoles.BountyHunter => CustomRoles.Impostor,
CustomRoles.Trickster => CustomRoles.Impostor, CustomRoles.Trickster => CustomRoles.Impostor,
CustomRoles.Witch => CustomRoles.Impostor, CustomRoles.Witch => CustomRoles.Impostor,
CustomRoles.ShapeshifterTOHE => CustomRoles.Shapeshifter, CustomRoles.ShapeshifterEHR => CustomRoles.Shapeshifter,
CustomRoles.Agitater => CustomRoles.Impostor, CustomRoles.Agitater => CustomRoles.Impostor,
CustomRoles.ImpostorTOHE => CustomRoles.Impostor, CustomRoles.ImpostorEHR => CustomRoles.Impostor,
CustomRoles.EvilDiviner => CustomRoles.Impostor, CustomRoles.EvilDiviner => CustomRoles.Impostor,
CustomRoles.Wildling => Wildling.CanShapeshiftOpt.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor, CustomRoles.Wildling => Wildling.CanShapeshiftOpt.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Morphling => CustomRoles.Shapeshifter, CustomRoles.Morphling => CustomRoles.Shapeshifter,
@@ -120,15 +121,15 @@ internal static class CustomRolesHelper
CustomRoles.Hitman => CustomRoles.Shapeshifter, CustomRoles.Hitman => CustomRoles.Shapeshifter,
CustomRoles.Saboteur => CustomRoles.Impostor, CustomRoles.Saboteur => CustomRoles.Impostor,
CustomRoles.Doctor => CustomRoles.Scientist, CustomRoles.Doctor => CustomRoles.Scientist,
CustomRoles.ScientistTOHE => CustomRoles.Scientist, CustomRoles.ScientistEHR => CustomRoles.Scientist,
CustomRoles.Tracefinder => CustomRoles.Scientist, CustomRoles.Tracefinder => CustomRoles.Scientist,
CustomRoles.Puppeteer => CustomRoles.Impostor, CustomRoles.Puppeteer => CustomRoles.Impostor,
CustomRoles.TimeThief => CustomRoles.Impostor, CustomRoles.TimeThief => CustomRoles.Impostor,
CustomRoles.EvilTracker => CustomRoles.Shapeshifter, CustomRoles.EvilTracker => CustomRoles.Shapeshifter,
CustomRoles.Paranoia => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer, CustomRoles.Paranoia => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.EngineerTOHE => CustomRoles.Engineer, CustomRoles.EngineerEHR => CustomRoles.Engineer,
CustomRoles.TimeMaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer, CustomRoles.TimeMaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.CrewmateTOHE => CustomRoles.Crewmate, CustomRoles.CrewmateEHR => CustomRoles.Crewmate,
CustomRoles.Cleanser => CustomRoles.Crewmate, CustomRoles.Cleanser => CustomRoles.Crewmate,
CustomRoles.Miner => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter, CustomRoles.Miner => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Psychic => CustomRoles.Crewmate, CustomRoles.Psychic => CustomRoles.Crewmate,
@@ -150,7 +151,7 @@ internal static class CustomRolesHelper
CustomRoles.Beacon => CustomRoles.Crewmate, CustomRoles.Beacon => CustomRoles.Crewmate,
CustomRoles.Rabbit => CustomRoles.Crewmate, CustomRoles.Rabbit => CustomRoles.Crewmate,
CustomRoles.Shiftguard => CustomRoles.Crewmate, CustomRoles.Shiftguard => CustomRoles.Crewmate,
CustomRoles.Mole => CustomRoles.Engineer, CustomRoles.Mole => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Markseeker => CustomRoles.Crewmate, CustomRoles.Markseeker => CustomRoles.Crewmate,
CustomRoles.Sentinel => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer, CustomRoles.Sentinel => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Electric => CustomRoles.Crewmate, CustomRoles.Electric => CustomRoles.Crewmate,
@@ -185,7 +186,7 @@ internal static class CustomRolesHelper
CustomRoles.EvilGuesser => CustomRoles.Impostor, CustomRoles.EvilGuesser => CustomRoles.Impostor,
CustomRoles.Detective => CustomRoles.Crewmate, CustomRoles.Detective => CustomRoles.Crewmate,
CustomRoles.God => CustomRoles.Crewmate, CustomRoles.God => CustomRoles.Crewmate,
CustomRoles.GuardianAngelTOHE => CustomRoles.GuardianAngel, CustomRoles.GuardianAngelEHR => CustomRoles.GuardianAngel,
CustomRoles.Zombie => CustomRoles.Impostor, CustomRoles.Zombie => CustomRoles.Impostor,
CustomRoles.Mario => CustomRoles.Engineer, CustomRoles.Mario => CustomRoles.Engineer,
CustomRoles.AntiAdminer => AntiAdminer.EnableExtraAbility.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor, 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; if (role.GetDYRole() == RoleTypes.Impostor) vnRole = CustomRoles.Impostor;
return vnRole switch return vnRole switch
{ {
CustomRoles.Crewmate => CustomRoles.CrewmateTOHE, CustomRoles.Crewmate => CustomRoles.CrewmateEHR,
CustomRoles.Engineer => CustomRoles.EngineerTOHE, CustomRoles.Engineer => CustomRoles.EngineerEHR,
CustomRoles.Scientist => CustomRoles.ScientistTOHE, CustomRoles.Scientist => CustomRoles.ScientistEHR,
CustomRoles.Impostor when role.IsCrewmate() => CustomRoles.CrewmateTOHE, CustomRoles.Impostor when role.IsCrewmate() => CustomRoles.CrewmateEHR,
CustomRoles.Impostor => CustomRoles.ImpostorTOHE, CustomRoles.Impostor => CustomRoles.ImpostorEHR,
CustomRoles.Shapeshifter => CustomRoles.ShapeshifterTOHE, CustomRoles.Shapeshifter => CustomRoles.ShapeshifterEHR,
_ => role.IsImpostor() ? CustomRoles.ImpostorTOHE : CustomRoles.CrewmateTOHE _ => role.IsImpostor() ? CustomRoles.ImpostorEHR : CustomRoles.CrewmateEHR
}; };
} }
@@ -288,6 +289,7 @@ internal static class CustomRolesHelper
CustomRoles.Fox => RoleTypes.Crewmate, CustomRoles.Fox => RoleTypes.Crewmate,
CustomRoles.Troll => RoleTypes.Crewmate, CustomRoles.Troll => RoleTypes.Crewmate,
//Standard //Standard
CustomRoles.Executioner => Executioner.CRoleChangeRoles[Executioner.ChangeRolesAfterTargetKilled.GetValue()].GetDYRole(),
CustomRoles.Sheriff => UsePets && Sheriff.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, CustomRoles.Sheriff => UsePets && Sheriff.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor,
CustomRoles.Crusader => UsePets && Crusader.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, CustomRoles.CopyCat => UsePets && CopyCat.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor,
@@ -506,8 +508,8 @@ internal static class CustomRolesHelper
CustomRoles.Impostor or CustomRoles.Impostor or
CustomRoles.Godfather or CustomRoles.Godfather or
CustomRoles.Shapeshifter or CustomRoles.Shapeshifter or
CustomRoles.ShapeshifterTOHE or CustomRoles.ShapeshifterEHR or
CustomRoles.ImpostorTOHE or CustomRoles.ImpostorEHR or
CustomRoles.EvilDiviner or CustomRoles.EvilDiviner or
CustomRoles.Wildling or CustomRoles.Wildling or
CustomRoles.Silencer or CustomRoles.Silencer or
@@ -731,9 +733,9 @@ internal static class CustomRolesHelper
CustomRoles.Pickpocket or CustomRoles.Pickpocket or
CustomRoles.TicketsStealer; 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.Necroview when mainRole is CustomRoles.Doctor => false,
CustomRoles.Lazy when mainRole is CustomRoles.Speedrunner => false, CustomRoles.Lazy when mainRole is CustomRoles.Speedrunner => false,
CustomRoles.Mischievous when mainRole.Is(Team.Impostor) || mainRole.GetDYRole() != RoleTypes.Impostor || !mainRole.IsNK() => 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.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.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.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.Torch when !mainRole.IsCrewmate() || mainRole is CustomRoles.Bewilder or CustomRoles.Sunglasses or CustomRoles.GuardianAngelEHR => false,
CustomRoles.Bewilder when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelTOHE or CustomRoles.Sunglasses => false, CustomRoles.Bewilder when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelEHR or CustomRoles.Sunglasses => false,
CustomRoles.Sunglasses when mainRole is CustomRoles.Torch or CustomRoles.GuardianAngelTOHE or CustomRoles.Bewilder => 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.GuardianAngelTOHE => 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.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.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.GuardianAngelTOHE => false, CustomRoles.Youtuber when !mainRole.IsCrewmate() || mainRole is CustomRoles.Madmate or CustomRoles.Sheriff or CustomRoles.GuardianAngelEHR => false,
CustomRoles.Egoist when !mainRole.IsImpostor() => 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.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, 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.Luckey => false,
CustomRoles.Unlucky when mainRole is CustomRoles.Lucky => false, CustomRoles.Unlucky when mainRole is CustomRoles.Lucky => false,
CustomRoles.Lucky when mainRole is CustomRoles.Unlucky => 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.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.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, 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 _ => 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.Sidekick when pc.Is(CustomRoles.Madmate) => false,
CustomRoles.Madmate when pc.Is(CustomRoles.Sidekick) => false, CustomRoles.Madmate when pc.Is(CustomRoles.Sidekick) => false,
CustomRoles.Egoist 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.Necroview when pc.Is(CustomRoles.Doctor) => false,
CustomRoles.Lazy when pc.Is(CustomRoles.Speedrunner) => false, CustomRoles.Lazy when pc.Is(CustomRoles.Speedrunner) => false,
CustomRoles.Mischievous when pc.Is(Team.Impostor) || pc.GetCustomRole().GetDYRole() != RoleTypes.Impostor || !pc.IsNeutralKiller() => 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.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.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.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.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.GuardianAngelTOHE) || pc.Is(CustomRoles.Sunglasses) => 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.GuardianAngelTOHE) || pc.Is(CustomRoles.Bewilder) => 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.GuardianAngelTOHE) => 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.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.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.GuardianAngelTOHE) => 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.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.GetCustomRole() is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.SerialKiller or CustomRoles.Cantankerous => false,
CustomRoles.Damocles when !pc.CanUseKillButton() => 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.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() && !pc.IsCrewmate()) || pc.Is(CustomRoles.Madmate) => false,
CustomRoles.Loyal when pc.GetCustomRole().IsImpostor() && !Options.ImpCanBeLoyal.GetBool() => 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.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.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, 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.GetCustomRole().IsImpostor() && !Options.ImpostorCanBeSidekick.GetBool() => false,
CustomRoles.Sidekick when pc.Is(CustomRoles.Jackal) => false, CustomRoles.Sidekick when pc.Is(CustomRoles.Jackal) => false,
CustomRoles.Lucky when pc.Is(CustomRoles.Guardian) => 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.Bait when pc.Is(CustomRoles.Trapper) => false,
CustomRoles.Trapper when pc.Is(CustomRoles.Bait) => false, CustomRoles.Trapper when pc.Is(CustomRoles.Bait) => false,
CustomRoles.DualPersonality when pc.Is(CustomRoles.Dictator) => 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.Witch) => false,
CustomRoles.Swift when pc.Is(CustomRoles.Mafia) => false, CustomRoles.Swift when pc.Is(CustomRoles.Mafia) => false,
CustomRoles.Reach when pc.Is(CustomRoles.Mafioso) => 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.Reach when !pc.CanUseKillButton() => false,
CustomRoles.Magnet when !pc.CanUseKillButton() => false, CustomRoles.Magnet when !pc.CanUseKillButton() => false,
CustomRoles.Haste 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.Luckey) => false,
CustomRoles.Unlucky when pc.Is(CustomRoles.Lucky) => false, CustomRoles.Unlucky when pc.Is(CustomRoles.Lucky) => false,
CustomRoles.Lucky when pc.Is(CustomRoles.Unlucky) => 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.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(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, 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), AddonTypes.Mixed => Utils.GetRoleColor(CustomRoles.TaskManager),
_ => Palette.CrewmateBlue _ => Palette.CrewmateBlue
}; };
public static string ToColoredString(this CustomRoles role) => Utils.ColorString(Utils.GetRoleColor(role), Translator.GetString($"{role}"));
} }
public enum RoleOptionType public enum RoleOptionType
+21 -12
View File
@@ -51,6 +51,7 @@ namespace EHR.Modules
public static HashSet<CustomTeam> CustomTeams = []; public static HashSet<CustomTeam> CustomTeams = [];
public static CustomTeam WinnerTeam; public static CustomTeam WinnerTeam;
public static Dictionary<CustomTeam, HashSet<byte>> CustomTeamPlayerIds = [];
public static void LoadCustomTeams() 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() public static bool CheckCustomTeamGameEnd()
{ {
if (CustomTeams.Count == 0) return false; if (CustomTeams.Count == 0 || CustomTeamPlayerIds.Count == 0) return false;
var alivePlayerRoles = Main.PlayerStates CustomTeamPlayerIds.Values.Do(x => x.RemoveWhere(p =>
.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)
{ {
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.ResetAndSetWinner(CustomWinner.CustomTeam);
CustomWinnerHolder.WinnerIds = customTeams.Values.First(); CustomWinnerHolder.WinnerIds = CustomTeamPlayerIds.Values.First();
return true; return true;
} }
+1 -1
View File
@@ -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: "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: "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: "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: "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 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 // lol hi go away
@@ -166,11 +166,11 @@ public class PlayerGameOptionsSender(PlayerControl player) : GameOptionsSender
switch (role) switch (role)
{ {
case CustomRoles.ShapeshifterTOHE: case CustomRoles.ShapeshifterEHR:
AURoleOptions.ShapeshifterCooldown = Options.ShapeshiftCD.GetFloat(); AURoleOptions.ShapeshifterCooldown = Options.ShapeshiftCD.GetFloat();
AURoleOptions.ShapeshifterDuration = Options.ShapeshiftDur.GetFloat(); AURoleOptions.ShapeshifterDuration = Options.ShapeshiftDur.GetFloat();
break; break;
case CustomRoles.ScientistTOHE: case CustomRoles.ScientistEHR:
AURoleOptions.ScientistCooldown = Options.ScientistCD.GetFloat(); AURoleOptions.ScientistCooldown = Options.ScientistCD.GetFloat();
AURoleOptions.ScientistBatteryCharge = Options.ScientistDur.GetFloat(); AURoleOptions.ScientistBatteryCharge = Options.ScientistDur.GetFloat();
break; break;
+1 -1
View File
@@ -1067,7 +1067,7 @@ public static class GuessManager
or CustomRoles.SuperStar or CustomRoles.SuperStar
or CustomRoles.Konan or CustomRoles.Konan
or CustomRoles.Oblivious or CustomRoles.Oblivious
or CustomRoles.GuardianAngelTOHE or CustomRoles.GuardianAngelEHR
) continue; ) continue;
if (!role.IsEnable() && !role.RoleExist(countDead: true) && !role.IsConverted()) continue; if (!role.IsEnable() && !role.RoleExist(countDead: true) && !role.IsConverted()) continue;
+1 -1
View File
@@ -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.Sidekick) && Options.SidekickKnowOtherSidekick.GetBool() => Main.RoleColors[CustomRoles.Jackal],
CustomRoles.Sidekick when target.Is(CustomRoles.Recruit) && 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.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.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.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", CustomRoles.Pyromaniac when ((Pyromaniac)Main.PlayerStates[seer.PlayerId].Role).DousedList.Contains(target.PlayerId) => "#BA4A00",
+46 -34
View File
@@ -27,6 +27,7 @@ public enum CustomGameMode
public static class Options public static class Options
{ {
static Task taskOptionsLoad; static Task taskOptionsLoad;
public static Dictionary<TabGroup, OptionItem[]> GroupedOptions = [];
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.Initialize)), HarmonyPostfix] [HarmonyPatch(typeof(TranslationController), nameof(TranslationController.Initialize)), HarmonyPostfix]
public static void OptionsLoadStart() public static void OptionsLoadStart()
@@ -34,7 +35,19 @@ public static class Options
Logger.Info("Options.Load Start", "Options"); Logger.Info("Options.Load Start", "Options");
Main.LoadRoleClasses(); Main.LoadRoleClasses();
taskOptionsLoad = Task.Run(Load); 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] //[HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start)), HarmonyPostfix]
//public static void WaitOptionsLoad() //public static void WaitOptionsLoad()
@@ -44,7 +57,6 @@ public static class Options
// //Logger.Info("Options.Load End", "Options"); // //Logger.Info("Options.Load End", "Options");
//} //}
// プリセット
//private static readonly string[] presets = //private static readonly string[] presets =
//[ //[
// Main.Preset1.Value, // Main.Preset1.Value,
@@ -54,7 +66,6 @@ public static class Options
// Main.Preset5.Value // Main.Preset5.Value
//]; //];
// ゲームモード
public static OptionItem GameMode; public static OptionItem GameMode;
public static CustomGameMode CurrentGameMode public static CustomGameMode CurrentGameMode
@@ -68,7 +79,7 @@ public static class Options
_ => CustomGameMode.Standard _ => CustomGameMode.Standard
}; };
public static readonly string[] gameModes = public static readonly string[] GameModes =
[ [
"Standard", "Standard",
"SoloKombat", "SoloKombat",
@@ -78,14 +89,13 @@ public static class Options
"HideAndSeek" "HideAndSeek"
]; ];
// 役職数・確率
public static Dictionary<CustomRoles, int> roleCounts; public static Dictionary<CustomRoles, int> roleCounts;
public static Dictionary<CustomRoles, float> roleSpawnChances; public static Dictionary<CustomRoles, float> roleSpawnChances;
public static Dictionary<CustomRoles, OptionItem> CustomRoleCounts; public static Dictionary<CustomRoles, OptionItem> CustomRoleCounts;
public static Dictionary<CustomRoles, StringOptionItem> CustomRoleSpawnChances; public static Dictionary<CustomRoles, StringOptionItem> CustomRoleSpawnChances;
public static Dictionary<CustomRoles, IntegerOptionItem> CustomAdtRoleSpawnRate; public static Dictionary<CustomRoles, IntegerOptionItem> CustomAdtRoleSpawnRate;
public static readonly string[] rates = public static readonly string[] Rates =
[ [
"Rate0", "Rate0",
"Rate5", "Rate5",
@@ -110,7 +120,7 @@ public static class Options
"Rate100", "Rate100",
]; ];
public static readonly string[] ratesZeroOne = public static readonly string[] RatesZeroOne =
[ [
"RoleOff", /*"Rate10", "Rate20", "Rate30", "Rate40", "Rate50", "RoleOff", /*"Rate10", "Rate20", "Rate30", "Rate40", "Rate50",
"Rate60", "Rate70", "Rate80", "Rate90", */ "Rate60", "Rate70", "Rate80", "Rate90", */
@@ -723,7 +733,7 @@ public static class Options
public static OptionItem DisableAirshipGapRoomLightsPanel; public static OptionItem DisableAirshipGapRoomLightsPanel;
public static OptionItem DisableAirshipCargoLightsPanel; public static OptionItem DisableAirshipCargoLightsPanel;
//Guesser Mode// // Guesser Mode
public static OptionItem GuesserMode; public static OptionItem GuesserMode;
public static OptionItem CrewmatesCanGuess; public static OptionItem CrewmatesCanGuess;
public static OptionItem ImpostorsCanGuess; public static OptionItem ImpostorsCanGuess;
@@ -745,7 +755,7 @@ public static class Options
public static OptionItem AprilFoolsMode; public static OptionItem AprilFoolsMode;
// 投票モード // Voting Modes
public static OptionItem VoteMode; public static OptionItem VoteMode;
public static OptionItem WhenSkipVote; public static OptionItem WhenSkipVote;
public static OptionItem WhenSkipVoteIgnoreFirstMeeting; public static OptionItem WhenSkipVoteIgnoreFirstMeeting;
@@ -754,7 +764,7 @@ public static class Options
public static OptionItem WhenNonVote; public static OptionItem WhenNonVote;
public static OptionItem WhenTie; public static OptionItem WhenTie;
public static readonly string[] voteModes = public static readonly string[] VoteModes =
[ [
"Default", "Default",
"Suicide", "Suicide",
@@ -762,7 +772,7 @@ public static class Options
"Skip" "Skip"
]; ];
public static readonly string[] tieModes = public static readonly string[] TieModes =
[ [
"TieMode.Default", "TieMode.Default",
"TieMode.All", "TieMode.All",
@@ -773,21 +783,21 @@ public static class Options
{ {
"GuesserMode.All", "GuesserMode.Harmful", "GuesserMode.Random" "GuesserMode.All", "GuesserMode.Harmful", "GuesserMode.Random"
}; */ }; */
public static readonly string[] madmateSpawnMode = public static readonly string[] MadmateSpawnModeStrings =
[ [
"MadmateSpawnMode.Assign", "MadmateSpawnMode.Assign",
"MadmateSpawnMode.FirstKill", "MadmateSpawnMode.FirstKill",
"MadmateSpawnMode.SelfVote", "MadmateSpawnMode.SelfVote",
]; ];
public static readonly string[] madmateCountMode = public static readonly string[] MadmateCountModeStrings =
[ [
"MadmateCountMode.None", "MadmateCountMode.None",
"MadmateCountMode.Imp", "MadmateCountMode.Imp",
"MadmateCountMode.Crew", "MadmateCountMode.Crew",
]; ];
public static readonly string[] sidekickCountMode = public static readonly string[] SidekickCountMode =
[ [
"SidekickCountMode.Jackal", "SidekickCountMode.Jackal",
"SidekickCountMode.None", "SidekickCountMode.None",
@@ -925,7 +935,7 @@ public static class Options
public static OptionItem DumpLogAfterGameEnd; public static OptionItem DumpLogAfterGameEnd;
public static readonly string[] suffixModes = public static readonly string[] SuffixModes =
[ [
"SuffixMode.None", "SuffixMode.None",
"SuffixMode.Version", "SuffixMode.Version",
@@ -938,7 +948,7 @@ public static class Options
"SuffixMode.AutoHost" "SuffixMode.AutoHost"
]; ];
public static readonly string[] roleAssigningAlgorithms = public static readonly string[] RoleAssigningAlgorithms =
[ [
"RoleAssigningAlgorithm.Default", "RoleAssigningAlgorithm.Default",
"RoleAssigningAlgorithm.NetRandom", "RoleAssigningAlgorithm.NetRandom",
@@ -947,7 +957,7 @@ public static class Options
"RoleAssigningAlgorithm.MersenneTwister", "RoleAssigningAlgorithm.MersenneTwister",
]; ];
public static readonly string[] formatNameModes = public static readonly string[] FormatNameModes =
[ [
"FormatNameModes.None", "FormatNameModes.None",
"FormatNameModes.Color", "FormatNameModes.Color",
@@ -1019,7 +1029,7 @@ public static class Options
.SetColor(new Color32(255, 235, 4, byte.MaxValue)) .SetColor(new Color32(255, 235, 4, byte.MaxValue))
.SetHeader(true); .SetHeader(true);
GameMode = StringOptionItem.Create(1, "GameMode", gameModes, 0, TabGroup.GameSettings, false) GameMode = StringOptionItem.Create(1, "GameMode", GameModes, 0, TabGroup.GameSettings, false)
.SetHeader(true); .SetHeader(true);
#region Settings #region Settings
@@ -1236,17 +1246,13 @@ public static class Options
#endregion #endregion
#region TOHESettings #region EHRSettings
MainLoadingText = "Building EHR settings"; MainLoadingText = "Building EHR settings";
KickLowLevelPlayer = IntegerOptionItem.Create(19300, "KickLowLevelPlayer", new(0, 100, 1), 0, TabGroup.SystemSettings, false) KickLowLevelPlayer = IntegerOptionItem.Create(19300, "KickLowLevelPlayer", new(0, 100, 1), 0, TabGroup.SystemSettings, false)
.SetValueFormat(OptionFormat.Level) .SetValueFormat(OptionFormat.Level)
.SetHeader(true); .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); KickAndroidPlayer = BooleanOptionItem.Create(19301, "KickAndroidPlayer", false, TabGroup.SystemSettings, false);
KickPlayerFriendCodeNotExist = BooleanOptionItem.Create(19302, "KickPlayerFriendCodeNotExist", false, TabGroup.SystemSettings, true); KickPlayerFriendCodeNotExist = BooleanOptionItem.Create(19302, "KickPlayerFriendCodeNotExist", false, TabGroup.SystemSettings, true);
ApplyDenyNameList = BooleanOptionItem.Create(19303, "ApplyDenyNameList", true, 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); AutoDisplayLastAddOns = BooleanOptionItem.Create(19328, "AutoDisplayLastAddOns", true, TabGroup.SystemSettings, false);
AutoDisplayLastResult = BooleanOptionItem.Create(19323, "AutoDisplayLastResult", 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); .SetHeader(true);
HideGameSettings = BooleanOptionItem.Create(19400, "HideGameSettings", false, TabGroup.SystemSettings, false); HideGameSettings = BooleanOptionItem.Create(19400, "HideGameSettings", false, TabGroup.SystemSettings, false);
DIYGameSettings = BooleanOptionItem.Create(19401, "DIYGameSettings", false, TabGroup.SystemSettings, false); DIYGameSettings = BooleanOptionItem.Create(19401, "DIYGameSettings", false, TabGroup.SystemSettings, false);
PlayerCanSetColor = BooleanOptionItem.Create(19402, "PlayerCanSetColor", false, TabGroup.SystemSettings, false); PlayerCanSetColor = BooleanOptionItem.Create(19402, "PlayerCanSetColor", false, TabGroup.SystemSettings, false);
PlayerCanSetName = BooleanOptionItem.Create(19410, "PlayerCanSetName", false, TabGroup.SystemSettings, false); PlayerCanSetName = BooleanOptionItem.Create(19410, "PlayerCanSetName", false, TabGroup.SystemSettings, false);
PlayerCanTPInAndOut = BooleanOptionItem.Create(19411, "PlayerCanTPInAndOut", 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); DisableEmojiName = BooleanOptionItem.Create(19404, "DisableEmojiName", true, TabGroup.SystemSettings, false);
ChangeNameToRoleInfo = BooleanOptionItem.Create(19405, "ChangeNameToRoleInfo", true, TabGroup.SystemSettings, false); ChangeNameToRoleInfo = BooleanOptionItem.Create(19405, "ChangeNameToRoleInfo", true, TabGroup.SystemSettings, false);
SendRoleDescriptionFirstMeeting = BooleanOptionItem.Create(19406, "SendRoleDescriptionFirstMeeting", true, TabGroup.SystemSettings, false); SendRoleDescriptionFirstMeeting = BooleanOptionItem.Create(19406, "SendRoleDescriptionFirstMeeting", true, TabGroup.SystemSettings, false);
@@ -1330,7 +1336,7 @@ public static class Options
.SetColor(Color.red); .SetColor(Color.red);
AllowConsole = BooleanOptionItem.Create(19408, "AllowConsole", false, TabGroup.SystemSettings, false) AllowConsole = BooleanOptionItem.Create(19408, "AllowConsole", false, TabGroup.SystemSettings, false)
.SetColor(Color.red); .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)); .RegisterUpdateValueEvent((_, args) => IRandom.SetInstanceById(args.CurrentValue));
KPDCamouflageMode = StringOptionItem.Create(19500, "KPDCamouflageMode", CamouflageMode, 0, TabGroup.SystemSettings, false) KPDCamouflageMode = StringOptionItem.Create(19500, "KPDCamouflageMode", CamouflageMode, 0, TabGroup.SystemSettings, false)
.SetHeader(true) .SetHeader(true)
@@ -1999,7 +2005,7 @@ public static class Options
LoadingPercentage = 89; 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) DisableOtherTasks = BooleanOptionItem.Create(23200, "DisableOtherTasks", false, TabGroup.TaskSettings, false)
.SetGameMode(CustomGameMode.Standard) .SetGameMode(CustomGameMode.Standard)
.SetColor(new Color32(239, 89, 175, byte.MaxValue)); .SetColor(new Color32(239, 89, 175, byte.MaxValue));
@@ -2091,6 +2097,12 @@ public static class Options
.SetParent(AllAliveMeeting) .SetParent(AllAliveMeeting)
.SetValueFormat(OptionFormat.Seconds); .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; LoadingPercentage = 94;
@@ -2111,7 +2123,7 @@ public static class Options
VoteMode = BooleanOptionItem.Create(23600, "VoteMode", false, TabGroup.GameSettings, false) VoteMode = BooleanOptionItem.Create(23600, "VoteMode", false, TabGroup.GameSettings, false)
.SetColor(new Color32(147, 241, 240, byte.MaxValue)) .SetColor(new Color32(147, 241, 240, byte.MaxValue))
.SetGameMode(CustomGameMode.Standard); .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) .SetParent(VoteMode)
.SetGameMode(CustomGameMode.Standard); .SetGameMode(CustomGameMode.Standard);
WhenSkipVoteIgnoreFirstMeeting = BooleanOptionItem.Create(23611, "WhenSkipVoteIgnoreFirstMeeting", false, TabGroup.GameSettings, false) 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) WhenSkipVoteIgnoreEmergency = BooleanOptionItem.Create(23613, "WhenSkipVoteIgnoreEmergency", false, TabGroup.GameSettings, false)
.SetParent(WhenSkipVote) .SetParent(WhenSkipVote)
.SetGameMode(CustomGameMode.Standard); .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) .SetParent(VoteMode)
.SetGameMode(CustomGameMode.Standard); .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) .SetParent(VoteMode)
.SetGameMode(CustomGameMode.Standard); .SetGameMode(CustomGameMode.Standard);
@@ -2139,7 +2151,7 @@ public static class Options
LadderDeath = BooleanOptionItem.Create(23800, "LadderDeath", false, TabGroup.GameSettings, false) LadderDeath = BooleanOptionItem.Create(23800, "LadderDeath", false, TabGroup.GameSettings, false)
.SetColor(new Color32(193, 255, 209, byte.MaxValue)); .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); .SetParent(LadderDeath);
LoadingPercentage = 97; 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) 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) .SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem; .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) 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) .SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem; .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) 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) .SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem; .SetGameMode(customGameMode) as StringOptionItem;
+1 -1
View File
@@ -247,7 +247,7 @@ public abstract class OptionItem
{ {
CurrentPreset = Math.Clamp(newPreset, 0, NumPresets - 1); CurrentPreset = Math.Clamp(newPreset, 0, NumPresets - 1);
foreach (OptionItem op in AllOptions.ToArray()) foreach (OptionItem op in AllOptions)
{ {
op.Refresh(); op.Refresh();
} }
+9 -6
View File
@@ -1,20 +1,23 @@
using System;
using System.Linq;
namespace EHR; 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 IntegerValueRule Rule = (0, selections.Length - 1, 1);
public string[] Selections = selections; public string[] Selections = selections;
public static StringOptionItem Create(int id, string name, string[] selections, int defaultIndex, TabGroup tab, bool isSingleValue) 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); => new(id, name, defaultIndex, tab, isSingleValue, selections, noTranslation);
// Getter // Getter
public override int GetInt() => Rule.GetValueByIndex(CurrentValue); public override int GetInt() => Rule.GetValueByIndex(CurrentValue);
public override float GetFloat() => Rule.GetValueByIndex(CurrentValue); public override float GetFloat() => Rule.GetValueByIndex(CurrentValue);
public override string GetString() 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() public int GetChance()
{ {
@@ -25,7 +28,7 @@ public class StringOptionItem(int id, string name, int defaultValue, TabGroup ta
if (Selections.Length == 3) return CurrentValue; if (Selections.Length == 3) return CurrentValue;
//For 0% to 100% or 5% to 100% //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 index = CurrentValue + offset;
var rate = index * 5; var rate = index * 5;
return rate; return rate;
+1 -1
View File
@@ -45,7 +45,7 @@ public static class OptionSaver
{ {
Dictionary<int, int> singleOptions = []; Dictionary<int, int> singleOptions = [];
Dictionary<int, int[]> presetOptions = []; Dictionary<int, int[]> presetOptions = [];
foreach (OptionItem option in OptionItem.AllOptions.ToArray()) foreach (OptionItem option in OptionItem.AllOptions)
{ {
if (option.IsSingleValue) if (option.IsSingleValue)
{ {
+7 -5
View File
@@ -59,12 +59,14 @@ public static class OptionShower
ShowChildren(kvp.Value, ref sb, Utils.GetRoleColor(kvp.Key).ShadeColor(-0.5f), 1); 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'); if (opt.Id is >= 90000 and (< 600000 or > 700000) && !opt.IsHiddenOn(Options.CurrentGameMode) && opt.Parent == null && !opt.IsText)
sb.Append($"{opt.GetName()}: {opt.GetString()}\n"); {
if (opt.GetBool()) if (opt.IsHeader) sb.Append('\n');
ShowChildren(opt, ref sb, Color.white, 1); sb.Append($"{opt.GetName()}: {opt.GetString()}\n");
if (opt.GetBool()) ShowChildren(opt, ref sb, Color.white, 1);
}
} }
} }
-9
View File
@@ -730,15 +730,6 @@ internal static class RPC
} }
} }
/*
public static void SyncCustomSettingsRPCforOneOption(OptionItem option)
{
List<OptionItem> 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) static void SyncOptionsBetween(int startAmount, int lastAmount, int targetId = -1)
{ {
if (targetId != -1) if (targetId != -1)
+3
View File
@@ -1601,6 +1601,7 @@ public static class Utils
if (!AmongUsClient.Instance.AmHost) return; if (!AmongUsClient.Instance.AmHost) return;
if (title == "") title = "<color=#aaaaff>" + GetString("DefaultSystemMessageTitle") + "</color>"; if (title == "") title = "<color=#aaaaff>" + GetString("DefaultSystemMessageTitle") + "</color>";
text = text.Replace("color=", string.Empty); text = text.Replace("color=", string.Empty);
Main.MessagesToSend.Add((text.RemoveHtmlTagsTemplate(), sendTo, title)); Main.MessagesToSend.Add((text.RemoveHtmlTagsTemplate(), sendTo, title));
} }
@@ -2374,6 +2375,7 @@ public static class Utils
int CD = role switch int CD = role switch
{ {
CustomRoles.Mole => 5,
CustomRoles.Doormaster => Doormaster.VentCooldown.GetInt(), CustomRoles.Doormaster => Doormaster.VentCooldown.GetInt(),
CustomRoles.Tether => Tether.VentCooldown.GetInt(), CustomRoles.Tether => Tether.VentCooldown.GetInt(),
CustomRoles.Mayor => (int)Math.Round(Options.DefaultKillCooldown), CustomRoles.Mayor => (int)Math.Round(Options.DefaultKillCooldown),
@@ -2565,6 +2567,7 @@ public static class Utils
Bloodhound.OnPlayerDead(target); Bloodhound.OnPlayerDead(target);
Tracefinder.OnPlayerDead(target); Tracefinder.OnPlayerDead(target);
Vulture.OnPlayerDead(target); Vulture.OnPlayerDead(target);
Tracker.OnPlayerDeath(target);
FixedUpdatePatch.LoversSuicide(target.PlayerId, onMeeting); FixedUpdatePatch.LoversSuicide(target.PlayerId, onMeeting);
} }
+2 -6
View File
@@ -274,14 +274,14 @@ internal class ChatCommands
if (Main.AlwaysSpawnTogetherCombos.Count > 0) if (Main.AlwaysSpawnTogetherCombos.Count > 0)
{ {
sb.AppendLine(GetString("AlwaysComboListTitle")); 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(); sb.AppendLine();
} }
if (Main.NeverSpawnTogetherCombos.Count > 0) if (Main.NeverSpawnTogetherCombos.Count > 0)
{ {
sb.AppendLine(GetString("NeverComboListTitle")); 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(); sb.AppendLine();
} }
@@ -326,10 +326,6 @@ internal class ChatCommands
break; break;
case "/xor":
break;
case "/eff": case "/eff":
case "/effect": case "/effect":
canceled = true; canceled = true;
-1
View File
@@ -357,7 +357,6 @@ class GameEndChecker
if (Main.AllAlivePlayerControls.All(p => p.Is(CustomRoles.Lovers))) if (Main.AllAlivePlayerControls.All(p => p.Is(CustomRoles.Lovers)))
{ {
reason = GameOverReason.ImpostorByKill;
ResetAndSetWinner(CustomWinner.Lovers); ResetAndSetWinner(CustomWinner.Lovers);
return true; return true;
} }
+74 -53
View File
@@ -37,29 +37,32 @@ public static class GameOptionsMenuPatch
{ {
public static void Postfix(GameOptionsMenu __instance) 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: switch (ob.Title)
ob.Cast<NumberOption>().ValidRange = new(0, 600); {
break; case StringNames.GameVotingTime:
case StringNames.GameShortTasks: ob.Cast<NumberOption>().ValidRange = new(0, 600);
case StringNames.GameLongTasks: break;
case StringNames.GameCommonTasks: case StringNames.GameShortTasks:
ob.Cast<NumberOption>().ValidRange = new(0, 90); case StringNames.GameLongTasks:
break; case StringNames.GameCommonTasks:
case StringNames.GameKillCooldown: ob.Cast<NumberOption>().ValidRange = new(0, 90);
ob.Cast<NumberOption>().ValidRange = new(0, 180); break;
ob.Cast<NumberOption>().Increment = 0.5f; case StringNames.GameKillCooldown:
break; ob.Cast<NumberOption>().ValidRange = new(0, 180);
case StringNames.GamePlayerSpeed: ob.Cast<NumberOption>().Increment = 0.5f;
case StringNames.GameCrewLight: break;
case StringNames.GameImpostorLight: case StringNames.GamePlayerSpeed:
ob.Cast<NumberOption>().Increment = 0.05f; case StringNames.GameCrewLight:
break; case StringNames.GameImpostorLight:
ob.Cast<NumberOption>().Increment = 0.05f;
break;
}
} }
} }, 2f, log: false);
var template = Object.FindObjectsOfType<StringOption>().FirstOrDefault(); var template = Object.FindObjectsOfType<StringOption>().FirstOrDefault();
if (template == null) return; if (template == null) return;
@@ -81,7 +84,9 @@ public static class GameOptionsMenuPatch
var gameTab = GameObject.Find("GameTab"); var gameTab = GameObject.Find("GameTab");
System.Collections.Generic.List<GameObject> tabs = [gameTab, roleTab]; System.Collections.Generic.List<GameObject> tabs = [gameTab, roleTab];
foreach (var tab in EnumHelper.GetAllValues<TabGroup>()) float delay = 0f;
foreach ((TabGroup tab, OptionItem[] optionItems) in Options.GroupedOptions)
{ {
var obj = gameSettings.transform.parent.Find(tab + "Tab"); var obj = gameSettings.transform.parent.Find(tab + "Tab");
if (obj != null) if (obj != null)
@@ -92,56 +97,72 @@ public static class GameOptionsMenuPatch
var tohSettings = Object.Instantiate(gameSettings, gameSettings.transform.parent); var tohSettings = Object.Instantiate(gameSettings, gameSettings.transform.parent);
tohSettings.name = tab + "Tab"; 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("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("Bottom Gradient").transform.localPosition += new Vector3(0.2f, 0f, 0f);
tohSettings.transform.FindChild("Background").transform.localScale = new(1.8f, 1f, 1f); 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_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("UI_ScrollbarTrack").transform.localPosition += new Vector3(1.4f, 0f, 0f);
tohSettings.transform.FindChild("GameGroup/SliderInner").transform.localPosition += new Vector3(-0.3f, 0f, 0f); tohSettings.transform.FindChild("GameGroup/SliderInner").transform.localPosition += new Vector3(-0.3f, 0f, 0f);
var tohMenu = tohSettings.transform.FindChild("GameGroup/SliderInner").GetComponent<GameOptionsMenu>(); var tohMenu = tohSettings.transform.FindChild("GameGroup/SliderInner").GetComponent<GameOptionsMenu>();
tohMenu.GetComponentsInChildren<OptionBehaviour>().Do(x => Object.Destroy(x.gameObject));
var scOptions = new System.Collections.Generic.List<OptionBehaviour>(); var scOptions = new System.Collections.Generic.List<OptionBehaviour>();
foreach (OptionItem option in OptionItem.AllOptions)
_ = new LateTask(() =>
{ {
if (option.Tab != tab) continue; tohMenu.GetComponentsInChildren<OptionBehaviour>().Do(x => Object.Destroy(x.gameObject));
if (option.OptionBehaviour == null)
foreach (OptionItem option in optionItems)
{ {
float yoffset = option.IsText ? 100f : 0f; if (option.OptionBehaviour == null)
var stringOption = Object.Instantiate(template, tohMenu.transform); {
scOptions.Add(stringOption); float yoffset = option.IsText ? 100f : 0f;
stringOption.OnValueChanged = new Action<OptionBehaviour>(_ => { }); var stringOption = Object.Instantiate(template, tohMenu.transform);
stringOption.TitleText.text = option.Name; scOptions.Add(stringOption);
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<SpriteRenderer>().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<RectTransform>().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<RectTransform>().sizeDelta = new(5.5f, 0.37f);
option.OptionBehaviour = stringOption; stringOption.OnValueChanged = new Action<OptionBehaviour>(_ => { });
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<SpriteRenderer>().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<RectTransform>().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<RectTransform>().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(); tohMenu.Children = scOptions.ToArray();
tohSettings.gameObject.SetActive(false); tohSettings.gameObject.SetActive(false);
menus.Add(tohSettings.gameObject); menus.Add(tohSettings.gameObject);
var tohTab = Object.Instantiate(roleTab, roleTab.transform.parent); var tohTab = Object.Instantiate(roleTab, roleTab.transform.parent);
tohTab.transform.FindChild("Hat Button").FindChild("Icon").GetComponent<SpriteRenderer>().sprite = Utils.LoadSprite($"EHR.Resources.Images.TabIcon_{tab}.png", 100f); var hatButton = tohTab.transform.FindChild("Hat Button");
hatButton.FindChild("Icon").GetComponent<SpriteRenderer>().sprite = Utils.LoadSprite($"EHR.Resources.Images.TabIcon_{tab}.png", 100f);
tabs.Add(tohTab); tabs.Add(tohTab);
var tohTabHighlight = tohTab.transform.FindChild("Hat Button").FindChild("Tab Background").GetComponent<SpriteRenderer>(); var tohTabHighlight = hatButton.FindChild("Tab Background").GetComponent<SpriteRenderer>();
highlights.Add(tohTabHighlight); highlights.Add(tohTabHighlight);
} }
@@ -176,7 +197,8 @@ public class GameOptionsMenuUpdatePatch
public static void Postfix(GameOptionsMenu __instance) public static void Postfix(GameOptionsMenu __instance)
{ {
if (__instance.transform.parent.parent.name == "Game Settings") return; if (__instance.transform.parent.parent.name == "Game Settings") return;
foreach (var tab in EnumHelper.GetAllValues<TabGroup>())
foreach ((TabGroup tab, OptionItem[] optionItems) in Options.GroupedOptions)
{ {
string tabcolor = tab switch string tabcolor = tab switch
{ {
@@ -199,9 +221,8 @@ public class GameOptionsMenuUpdatePatch
var offset = 2.7f; 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; if (option.OptionBehaviour == null || option.OptionBehaviour.gameObject == null) continue;
var parent = option.Parent; var parent = option.Parent;
+1 -1
View File
@@ -65,7 +65,7 @@ public class GameStartManagerPatch
cancelButton.transform.localPosition = new(0f, -0.36f, 0f); //new(0f, 0.1f, 0f); cancelButton.transform.localPosition = new(0f, -0.36f, 0f); //new(0f, 0.1f, 0f);
var buttonComponent = cancelButton.GetComponent<PassiveButton>(); var buttonComponent = cancelButton.GetComponent<PassiveButton>();
buttonComponent.OnClick = new(); buttonComponent.OnClick = new();
buttonComponent.OnClick.AddListener((Action)(() => __instance.ResetStartState())); buttonComponent.OnClick.AddListener((Action)(__instance.ResetStartState));
cancelButton.gameObject.SetActive(false); cancelButton.gameObject.SetActive(false);
if (!AmongUsClient.Instance.AmHost) return; if (!AmongUsClient.Instance.AmHost) return;
+20 -4
View File
@@ -180,7 +180,7 @@ class BeginCrewmatePatch
return true; return true;
} }
public static void Postfix(IntroCutscene __instance /*, ref Il2CppSystem.Collections.Generic.List<PlayerControl> teamToDisplay*/) public static void Postfix(IntroCutscene __instance, ref List<PlayerControl> teamToDisplay)
{ {
CustomRoles role = PlayerControl.LocalPlayer.GetCustomRole(); CustomRoles role = PlayerControl.LocalPlayer.GetCustomRole();
@@ -306,7 +306,7 @@ class BeginCrewmatePatch
CustomRoles.SabotageMaster or CustomRoles.SabotageMaster or
CustomRoles.Engineer or CustomRoles.Engineer or
CustomRoles.EngineerTOHE or CustomRoles.EngineerEHR or
CustomRoles.Inhibitor or CustomRoles.Inhibitor or
CustomRoles.Saboteur or CustomRoles.Saboteur or
CustomRoles.SecurityGuard or CustomRoles.SecurityGuard or
@@ -401,6 +401,14 @@ class BeginCrewmatePatch
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = bgColor; __instance.TeamTitle.color = __instance.BackgroundBar.material.color = bgColor;
__instance.ImpostorText.gameObject.SetActive(team.RoleRevealScreenSubtitle != "*"); __instance.ImpostorText.gameObject.SetActive(team.RoleRevealScreenSubtitle != "*");
__instance.ImpostorText.text = 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; return true;
} }
public static void Postfix(IntroCutscene __instance /*, ref Il2CppSystem.Collections.Generic.List<PlayerControl> yourTeam*/) public static void Postfix(IntroCutscene __instance, ref List<PlayerControl> 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"); _ = new LateTask(() => Main.AllPlayerControls.Do(pc => pc.RpcSetRoleDesync(RoleTypes.Shapeshifter, -3)), 2f, "SetImpostorForServer");
if (Options.UsePets.GetBool()) if (Options.UsePets.GetBool())
+2 -2
View File
@@ -50,7 +50,7 @@ class EndGamePatch
SummaryText[id] = Utils.SummaryTexts(id, disableColor: false); SummaryText[id] = Utils.SummaryTexts(id, disableColor: false);
if (state.SubRoles.Count == 0) continue; if (state.SubRoles.Count == 0) continue;
Main.LastAddOns[id] = $"<size=70%>{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}")))}</size>"; Main.LastAddOns[id] = $"<size=70%>{Utils.ColorString(Main.PlayerColors.GetValueOrDefault(id, Color.white), Main.AllPlayerNames.GetValueOrDefault(id, $"ID {id}"))}: {state.SubRoles.Join(x => x.ToColoredString())}</size>";
} }
if (Options.DumpLogAfterGameEnd.GetBool()) if (Options.DumpLogAfterGameEnd.GetBool())
@@ -259,7 +259,7 @@ class SetEverythingUpPatch
CustomWinnerText = string.Format(GetString("CustomWinnerText"), team.TeamName); CustomWinnerText = string.Format(GetString("CustomWinnerText"), team.TeamName);
CustomWinnerColor = team.RoleRevealScreenBackgroundColor == "*" ? Main.NeutralColor : team.RoleRevealScreenBackgroundColor; CustomWinnerColor = team.RoleRevealScreenBackgroundColor == "*" ? Main.NeutralColor : team.RoleRevealScreenBackgroundColor;
__instance.BackgroundBar.material.color = ColorUtility.TryParseHtmlString(team.RoleRevealScreenBackgroundColor, out var color) ? color : Utils.GetRoleColor(CustomRoles.Sprayer); __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; goto Skip;
} }
+5 -5
View File
@@ -2051,11 +2051,11 @@ class PlayerControlLocalSetRolePatch
{ {
var moddedRole = role switch var moddedRole = role switch
{ {
RoleTypes.Impostor => CustomRoles.ImpostorTOHE, RoleTypes.Impostor => CustomRoles.ImpostorEHR,
RoleTypes.Shapeshifter => CustomRoles.ShapeshifterTOHE, RoleTypes.Shapeshifter => CustomRoles.ShapeshifterEHR,
RoleTypes.Crewmate => CustomRoles.CrewmateTOHE, RoleTypes.Crewmate => CustomRoles.CrewmateEHR,
RoleTypes.Engineer => CustomRoles.EngineerTOHE, RoleTypes.Engineer => CustomRoles.EngineerEHR,
RoleTypes.Scientist => CustomRoles.ScientistTOHE, RoleTypes.Scientist => CustomRoles.ScientistEHR,
_ => CustomRoles.NotAssigned, _ => CustomRoles.NotAssigned,
}; };
if (moddedRole != CustomRoles.NotAssigned) if (moddedRole != CustomRoles.NotAssigned)
+1 -1
View File
@@ -30,7 +30,7 @@ class OnGameJoinedPatch
GameStates.InGame = false; GameStates.InGame = false;
ErrorText.Instance?.Clear(); ErrorText.Instance?.Clear();
if (AmongUsClient.Instance.AmHost) //以下、ホストのみ実行 if (AmongUsClient.Instance.AmHost)
{ {
GameStartManagerPatch.GameStartManagerUpdatePatch.exitTimer = -1; GameStartManagerPatch.GameStartManagerUpdatePatch.exitTimer = -1;
Main.DoBlockNameChange = false; Main.DoBlockNameChange = false;
+1 -1
View File
@@ -4,7 +4,7 @@ using HarmonyLib;
namespace EHR; namespace EHR;
// 参考:https://github.com/ykundesu/SuperNewRoles/blob/master/SuperNewRoles/Patches/SNROnlySearch.cs // 参考:https://github.com/ykundesu/SuperNewRoles/blob/master/SuperNewRoles/Patches/SNROnlySearch.cs
public static class TOHEOnlySearch public static class EHROnlySearch
{ {
public const string FilterText = "EHR"; public const string FilterText = "EHR";
[HarmonyPatch(typeof(FilterTagManager), nameof(FilterTagManager.RefreshTags))] [HarmonyPatch(typeof(FilterTagManager), nameof(FilterTagManager.RefreshTags))]
+2
View File
@@ -542,6 +542,8 @@ internal class SelectRolesPatch
Asthmatic.Add(); Asthmatic.Add();
Circumvent.Add(); Circumvent.Add();
_ = new LateTask(CustomTeamManager.InitializeCustomTeamPlayers, 7f, log: false);
if (overrideLovers) Logger.Msg(Main.LoversPlayers.Join(x => x?.GetRealName()), "Lovers"); if (overrideLovers) Logger.Msg(Main.LoversPlayers.Join(x => x?.GetRealName()), "Lovers");
EndOfSelectRolePatch: EndOfSelectRolePatch:
+7 -7
View File
@@ -1,6 +1,6 @@
<h1 align="center">Endless Host Roles</h1> <h1 align="center">Endless Host Roles</h1>
<h4 align="center">Previously known as TOHE+</h4> <h4 align="center">Previously known as EHR+</h4>
<br> <br>
@@ -18,7 +18,7 @@
<a href="https://sites.google.com/view/ehr-au" target="_blank"><img src="https://img.shields.io/badge/Website%20-%231DA1F2.svg?&style=for-the-badge&logo=vuedotjs&logoColor=white&color=3aa675"/></a> <a href="https://sites.google.com/view/ehr-au" target="_blank"><img src="https://img.shields.io/badge/Website%20-%231DA1F2.svg?&style=for-the-badge&logo=vuedotjs&logoColor=white&color=3aa675"/></a>
<a href="https://discord.gg/m3ayxfumC8" target="_blank"><img src="https://img.shields.io/badge/Discord%20-%231DA1F2.svg?&style=for-the-badge&logo=discord&logoColor=white&color=5662f6"/></a> <a href="https://discord.gg/m3ayxfumC8" target="_blank"><img src="https://img.shields.io/badge/Discord%20-%231DA1F2.svg?&style=for-the-badge&logo=discord&logoColor=white&color=5662f6"/></a>
<a href="https://github.com/Gurge44/TOHE_PLUS_/releases/latest" target="_blank"><img src="https://img.shields.io/badge/Latest Version%20-%231DA1F2.svg?&style=for-the-badge&logo=github&logoColor=white&color=181717"/></a> <a href="https://github.com/Gurge44/EHR_PLUS_/releases/latest" target="_blank"><img src="https://img.shields.io/badge/Latest Version%20-%231DA1F2.svg?&style=for-the-badge&logo=github&logoColor=white&color=181717"/></a>
</p> </p>
@@ -196,13 +196,13 @@
<br> <br>
## Credit to these mods and their developers for the code and help: ## 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 > - TONX reference: Modify character limit for chat messages
> >
### :star: [TOH](https://github.com/tukasa0001/TownOfHost) : ### :star: [TOH](https://github.com/tukasa0001/TownOfHost) :
@@ -256,7 +256,7 @@
> - Reference: Some custom button images > - 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 > - Provided role: Swapper
> - Reference: Store message history > - Reference: Store message history
+22 -22
View File
@@ -87,12 +87,12 @@
"GuardianAngel": "Guardian Angel", "GuardianAngel": "Guardian Angel",
"Impostor": "Impostor", "Impostor": "Impostor",
"Shapeshifter": "Shapeshifter", "Shapeshifter": "Shapeshifter",
"EngineerTOHE": "Engineer", "EngineerEHR": "Engineer",
"ScientistTOHE": "Scientist", "ScientistEHR": "Scientist",
"ShapeshifterTOHE": "Shapeshifter", "ShapeshifterEHR": "Shapeshifter",
"GuardianAngelTOHE": "Guardian Angel", "GuardianAngelEHR": "Guardian Angel",
"ImpostorTOHE": "Impostor", "ImpostorEHR": "Impostor",
"CrewmateTOHE": "Crewmate", "CrewmateEHR": "Crewmate",
"BountyHunter": "Bounty Hunter", "BountyHunter": "Bounty Hunter",
"Mare": "Mare", "Mare": "Mare",
"FireWorks": "Fireworker", "FireWorks": "Fireworker",
@@ -374,12 +374,12 @@
"Prefix.Sunglasses": "Sunglasses", "Prefix.Sunglasses": "Sunglasses",
"Prefix.Mare": "Mare", "Prefix.Mare": "Mare",
"BracketAddons": "Add Brackets To Add-ons", "BracketAddons": "Add Brackets To Add-ons",
"EngineerTOHEInfo": "Use the vents to catch the <color=#ff1919>Impostors</color>", "EngineerEHRInfo": "Use the vents to catch the <color=#ff1919>Impostors</color>",
"ScientistTOHEInfo": "Access portable vitals from anywhere", "ScientistEHRInfo": "Access portable vitals from anywhere",
"ShapeshifterTOHEInfo": "Disguise as crewmates to frame them", "ShapeshifterEHRInfo": "Disguise as crewmates to frame them",
"GuardianAngelTOHEInfo": "Protect the crewmates from the <color=#ff1919>Impostors</color>", "GuardianAngelEHRInfo": "Protect the crewmates from the <color=#ff1919>Impostors</color>",
"ImpostorTOHEInfo": "Kill and sabotage", "ImpostorEHRInfo": "Kill and sabotage",
"CrewmateTOHEInfo": "Do your tasks", "CrewmateEHRInfo": "Do your tasks",
"BountyHunterInfo": "Eliminate your target", "BountyHunterInfo": "Eliminate your target",
"MareInfo": "Kill in the dark", "MareInfo": "Kill in the dark",
"FireWorksInfo": "Go out with a BANG", "FireWorksInfo": "Go out with a BANG",
@@ -608,12 +608,12 @@
"SunnyboyInfo": "Shine, shine my sunshine!", "SunnyboyInfo": "Shine, shine my sunshine!",
"BardInfo": "Poem's grace, murder's trace, a rhythmic dance in dark embrace.", "BardInfo": "Poem's grace, murder's trace, a rhythmic dance in dark embrace.",
"NukerInfo": "Shapeshift to nuke everyone", "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.", "EngineerEHRInfoLong": "(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.", "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.",
"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.", "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.",
"GuardianAngelTOHEInfoLong": "(Crewmates):\\nAs the Guardian Angel, you spawn as a ghost and must do your job by protecting crewmates from the Impostors.", "GuardianAngelEHRInfoLong": "(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.", "ImpostorEHRInfoLong": "(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.", "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.", "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.", "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.", "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", "turnOn": "On",
"turnOff": "Off", "turnOff": "Off",
"CancelStartCountDown": "The starting countdown was cancelled", "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}", "FPSSetTo": "FPS Set To: {0}",
"HostKillSelfByCommand": "The lobby Host decided to commit suicide", "HostKillSelfByCommand": "The lobby Host decided to commit suicide",
"SyncCustomSettingsRPC": "Synchronized RPC", "SyncCustomSettingsRPC": "Synchronized RPC",
"TOHEVisitorCount": "To date EHR has been used <color={0}>{1}</color> times~", "EHRVisitorCount": "To date EHR has been used <color={0}>{1}</color> times~",
"Mode": "Mode", "Mode": "Mode",
"Target": "Target", "Target": "Target",
"PlayerInfo": "Player Info", "PlayerInfo": "Player Info",
@@ -2331,7 +2331,7 @@
"KBTimeRemain": "<color=#00ffa5>Time Remaining:</color> <b>{0}</b>s", "KBTimeRemain": "<color=#00ffa5>Time Remaining:</color> <b>{0}</b>s",
"ResetDoorsEveryTurns": "Reset All Doors After Meetings", "ResetDoorsEveryTurns": "Reset All Doors After Meetings",
"GameOver": "Game Over", "GameOver": "Game Over",
"TOHEOptions": "EHR Options", "EHROptions": "EHR Options",
"Cancel": "Cancel", "Cancel": "Cancel",
"Back": "Back", "Back": "Back",
"Yes": "Yes", "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.", "ElectricInfoLong": "(Crewmates):\\nAs the Electric, when you complete a task, a random killer gets frozen for a few seconds.",
"Mole": "Mole", "Mole": "Mole",
"MoleInfo": "TP to Random Vents by Entering One", "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", "Tornado": "Tornado",
"TornadoInfo": "Spawn Tornados", "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.", "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.",
+21 -21
View File
@@ -87,12 +87,12 @@
"GuardianAngel": "Anjo da Guarda", "GuardianAngel": "Anjo da Guarda",
"Impostor": "Impostor", "Impostor": "Impostor",
"Shapeshifter": "Metamorfo", "Shapeshifter": "Metamorfo",
"EngineerTOHE": "Engenheiro", "EngineerEHR": "Engenheiro",
"ScientistTOHE": "Cientista", "ScientistEHR": "Cientista",
"ShapeshifterTOHE": "Metamorfo", "ShapeshifterEHR": "Metamorfo",
"GuardianAngelTOHE": "Anjo da Guarda", "GuardianAngelEHR": "Anjo da Guarda",
"ImpostorTOHE": "Impostor", "ImpostorEHR": "Impostor",
"CrewmateTOHE": "Tripulante", "CrewmateEHR": "Tripulante",
"BountyHunter": "Caçador de Recompensas", "BountyHunter": "Caçador de Recompensas",
"Mare": "Pesadelo", "Mare": "Pesadelo",
"FireWorks": "Artilheiro", "FireWorks": "Artilheiro",
@@ -374,12 +374,12 @@
"Prefix.Sunglasses": "Óculos de Sol", "Prefix.Sunglasses": "Óculos de Sol",
"Prefix.Mare": "Pesadelo", "Prefix.Mare": "Pesadelo",
"BracketAddons": "Adicionar parênteses para Atributos", "BracketAddons": "Adicionar parênteses para Atributos",
"EngineerTOHEInfo": "Use ventilações para encontrar os <color=#ff1919>Impostores</color>", "EngineerEHRInfo": "Use ventilações para encontrar os <color=#ff1919>Impostores</color>",
"ScientistTOHEInfo": "Acesse vitais portáveis de qualquer lugar", "ScientistEHRInfo": "Acesse vitais portáveis de qualquer lugar",
"ShapeshifterTOHEInfo": "Disfarce-se de Tripulantes para confundi-los", "ShapeshifterEHRInfo": "Disfarce-se de Tripulantes para confundi-los",
"GuardianAngelTOHEInfo": "Proteja os Tripulantes dos <color=#ff1919>Impostores</color>", "GuardianAngelEHRInfo": "Proteja os Tripulantes dos <color=#ff1919>Impostores</color>",
"ImpostorTOHEInfo": "Sabote e mate todos", "ImpostorEHRInfo": "Sabote e mate todos",
"CrewmateTOHEInfo": "Faça suas tarefas", "CrewmateEHRInfo": "Faça suas tarefas",
"BountyHunterInfo": "Elimine seu alvo", "BountyHunterInfo": "Elimine seu alvo",
"MareInfo": "Mate na escuridão", "MareInfo": "Mate na escuridão",
"FireWorksInfo": "Use explosivos a seu favor", "FireWorksInfo": "Use explosivos a seu favor",
@@ -608,12 +608,12 @@
"SunnyboyInfo": "Brilhe, brilhe meu brilho de sol!", "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", "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", "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.", "EngineerEHRInfoLong": "(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.", "ScientistEHRInfoLong": "(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.", "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.",
"GuardianAngelTOHEInfoLong": "(Tripulantes):★O Anjo Guardião, você aparece como um fantasma e deve fazer o seu trabalho protegendo os Tripulantes dos Impostores.", "GuardianAngelEHRInfoLong": "(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.", "ImpostorEHRInfoLong": "(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.", "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.", "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.", "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á.", "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", "turnOn": "Ligado",
"turnOff": "Desligado", "turnOff": "Desligado",
"CancelStartCountDown": "A contagem para começar o jogo foi cancelada", "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}", "FPSSetTo": "FPS definido para: {0}",
"HostKillSelfByCommand": "O anfitrião da sala decidiu cometer suicídio.", "HostKillSelfByCommand": "O anfitrião da sala decidiu cometer suicídio.",
"SyncCustomSettingsRPC": "RPC Sincronizado", "SyncCustomSettingsRPC": "RPC Sincronizado",
"TOHEVisitorCount": "Até agora o EHR foi usado <color={0}>{1}</color> vezes~", "EHRVisitorCount": "Até agora o EHR foi usado <color={0}>{1}</color> vezes~",
"Mode": "Modo", "Mode": "Modo",
"Target": "Alvo", "Target": "Alvo",
"PlayerInfo": "Informações do Jogador", "PlayerInfo": "Informações do Jogador",
@@ -2326,7 +2326,7 @@
"KBTimeRemain": "<color=#00ffa5>Tempo Restante:</color> <b>{0}</b>s", "KBTimeRemain": "<color=#00ffa5>Tempo Restante:</color> <b>{0}</b>s",
"ResetDoorsEveryTurns": "Redefinir Portas Após Reunião (<color=#ed0007>Airship</color>/<color=#a167c0>Polus</color>/<color=#ffa646>Fungle</color>)", "ResetDoorsEveryTurns": "Redefinir Portas Após Reunião (<color=#ed0007>Airship</color>/<color=#a167c0>Polus</color>/<color=#ffa646>Fungle</color>)",
"GameOver": "Fim de Jogo", "GameOver": "Fim de Jogo",
"TOHEOptions": "Opções EHR", "EHROptions": "Opções EHR",
"Cancel": "Cancelar", "Cancel": "Cancelar",
"Back": "Voltar", "Back": "Voltar",
"Yes": "Sim", "Yes": "Sim",
+1 -1
View File
@@ -10,7 +10,7 @@
## Urgent announcement and warning ## 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. - 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 ## Fixes
- Fixed a lot of minor bugs. There are literally so many that I can't remember them. - Fixed a lot of minor bugs. There are literally so many that I can't remember them.
+1 -1
View File
@@ -12,7 +12,7 @@ namespace EHR.Roles.AddOns.Common
const int id = 16200; const int id = 16200;
const CustomGameMode customGameMode = CustomGameMode.Standard; 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)) .SetColor(Utils.GetRoleColor(role))
.SetHeader(true) .SetHeader(true)
.SetGameMode(customGameMode) as StringOptionItem; .SetGameMode(customGameMode) as StringOptionItem;
+2 -2
View File
@@ -9,9 +9,9 @@ namespace EHR.Roles.AddOns.Impostor
public void SetupCustomOption() public void SetupCustomOption()
{ {
SetupAdtRoleOptions(15800, CustomRoles.Madmate, canSetNum: true, canSetChance: false); 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]); .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]); .SetParent(CustomRoleSpawnChances[CustomRoles.Madmate]);
SheriffCanBeMadmate = BooleanOptionItem.Create(15812, "SheriffCanBeMadmate", false, TabGroup.Addons, false) SheriffCanBeMadmate = BooleanOptionItem.Create(15812, "SheriffCanBeMadmate", false, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Madmate]); .SetParent(CustomRoleSpawnChances[CustomRoles.Madmate]);
+1 -1
View File
@@ -11,7 +11,7 @@ namespace EHR.Roles.Crewmate
if (killer == null) return; if (killer == null) return;
if (!killer.GetCustomRole().IsImpostor()) 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);
} }
} }
} }
+5 -5
View File
@@ -8,14 +8,14 @@ namespace EHR.Roles.Crewmate
public void SetupCustomOption() public void SetupCustomOption()
{ {
SetupRoleOptions(5050, Tab, CustomRoles.CrewmateTOHE); SetupRoleOptions(5050, Tab, CustomRoles.CrewmateEHR);
SetupRoleOptions(5000, Tab, CustomRoles.EngineerTOHE); SetupRoleOptions(5000, Tab, CustomRoles.EngineerEHR);
SetupRoleOptions(5100, Tab, CustomRoles.ScientistTOHE); SetupRoleOptions(5100, Tab, CustomRoles.ScientistEHR);
ScientistCD = FloatOptionItem.Create(5110, "VitalsCooldown", new(1f, 250f, 1f), 3f, Tab, false) ScientistCD = FloatOptionItem.Create(5110, "VitalsCooldown", new(1f, 250f, 1f), 3f, Tab, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.ScientistTOHE]) .SetParent(CustomRoleSpawnChances[CustomRoles.ScientistEHR])
.SetValueFormat(OptionFormat.Seconds); .SetValueFormat(OptionFormat.Seconds);
ScientistDur = FloatOptionItem.Create(5111, "VitalsDuration", new(1f, 250f, 1f), 15f, Tab, false) ScientistDur = FloatOptionItem.Create(5111, "VitalsDuration", new(1f, 250f, 1f), 15f, Tab, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.ScientistTOHE]) .SetParent(CustomRoleSpawnChances[CustomRoles.ScientistEHR])
.SetValueFormat(OptionFormat.Seconds); .SetValueFormat(OptionFormat.Seconds);
} }
} }
+5
View File
@@ -31,5 +31,10 @@ namespace EHR.Roles.Crewmate
{ {
_ = new LateTask(() => { pc.TPtoRndVent(); }, 0.5f, "Mole TP"); _ = new LateTask(() => { pc.TPtoRndVent(); }, 0.5f, "Mole TP");
} }
public override void OnPet(PlayerControl pc)
{
pc.TPtoRndVent();
}
} }
} }
+23 -16
View File
@@ -1,6 +1,7 @@
using EHR.Modules; using EHR.Modules;
using Hazel; using Hazel;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEngine; using UnityEngine;
using static EHR.Options; using static EHR.Options;
using static EHR.Translator; using static EHR.Translator;
@@ -103,20 +104,7 @@ namespace EHR.Roles.Crewmate
if (!TrackerTarget.ContainsKey(seer.PlayerId)) return string.Empty; if (!TrackerTarget.ContainsKey(seer.PlayerId)) return string.Empty;
if (GameStates.IsMeeting) return string.Empty; if (GameStates.IsMeeting) return string.Empty;
var arrows = string.Empty; 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)));
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;
} }
public static bool IsTrackTarget(PlayerControl seer, PlayerControl target) public static bool IsTrackTarget(PlayerControl seer, PlayerControl target)
@@ -127,11 +115,30 @@ namespace EHR.Roles.Crewmate
public static string GetArrowAndLastRoom(PlayerControl seer, PlayerControl target) public static string GetArrowAndLastRoom(PlayerControl seer, PlayerControl target)
{ {
if (seer == null || target == null) return string.Empty; 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; var room = Main.PlayerStates[target.PlayerId].LastRoom;
if (room == null) text += Utils.ColorString(Color.gray, "@" + GetString("FailToTrack")); 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; 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());
}
}
}
} }
} }
+5 -5
View File
@@ -44,11 +44,11 @@ namespace EHR.Roles.Impostor
IEnumerable<CustomRoles> result = AvailableRoles.GetValue() switch IEnumerable<CustomRoles> result = AvailableRoles.GetValue() switch
{ {
0 => allRoles, 0 => allRoles,
1 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorTOHE), 1 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorEHR),
2 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterTOHE), 2 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterEHR),
3 => allRoles.Where(x => x.GetMode() != 0), 3 => allRoles.Where(x => x.GetMode() != 0),
4 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Impostor or CustomRoles.ImpostorTOHE && 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.ShapeshifterTOHE && x.GetMode() != 0), 5 => allRoles.Where(x => x.GetVNRole() is CustomRoles.Shapeshifter or CustomRoles.ShapeshifterEHR && x.GetMode() != 0),
_ => allRoles _ => allRoles
}; };
@@ -77,7 +77,7 @@ namespace EHR.Roles.Impostor
catch (InvalidOperationException) catch (InvalidOperationException)
{ {
Logger.Error("No roles for Changeling", "Changeling"); Logger.Error("No roles for Changeling", "Changeling");
Utils.GetPlayerById(playerId).RpcSetCustomRole(CustomRoles.ImpostorTOHE); Utils.GetPlayerById(playerId).RpcSetCustomRole(CustomRoles.ImpostorEHR);
} }
} }
+4 -4
View File
@@ -8,13 +8,13 @@ namespace EHR.Roles.Impostor
public void SetupCustomOption() public void SetupCustomOption()
{ {
SetupRoleOptions(300, Tab, CustomRoles.ImpostorTOHE); SetupRoleOptions(300, Tab, CustomRoles.ImpostorEHR);
SetupRoleOptions(400, Tab, CustomRoles.ShapeshifterTOHE); SetupRoleOptions(400, Tab, CustomRoles.ShapeshifterEHR);
ShapeshiftCD = FloatOptionItem.Create(402, "ShapeshiftCooldown", new(1f, 180f, 1f), 30f, Tab, false) ShapeshiftCD = FloatOptionItem.Create(402, "ShapeshiftCooldown", new(1f, 180f, 1f), 30f, Tab, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterTOHE]) .SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterEHR])
.SetValueFormat(OptionFormat.Seconds); .SetValueFormat(OptionFormat.Seconds);
ShapeshiftDur = FloatOptionItem.Create(403, "ShapeshiftDuration", new(1f, 60f, 1f), 10f, Tab, false) ShapeshiftDur = FloatOptionItem.Create(403, "ShapeshiftDuration", new(1f, 60f, 1f), 10f, Tab, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterTOHE]) .SetParent(CustomRoleSpawnChances[CustomRoles.ShapeshifterEHR])
.SetValueFormat(OptionFormat.Seconds); .SetValueFormat(OptionFormat.Seconds);
} }
} }
+9 -32
View File
@@ -21,36 +21,19 @@ public class Executioner : RoleBase
public static OptionItem KnowTargetRole; public static OptionItem KnowTargetRole;
public static OptionItem ChangeRolesAfterTargetKilled; public static OptionItem ChangeRolesAfterTargetKilled;
/// <summary>
/// Key: エクスキューショナーのPlayerId, Value: ターゲットのPlayerId
/// </summary>
public static Dictionary<byte, byte> Target = []; public static Dictionary<byte, byte> 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 = public static readonly CustomRoles[] CRoleChangeRoles =
[ [
CustomRoles.CrewmateTOHE, CustomRoles.Amnesiac,
CustomRoles.Maverick,
CustomRoles.CrewmateEHR,
CustomRoles.Jester, CustomRoles.Jester,
CustomRoles.Opportunist, CustomRoles.Opportunist,
CustomRoles.Convict, CustomRoles.Convict,
CustomRoles.CyberStar, CustomRoles.CyberStar,
CustomRoles.Bodyguard, CustomRoles.Bodyguard,
CustomRoles.Dictator, CustomRoles.Dictator,
CustomRoles.Mayor,
CustomRoles.Doctor, CustomRoles.Doctor,
]; ];
@@ -63,7 +46,7 @@ public class Executioner : RoleBase
CanTargetNeutralEvil = BooleanOptionItem.Create(Id + 15, "CanTargetNeutralEvil", false, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Executioner]); 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]); 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]); 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() public override void Init()
@@ -76,7 +59,6 @@ public class Executioner : RoleBase
{ {
playerIdList.Add(playerId); playerIdList.Add(playerId);
//ターゲット割り当て
try try
{ {
if (AmongUsClient.Instance.AmHost) if (AmongUsClient.Instance.AmHost)
@@ -143,17 +125,13 @@ public class Executioner : RoleBase
public static void ChangeRoleByTarget(PlayerControl target) public static void ChangeRoleByTarget(PlayerControl target)
{ {
byte Executioner = 0x73; byte Executioner = Target.FirstOrDefault(x => x.Value == target.PlayerId).Key;
Target.Do(x => var ExePC = Utils.GetPlayerById(Executioner);
{ ExePC.RpcSetCustomRole(CRoleChangeRoles[ChangeRolesAfterTargetKilled.GetValue()]);
if (x.Value == target.PlayerId)
Executioner = x.Key;
});
Utils.GetPlayerById(Executioner).RpcSetCustomRole(CRoleChangeRoles[ChangeRolesAfterTargetKilled.GetValue()]);
Target.Remove(Executioner); Target.Remove(Executioner);
SendRPC(Executioner); SendRPC(Executioner);
Utils.NotifyRoles(SpecifySeer: Utils.GetPlayerById(Executioner), SpecifyTarget: target); Utils.NotifyRoles(SpecifySeer: ExePC, SpecifyTarget: target);
Utils.NotifyRoles(SpecifySeer: target, SpecifyTarget: Utils.GetPlayerById(Executioner)); Utils.NotifyRoles(SpecifySeer: target, SpecifyTarget: ExePC);
} }
public static void ChangeRole(PlayerControl executioner) public static void ChangeRole(PlayerControl executioner)
@@ -199,7 +177,6 @@ public class Executioner : RoleBase
} }
else else
{ {
//CustomWinnerHolder.AdditionalWinnerTeams.Add(AdditionalWinners.Executioner);
CustomWinnerHolder.SetWinnerOrAdditonalWinner(CustomWinner.Executioner); CustomWinnerHolder.SetWinnerOrAdditonalWinner(CustomWinner.Executioner);
CustomWinnerHolder.WinnerIds.Add(playerId); CustomWinnerHolder.WinnerIds.Add(playerId);
} }
+1 -1
View File
@@ -62,7 +62,7 @@ public class Jackal : RoleBase
// SidekickKnowOtherSidekick = BooleanOptionItem.Create(6050585, "SidekickKnowOtherSidekick", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick); // SidekickKnowOtherSidekick = BooleanOptionItem.Create(6050585, "SidekickKnowOtherSidekick", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
// SidekickKnowOtherSidekickRole = BooleanOptionItem.Create(6050590, "SidekickKnowOtherSidekickRole", false, TabGroup.NeutralRoles, false).SetParent(SidekickKnowOtherSidekick); // SidekickKnowOtherSidekickRole = BooleanOptionItem.Create(6050590, "SidekickKnowOtherSidekickRole", false, TabGroup.NeutralRoles, false).SetParent(SidekickKnowOtherSidekick);
SidekickCanKillSidekick = BooleanOptionItem.Create(Id + 24, "SidekickCanKillSidekick", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick); 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); // SidekickCanWinWithOriginalTeam = BooleanOptionItem.Create(6050795, "SidekickCanWinWithOriginalTeam", false, TabGroup.NeutralRoles, false).SetParent(CanRecruitSidekick);
} }
+1 -1
View File
@@ -38,7 +38,7 @@ public class Lawyer : RoleBase
public static readonly CustomRoles[] CRoleChangeRoles = public static readonly CustomRoles[] CRoleChangeRoles =
[ [
CustomRoles.CrewmateTOHE, CustomRoles.CrewmateEHR,
CustomRoles.Jester, CustomRoles.Jester,
CustomRoles.Opportunist, CustomRoles.Opportunist,
CustomRoles.Convict, CustomRoles.Convict,
+1 -1
View File
@@ -26,7 +26,7 @@ public class WeaponMaster : RoleBase
/* /*
* 0 = Kill (Sword) ~ Normal Kill * 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) * 2 = Reach + Swift / Can't Vent (Lance)
* 3 = 1-Time Shield / Can't Kill (Shield) * 3 = 1-Time Shield / Can't Kill (Shield)
*/ */
+6 -4
View File
@@ -283,10 +283,10 @@ public class Main : BasePlugin
{ CustomRoles.Scientist, "#8cffff" }, { CustomRoles.Scientist, "#8cffff" },
{ CustomRoles.GuardianAngel, "#ffffff" }, { CustomRoles.GuardianAngel, "#ffffff" },
// Vanilla Remakes // Vanilla Remakes
{ CustomRoles.CrewmateTOHE, "#8cffff" }, { CustomRoles.CrewmateEHR, "#8cffff" },
{ CustomRoles.EngineerTOHE, "#FF6A00" }, { CustomRoles.EngineerEHR, "#FF6A00" },
{ CustomRoles.ScientistTOHE, "#8ee98e" }, { CustomRoles.ScientistEHR, "#8ee98e" },
{ CustomRoles.GuardianAngelTOHE, "#77e6d1" }, { CustomRoles.GuardianAngelEHR, "#77e6d1" },
// Crewmates // Crewmates
{ CustomRoles.Luckey, "#b8d7a3" }, { CustomRoles.Luckey, "#b8d7a3" },
{ CustomRoles.Needy, "#a4dffe" }, { CustomRoles.Needy, "#a4dffe" },
@@ -724,6 +724,7 @@ public enum AdditionalWinners
// ------------- // -------------
Lovers = CustomRoles.Lovers, Lovers = CustomRoles.Lovers,
Executioner = CustomRoles.Executioner,
Opportunist = CustomRoles.Opportunist, Opportunist = CustomRoles.Opportunist,
Lawyer = CustomRoles.Lawyer, Lawyer = CustomRoles.Lawyer,
FFF = CustomRoles.FFF, FFF = CustomRoles.FFF,
@@ -734,6 +735,7 @@ public enum AdditionalWinners
VengefulRomantic = CustomRoles.VengefulRomantic, VengefulRomantic = CustomRoles.VengefulRomantic,
Pursuer = CustomRoles.Pursuer, Pursuer = CustomRoles.Pursuer,
Phantom = CustomRoles.Phantom, Phantom = CustomRoles.Phantom,
Sidekick = CustomRoles.Sidekick,
Maverick = CustomRoles.Maverick, Maverick = CustomRoles.Maverick,
Postman = CustomRoles.Postman, Postman = CustomRoles.Postman,
Impartial = CustomRoles.Impartial, Impartial = CustomRoles.Impartial,