mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
just fixes
This commit is contained in:
1 parent
bf2e93a6c1
commit
ed5d8f2e07
7 files changed
+29
-13
No files matched your search
@@ -104,7 +104,7 @@ public class Main : BasePlugin
|
||||
public static Dictionary<byte, byte> ShapeshiftTarget = [];
|
||||
public static bool VisibleTasksCount;
|
||||
public static string NickName = "";
|
||||
public static bool IntroDestroyed;
|
||||
public static bool IntroDestroyed = true;
|
||||
public static float DefaultCrewmateVision;
|
||||
public static float DefaultImpostorVision;
|
||||
public static readonly bool IsAprilFools = DateTime.Now.Month == 4 && DateTime.Now.Day == 1;
|
||||
@@ -230,7 +230,7 @@ public class Main : BasePlugin
|
||||
|
||||
foreach (PlayerControl pc in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
if (pc == null || pc.PlayerId >= 254 || !pc.IsAlive() || (pc.Data.Disconnected && (CoShowIntroPatch.IntroStarted || IntroDestroyed || GameStates.IsLobby)) || Pelican.IsEaten(pc.PlayerId)) continue;
|
||||
if (pc == null || pc.PlayerId >= 254 || !pc.IsAlive() || (pc.Data.Disconnected && IntroDestroyed) || Pelican.IsEaten(pc.PlayerId)) continue;
|
||||
|
||||
result[i++] = pc;
|
||||
}
|
||||
|
||||
@@ -681,6 +681,7 @@ public static class Options
|
||||
public static OptionItem StoreCompletedAchievementsOnEHRDatabase;
|
||||
public static OptionItem AllCrewRolesHaveVanillaColor;
|
||||
public static OptionItem MessageRpcSizeLimit;
|
||||
public static OptionItem DraftMaxRolesPerPlayer;
|
||||
public static OptionItem ShowAntiBlackoutWarning;
|
||||
public static OptionItem AllowConsole;
|
||||
public static OptionItem NoGameEnd;
|
||||
@@ -2649,6 +2650,11 @@ public static class Options
|
||||
.SetGameMode(CustomGameMode.Standard)
|
||||
.SetColor(new Color32(193, 255, 209, byte.MaxValue));
|
||||
|
||||
DraftMaxRolesPerPlayer = new IntegerOptionItem(19430, "DraftMaxRolesPerPlayer", new(1, 30, 1), 5, TabGroup.SystemSettings)
|
||||
.SetHeader(true)
|
||||
.SetGameMode(CustomGameMode.Standard)
|
||||
.SetColor(new Color32(193, 255, 209, byte.MaxValue));
|
||||
|
||||
|
||||
new TextOptionItem(100029, "MenuTitle.Ghost", TabGroup.GameSettings)
|
||||
.SetGameMode(CustomGameMode.Standard)
|
||||
|
||||
@@ -963,13 +963,15 @@ internal static class ChatCommands
|
||||
allRoles.RemoveAll(x => x.IsNonNK());
|
||||
allRoles.RemoveAll(x => x.IsCoven());
|
||||
|
||||
int maxRolesPerPlayer = Options.DraftMaxRolesPerPlayer.GetInt();
|
||||
|
||||
DraftRoles = allRoles
|
||||
.Take(allPlayerIds.Length * 5)
|
||||
.Take(allPlayerIds.Length * maxRolesPerPlayer)
|
||||
.CombineWith(impRoles, nkRoles, nnkRoles, covenRoles)
|
||||
.Shuffle()
|
||||
.Partition(allPlayerIds.Length)
|
||||
.Zip(allPlayerIds)
|
||||
.ToDictionary(x => x.Second, x => x.First.Take(5).ToList());
|
||||
.ToDictionary(x => x.Second, x => x.First.Take(maxRolesPerPlayer).ToList());
|
||||
|
||||
Main.Instance.StartCoroutine(RepeatedlySendMessage());
|
||||
return;
|
||||
@@ -989,7 +991,7 @@ internal static class ChatCommands
|
||||
|
||||
messages.SendMultipleMessages(index == 0 ? SendOption.Reliable : SendOption.None);
|
||||
|
||||
yield return new WaitForSeconds(30f);
|
||||
yield return new WaitForSeconds(20f);
|
||||
if (DraftResult.Count >= DraftRoles.Count || !GameStates.IsLobby || GameStates.InGame) yield break;
|
||||
}
|
||||
}
|
||||
@@ -1031,6 +1033,8 @@ internal static class ChatCommands
|
||||
CustomRoles role = roles[chosenIndex - 1];
|
||||
DraftResult[player.PlayerId] = role;
|
||||
Utils.SendMessage(string.Format(GetString("DraftChosen"), role.ToColoredString()), player.PlayerId, GetString("DraftTitle"));
|
||||
|
||||
if (DraftResult.Count >= DraftRoles.Count) Utils.SendMessage("\n", PlayerControl.LocalPlayer.PlayerId, GetString("EveryoneDrafted"));
|
||||
}
|
||||
|
||||
private static void MuteCommand(PlayerControl player, string text, string[] args)
|
||||
|
||||
@@ -708,7 +708,7 @@ internal static class MeetingHudStartPatch
|
||||
roleDescMsgs.Add(new(sb.Append("</size>").ToString(), pc.PlayerId, titleSb.ToString()));
|
||||
}
|
||||
|
||||
LateTask.New(() => roleDescMsgs.SendMultipleMessages(SendOption.None), 6f, "Send Role Descriptions Round 1");
|
||||
LateTask.New(() => roleDescMsgs.SendMultipleMessages(SendOption.None), 7f, "Send Role Descriptions Round 1");
|
||||
}
|
||||
|
||||
if (Options.MadmateSpawnMode.GetInt() == 2 && CustomRoles.Madmate.IsEnable() && MeetingStates.FirstMeeting)
|
||||
@@ -797,7 +797,7 @@ internal static class MeetingHudStartPatch
|
||||
}
|
||||
}
|
||||
|
||||
if (msgToSend.Count > 0) LateTask.New(() => msgToSend.Do(x => Utils.SendMessage(x.Text, x.SendTo, x.Title)), 6f, "Meeting Start Notify");
|
||||
if (msgToSend.Count > 0) LateTask.New(() => msgToSend.Do(x => Utils.SendMessage(x.Text, x.SendTo, x.Title)), 8f, "Meeting Start Notify");
|
||||
|
||||
Main.CyberStarDead.Clear();
|
||||
Express.SpeedNormal.Clear();
|
||||
@@ -934,8 +934,11 @@ internal static class MeetingHudStartPatch
|
||||
Logger.Info("The ship has " + (Options.SyncedButtonCount.GetFloat() - Options.UsedButtonCount) + " buttons left", "SyncButtonMode");
|
||||
}
|
||||
|
||||
TemplateManager.SendTemplate("OnMeeting", noErr: true, sendOption: SendOption.None);
|
||||
if (MeetingStates.FirstMeeting) TemplateManager.SendTemplate("OnFirstMeeting", noErr: true, sendOption: SendOption.None);
|
||||
LateTask.New(() =>
|
||||
{
|
||||
TemplateManager.SendTemplate("OnMeeting", noErr: true, sendOption: SendOption.None);
|
||||
if (MeetingStates.FirstMeeting) TemplateManager.SendTemplate("OnFirstMeeting", noErr: true, sendOption: SendOption.None);
|
||||
}, 2f, log: false);
|
||||
|
||||
NotifyRoleSkillOnMeetingStart();
|
||||
|
||||
|
||||
@@ -2872,6 +2872,8 @@
|
||||
"DraftResend": "<size=90%>Your drafting choices are:</size>\\n\\n{0}\\n\\n<size=90%>Chat commands to use:</size>\\n- Pick role: <b>/draft [index]</b>\\n- View description of role: <b>/dd [index]</b>\\n<size=90%>Replace [index] with the number of the role you want to pick. Example: <b>/draft 4</b></size>",
|
||||
"DraftTitle": "<#00a5ff>➡</color> <#00ffa5>Drafting</color> <#00a5ff>⬅</color>",
|
||||
"DraftChosen": "You have chosen the <b>{0}</b> role for the next game.\\n<size=70%>You can still change your choice by typing /draft [index] again.</size>",
|
||||
"DraftMaxRolesPerPlayer": "Max Roles For Each Player To Choose From When Drafting",
|
||||
"EveryoneDrafted": "<#00ffa5>✓</color> <#00ff00>Everyone has drafted their role!</color>",
|
||||
"DeathCommand": "<#ffffff>You were killed by </color>{0}<#ffffff>\\nTheir role is </color>{1}",
|
||||
"DeathCommandFail": "<#ff0000>The game could not determine your real killer.</color>",
|
||||
"DefaultSystemMessageTitle": "➡ SYSTEM MESSAGE ⬅",
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Snitch : RoleBase
|
||||
|
||||
public static void CheckTask(PlayerControl snitch)
|
||||
{
|
||||
if (!snitch.IsAlive() || snitch.Is(CustomRoles.Madmate)) return;
|
||||
if (!snitch.IsAlive() || snitch.Is(CustomRoles.Madmate) || snitch.IsConverted()) return;
|
||||
|
||||
byte snitchId = snitch.PlayerId;
|
||||
TaskState snitchTask = snitch.GetTaskState();
|
||||
|
||||
@@ -110,7 +110,7 @@ public class PlagueBearer : RoleBase
|
||||
|
||||
public static bool IsPlaguedAll(PlayerControl player)
|
||||
{
|
||||
if (!player.Is(CustomRoles.PlagueBearer)) return false;
|
||||
if (!player.Is(CustomRoles.PlagueBearer) || !Main.IntroDestroyed) return false;
|
||||
|
||||
(int plagued, int all) = PlaguedPlayerCount(player.PlayerId);
|
||||
return plagued >= all;
|
||||
@@ -128,7 +128,7 @@ public class PlagueBearer : RoleBase
|
||||
Utils.NotifyRoles(SpecifySeer: killer, SpecifyTarget: target);
|
||||
killer.ResetKillCooldown();
|
||||
killer.SetKillCooldown();
|
||||
Logger.Msg($"kill cooldown {PlagueBearerCD[killer.PlayerId]}", "PlagueBearer");
|
||||
Logger.Msg($"Kill cooldown: {PlagueBearerCD[killer.PlayerId]}", "PlagueBearer");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,8 @@ public class Pestilence : RoleBase
|
||||
|
||||
public override bool OnCheckMurder(PlayerControl killer, PlayerControl target)
|
||||
{
|
||||
if (base.OnCheckMurder(killer, target)) killer.Kill(target);
|
||||
if (base.OnCheckMurder(killer, target))
|
||||
killer.Kill(target);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user