mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-11-19 13:16:52 +00:00
Okay, I suppose
This commit is contained in:
1 parent
e3d8c23482
commit
d86aa2343a
7 files changed
+37
-28
No files matched your search
+1
-1
@@ -46,7 +46,7 @@ public partial class Main : BasePlugin
|
||||
|
||||
public static bool HasArgumentException;
|
||||
public static string CredentialsText;
|
||||
public const string ModVersion = "v2.2.3";
|
||||
public const string ModVersion = "v2.3.0";
|
||||
|
||||
public static float GameTimer;
|
||||
public static float AfkTimer;
|
||||
|
||||
@@ -192,11 +192,18 @@ class FixedUpdateInGamePatch
|
||||
}
|
||||
if ( !Main.DisableLobbyInfo.Value && __instance.cosmetics.nameText.text != $"<size=70%><color=#00ffff>Lv.{__instance.Data.PlayerLevel}</color> | <color=yellow>{AmongUsClient.Instance.GetClientFromCharacter(__instance).PlatformData.Platform}</size>\n<color={color}>{__instance.Data.PlayerName}</color>")
|
||||
{
|
||||
__instance.cosmetics.nameText.text = $"<size=70%><color=#00ffff>Lv.{__instance.Data.PlayerLevel}</color> | <color=yellow>{AmongUsClient.Instance.GetClientFromCharacter(__instance).PlatformData.Platform}</size>\n<color={color}>{__instance.Data.PlayerName}</color>";
|
||||
__instance.cosmetics.nameText.text = $"<size=60%><color=#00ffff>Lv.{__instance.Data.PlayerLevel + 1}</color> | <color=yellow>{Utils.ConvertPlatform(AmongUsClient.Instance.GetClientFromCharacter(__instance).PlatformData.Platform)}</size>\n<color={color}>{__instance.Data.PlayerName}</color>";
|
||||
}
|
||||
LastColors[__instance.PlayerId] = color;
|
||||
}
|
||||
}
|
||||
if (Utils.InGame)
|
||||
{
|
||||
if (__instance.cosmetics.nameText.text != __instance.Data.PlayerName)
|
||||
{
|
||||
__instance.cosmetics.nameText.text = __instance.Data.PlayerName;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
|
||||
+1
-3
@@ -28,9 +28,7 @@ internal class Hotkeys
|
||||
|
||||
if (Input.GetKey(KeyCode.L) && Shift && Enter)
|
||||
{
|
||||
MessageWriter writer = AmongUsClient.Instance.StartEndGame();
|
||||
writer.Write((byte)GameOverReason.ImpostorDisconnect);
|
||||
AmongUsClient.Instance.FinishEndGame(writer);
|
||||
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorDisconnect, false);
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeyCode.M) && Shift && Enter && Utils.InGame)
|
||||
|
||||
+21
-13
@@ -460,17 +460,18 @@ public static class Utils
|
||||
{
|
||||
foreach (PlayerControl pc in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
CustomGameOverReason = (byte)GameOverReason.ImpostorsByVote;
|
||||
pc.RpcSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
}
|
||||
new LateTask(() =>
|
||||
{
|
||||
ContinueEndGame(GameOverReason.ImpostorsByVote);
|
||||
}, 1f, "CustomWinnerEndGame");
|
||||
}
|
||||
|
||||
if (winnerType == 1)
|
||||
{
|
||||
foreach (PlayerControl pc in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
CustomGameOverReason = (byte)GameOverReason.ImpostorsByVote;
|
||||
|
||||
if (pc != winner)
|
||||
{
|
||||
pc.RpcSetRole(AmongUs.GameOptions.RoleTypes.CrewmateGhost, false);
|
||||
@@ -480,19 +481,16 @@ public static class Utils
|
||||
pc.RpcSetRole(AmongUs.GameOptions.RoleTypes.ImpostorGhost, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new LateTask(() =>
|
||||
{
|
||||
ContinueEndGame((byte)CustomGameOverReason);
|
||||
}, 1f, "CustomWinnerEndGame");
|
||||
new LateTask(() =>
|
||||
{
|
||||
ContinueEndGame(GameOverReason.ImpostorsByVote);
|
||||
}, 1f, "CustomWinnerEndGame");
|
||||
}
|
||||
}
|
||||
|
||||
public static void ContinueEndGame(byte gameOverReason)
|
||||
public static void ContinueEndGame(GameOverReason gameOverReason)
|
||||
{
|
||||
MessageWriter writer = AmongUsClient.Instance.StartEndGame();
|
||||
writer.Write(gameOverReason);
|
||||
AmongUsClient.Instance.FinishEndGame(writer);
|
||||
GameManager.Instance.RpcEndGame(gameOverReason, false);
|
||||
HandlingGameEnd = false;
|
||||
Logger.Info($"{gameOverReason}", "ContinueEndGame");
|
||||
}
|
||||
@@ -913,4 +911,14 @@ public static class Utils
|
||||
|
||||
return newText;
|
||||
}
|
||||
|
||||
public static string ConvertPlatform(Platforms input)
|
||||
{
|
||||
if (input == Platforms.StandaloneSteamPC) return "Steam";
|
||||
if (input == Platforms.Playstation) return "PS";
|
||||
if (input == Platforms.StandaloneWin10) return "Win10";
|
||||
if (input == Platforms.StandaloneEpicPC) return "Epic";
|
||||
|
||||
return input.ToString();
|
||||
}
|
||||
}
|
||||
@@ -149,9 +149,7 @@ internal static class SendChatPatch
|
||||
__instance.freeChatField.textArea.SetText(string.Empty);
|
||||
|
||||
if (!Utils.InGame) return false;
|
||||
MessageWriter writer = AmongUsClient.Instance.StartEndGame();
|
||||
writer.Write((byte)GameOverReason.ImpostorDisconnect);
|
||||
AmongUsClient.Instance.FinishEndGame(writer);
|
||||
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorDisconnect, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -859,9 +857,7 @@ public static class RPCHandlerPatch
|
||||
if (text == "/eg" || text == "/endgame")
|
||||
{
|
||||
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashStartAndEndGameCmd.GetValue()) return;
|
||||
MessageWriter writer = AmongUsClient.Instance.StartEndGame();
|
||||
writer.Write((byte)GameOverReason.ImpostorDisconnect);
|
||||
AmongUsClient.Instance.FinishEndGame(writer);
|
||||
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorDisconnect, false);
|
||||
}
|
||||
|
||||
if (text == "/em" || text == "/endmeeting")
|
||||
|
||||
@@ -167,7 +167,7 @@ public static class ReactorSystemTypePatch
|
||||
{
|
||||
if (__instance.IsActive && __instance.Countdown <= 0 && !Utils.HandlingGameEnd)
|
||||
{
|
||||
Utils.ContinueEndGame((byte)GameOverReason.ImpostorsBySabotage);
|
||||
Utils.ContinueEndGame(GameOverReason.ImpostorsBySabotage);
|
||||
NormalGameEndChecker.CheckWinnerText("ImpostorSabotage");
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public static class HeliSabotageSystemPatch
|
||||
{
|
||||
if (__instance.IsActive && __instance.Countdown <= 0 && !Utils.HandlingGameEnd)
|
||||
{
|
||||
Utils.ContinueEndGame((byte)GameOverReason.ImpostorsBySabotage);
|
||||
Utils.ContinueEndGame(GameOverReason.ImpostorsBySabotage);
|
||||
NormalGameEndChecker.CheckWinnerText("ImpostorSabotage");
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ public static class LifeSuppSystemTypePatch
|
||||
{
|
||||
if (__instance.IsActive && __instance.Countdown <= 0 && !Utils.HandlingGameEnd)
|
||||
{
|
||||
Utils.ContinueEndGame((byte)GameOverReason.ImpostorsBySabotage);
|
||||
Utils.ContinueEndGame(GameOverReason.ImpostorsBySabotage);
|
||||
NormalGameEndChecker.CheckWinnerText("ImpostorSabotage");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user