mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-25 22:46:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91e2748156 |
No files matched your search
@@ -146,6 +146,8 @@ internal static class FFAManager
|
||||
PlayerTeams.Add(id, i);
|
||||
}
|
||||
}
|
||||
|
||||
_ = new LateTask(() => { Utils.NotifyRoles(NoCache: true, ForceLoop: true); }, 10f, log: false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +405,7 @@ internal static class FFAManager
|
||||
LatestChatMessage = string.Format(GetString("FFAChatMessageNotify"), playerName, message);
|
||||
foreach (var pc in Main.AllAlivePlayerControls)
|
||||
{
|
||||
Utils.NotifyRoles(SpecifySeer: pc, SpecifyTarget: pc);
|
||||
pc.Notify(LatestChatMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,15 @@ public class Counter(int totalGreenTime, int totalRedTime, long startTimeStamp,
|
||||
|
||||
public string ColoredTimerString
|
||||
{
|
||||
get => IsYellow ? Utils.ColorString(Color.clear, "00") : Utils.ColorString(IsRed ? Color.red : Color.green, Timer < 10 ? $"0{Timer}" : Timer.ToString());
|
||||
get
|
||||
{
|
||||
string result = IsYellow || (Timer == TotalGreenTime && !IsRed && !IsYellow) || (Timer == TotalRedTime && IsRed) ? Utils.ColorString(Color.clear, "00") : Utils.ColorString(IsRed ? Color.red : Color.green, Timer < 10 ? $"0{Timer}" : Timer.ToString());
|
||||
|
||||
if (Timer is <= 19 and >= 10 && !IsYellow) result = $" {result}";
|
||||
if (Timer % 10 == 1 && !IsYellow) result = result.Insert(result.Length - 9, " ");
|
||||
|
||||
return $"<font=\"DIGITAL-7 SDF\"><size=130%>{result}</size></font>";
|
||||
}
|
||||
}
|
||||
|
||||
public string ColoredArrow
|
||||
@@ -139,10 +147,10 @@ class MoveAndStopPlayerData(Counter leftCounter, Counter middleCounter, Counter
|
||||
var middleTimer = MiddleCounter.ColoredTimerString;
|
||||
var rightTimer = RightCounter.ColoredTimerString;
|
||||
|
||||
var arrowRow = $"{LeftCounter.ColoredArrow.PadRightV2(4)} {MiddleCounter.ColoredArrow.PadRightV2(4)} {RightCounter.ColoredArrow.PadRightV2(4)}";
|
||||
var counterRow = $"{leftTimer.PadRightV2(4)} {middleTimer.PadRightV2(4)} {rightTimer.PadRightV2(4)}";
|
||||
var arrowRow = $"{LeftCounter.ColoredArrow} {MiddleCounter.ColoredArrow} {RightCounter.ColoredArrow}";
|
||||
var counterRow = $"{leftTimer} {middleTimer} {rightTimer}";
|
||||
|
||||
return $"{arrowRow}\n{counterRow}";
|
||||
return $"{counterRow}\n{arrowRow}";
|
||||
}
|
||||
|
||||
public void UpdateCounters()
|
||||
|
||||
@@ -631,13 +631,13 @@ static class ExtendedPlayerControl
|
||||
|
||||
return pc.GetCustomRole() switch
|
||||
{
|
||||
//SoloKombat
|
||||
// SoloKombat
|
||||
CustomRoles.KB_Normal => true,
|
||||
//FFA
|
||||
// FFA
|
||||
CustomRoles.Killer => true,
|
||||
//Move And Stop
|
||||
// Move And Stop
|
||||
CustomRoles.Tasker => false,
|
||||
//Hot Potato
|
||||
// Hot Potato
|
||||
CustomRoles.Potato => false,
|
||||
|
||||
_ => Main.PlayerStates.TryGetValue(pc.PlayerId, out var state) && state.Role.CanUseImpostorVentButton(pc),
|
||||
|
||||
@@ -40,8 +40,7 @@ public static class NameColorManager
|
||||
switch (Options.CurrentGameMode)
|
||||
{
|
||||
case CustomGameMode.FFA when FFAManager.FFATeamMode.GetBool():
|
||||
if (FFAManager.PlayerTeams[seer.PlayerId] == FFAManager.PlayerTeams[target.PlayerId])
|
||||
color = FFAManager.TeamColors[FFAManager.PlayerTeams[seer.PlayerId]];
|
||||
color = FFAManager.TeamColors[FFAManager.PlayerTeams[target.PlayerId]];
|
||||
return true;
|
||||
case CustomGameMode.MoveAndStop:
|
||||
color = "#ffffff";
|
||||
|
||||
+1
-4
@@ -1587,7 +1587,7 @@ public static class Utils
|
||||
public static void ApplySuffix(PlayerControl player)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost || player == null) return;
|
||||
if (!(player.AmOwner || player.FriendCode.GetDevUser().HasTag())) return;
|
||||
if (!player.AmOwner && !player.FriendCode.GetDevUser().HasTag() && !ChatCommands.IsPlayerModerator(player.FriendCode)) return;
|
||||
string name = Main.AllPlayerNames.TryGetValue(player.PlayerId, out var n) ? n : string.Empty;
|
||||
if (Main.NickName != string.Empty && player.AmOwner) name = Main.NickName;
|
||||
if (name == string.Empty) return;
|
||||
@@ -1915,7 +1915,6 @@ public static class Utils
|
||||
{
|
||||
case CustomGameMode.FFA:
|
||||
SelfSuffix.Append(FFAManager.GetPlayerArrow(seer));
|
||||
if (FFAManager.FFAChatDuringGame.GetBool()) SelfSuffix.Append(SelfSuffix.Length > 0 && FFAManager.LatestChatMessage != string.Empty ? "\n" : string.Empty).Append(FFAManager.LatestChatMessage);
|
||||
break;
|
||||
case CustomGameMode.SoloKombat:
|
||||
SelfSuffix.Append(SoloKombatManager.GetDisplayHealth(seer));
|
||||
@@ -2037,8 +2036,6 @@ public static class Utils
|
||||
if (target.PlayerId == seer.PlayerId) continue;
|
||||
Logger.Info($"NotifyRoles-Loop2-{target.GetNameWithRole().RemoveHtmlTags()}:START", "NotifyRoles");
|
||||
|
||||
ApplySuffix(target);
|
||||
|
||||
if ((IsActive(SystemTypes.MushroomMixupSabotage) || MushroomMixup) && target.IsAlive() && !seer.Is(CustomRoleTypes.Impostor) && Main.ResetCamPlayerList.Contains(seer.PlayerId))
|
||||
{
|
||||
seer.RpcSetNamePrivate("<size=0%>", true, force: NoCache);
|
||||
|
||||
@@ -524,15 +524,22 @@ class GameEndChecker
|
||||
|
||||
if (FFAManager.FFATeamMode.GetBool())
|
||||
{
|
||||
var teams = FFAManager.PlayerTeams.GroupBy(x => x.Value, x => x.Key).Select(x => x.Where(p =>
|
||||
var firstTeam = FFAManager.PlayerTeams.GroupBy(x => x.Value, x => x.Key).Select(x => x.Where(p =>
|
||||
{
|
||||
var pc = GetPlayerById(p);
|
||||
return pc != null && !pc.Data.Disconnected && pc.IsAlive();
|
||||
}).ToHashSet()).Where(x => x.Count > 0).ToArray();
|
||||
return pc != null && !pc.Data.Disconnected;
|
||||
}).ToHashSet()).FirstOrDefault(x => x.Count > 0);
|
||||
|
||||
if (teams.Length == 1)
|
||||
if (firstTeam == null)
|
||||
{
|
||||
WinnerIds = teams[0];
|
||||
FFAManager.RoundTime = 0;
|
||||
Logger.Warn("No players alive. Force ending the game", "FFA");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Main.AllAlivePlayerControls.All(x => firstTeam.Contains(x.PlayerId)))
|
||||
{
|
||||
WinnerIds = firstTeam;
|
||||
|
||||
Main.DoBlockNameChange = true;
|
||||
return true;
|
||||
|
||||
@@ -317,13 +317,13 @@ class CheckForEndVotingPatch
|
||||
|
||||
exiledPlayer?.Object.SetRealKiller(null);
|
||||
|
||||
//RPC
|
||||
// RPC
|
||||
if (AntiBlackout.OverrideExiledPlayer)
|
||||
{
|
||||
__instance.RpcVotingComplete(states.ToArray(), null, true);
|
||||
ExileControllerWrapUpPatch.AntiBlackout_LastExiled = exiledPlayer;
|
||||
}
|
||||
else __instance.RpcVotingComplete(states.ToArray(), exiledPlayer, tie); //通常処理
|
||||
else __instance.RpcVotingComplete(states.ToArray(), exiledPlayer, tie);
|
||||
|
||||
CheckForDeathOnExile(PlayerState.DeathReason.Vote, exileId);
|
||||
|
||||
@@ -852,7 +852,7 @@ class MeetingHudStartPatch
|
||||
|
||||
if (AmongUsClient.Instance.AmHost)
|
||||
{
|
||||
_ = _ = new LateTask(() =>
|
||||
_ = new LateTask(() =>
|
||||
{
|
||||
foreach (PlayerControl pc in Main.AllPlayerControls)
|
||||
{
|
||||
|
||||
@@ -1505,7 +1505,6 @@ class FixedUpdatePatch
|
||||
{
|
||||
case CustomGameMode.FFA:
|
||||
Suffix.Append(FFAManager.GetPlayerArrow(seer, target));
|
||||
if (self && FFAManager.FFAChatDuringGame.GetBool()) Suffix.Append((Suffix.Length > 0 && FFAManager.LatestChatMessage != string.Empty ? "\n" : string.Empty) + FFAManager.LatestChatMessage);
|
||||
break;
|
||||
case CustomGameMode.MoveAndStop when self:
|
||||
Suffix.Append(MoveAndStopManager.GetSuffixText(seer));
|
||||
@@ -1684,7 +1683,7 @@ class EnterVentPatch
|
||||
{
|
||||
Logger.Info($" {pc.GetNameWithRole()}, Vent ID: {__instance.Id} ({__instance.name})", "EnterVent");
|
||||
|
||||
if (pc.GetRoleTypes() != RoleTypes.Engineer && !Main.PlayerStates[pc.PlayerId].Role.CanUseImpostorVentButton(pc))
|
||||
if (pc.GetRoleTypes() != RoleTypes.Engineer && !Main.PlayerStates[pc.PlayerId].Role.CanUseImpostorVentButton(pc) && Options.CurrentGameMode == CustomGameMode.Standard)
|
||||
{
|
||||
pc.MyPhysics?.RpcBootFromVent(__instance.Id);
|
||||
return;
|
||||
@@ -1799,10 +1798,7 @@ class CoEnterVentPatch
|
||||
if (Ventguard.BlockedVents.Contains(id))
|
||||
{
|
||||
var pc = __instance.myPlayer;
|
||||
if (Options.VentguardBlockDoesNotAffectCrew.GetBool() && pc.IsCrewmate())
|
||||
{
|
||||
}
|
||||
else
|
||||
if (!Options.VentguardBlockDoesNotAffectCrew.GetBool() || !pc.IsCrewmate())
|
||||
{
|
||||
_ = new LateTask(() =>
|
||||
{
|
||||
@@ -1823,7 +1819,7 @@ class CoEnterVentPatch
|
||||
Circumvent.OnCoEnterVent(__instance, id);
|
||||
}
|
||||
|
||||
if (__instance.myPlayer.GetCustomRole().GetDYRole() == RoleTypes.Impostor && !Main.PlayerStates[__instance.myPlayer.PlayerId].Role.CanUseImpostorVentButton(__instance.myPlayer))
|
||||
if (__instance.myPlayer.GetCustomRole().GetDYRole() == RoleTypes.Impostor && !Main.PlayerStates[__instance.myPlayer.PlayerId].Role.CanUseImpostorVentButton(__instance.myPlayer) && Options.CurrentGameMode == CustomGameMode.Standard)
|
||||
{
|
||||
_ = new LateTask(() => { __instance.RpcBootFromVent(id); }, 0.5f);
|
||||
}
|
||||
@@ -1831,7 +1827,7 @@ class CoEnterVentPatch
|
||||
if (((__instance.myPlayer.Data.Role.Role != RoleTypes.Engineer && !__instance.myPlayer.CanUseImpostorVentButton()) ||
|
||||
(__instance.myPlayer.Is(CustomRoles.Mayor) && Mayor.MayorUsedButtonCount.TryGetValue(__instance.myPlayer.PlayerId, out var count) && count >= Mayor.MayorNumOfUseButton.GetInt()) ||
|
||||
(__instance.myPlayer.Is(CustomRoles.Paranoia) && Paranoia.ParaUsedButtonCount.TryGetValue(__instance.myPlayer.PlayerId, out var count2) && count2 >= Options.ParanoiaNumOfUseButton.GetInt()))
|
||||
&& !__instance.myPlayer.Is(CustomRoles.Nimble) && !__instance.myPlayer.Is(CustomRoles.Bloodlust))
|
||||
&& !__instance.myPlayer.Is(CustomRoles.Nimble) && !__instance.myPlayer.Is(CustomRoles.Bloodlust) && Options.CurrentGameMode == CustomGameMode.Standard)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
+10
-10
@@ -240,7 +240,7 @@
|
||||
"Infectious": "Infectious",
|
||||
"Virus": "Virus",
|
||||
"Pursuer": "Pursuer",
|
||||
"Phantom": "Phantom",
|
||||
"Phantom": "Specter",
|
||||
"Pirate": "Pirate",
|
||||
"Jinx": "Jinx",
|
||||
"Maverick": "Maverick",
|
||||
@@ -761,7 +761,7 @@
|
||||
"InfectiousInfoLong": "(Neutrals):\\nAs the Infectious, your job is to infect as many players as you can.\\n\\nIf you infect all the killers, you then can simply outnumber the crew and win the game.",
|
||||
"VirusInfoLong": "(Neutrals):\\nThe virus' goal is to eliminate other players. When a crewmate is killed, their corpse is infected, and the reporting crewmate joins the virus team or dies if the virus isn't voted out. The Virus team wins if they outnumber the Crewmate team.",
|
||||
"PursuerInfoLong": "(Neutrals):\\nAs the Pursuer, you can use your ability on someone to make them shoot a blank when they try to kill (= reset their kill cooldown).\\n\\nTo win, just survive to the end of the game.",
|
||||
"PhantomInfoLong": "(Neutrals):\\nAs the Phantom, your job is to get killed and finish your tasks.\\nYou can do your tasks while alive.\\nYou cannot win if you're alive.\\nIf you get killed, you win with the winning team if your tasks are completed.",
|
||||
"PhantomInfoLong": "(Neutrals):\\nAs the Specter, your job is to get killed and finish your tasks.\\nYou can do your tasks while alive.\\nYou cannot win if you're alive.\\nIf you get killed, you win with the winning team if your tasks are completed.",
|
||||
"PirateInfoLong": "(Neutrals):\\nAs the Pirate, use your kill button to select a target every round. You will duel with your target when in a meeting. If both the Pirate and the target choose the same number Pirate wins.\\nAdditionally, if Pirate wins the duel, or Target doesn't duel Target will suicide.\\n\\nDueling command:- /duel X (where X can be 0, 1 or 2)\\n\\nYou win after winning a certain number of duels set by the host.",
|
||||
"JinxInfoLong": "(Neutrals):\\nAs the Jinx, whenever you are attacked, you jinx them, resulting in them dying to a jinx.\\nThis has limited uses.\\n\\nKill off everyone to win.",
|
||||
"MaverickInfoLong": "(Neutrals):\\nAs the Maverick, you can kill much like a Serial Killer.\\n\\nHowever, you win with the winning team rather than alone.\\nIf you die, you lose.",
|
||||
@@ -1946,7 +1946,7 @@
|
||||
"InfectiousBittenPlayer": "You successfully infected a player",
|
||||
"GuessNotAllowed": "Sorry, your role does not have access to guessing.",
|
||||
"GuessOnbound": "This player has the Onbound add-on, so your guess on them was canceled.",
|
||||
"GuessPhantom": "You can't guess a Phantom, that allows them to win!",
|
||||
"GuessPhantom": "You can't guess a Specter, that allows them to win!",
|
||||
"DovesOfNeaceOnGuard": "Ability used, {0} uses remain",
|
||||
"DovesOfNeaceMaxUsage": "Ability use limit reached",
|
||||
"DovesOfNeaceSkillNotify": "Pacifist reset your kill cooldown",
|
||||
@@ -3457,11 +3457,11 @@
|
||||
"WardenInfoLong": "(Crewmates):\\nAs the Warden, you can protect someone (optimally a crewmate) to notify them about being in danger and to give them a temporary speed boost.",
|
||||
"WardenNotify": "The Warden warns you that you're in danger!",
|
||||
"Prefix.Warden": "Warden",
|
||||
"Specter": "Specter",
|
||||
"Specter": "Phantom",
|
||||
"SpecterInfo": "Finish Tasks to Win!",
|
||||
"SpecterInfoLong": "(Crewmates):\\nAs the Specter, you must finish all of your tasks to win! Depending on a setting, you may also end the game and win alone if you do so!",
|
||||
"SpecterInfoLong": "(Crewmates):\\nAs the Phantom, you must finish all of your tasks to win! Depending on a setting, you may also end the game and win alone if you do so!",
|
||||
"SnatchWin": "Snatches Win (Win With Winning Team if Off)",
|
||||
"Prefix.Specter": "Specter",
|
||||
"Prefix.Specter": "Phantom",
|
||||
"Haunter": "Haunter",
|
||||
"HaunterInfo": "You're the Impostors' Worst Nightmare",
|
||||
"HaunterInfoLong": "(Neutrals):\\nAs the Haunter, when you complete all of your tasks, a random living impostor's name will show in red to everyone in meetings. When you have 1 task left, all impostors will get an arrow pointing towards you, and if any of them come close to you, you lose this role.",
|
||||
@@ -3838,7 +3838,7 @@
|
||||
"WinnerRoleText.Infectious": "Infectious Wins!",
|
||||
"WinnerRoleText.Rogue": "Mavericks Win!",
|
||||
"WinnerRoleText.Virus": "Virus Wins!",
|
||||
"WinnerRoleText.Phantom": "Phantom Wins!",
|
||||
"WinnerRoleText.Phantom": "Specter Wins!",
|
||||
"WinnerRoleText.Jinx": "Jinx Wins!",
|
||||
"WinnerRoleText.CursedSoul": "Cursed Soul Wins!",
|
||||
"WinnerRoleText.Ritualist": "Ritualist Wins!",
|
||||
@@ -3870,7 +3870,7 @@
|
||||
"WinnerRoleText.Sprayer": "Sprayer Wins!",
|
||||
"WinnerRoleText.SoulHunter": "Soul Hunter Wins!",
|
||||
"WinnerRoleText.Tiger": "Tiger Wins!",
|
||||
"WinnerRoleText.Specter": "Specter Wins!",
|
||||
"WinnerRoleText.Specter": "Phantom Wins!",
|
||||
"WinnerRoleText.Default": "{0} Wins!",
|
||||
"AdditionalWinnerRoleText.Sidekick": "along with Sidekicks",
|
||||
"AdditionalWinnerRoleText.Opportunist": "The Opportunist survived",
|
||||
@@ -3884,13 +3884,13 @@
|
||||
"AdditionalWinnerRoleText.Jester": "The Jester wins along",
|
||||
"AdditionalWinnerRoleText.Lovers": "Lovers win along",
|
||||
"AdditionalWinnerRoleText.Executioner": "Executioner wins along",
|
||||
"AdditionalWinnerRoleText.Phantom": "Phantom wins along",
|
||||
"AdditionalWinnerRoleText.Phantom": "Specter wins along",
|
||||
"AdditionalWinnerRoleText.Maverick": "The Maverick survived",
|
||||
"AdditionalWinnerRoleText.Romantic": "The Romantic wins along",
|
||||
"AdditionalWinnerRoleText.VengefulRomantic": "The Vengeful Romantic avenged their lover",
|
||||
"AdditionalWinnerRoleText.Postman": "The Postman delivered mail to everyone",
|
||||
"AdditionalWinnerRoleText.SoulHunter": "Soul Hunter wins along",
|
||||
"AdditionalWinnerRoleText.Specter": "Specter wins along",
|
||||
"AdditionalWinnerRoleText.Specter": "Phantom wins along",
|
||||
"AdditionalWinnerRoleText.Default": "{0} wins along",
|
||||
"ErrorEndText": "An error occurred",
|
||||
"ErrorEndTextDescription": "To avoid crashing, the game was forcibly ended.",
|
||||
|
||||
@@ -35,8 +35,8 @@ public class Main : BasePlugin
|
||||
public const string DebugKeySalt = "59687b";
|
||||
public static ConfigEntry<string> DebugKeyInput { get; private set; }
|
||||
public const string PluginGuid = "com.gurge44.endlesshostroles";
|
||||
public const string PluginVersion = "3.1.3";
|
||||
public const string PluginDisplayVersion = "3.1.3";
|
||||
public const string PluginVersion = "3.1.4";
|
||||
public const string PluginDisplayVersion = "3.1.4";
|
||||
public static readonly string SupportedAUVersion = "2024.3.5";
|
||||
|
||||
public Harmony Harmony { get; } = new(PluginGuid);
|
||||
|
||||
Reference in new issue
Block a user