mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
comment out => dynamic disable
This commit is contained in:
1 parent
325cdb6b91
commit
ea6d112519
24 files changed
+106
-100
No files matched your search
@@ -851,7 +851,7 @@ public static class BedWars
|
||||
NameNotifyManager.Notifies.Remove(pc.PlayerId);
|
||||
RPC.PlaySoundRPC(pc.PlayerId, Sounds.TaskComplete);
|
||||
pc.ReviveFromTemporaryExile();
|
||||
// pc.RpcSetColor(Team.GetColorId());
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) pc.RpcSetColor(Team.GetColorId());
|
||||
pc.TP(Base.SpawnPosition);
|
||||
pc.SetChatVisible(true);
|
||||
Utils.NotifyRoles(SpecifyTarget: pc, SendOption: SendOption.None);
|
||||
|
||||
@@ -363,6 +363,8 @@ public static class CaptureTheFlag
|
||||
int blueCount = players.Count / 2;
|
||||
HashSet<byte> bluePlayers = [];
|
||||
HashSet<byte> yellowPlayers = [];
|
||||
|
||||
bool vanillaServer = GameStates.CurrentServerType == GameStates.ServerType.Vanilla;
|
||||
|
||||
for (var i = 0; i < blueCount; i++)
|
||||
{
|
||||
@@ -370,7 +372,7 @@ public static class CaptureTheFlag
|
||||
players.Remove(player);
|
||||
PlayerTeams[player.PlayerId] = CTFTeam.Blue;
|
||||
bluePlayers.Add(player.PlayerId);
|
||||
// player.RpcSetColor(1);
|
||||
if (!vanillaServer) player.RpcSetColor(1);
|
||||
yield return WaitFrameIfNecessary();
|
||||
}
|
||||
|
||||
@@ -378,7 +380,7 @@ public static class CaptureTheFlag
|
||||
{
|
||||
PlayerTeams[player.PlayerId] = CTFTeam.Yellow;
|
||||
yellowPlayers.Add(player.PlayerId);
|
||||
// player.RpcSetColor(5);
|
||||
if (!vanillaServer) player.RpcSetColor(5);
|
||||
yield return WaitFrameIfNecessary();
|
||||
}
|
||||
|
||||
|
||||
@@ -972,17 +972,20 @@ public static class KingOfTheZones
|
||||
|
||||
yield return null;
|
||||
|
||||
/*foreach (PlayerControl player in Main.EnumerateAlivePlayerControls())
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla)
|
||||
{
|
||||
try
|
||||
foreach (PlayerControl player in Main.EnumerateAlivePlayerControls())
|
||||
{
|
||||
byte colorId = PlayerTeams[player.PlayerId].GetColorId();
|
||||
if (player.CurrentOutfit.ColorId == colorId) continue;
|
||||
try
|
||||
{
|
||||
byte colorId = PlayerTeams[player.PlayerId].GetColorId();
|
||||
if (player.CurrentOutfit.ColorId == colorId) continue;
|
||||
|
||||
player.RpcSetColor(colorId);
|
||||
player.RpcSetColor(colorId);
|
||||
}
|
||||
catch (Exception e) { Utils.ThrowException(e); }
|
||||
}
|
||||
catch (Exception e) { Utils.ThrowException(e); }
|
||||
}*/
|
||||
}
|
||||
|
||||
yield return null;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using EHR.Modules;
|
||||
using EHR.Roles;
|
||||
@@ -327,7 +328,6 @@ public static class TheMindGame
|
||||
foreach (PlayerControl pc in players)
|
||||
{
|
||||
Groups[pc.PlayerId] = group;
|
||||
// pc.RpcSetColor(group.GetColorId());
|
||||
pc.TP(location);
|
||||
ids.Add(pc.PlayerId);
|
||||
}
|
||||
@@ -402,8 +402,6 @@ public static class TheMindGame
|
||||
|
||||
Round = 2;
|
||||
|
||||
// DefaultColorIds.DoIf(x => x.Key && x.Value is >= byte.MinValue and <= byte.MaxValue, x => x.Key.RpcSetColor((byte)x.Value));
|
||||
|
||||
yield return NotifyEveryone("TMG.Notify.Round", 2, 2);
|
||||
if (Stop) yield break;
|
||||
|
||||
@@ -997,6 +995,7 @@ public static class TheMindGame
|
||||
MindDetective
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
private enum Group
|
||||
{
|
||||
Red,
|
||||
|
||||
@@ -112,7 +112,7 @@ public static class AntiBlackout
|
||||
pc.RpcExiled();
|
||||
|
||||
if (GhostRolesManager.AssignedGhostRoles.TryGetValue(pc.PlayerId, out var ghostRole) && ghostRole.Instance.RoleTypes == RoleTypes.GuardianAngel)
|
||||
pc.RpcResetAbilityCooldown();
|
||||
pc.AddAbilityCD(ghostRole.Instance.Cooldown);
|
||||
}
|
||||
}
|
||||
catch (Exception e) { Utils.ThrowException(e); }
|
||||
|
||||
@@ -159,6 +159,7 @@ public static class Camouflage
|
||||
|
||||
public static void RpcSetSkin(PlayerControl target, bool forceRevert = false, bool revertToDefault = false, bool gameEnd = false, bool revive = false, bool notCommsOrCamo = false, CustomRpcSender sender = null)
|
||||
{
|
||||
if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return;
|
||||
if (!AmongUsClient.Instance.AmHost || (!Options.CommsCamouflage.GetBool() && !Camouflager.On && !revive && !notCommsOrCamo) || !target || (BlockCamouflage && !forceRevert && !revertToDefault && !gameEnd && !revive && !notCommsOrCamo)) return;
|
||||
|
||||
Logger.Info($"New outfit for {target.GetNameWithRole()}", "Camouflage.RpcSetSkin");
|
||||
|
||||
@@ -103,7 +103,7 @@ internal static class CustomRoleSelector
|
||||
|
||||
switch (role)
|
||||
{
|
||||
case CustomRoles.Camouflager or CustomRoles.Magistrate or CustomRoles.Devourer or CustomRoles.Venerer or CustomRoles.Amogus or CustomRoles.Shadow or CustomRoles.MoonDancer or CustomRoles.Merchant or CustomRoles.Catalyst or CustomRoles.Doppelganger when GameStates.CurrentServerType == GameStates.ServerType.Vanilla:
|
||||
case CustomRoles.Camouflager or CustomRoles.Magistrate or CustomRoles.Devourer or CustomRoles.Venerer or CustomRoles.Amogus or CustomRoles.Shadow or CustomRoles.MoonDancer or CustomRoles.Merchant or CustomRoles.Catalyst or CustomRoles.Doppelganger or CustomRoles.Butcher when GameStates.CurrentServerType == GameStates.ServerType.Vanilla:
|
||||
case CustomRoles.Bargainer when Main.LIMap:
|
||||
case CustomRoles.AntiAdminer when Main.LIMap:
|
||||
case CustomRoles.CameraMan when Main.LIMap:
|
||||
|
||||
@@ -499,7 +499,7 @@ internal static class ExtendedPlayerControl
|
||||
if (Options.AnonymousBodies.GetBool() && Main.AllPlayerNames.TryGetValue(player.PlayerId, out string name))
|
||||
RpcChangeSkin(player, new NetworkedPlayerInfo.PlayerOutfit().Set(name, 15, "", "", "", "", ""), sender);
|
||||
|
||||
// Camouflage.RpcSetSkin(player, sender: sender);
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) Camouflage.RpcSetSkin(player, sender: sender);
|
||||
sender.SyncSettings(player);
|
||||
|
||||
sender.SendMessage();
|
||||
@@ -844,7 +844,7 @@ internal static class ExtendedPlayerControl
|
||||
|
||||
public void AddKCDAsAbilityCD()
|
||||
{
|
||||
player.AddAbilityCD((int)Math.Round(Main.AllPlayerKillCooldown.TryGetValue(player.PlayerId, out float kcd) ? kcd : Options.AdjustedDefaultKillCooldown));
|
||||
player.AddAbilityCD((int)Math.Round(Main.AllPlayerKillCooldown.GetValueOrDefault(player.PlayerId, Options.AdjustedDefaultKillCooldown)));
|
||||
}
|
||||
|
||||
public void AddAbilityCD(bool includeDuration = true)
|
||||
@@ -1491,7 +1491,7 @@ internal static class ExtendedPlayerControl
|
||||
if (phantom && Options.CurrentGameMode != CustomGameMode.Standard) return;
|
||||
if (!Main.Invisible.Add(player.PlayerId)) return;
|
||||
|
||||
// player.RpcSetPet("");
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) player.RpcSetPet("");
|
||||
|
||||
if (!(phantom && PlayerControl.LocalPlayer.IsImpostor()))
|
||||
player.MakeInvisible();
|
||||
|
||||
@@ -471,7 +471,7 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
|
||||
{
|
||||
if (subRole.IsGhostRole())
|
||||
{
|
||||
AURoleOptions.GuardianAngelCooldown = subRole == CustomRoles.EvilSpirit ? Spiritcaller.SpiritAbilityCooldown.GetFloat() : GhostRolesManager.AssignedGhostRoles.Values.First(x => x.Role == subRole).Instance.Cooldown;
|
||||
AURoleOptions.GuardianAngelCooldown = 5f;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ internal static class GhostRolesManager
|
||||
IGhostRole instance = CreateGhostRoleInstance(suitableRole);
|
||||
pc.RpcSetCustomRole(suitableRole);
|
||||
pc.RpcSetRoleDesync(instance.RoleTypes, pc.OwnerId);
|
||||
pc.AddAbilityCD(instance.Cooldown);
|
||||
instance.OnAssign(pc);
|
||||
Main.ResetCamPlayerList.Add(pc.PlayerId);
|
||||
AssignedGhostRoles[pc.PlayerId] = (suitableRole, instance);
|
||||
|
||||
+6
-25
@@ -2920,32 +2920,13 @@ public static class Utils
|
||||
|
||||
SelfSuffix.Append(BuildSuffix(seer, seer, meeting: forMeeting));
|
||||
|
||||
AppendSuffixIfNotEmpty(Spurt.GetSuffix(seer));
|
||||
AppendSuffixIfNotEmpty(Dynamo.GetSuffix(seer));
|
||||
AppendSuffixIfNotEmpty(CustomTeamManager.GetSuffix(seer));
|
||||
|
||||
static void AppendSuffixIfNotEmpty(string suffix)
|
||||
{
|
||||
if (string.IsNullOrEmpty(suffix)) return;
|
||||
|
||||
bool hasNonWhite = false;
|
||||
for (int i = 0; i < suffix.Length; i++)
|
||||
{
|
||||
if (!char.IsWhiteSpace(suffix[i]))
|
||||
{
|
||||
hasNonWhite = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasNonWhite) return;
|
||||
|
||||
SelfSuffix.Append('\n');
|
||||
SelfSuffix.Append(suffix);
|
||||
}
|
||||
AdditionalSuffixes.Add(Spurt.GetSuffix(seer));
|
||||
AdditionalSuffixes.Add(Dynamo.GetSuffix(seer));
|
||||
AdditionalSuffixes.Add(CustomTeamManager.GetSuffix(seer));
|
||||
|
||||
if (!forMeeting)
|
||||
{
|
||||
if (Options.UsePets.GetBool() && Main.AbilityCD.TryGetValue(seer.PlayerId, out (long StartTimeStamp, int TotalCooldown) time))
|
||||
if (Main.AbilityCD.TryGetValue(seer.PlayerId, out (long StartTimeStamp, int TotalCooldown) time))
|
||||
{
|
||||
long remainingCD = time.TotalCooldown - (now - time.StartTimeStamp) + 1;
|
||||
SelfSuffix.Append("\n" + string.Format(GetString("CDPT"), remainingCD > 30 ? "> 30" : remainingCD));
|
||||
@@ -3042,7 +3023,7 @@ public static class Utils
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < AdditionalSuffixes.Count; i++)
|
||||
for (int i = AdditionalSuffixes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(AdditionalSuffixes[i]))
|
||||
{
|
||||
@@ -4169,7 +4150,7 @@ public static class Utils
|
||||
{
|
||||
LateTask.New(() =>
|
||||
{
|
||||
if (GameStates.IsEnded) return;
|
||||
if (GameStates.IsEnded || GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return;
|
||||
string petId = PetsHelper.GetPetId();
|
||||
PetsHelper.SetPet(pc, petId);
|
||||
pc.Data.DefaultOutfit.PetSequenceId += 10;
|
||||
|
||||
@@ -2055,7 +2055,7 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.IsHost() && !Options.PlayerCanSetColor.GetBool() && !IsPlayerVIP(player.FriendCode) && !player.FriendCode.GetDevUser().up)
|
||||
if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla || (!player.IsHost() && !Options.PlayerCanSetColor.GetBool() && !IsPlayerVIP(player.FriendCode) && !player.FriendCode.GetDevUser().up))
|
||||
{
|
||||
Utils.SendMessage(GetString("DisableUseCommand"), player.PlayerId, importance: MessageImportance.Low);
|
||||
return;
|
||||
@@ -2070,7 +2070,7 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
// player.RpcSetColor(color);
|
||||
player.RpcSetColor(color);
|
||||
Utils.SendMessage(string.Format(GetString("Message.SetColor"), subArgs), player.PlayerId, importance: MessageImportance.Low);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,10 +84,9 @@ internal static class GameEndChecker
|
||||
Ended = true;
|
||||
LoadingEndScreen = true;
|
||||
|
||||
/*foreach (var pc in Main.CachedAllPlayerControls())
|
||||
{
|
||||
Camouflage.RpcSetSkin(pc, true, true, true);
|
||||
}*/
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla)
|
||||
foreach (var pc in Main.CachedAllPlayerControls())
|
||||
Camouflage.RpcSetSkin(pc, true, true, true);
|
||||
|
||||
NameNotifyManager.Reset();
|
||||
NotifyRoles(ForceLoop: true);
|
||||
|
||||
+25
-13
@@ -376,27 +376,21 @@ internal static class HudManagerPatch
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
string cdHUDText = !Options.UsePets.GetBool() || !Main.AbilityCD.TryGetValue(player.PlayerId, out (long StartTimeStamp, int TotalCooldown) CD)
|
||||
? string.Empty
|
||||
: string.Format(GetString("CDPT"), CD.TotalCooldown - (Utils.TimeStamp - CD.StartTimeStamp) + 1);
|
||||
|
||||
bool hasCD = cdHUDText != string.Empty;
|
||||
|
||||
if (hasCD)
|
||||
if (Main.AbilityCD.TryGetValue(player.PlayerId, out (long StartTimeStamp, int TotalCooldown) info))
|
||||
{
|
||||
if (CooldownTimerFlashColor.HasValue) cdHUDText = $"<b>{Utils.ColorString(CooldownTimerFlashColor.Value, cdHUDText.RemoveHtmlTags())}</b>";
|
||||
|
||||
LowerInfoText.text = $"{cdHUDText}\n{LowerInfoText.text}";
|
||||
string text = string.Format(GetString("CDPT"), info.TotalCooldown - (Utils.TimeStamp - info.StartTimeStamp) + 1);
|
||||
if (CooldownTimerFlashColor.HasValue) text = $"<b>{Utils.ColorString(CooldownTimerFlashColor.Value, text.RemoveHtmlTags())}</b>";
|
||||
LowerInfoText.text = $"{text}\n{LowerInfoText.text}";
|
||||
}
|
||||
|
||||
if (AchievementUnlockedText != string.Empty)
|
||||
if (!string.IsNullOrWhiteSpace(AchievementUnlockedText))
|
||||
{
|
||||
LowerInfoText.text = LowerInfoText.text == string.Empty
|
||||
LowerInfoText.text = string.IsNullOrWhiteSpace(LowerInfoText.text)
|
||||
? AchievementUnlockedText
|
||||
: $"{AchievementUnlockedText}\n\n{LowerInfoText.text}\n\n\n\n";
|
||||
}
|
||||
|
||||
LowerInfoText.enabled = hasCD || LowerInfoText.text != string.Empty;
|
||||
LowerInfoText.enabled = !string.IsNullOrWhiteSpace(LowerInfoText.text);
|
||||
|
||||
if ((!AmongUsClient.Instance.IsGameStarted && AmongUsClient.Instance.NetworkMode != NetworkModes.FreePlay) || GameStates.IsMeeting)
|
||||
LowerInfoText.enabled = false;
|
||||
@@ -462,6 +456,24 @@ internal static class HudManagerPatch
|
||||
__instance.AbilityButton?.Show();
|
||||
__instance.AbilityButton?.SetEnabled();
|
||||
__instance.AbilityButton?.OverrideText(GetString(player.GetRoleTypes() == RoleTypes.GuardianAngel ? StringNames.ProtectAbility : StringNames.HauntAbilityName));
|
||||
|
||||
LowerInfoText.text = string.Empty;
|
||||
|
||||
if (Main.AbilityCD.TryGetValue(player.PlayerId, out (long StartTimeStamp, int TotalCooldown) info))
|
||||
{
|
||||
string text = string.Format(GetString("CDPT"), info.TotalCooldown - (Utils.TimeStamp - info.StartTimeStamp) + 1);
|
||||
if (CooldownTimerFlashColor.HasValue) text = $"<b>{Utils.ColorString(CooldownTimerFlashColor.Value, text.RemoveHtmlTags())}</b>";
|
||||
LowerInfoText.text = text;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(AchievementUnlockedText))
|
||||
{
|
||||
LowerInfoText.text = string.IsNullOrWhiteSpace(LowerInfoText.text)
|
||||
? AchievementUnlockedText
|
||||
: $"{AchievementUnlockedText}\n\n{LowerInfoText.text}\n\n\n\n";
|
||||
}
|
||||
|
||||
LowerInfoText.enabled = !string.IsNullOrWhiteSpace(LowerInfoText.text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ internal static class NotificationPopperPatch
|
||||
|
||||
private static void SendRpc(int optionId, bool playSound = true)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost || Options.HideGameSettings.GetBool()) return;
|
||||
if (!AmongUsClient.Instance.AmHost || Options.HideGameSettings.GetBool() || !Utils.DoRPC) return;
|
||||
var msg = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.NotificationPopper, Hazel.SendOption.None);
|
||||
msg.Write(optionId);
|
||||
msg.Write(playSound);
|
||||
|
||||
@@ -138,7 +138,7 @@ internal static class ExternalRpcPetPatch
|
||||
|
||||
if (pc.HasAbilityCD())
|
||||
{
|
||||
if (!pc.IsHost()) pc.Notify(Translator.GetString("AbilityOnCooldown"));
|
||||
if (!pc.AmOwner) pc.Notify(Translator.GetString("AbilityOnCooldown"));
|
||||
else Main.Instance.StartCoroutine(FlashCooldownTimer());
|
||||
|
||||
return;
|
||||
@@ -230,7 +230,7 @@ internal static class ExternalRpcPetPatch
|
||||
return target;
|
||||
}
|
||||
|
||||
private static IEnumerator FlashCooldownTimer()
|
||||
public static IEnumerator FlashCooldownTimer()
|
||||
{
|
||||
var yellow = false;
|
||||
|
||||
|
||||
@@ -25,6 +25,14 @@ internal static class CheckProtectPatch
|
||||
|
||||
Logger.Info($"CheckProtect: {__instance.GetNameWithRole().RemoveHtmlTags()} => {target.GetNameWithRole().RemoveHtmlTags()}", "CheckProtect");
|
||||
|
||||
if (__instance.HasAbilityCD())
|
||||
{
|
||||
if (!__instance.AmOwner) __instance.Notify(GetString("AbilityOnCooldown"));
|
||||
else Main.Instance.StartCoroutine(ExternalRpcPetPatch.FlashCooldownTimer());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (__instance.Is(CustomRoles.EvilSpirit))
|
||||
{
|
||||
if (target.Is(CustomRoles.Spiritcaller))
|
||||
@@ -32,24 +40,14 @@ internal static class CheckProtectPatch
|
||||
else
|
||||
Spiritcaller.HauntPlayer(target);
|
||||
|
||||
__instance.RpcResetAbilityCooldown();
|
||||
__instance.AddAbilityCD(Spiritcaller.SpiritAbilityCooldown.GetInt());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (GhostRolesManager.AssignedGhostRoles.TryGetValue(__instance.PlayerId, out (CustomRoles Role, IGhostRole Instance) ghostRole))
|
||||
{
|
||||
__instance.AddAbilityCD(ghostRole.Instance.Cooldown);
|
||||
ghostRole.Instance.OnProtect(__instance, target);
|
||||
__instance.RpcResetAbilityCooldown();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (__instance.Is(CustomRoles.Sheriff))
|
||||
{
|
||||
if (__instance.Data.IsDead)
|
||||
{
|
||||
Logger.Info("Blocked", "CheckProtect");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -637,12 +635,6 @@ internal static class MurderPlayerPatch
|
||||
|
||||
RandomSpawn.CustomNetworkTransformHandleRpcPatch.HasSpawned.Add(__instance.PlayerId);
|
||||
|
||||
/*if (!target.IsProtected() && !Doppelganger.DoppelVictim.ContainsKey(target.PlayerId) && !Camouflage.ResetSkinAfterDeathPlayers.Contains(target.PlayerId))
|
||||
{
|
||||
Camouflage.ResetSkinAfterDeathPlayers.Add(target.PlayerId);
|
||||
LateTask.New(() => Camouflage.RpcSetSkin(target, true), 0.2f, log: false);
|
||||
}*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -898,7 +890,11 @@ internal static class ShapeshiftPatch
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
|
||||
if (!shapeshifting) /*Camouflage.RpcSetSkin(shapeshifter);*/ {}
|
||||
if (!shapeshifting)
|
||||
{
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla)
|
||||
Camouflage.RpcSetSkin(shapeshifter);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlagueBearer.CheckAndSpreadInfection(shapeshifter, target);
|
||||
@@ -1418,8 +1414,8 @@ internal static class ReportDeadBodyPatch
|
||||
{
|
||||
try
|
||||
{
|
||||
/*if (Main.CheckShapeshift.ContainsKey(pc.PlayerId) && !Doppelganger.DoppelVictim.ContainsKey(pc.PlayerId))
|
||||
Camouflage.RpcSetSkin(pc, revertToDefault: true);*/
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla && Main.CheckShapeshift.ContainsKey(pc.PlayerId) && !Doppelganger.DoppelVictim.ContainsKey(pc.PlayerId))
|
||||
Camouflage.RpcSetSkin(pc, revertToDefault: true);
|
||||
|
||||
if (Main.CurrentMap == MapNames.Fungle && (pc.IsMushroomMixupActive() || IsActive(SystemTypes.MushroomMixupSabotage)))
|
||||
pc.FixMixedUpOutfit();
|
||||
@@ -1796,7 +1792,7 @@ internal static class FixedUpdatePatch
|
||||
if (inTask && alive && !lowLoad)
|
||||
Asthmatic.OnFixedUpdate();
|
||||
|
||||
if (!lowLoad && Options.UsePets.GetBool() && inTask && (!LastUpdate.TryGetValue(playerId, out long lastPetNotify) || lastPetNotify < now))
|
||||
if (!lowLoad && inTask && (!LastUpdate.TryGetValue(playerId, out long lastPetNotify) || lastPetNotify < now))
|
||||
{
|
||||
if (Main.AbilityCD.TryGetValue(playerId, out (long StartTimeStamp, int TotalCooldown) timer))
|
||||
{
|
||||
@@ -2144,7 +2140,7 @@ internal static class FixedUpdatePatch
|
||||
if (MeetingStates.FirstMeeting && Main.ShieldPlayer == target.FriendCode && !string.IsNullOrWhiteSpace(target.FriendCode) && !self && Options.CurrentGameMode is CustomGameMode.Standard or CustomGameMode.SoloPVP or CustomGameMode.FFA)
|
||||
AdditionalSuffixes.Add(GetString("DiedR1Warning"));
|
||||
|
||||
for (int i = 0; i < AdditionalSuffixes.Count; i++)
|
||||
for (int i = AdditionalSuffixes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(AdditionalSuffixes[i]))
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Tar : RoleBase
|
||||
|
||||
Main.AllPlayerSpeed[pc.PlayerId] = Main.MinSpeed;
|
||||
Main.PlayerStates[pc.PlayerId].IsBlackOut = true;
|
||||
// pc.RpcSetColor(6);
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) pc.RpcSetColor(6);
|
||||
pc.MarkDirtySettings();
|
||||
|
||||
Timer = new CountdownTimer(AbilityDuration.GetFloat(), () =>
|
||||
@@ -61,7 +61,7 @@ public class Tar : RoleBase
|
||||
if (!pc || !pc.IsAlive()) return;
|
||||
Main.AllPlayerSpeed[pc.PlayerId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod);
|
||||
Main.PlayerStates[pc.PlayerId].IsBlackOut = false;
|
||||
// pc.RpcSetColor((byte)ColorId);
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) pc.RpcSetColor((byte)ColorId);
|
||||
pc.MarkDirtySettings();
|
||||
}, cancelOnMeeting: false, onCanceled: () =>
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public class Tar : RoleBase
|
||||
Timer = null;
|
||||
Main.AllPlayerSpeed[TarId] = Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod);
|
||||
Main.PlayerStates[TarId].IsBlackOut = false;
|
||||
// TarId.GetPlayer()?.RpcSetColor((byte)ColorId);
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) TarId.GetPlayer()?.RpcSetColor((byte)ColorId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class Astral : RoleBase
|
||||
GhostRolesManager.RemoveGhostRole(pc.PlayerId);
|
||||
ReportDeadBodyPatch.AlreadyReportedBodies.Remove(pc.PlayerId);
|
||||
pc.RpcSetRoleGlobal(Options.UsePets.GetBool() ? RoleTypes.Crewmate : RoleTypes.Engineer);
|
||||
// Camouflage.RpcSetSkin(pc);
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla) Camouflage.RpcSetSkin(pc);
|
||||
|
||||
if (onMeeting) return;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ internal class Bloodmoon : IGhostRole
|
||||
ScheduledDeaths.TryAdd(target.PlayerId, (Utils.TimeStamp, pc.PlayerId));
|
||||
Main.AllPlayerSpeed[pc.PlayerId] = Speed.GetFloat();
|
||||
pc.MarkDirtySettings(); // failsafe check
|
||||
pc.AddAbilityCD(Cooldown + Duration.GetInt());
|
||||
}
|
||||
|
||||
public void SetupCustomOption()
|
||||
|
||||
@@ -16,7 +16,12 @@ internal class GA : IGhostRole
|
||||
|
||||
public void OnProtect(PlayerControl pc, PlayerControl target)
|
||||
{
|
||||
if (ProtectionList.Add(target.PlayerId)) LateTask.New(() => ProtectionList.Remove(target.PlayerId), ProtectDuration.GetFloat());
|
||||
if (ProtectionList.Add(target.PlayerId))
|
||||
{
|
||||
int duration = ProtectDuration.GetInt();
|
||||
LateTask.New(() => ProtectionList.Remove(target.PlayerId), duration);
|
||||
pc.AddAbilityCD(Cooldown + duration);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnAssign(PlayerControl pc)
|
||||
|
||||
@@ -22,11 +22,13 @@ internal class Minion : IGhostRole
|
||||
target.RPCPlayCustomSound("FlashBang");
|
||||
target.MarkDirtySettings();
|
||||
|
||||
int duration = BlindDuration.GetInt();
|
||||
LateTask.New(() =>
|
||||
{
|
||||
if (BlindPlayers.Remove(target.PlayerId)) target.MarkDirtySettings();
|
||||
RPC.PlaySoundRPC(target.PlayerId, Sounds.TaskComplete);
|
||||
}, BlindDuration.GetFloat(), "Remove Minion Blindness");
|
||||
}, duration, "Remove Minion Blindness");
|
||||
pc.AddAbilityCD(Cooldown + duration);
|
||||
}
|
||||
|
||||
public void OnAssign(PlayerControl pc) { }
|
||||
|
||||
@@ -87,10 +87,13 @@ public class Exclusionary : RoleBase
|
||||
sender.StartMessage(target.OwnerId);
|
||||
}
|
||||
|
||||
/*sender.StartRpc(player.NetId, RpcCalls.SetPetStr)
|
||||
.Write("")
|
||||
.Write(player.GetNextRpcSequenceId(RpcCalls.SetPetStr))
|
||||
.EndRpc();*/
|
||||
if (GameStates.CurrentServerType != GameStates.ServerType.Vanilla)
|
||||
{
|
||||
sender.StartRpc(player.NetId, RpcCalls.SetPetStr)
|
||||
.Write("")
|
||||
.Write(player.GetNextRpcSequenceId(RpcCalls.SetPetStr))
|
||||
.EndRpc();
|
||||
}
|
||||
sender.StartRpc(player.NetTransform.NetId, RpcCalls.SnapTo)
|
||||
.WriteVector2(new Vector2(50f, 50f))
|
||||
.Write(player.NetTransform.lastSequenceId)
|
||||
@@ -188,7 +191,7 @@ public class Exclusionary : RoleBase
|
||||
sender.StartMessage(pc.OwnerId);
|
||||
}
|
||||
|
||||
if (Options.UsePets.GetBool())
|
||||
if (Options.UsePets.GetBool() && GameStates.CurrentServerType != GameStates.ServerType.Vanilla)
|
||||
{
|
||||
sender.StartRpc(player.NetId, RpcCalls.SetPetStr)
|
||||
.Write(PetsHelper.GetPetId())
|
||||
|
||||
@@ -45,6 +45,7 @@ internal class Trapster : RoleBase
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) LegacyTrapster.SetValue(1);
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
|
||||
Reference in new issue
Block a user