mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
delay meeting messages more & check critical sabotages on meeting call
This commit is contained in:
1 parent
94036930e9
commit
48cb17e7ba
4 files changed
+26
-23
No files matched your search
@@ -1176,7 +1176,7 @@ internal static class IntroCutsceneDestroyPatch
|
||||
case CustomGameMode.Quiz when Quiz.Chat:
|
||||
case CustomGameMode.HideAndSeek when CustomHnS.Chat:
|
||||
case CustomGameMode.NaturalDisasters when NaturalDisasters.Chat:
|
||||
Utils.SetChatVisibleForAll();
|
||||
LateTask.New(Utils.SetChatVisibleForAll, 4f);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -734,7 +734,7 @@ internal static class MeetingHudStartPatch
|
||||
LateTask.New(() =>
|
||||
{
|
||||
PlayerControl player = Main.EnumerateAlivePlayerControls().MinBy(x => x.PlayerId);
|
||||
var sender = CustomRpcSender.Create("RpcSetNameEx on meeting start", SendOption.Reliable);
|
||||
var sender = CustomRpcSender.Create("Fix Sender Name", SendOption.Reliable);
|
||||
{
|
||||
sender.AutoStartRpc(player.NetId, 6);
|
||||
{
|
||||
@@ -745,7 +745,7 @@ internal static class MeetingHudStartPatch
|
||||
}
|
||||
sender.SendMessage();
|
||||
}, 1f, "Fix Sender Name");
|
||||
}, 7f, "Send Role Descriptions Round 1");
|
||||
}, 8.5f, "Send Role Descriptions Round 1");
|
||||
}
|
||||
|
||||
if (Options.MadmateSpawnMode.GetInt() == 2 && CustomRoles.Madmate.IsEnable() && MeetingStates.FirstMeeting)
|
||||
@@ -792,7 +792,7 @@ internal static class MeetingHudStartPatch
|
||||
AddMsg(string.Format(GetString("SuperStarDead"), Main.AllPlayerNames[csId]), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.SuperStar), GetString("SuperStarNewsTitle")));
|
||||
}
|
||||
|
||||
if (pc != null && Silencer.ForSilencer.Contains(pc.PlayerId))
|
||||
if (Silencer.ForSilencer.Contains(pc.PlayerId))
|
||||
{
|
||||
string playername = pc.GetRealName();
|
||||
if (Doppelganger.DoppelVictim.TryGetValue(pc.PlayerId, out string value)) playername = value;
|
||||
@@ -834,7 +834,7 @@ internal static class MeetingHudStartPatch
|
||||
}
|
||||
}
|
||||
|
||||
if (msgToSend.Count > 0) LateTask.New(() => msgToSend.Do(x => Utils.SendMessage(x.Text, x.SendTo, x.Title, importance: MessageImportance.High)), 8f, "Meeting Start Notify");
|
||||
if (msgToSend.Count > 0) LateTask.New(() => msgToSend.Do(x => Utils.SendMessage(x.Text, x.SendTo, x.Title, importance: MessageImportance.High)), 9f, "Meeting Start Notify");
|
||||
|
||||
Main.SuperStarDead.Clear();
|
||||
Forensic.ForensicNotify.Clear();
|
||||
@@ -870,7 +870,7 @@ internal static class MeetingHudStartPatch
|
||||
foreach (PlayerVoteArea pva in __instance.playerStates)
|
||||
{
|
||||
PlayerControl target = Utils.GetPlayerById(pva.TargetPlayerId);
|
||||
if (target == null) continue;
|
||||
if (!target) continue;
|
||||
|
||||
bool shouldSeeTargetAddons = seer.PlayerId == target.PlayerId || new[] { seer, target }.All(x => x.Is(Team.Impostor));
|
||||
(string, Color) roleTextData = Utils.GetRoleText(seer.PlayerId, target.PlayerId, seeTargetBetrayalAddons: shouldSeeTargetAddons);
|
||||
@@ -954,7 +954,7 @@ internal static class MeetingHudStartPatch
|
||||
deathReasonTextMeeting.enableWordWrapping = false;
|
||||
deathReasonTextMeeting.enabled = seer.KnowDeathReason(target);
|
||||
Transform child = deathReasonTextMeeting.transform.FindChild("RoleTextMeeting");
|
||||
if (child != null) Object.Destroy(child.gameObject);
|
||||
if (child) Object.Destroy(child.gameObject);
|
||||
|
||||
byte id = pva.TargetPlayerId;
|
||||
|
||||
@@ -992,7 +992,7 @@ internal static class MeetingHudStartPatch
|
||||
|
||||
TemplateManager.SendTemplate("OnMeeting", noErr: true, importance: MessageImportance.Low);
|
||||
if (MeetingStates.FirstMeeting) TemplateManager.SendTemplate("OnFirstMeeting", noErr: true, importance: MessageImportance.Low);
|
||||
}, 6.5f, log: false);
|
||||
}, 8f, log: false);
|
||||
|
||||
NotifyRoleSkillOnMeetingStart();
|
||||
|
||||
@@ -1045,10 +1045,10 @@ internal static class MeetingHudStartPatch
|
||||
|
||||
foreach (PlayerVoteArea pva in __instance.playerStates)
|
||||
{
|
||||
if (pva == null) continue;
|
||||
if (!pva) continue;
|
||||
|
||||
PlayerControl target = Utils.GetPlayerById(pva.TargetPlayerId);
|
||||
if (target == null) continue;
|
||||
if (!target) continue;
|
||||
|
||||
if (seer.GetCustomRole().GetDYRole() is RoleTypes.Shapeshifter or RoleTypes.Phantom)
|
||||
{
|
||||
|
||||
@@ -1041,7 +1041,7 @@ internal static class ReportDeadBodyPatch
|
||||
|
||||
if (target == null)
|
||||
{
|
||||
if (CustomSabotage.Instances.Count > 0)
|
||||
if (IsAnySabotageActive())
|
||||
{
|
||||
Notify("CannotCallEmergencyMeetingWhileSabotage");
|
||||
return false;
|
||||
@@ -1205,14 +1205,17 @@ internal static class ReportDeadBodyPatch
|
||||
if (!Options.GameTimeLimitRunsDuringMeetings.GetBool())
|
||||
Main.GameTimer.Stop();
|
||||
|
||||
foreach (CustomNetObject cno in CustomNetObject.AllObjects.ToArray())
|
||||
LateTask.New(() =>
|
||||
{
|
||||
try
|
||||
foreach (CustomNetObject cno in CustomNetObject.AllObjects.ToArray())
|
||||
{
|
||||
cno.OnMeeting();
|
||||
try
|
||||
{
|
||||
cno.OnMeeting();
|
||||
}
|
||||
catch (Exception e) { ThrowException(e); }
|
||||
}
|
||||
catch (Exception e) { ThrowException(e); }
|
||||
}
|
||||
}, 2f, "CNO OnMeeting");
|
||||
|
||||
if (HudManager.InstanceExists) HudManager.Instance.SetRolePanelOpen(false);
|
||||
|
||||
@@ -1232,10 +1235,10 @@ internal static class ReportDeadBodyPatch
|
||||
foreach (byte id in Main.DiedThisRound)
|
||||
{
|
||||
PlayerControl receiver = id.GetPlayer();
|
||||
if (receiver == null) continue;
|
||||
if (!receiver) continue;
|
||||
|
||||
PlayerControl killer = receiver.GetRealKiller();
|
||||
if (killer == null) continue;
|
||||
if (!killer) continue;
|
||||
|
||||
SendMessage("\n", receiver.PlayerId, string.Format(GetString("DeathCommand"), killer.PlayerId.ColoredPlayerName(), (killer.Is(CustomRoles.Bloodlust) ? $"{CustomRoles.Bloodlust.ToColoredString()} " : string.Empty) + killer.GetCustomRole().ToColoredString()), importance: MessageImportance.Low);
|
||||
}
|
||||
@@ -1248,7 +1251,7 @@ internal static class ReportDeadBodyPatch
|
||||
try { Main.EnumerateAlivePlayerControls().DoIf(x => x.Is(CustomRoles.Lazy), x => Lazy.BeforeMeetingPositions[x.PlayerId] = x.Pos()); }
|
||||
catch (Exception e) { ThrowException(e); }
|
||||
|
||||
try { if (Lovers.PrivateChat.GetBool() && Main.LoversPlayers.Exists(x => x != null && x.IsAlive())) LateTask.New(() => ChatManager.ClearChat(Main.EnumerateAlivePlayerControls().ExceptBy(Main.LoversPlayers.ConvertAll(x => x.PlayerId), x => x.PlayerId).ToArray()), GameStates.CurrentServerType == GameStates.ServerType.Vanilla && !PlayerControl.LocalPlayer.IsAlive() ? 3f : 0f); }
|
||||
try { if (Lovers.PrivateChat.GetBool() && Main.LoversPlayers.Exists(x => x && x.IsAlive())) LateTask.New(() => ChatManager.ClearChat(Main.EnumerateAlivePlayerControls().ExceptBy(Main.LoversPlayers.ConvertAll(x => x.PlayerId), x => x.PlayerId).ToArray()), GameStates.CurrentServerType == GameStates.ServerType.Vanilla && !PlayerControl.LocalPlayer.IsAlive() ? 1.5f : 0f); }
|
||||
catch (Exception e) { ThrowException(e); }
|
||||
|
||||
CustomSabotage.Reset();
|
||||
@@ -1277,7 +1280,7 @@ internal static class ReportDeadBodyPatch
|
||||
{
|
||||
PlayerControl tpc = target.Object;
|
||||
|
||||
if (tpc != null && !tpc.IsAlive())
|
||||
if (tpc && !tpc.IsAlive())
|
||||
{
|
||||
if (player.Is(CustomRoles.Forensic) && player.PlayerId != target.PlayerId)
|
||||
Forensic.OnReportDeadBody(player, target.Object);
|
||||
@@ -1308,9 +1311,9 @@ internal static class ReportDeadBodyPatch
|
||||
QuizMaster.Data.NumMeetings++;
|
||||
}
|
||||
|
||||
if (Main.LoversPlayers.Exists(x => x != null && x.IsAlive()) && Main.IsLoversDead && Lovers.LoverDieConsequence.GetValue() == 1)
|
||||
if (Main.IsLoversDead && Lovers.LoverDieConsequence.GetValue() == 1 && Main.LoversPlayers.Exists(x => x && x.IsAlive()))
|
||||
{
|
||||
PlayerControl aliveLover = Main.LoversPlayers.First(x => x != null && x.IsAlive());
|
||||
PlayerControl aliveLover = Main.LoversPlayers.First(x => x && x.IsAlive());
|
||||
|
||||
switch (Lovers.LoverSuicideTime.GetValue())
|
||||
{
|
||||
|
||||
@@ -309,7 +309,7 @@ internal static class SabotageSystemTypeAnyActivePatch
|
||||
{
|
||||
public static bool Prefix(SabotageSystemType __instance, ref bool __result)
|
||||
{
|
||||
__result = __instance.specials.ToArray().Any(s => s.IsActive) || CustomSabotage.Instances.Count > 0;
|
||||
__result = __instance.specials.Exists((Il2CppSystem.Predicate<IActivatable>)(s => s.IsActive)) || CustomSabotage.Instances.Count > 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user