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