This commit is contained in:
Gurge44 committed 2026-06-12 17:50:57 +02:00
1 parent f5cb6ab6e1
commit 4954d01467
6 files changed
+14 -124

No files matched your search

+3 -3
View File
@@ -41,9 +41,9 @@ public class Main : BasePlugin
private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d";
private const string DebugKeySalt = "59687b";
public const string PluginGuid = "com.gurge44.endlesshostroles";
public const string PluginVersion = "7.5.1";
public const string PluginDisplayVersion = "7.5.1";
public const bool TestBuild = false;
public const string PluginVersion = "7.5.2";
public const string PluginDisplayVersion = "7.5.2";
public const bool TestBuild = true;
public const string NeutralColor = "#ffab1b";
public const string ImpostorColor = "#ff1919";
+2 -2
View File
@@ -1675,14 +1675,14 @@ internal static class ExtendedPlayerControl
{
if (!player || !target) return false;
return Revolutionist.IsDraw.GetValueOrDefault((player.PlayerId, target.PlayerId));
return Revolutionist.IsDraw != null && Revolutionist.IsDraw.GetValueOrDefault((player.PlayerId, target.PlayerId));
}
public bool IsRevealedPlayer(PlayerControl target)
{
if (!player || !target) return false;
return Investigator.IsRevealed.GetValueOrDefault((player.PlayerId, target.PlayerId));
return Investigator.IsRevealed != null && Investigator.IsRevealed.GetValueOrDefault((player.PlayerId, target.PlayerId));
}
public void RpcSetDousedPlayer(PlayerControl target, bool isDoused)
@@ -724,7 +724,7 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
bool energeticIncreaseSpeed = false, energeticDecreaseCooldown = false;
if (state.SubRoles.Contains(CustomRoles.Energetic) || Empress.Encouraged.Contains(player.PlayerId))
if (state.SubRoles.Contains(CustomRoles.Energetic) || (Empress.Encouraged != null && Empress.Encouraged.Contains(player.PlayerId)))
{
if (player.CanUseKillButton())
energeticDecreaseCooldown = true;
-106
View File
@@ -199,112 +199,6 @@ public static class UpdateFriendCodeUIPatch
}
}
[HarmonyPatch(typeof(FriendsListUI), nameof(FriendsListUI.Open))]
internal static class FriendsListUIOpenPatch
{
public static bool Prefix(FriendsListUI __instance)
{
try
{
if (__instance.gameObject.activeSelf || __instance.currentSceneName == "")
__instance.Close();
else
{
FriendsListBar[] componentsInChildren = __instance.GetComponentsInChildren<FriendsListBar>(true);
for (var index = 0; index < componentsInChildren.Length; ++index)
{
if (componentsInChildren[index])
Object.Destroy(componentsInChildren[index].gameObject);
}
Scene activeScene = SceneManager.GetActiveScene();
__instance.currentSceneName = activeScene.name;
__instance.UpdateFriendCodeUI();
if ((HudManager.InstanceExists && HudManager.InstanceExists && HudManager.Instance.Chat && HudManager.Instance.Chat.IsOpenOrOpening) || ShipStatus.Instance)
return false;
__instance.friendBars = new();
__instance.lobbyBars = new();
__instance.notifBars = new();
__instance.platformFriendBars = new();
__instance.viewingAllFriends = true;
__instance.gameObject.SetActive(true);
__instance.guestAccountWarnings.ForEach((Action<FriendsListGuestWarning>)(t => t.gameObject.SetActive(false)));
__instance.ViewRequestsButton.color = __instance.NoRequestsColor;
__instance.ViewRequestsText.text = TranslationController.Instance.GetString(StringNames.NoNewRequests);
__instance.StartCoroutine(FriendsListManager.Instance.RefreshFriendsList((Action)(() =>
{
__instance.ClearNotifs();
if (EOSManager.Instance.IsFriendsListAllowed())
{
__instance.AddFriendObjects.SetActive(true);
__instance.RefreshBlockedPlayers();
__instance.RefreshFriends();
__instance.RefreshNotifications();
}
else
{
__instance.AddFriendObjects.SetActive(false);
__instance.guestAccountWarnings.ForEach((Action<FriendsListGuestWarning>)(g => g.SetUp()));
}
__instance.RefreshRecentlyPlayed();
__instance.RefreshPlatformFriends();
foreach (FriendsListBar friendBar in __instance.friendBars)
{
foreach (PassiveButton passiveButton in friendBar.ControllerSelectable)
ControllerManager.Instance.AddSelectableUiElement(passiveButton);
}
foreach (FriendsListBar platformFriendBar in __instance.platformFriendBars)
{
foreach (PassiveButton passiveButton in platformFriendBar.ControllerSelectable)
ControllerManager.Instance.AddSelectableUiElement(passiveButton);
}
foreach (FriendsListBar notifBar in __instance.notifBars)
{
foreach (PassiveButton passiveButton in notifBar.ControllerSelectable)
ControllerManager.Instance.AddSelectableUiElement(passiveButton);
}
foreach (FriendsListBar lobbyBar in __instance.lobbyBars)
{
foreach (PassiveButton passiveButton in lobbyBar.ControllerSelectable)
ControllerManager.Instance.AddSelectableUiElement(passiveButton);
}
ControllerManager.Instance.PickTopSelectable();
})));
if (__instance.currentSceneName == "OnlineGame")
{
__instance.RefreshLobbyPlayers();
__instance.LobbyPlayersTab.SetActive(true);
__instance.LobbyPlayersInactiveTab.SetActive(false);
__instance.OpenTab(0);
}
else
{
__instance.LobbyPlayersInactiveTab.SetActive(true);
__instance.LobbyPlayersTab.SetActive(false);
__instance.OpenTab(2);
}
ControllerManager.Instance.OpenOverlayMenu(__instance.name, __instance.BackButton, __instance.DefaultButtonSelected, __instance.ControllerSelectable);
}
}
catch (Exception e) { Utils.ThrowException(e); }
return false;
}
}
[HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start))]
[HarmonyPriority(Priority.First)]
internal static class TitleLogoPatch
+1 -1
View File
@@ -133,7 +133,7 @@ public class Wyrd : CovenBase
public static bool CheckPlayerAction(PlayerControl pc, Action action)
{
if (!ActionSuicideSettings[action] || Instances == null) return true;
if (ActionSuicideSettings == null || !ActionSuicideSettings[action] || Instances == null) return true;
foreach (Wyrd instance in Instances)
{
+7 -11
View File
@@ -193,18 +193,7 @@ internal class Chemist : RoleBase
{
On = false;
Instances = [];
FactoryLocations = [];
LateTask.New(() =>
{
FactoryLocations = ShipStatus.Instance.AllRooms
.Select(x => x.RoomId)
.Where(x => x != SystemTypes.Outside && !x.ToString().Contains("Decontamination"))
.Distinct()
.Zip(Enum.GetValues<Factory>()[1..])
.ToDictionary(x => x.First, x => x.Second);
}, 20f, log: false);
}
public override void Add(byte playerId)
@@ -226,6 +215,13 @@ internal class Chemist : RoleBase
Grenades = [];
ItemCounts = Enum.GetValues<Item>().ToDictionary(x => x, _ => 0);
FactoryLocations = ShipStatus.Instance.AllRooms
.Select(x => x.RoomId)
.Where(x => x != SystemTypes.Outside && !x.ToString().Contains("Decontamination"))
.Distinct()
.Zip(Enum.GetValues<Factory>()[1..])
.ToDictionary(x => x.First, x => x.Second);
}
public override void Remove(byte playerId)