Decompiled source of LycansNewRoles v0.213.0
plugins/LycansNewRoles/LycansNewRoles.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using DynamicSmokeSystem; using ExitGames.Client.Photon; using Fusion; using Fusion.Sockets; using HarmonyLib; using HarmonyLib.Tools; using Helpers.Collections; using LycansNewRoles.NewEffects; using LycansNewRoles.NewItems; using LycansNewRoles.NewMaps; using LycansNewRoles.NewMaps.Components; using LycansNewRoles.NewPrimaryRoles; using LycansNewRoles.Sabotages; using LycansNewRoles.Stats; using Managers; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Photon.Realtime; using Photon.Voice; using Photon.Voice.Fusion; using Photon.Voice.Unity; using Photon.Voice.Unity.UtilityScripts; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Localization; using UnityEngine.Localization.Components; using UnityEngine.Localization.Settings; using UnityEngine.Localization.Tables; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using UnityEngine.Scripting; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LycansNewRoles")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a1d03a9d01d860863d5c0de9b664cb440b8c4875")] [assembly: AssemblyProduct("My first plugin")] [assembly: AssemblyTitle("LycansNewRoles")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LycansNewRoles { [HarmonyPatch(typeof(LightingManager), "FixedUpdateNetwork")] internal class AmogusModeNoCyclePatch { private static bool Prefix(LightingManager __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkBool.op_Implicit(Plugin.CustomConfig.AmogusMode)) { return false; } return true; } catch (Exception ex) { Plugin.Logger.LogError((object)("AmogusModeNoCyclePatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(PlayerController), "Interact")] internal class AmogusModeInteractPatch { private static void Postfix(bool isPrimary, PlayerController __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Invalid comparison between Unknown and I4 //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Invalid comparison between Unknown and I4 //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) try { if (!NetworkBool.op_Implicit(Plugin.CustomConfig.AmogusMode)) { return; } if (LycansUtility.GameActuallyInPlay && (Object)(object)__instance.targetObject != (Object)null && !NetworkBool.op_Implicit(GameManager.LightingManager.IsNight)) { PlayerController componentInParent = __instance.targetObject.GetComponentInParent<PlayerController>(); PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); if ((Object)(object)componentInParent != (Object)null && NetworkBool.op_Implicit(componentInParent.IsDead)) { AmogusManager.Rpc_Report(((SimulationBehaviour)__instance).Runner, __instance.Index, componentInParent.Index); } } if (!LycansUtility.GameActuallyInPlay || NetworkBool.op_Implicit(GameManager.LightingManager.IsNight) || !((Object)(object)__instance.targetObject != (Object)null) || (int)__instance.Role != 1) { return; } PlayerController componentInParent2 = __instance.targetObject.GetComponentInParent<PlayerController>(); PlayerCustom player2 = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); if ((Object)(object)componentInParent2 != (Object)null && (int)componentInParent2.Role != 1 && !NetworkBool.op_Implicit(componentInParent2.IsDead)) { TickTimer amogusModeKillCooldown = player2.AmogusModeKillCooldown; if (!((TickTimer)(ref amogusModeKillCooldown)).IsRunning) { componentInParent2.Rpc_Kill(__instance.Ref); } } } catch (Exception ex) { Plugin.Logger.LogError((object)("AmogusModeInteractPatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerController), "Rpc_Kill")] internal class AmogusModeKillSilentPatch { private unsafe static bool Prefix(PlayerRef killer, PlayerController __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) try { if (!NetworkBool.op_Implicit(Plugin.CustomConfig.AmogusMode)) { return true; } if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { NetworkRunner runner = ((SimulationBehaviour)__instance).Runner; if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return false; } if (runner.HasAnyActiveConnections()) { int num = 8; num += 4; SimulationMessage* ptr = SimulationMessage.Allocate(((SimulationBehaviour)__instance).Runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(((SimulationBehaviour)__instance).Object.Id, ((NetworkBehaviour)__instance).ObjectIndex, 12), data); Unsafe.Write(data + num2, killer); num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationBehaviour)__instance).Runner.SendRpc(ptr); } } if (((SimulationBehaviour)__instance).HasStateAuthority) { if (!((PlayerRef)(ref killer)).IsNone) { PlayerController player = PlayerRegistry.GetPlayer(killer); PlayerCustom player2 = PlayerCustomRegistry.GetPlayer(killer); TickTimer amogusModeKillCooldown = player2.AmogusModeKillCooldown; if (((TickTimer)(ref amogusModeKillCooldown)).IsRunning) { return false; } player2.AmogusModeKillCooldown = TickTimer.CreateFromSeconds(((SimulationBehaviour)__instance).Runner, 30f); __instance.Killer = killer; } __instance.IsDead = NetworkBool.op_Implicit(true); GameManager.Instance.CheckForEndGame(); } return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("AmogusModeKillSilentPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(GameState), "Spawned")] internal class AmogusModeStateMachinePatch { private static void Postfix(GameState __instance) { try { StateMachine<EGameState> value = Traverse.Create((object)__instance).Field<StateMachine<EGameState>>("StateMachine").Value; GameState gameState = __instance; StateHooks<EGameState> obj = value[(EGameState)2]; obj.onEnter = (Action<EGameState>)Delegate.Combine(obj.onEnter, (Action<EGameState>)delegate(EGameState state) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 if (NetworkBool.op_Implicit(Plugin.CustomConfig.AmogusMode) && ((SimulationBehaviour)gameState).Runner.IsServer && (int)state != 5) { PlayerRegistry.ForEach((Action<PlayerController>)delegate(PlayerController player) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Invalid comparison between Unknown and I4 //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player != (Object)null && NetworkBool.op_Implicit(player.IsDead)) { PlayerCustom player2 = PlayerCustomRegistry.GetPlayer(player.Ref); if (!NetworkBool.op_Implicit(player2.Disappeared)) { player2.Disappeared = NetworkBool.op_Implicit(true); } } if ((Object)(object)player != (Object)null && !NetworkBool.op_Implicit(player.IsDead) && (int)player.Role == 1) { PlayerCustom player3 = PlayerCustomRegistry.GetPlayer(player.Ref); player3.AmogusModeKillCooldown = TickTimer.CreateFromSeconds(((SimulationBehaviour)gameState).Runner, 15f); } }); } }); } catch (Exception ex) { Plugin.Logger.LogError((object)("AmogusModeStateMachinePatch error: " + ex)); } } } [NetworkBehaviourWeaved(20)] public class AmogusManager : NetworkBehaviour { public static AmogusManager Instance { get; private set; } [Networked] [NetworkedWeaved(0, 1)] public unsafe TickTimer NextLootTimer { get { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing AmogusManager.NextLootTimer. Networked properties can only be accessed when Spawned() has been called."); } return (TickTimer)(*base.Ptr); } set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing AmogusManager.NextLootTimer. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr, value); } } public override void Spawned() { ((NetworkBehaviour)this).Spawned(); Instance = this; } public override void Despawned(NetworkRunner runner, bool hasState) { ((NetworkBehaviour)this).Despawned(runner, hasState); Instance = null; } public override void FixedUpdateNetwork() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) try { if (!NetworkBool.op_Implicit(Plugin.CustomConfig.AmogusMode) || !((SimulationBehaviour)this).Runner.IsServer || (int)GameManager.LocalGameState != 2) { return; } TickTimer nextLootTimer = NextLootTimer; if (((TickTimer)(ref nextLootTimer)).Expired(((SimulationBehaviour)this).Runner)) { List<Loot> source = (from o in Object.FindObjectsOfType<Loot>() where o.GetMapID() == GameManager.Instance.MapID select o).ToList(); for (int i = 0; i < 5; i++) { List<Loot> list = source.Where((Loot o) => !NetworkBool.op_Implicit(o.Available)).ToList(); if (list.Any()) { Loot val = CollectionsUtil.Grab<Loot>(list, 1).First(); val.Available = NetworkBool.op_Implicit(true); } } NextLootTimer = TickTimer.None; } nextLootTimer = NextLootTimer; if (!((TickTimer)(ref nextLootTimer)).IsRunning) { int num = PlayerRegistry.CountWhere((Predicate<PlayerController>)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))); float num2 = 60f / (float)num; NextLootTimer = TickTimer.CreateFromSeconds(((SimulationBehaviour)this).Runner, num2); } } catch (Exception ex) { Plugin.Logger.LogError((object)("AmogusManager FixedUpdateNetwork error: " + ex)); } } [Rpc] public unsafe static void Rpc_Report(NetworkRunner runner, int playerIndex, int targetPlayerIndex) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkBehaviourUtils.InvokeRpc) { NetworkBehaviourUtils.InvokeRpc = false; } else { if ((Object)(object)runner == (Object)null) { throw new ArgumentNullException("runner"); } if ((int)runner.Stage == 4) { return; } if (runner.HasAnyActiveConnections()) { int num = 24; SimulationMessage* ptr = SimulationMessage.Allocate(runner.Simulation, num); byte* data = SimulationMessage.GetData(ptr); int num2 = RpcHeader.Write(RpcHeader.Create(NetworkBehaviourUtils.GetRpcStaticIndexOrThrow("System.Void LycansNewRoles.AmogusManager::Rpc_Report(Fusion.NetworkRunner,System.Int32,System.Int32)")), data); *(int*)(data + num2) = playerIndex; num2 += 4; *(int*)(data + num2) = targetPlayerIndex; num2 += 4; ((SimulationMessage)ptr).Offset = num2 * 8; ((SimulationMessage)ptr).SetStatic(); runner.SendRpc(ptr); } } if (runner.IsServer) { GameManager.LightingManager.IsNight = NetworkBool.op_Implicit(true); PlayerRegistry.ForEach((Action<PlayerController>)delegate(PlayerController pObj) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) pObj.CanMove = NetworkBool.op_Implicit(false); }); GameManager.State.Server_DelaySetState((EGameState)3, 3f); } if (runner.IsPlayer) { AudioManager.Play("BELL", (MixerTarget)2, 1f, 1f); PlayerCustom player = PlayerCustomRegistry.GetPlayer(playerIndex); PlayerCustom player2 = PlayerCustomRegistry.GetPlayer(targetPlayerIndex); TextMeshProUGUI value = Traverse.Create((object)GameManager.Instance.gameUI).Field<TextMeshProUGUI>("transitionText").Value; LocalizeStringEvent value2 = Traverse.Create((object)GameManager.Instance.gameUI).Field<LocalizeStringEvent>("transition").Value; ((Graphic)value).color = Color.white; value2.StringReference.Arguments = new List<object> { player.PlayerController.PlayerData.Username, player2.PlayerController.PlayerData.Username }; ((LocalizedReference)value2.StringReference).SetReference(TableReference.op_Implicit("UI Text"), TableEntryReference.op_Implicit("NALES_AMOGUS_MODE_REPORT_TEXT")); value2.RefreshString(); GameManager.Instance.gameUI.StartFade(true); } } catch (Exception ex) { Plugin.Logger.LogError((object)("Rpc_Report error: " + ex)); } } [NetworkRpcStaticWeavedInvoker("System.Void LycansNewRoles.AmogusManager::Rpc_Report(Fusion.NetworkRunner,System.Int32,System.Int32)")] [Preserve] protected unsafe static void Rpc_Report_0040Invoker(NetworkRunner runner, SimulationMessage* message) { byte* data = SimulationMessage.GetData(message); int num = (RpcHeader.ReadSize(data) + 3) & -4; int playerIndex = *(int*)(data + num); num += 4; int targetPlayerIndex = *(int*)(data + num); num += 4; NetworkBehaviourUtils.InvokeRpc = true; Rpc_Report(runner, playerIndex, targetPlayerIndex); } } public static class BalancingValues { public struct ModifiedEffectData { public int RealIndex; public int MagicianCooldownSeconds; public float? DurationOnTransformedWolf; public float? DurationOnZombie; public ModifiedEffectData(int realIndex, int magicianCooldownSeconds, float? durationOnTransformedWolf, float? durationOnZombie) { RealIndex = realIndex; MagicianCooldownSeconds = magicianCooldownSeconds; DurationOnTransformedWolf = durationOnTransformedWolf; DurationOnZombie = durationOnZombie; } } public const float EffectDurationStunned = 5f; public const float EffectDurationChasing = 3f; public const float EffectDurationSprinting = 5f; public const float EffectDurationReverting = 15f; public const float EffectDurationDisoriented = 3f; public const float EffectDurationInfected = 10f; public const float EffectDurationStealthing = 7f; public const float EffectDurationUndetected = 15f; public const float EffectDurationStarvationActive = 150f; public const float EffectDurationShouting = 7f; public const float EffectDurationBlind = 3.5f; public const float EffectDurationIllusion = 25f; public const float EffectDurationDisguised = 300f; public const float EffectDurationDiseased = 300f; public const float EffectDurationBomb = 20f; public const float EffectDurationPanic = 3f; public const float EffectDurationFleeing = 4f; public const float EffectDurationCannibalFull = 50f; public const float EffectDurationDowned = 10f; public const float EffectDurationWounded = 30f; public const float EffectDurationPoisoned = 45f; public const float EffectDurationExorcised = 15f; public const float EffectDurationPhasing = 3f; public const float EffectDurationDying = 45f; public const float EffectDurationAngel = 12f; public const float EffectDurationResistance = 10f; public const float EffectDurationPortal = 8f; public const float EffectDurationSpiritResistance = 15f; public const float EffectDurationPotionDeaf = 60f; public const float EffectDurationPotionMidas = 60f; public const float EffectDurationPotionVampire = 35f; public const float EffectDurationPotionTiny = 35f; public const float EffectDurationPotionHaunted = 70f; public const float EffectDurationPotionNearsighted = 60f; public const float EffectDurationPotionAssassin = 20f; public const float EffectDurationPotionStinking = 60f; public const float EffectDurationPotionMute = 100f; public const float EffectDurationPotionClairvoyance = 45f; public const float EffectDurationPotionChaos = 60f; public const float AgentEliminationRange = 3f; public const float CannibalEatDuration = 4f; public const float NecromancerMarkCastTime = 2f; public const float NecromancerResurrectCastTime = 2f; public const float NecromancerResurrectDuration = 30f; public const int WarlockShapeshiftCastTime = 1; public const float DeceiverScaryEffectDistance = 40f; public const float DeceiverIllusionDelayInitialMinSeconds = 2f; public const float DeceiverIllusionDelayInitialMaxSeconds = 10f; public const float DeceiverIllusionDelayBetweenMinSeconds = 15f; public const float DeceiverIllusionDelayBetweenMaxSeconds = 30f; public const float DeceiverIllusionDurationMinSeconds = 8f; public const float DeceiverIllusionDurationMaxSeconds = 15f; public const float DeceiverTrickRange = 10f; public const float DeceiverDrunkChangeVoteChance = 0.65f; public const float DeceiverDrunkStunChanceEverySecondWhenTalking = 0.15f; public const float DeceiverDrunkStunDuration = 8f; public const int VillageIdiotStartingBoredom = 2500; public const int VillageIdiotBoredomIncreasePerSecond = 200; public const float VillageIdiotBoredomReductionPerSecondAtMinDistance = 2000f; public const float VillageIdiotBoredomReductionPerSecondAtMaxDistance = 0f; public const float VillageIdiotPlayerRange = 30f; public const int VillageIdiotBoredomReductionPerCollect = 1500; public const int VillageIdiotBoredomReductionPerSecondInWolfForm = 400; public const float VillageIdiotHungerPerSecondPerBoredom = 0.0002f; public const float SpyMaximumDistanceForBestTarget = 80f; public const float SpySpyingPerSecondWithoutBonus = 12f; public const float SpySpyingPerSecondWithTargetVisible = 35f; public const float SpySpyingPerSecondWithSpyImmobile = 20f; public const float SpySpyingPerSecondWithTargetVisibleAndSpyImmobile = 70f; public const float ScientistAnalysisPowerAtMinDistance = 70f; public const float ScientistAnalysisPowerAtMaxDistance = 20f; public const float ScientistAnalysisMultiplierIfNotRealWolf = 0.2f; public const float ScientistAnalysisMultiplierForTransform = 8f; public const float ScientistAnalysisMultiplierForKill = 8f; public const float ScientistAnalysisMultiplierIfWolfVisible = 4f; public const float ScientistAnalysisMultiplierIfWolfVisibleButWounded = 0.4f; public const float ScientistAnalysisMultiplierIfScientistCrouched = 0.8f; public const float ScientistAnalysisMultiplierIfScientistInvisible = 0.4f; public const float ScientistAnalysisMultiplierIfScientistFast = 0.3f; public const float ScientistAnalysisMultiplierIfScientistFeigningDeath = 0.5f; public const float ScientistAnalysisRangePeriodic = 40f; public const float ScientistAnalysisRangeTransform = 40f; public const float ScientistAnalysisRangeKill = 30f; public const float ScientistCreateGadgetCooldown = 60f; public const float BeastMarkRange = 7f; public const float BeastTransformationTime = 7f; public const float BeastKillRange = 3f; public const float BeastHealthLossPercentagePerSecond = 0.0115f; public const float BeastTrapHealthLossPercentagePerSecond = 0.025f; public const float BeastHealthGainPercentagePerKill = 0.15f; public const float BeastMovementSpeed = 1.25f; public const float BeastNegativeEffectsDurationPercentage = 0.5f; public const float BeastHealthLossPercentageOnShot = 0.1f; public const float BeastHealthLossPercentageOnBomb = 0.25f; public const float BeastTrapDurationSeconds = 5f; public const int BeastDamageBonusOnDoors = 50; public const int BeastActiveFogEndDistance = 65; public static Color BeastActiveFogColor = new Color(1f, 0f, 0f, 1f); public const float BeastVoiceRange = 40f; public const float BeastGlobalKnockbackMultiplier = 0.6f; public const float BeastSleepingGasStacksMultiplier = 0.5f; public const float BountyHunterShotSoundRange = 25f; public const float BountyHunterMarkRange = 10f; public const float BountyHunterSleepDurationOnHuman = 60f; public const float BountyHunterSleepDurationOnWolf = 6f; public const float VoodooReanimateRange = 10f; public const float VoodooReanimateCastTime = 2f; public const float VoodooHealthLossPerZombiePerPlayerCount = 0.015f; public const float ZombieMovementSpeed = 1.1f; public const float ZombieKillRange = 2.5f; public const float ZombieAttackOnWolfDownedDuration = 7f; public const float ZombieAttackOnWolfKnockbackPower = 7f; public const float ZombieAttackOnWolfKnockbackReductionPerSecond = 7f; public const float ZombieKillVoodooCooldownMultiplication = 0.5f; public const float ZombieMoaningRange = 20f; public const float ZombieHealthLossPerSecondWhenRunning = 25f; public const float ZombieHealthRegenPerSecondWhenNotRunning = 4f; public static Color ZombieFogColor = new Color(0.75f, 0f, 0.75f, 1f); public const float TrackerWolfSpeedMultiplier = 0.85f; public const float EnragedWolfSpeedMultiplier = 1.2f; public const float EnragedWolfTransformDelayMultiplier = 0.7f; public const float EnragedWolfHungerMultiplier = 1.5f; public const float WarlockWolfCurseRange = 10f; public const float WarlockWolfCurseDormantMinimumDelay = 1f; public const float WarlockWolfCurseDormantMaximumDelay = 20f; public const float WarlockWolfCurseDormantMinimumDuration = 30f; public const float WarlockWolfCurseDormantMaximumDuration = 60f; public const float PossessorDanceMaximumDuration = 6f; public const float PossessorMinimumCooldownAfterCancel = 10f; public const float PossessorMinimumCooldownAfterForceItem = 60f; public const float PossessorMinimumCooldownAfterForceDance = 40f; public const float SaboteurTrapHeldItemRange = 2.5f; public const float SaboteurPoisonHealthDecrease = 0.8f; public const int SaboteurPoisonFogEndDistance = 25; public static Color SaboteurPoisonFogColor = new Color(0f, 0.5f, 0f, 1f); public const float SaboteurTrappedGadgetHealthLossPercentage = 0.2f; public const float SaboteurWoundedMoveSpeedMultiplier = 0.65f; public const float SaboteurItemLightIntensityNotHeld = 2f; public const float SaboteurItemLightIntensityHeld = 0.5f; public const float SaboteurItemLightRangeNotHeld = 2f; public const float SaboteurItemLightRangeHeld = 0.15f; public const float TraitorSabotageDelayMultiplier = 1f; public const float BomberCreateBombRange = 2.5f; public const float BomberGiveBombRange = 2.5f; public const float BomberBombStartMinimumDelay = 10f; public const float BomberBombStartMaximumDelay = 20f; public const float BomberBombTickingSoundRange = 20f; public const float BomberBombExplosionSoundRange = 60f; public const float SeerWeakenedMoveSpeedMultiplier = 0.9f; public const float SeerWeakenedAdditionalHunger = 0.3f; public const float PoacherShotSoundRange = 25f; public const float PoacherMarkSoundRange = 30f; public const float RitualistChargePerSecondAtMinDistance = 450f; public const float RitualistChargePerSecondAtMaxDistance = 90f; public const float RitualistChargePerSecondRange = 30f; public const float RitualistMuteDuration = 50f; public const float RitualistDeafDuration = 20f; public const float RitualistParanoiaDuration = 20f; public const float RitualistFlatulenceDuration = 15f; public const float RitualistNearsightedDuration = 35f; public const float RitualistStunnedDuration = 10f; public const float PredatorScaryEffectRangeNotCrouched = 35f; public const float PredatorScaryEffectRangeCrouched = 5f; public const float PredatorEmpoweredDurationOnKill = 45f; public const float PredatorEffectMovementSpeed = 1.15f; public const float PredatorEffectScaryEffectRangeMultiplier = 0.75f; public const float PredatorHealthAfterBeingShotIfPrey = 0.5f; public const float AlcoholicPotionHealWolf = 0.45f; public const float AlcoholicPotionHealBeast = 0.2f; public const float SprinterSprintingMoveSpeedMultiplier = 1.75f; public const float SprinterChasingMoveSpeedMultiplier = 1.5f; public const float EngineerTrappedDuration = 4f; public const float EngineerTrapDisarmTime = 1f; public const int EngineerDoorBashBonusDamageWolf = 40; public const int EngineerDoorBashBonusDamageNonWolf = 20; public const int EngineerSmokeRadiusBoosted = 250; public const int EngineerSmokeRadiusNotBoosted = 250; public const float EngineerGrenadeKnockbackMultiplier = 0.6f; public const float EngineerSleepingGasStacksMultiplier = 0.4f; public const int InfectedWolfRadius = 30; public const float GamblerSwitchRange = 5f; public const float GamblerHealOnHumanForm = 0.2f; public const float GamblerHealOnWolfForm = 0.5f; public const float GamblerHealOnBeast = 0.15f; public const float HowlerShoutingVoiceRange = 80f; public const float HowlerShoutingDisorientedRange = 25f; public const float MetabolicWolfStarvationRange = 10f; public const float MetabolicVillagerFeedMultiplier = 1.4f; public const float MetabolicStarvationAdditionalHunger = 0.8f; public const float MetabolicPositiveEffectsDurationMultiplier = 1.25f; public const float MetabolicNegativeEffectsDurationMultiplier = 0.8f; public const float PoliticianDenyVoteRange = 10f; public const float SherifKillRange = 3f; public const float ResistanceMinimumHealthAfterBeingShot = 0.6f; public const float SprinterSprintingAdditionalHunger = 4f; public const float RangerWolfFootstepsDuration = 90f; public const float RangerVillagerFootstepsDuration = 40f; public const float RangerSearchRadius = 30f; public const float RangerWolfOnMinimapRadius = 30f; public const float RangerWolfHeartbeatDistance = 40f; public const float ScavengerHumanFormHealPercentage = 0.25f; public const float ScavengerWolfFormHealPercentage = 0.75f; public const float MagicianCastRange = 7f; public const float MagicianMinimumCooldownAfterNewSpell = 10f; public const float ActorInWolfFormHungerMultiplier = 0.25f; public const float CarabineerKnockbackPower = 14f; public const float CarabineerKnockbackReductionPerSecond = 9.5f; public const float CarabineerDisorientedDurationOnWolf = 3f; public const float CarabineerForcedRotationPower = 900f; public const float CarabineerForcedRotationReductionPerSecond = 700f; public const float CarabineerKnockdownDurationOnHuman = 4f; public const float ForgerCopyItemRange = 10f; public const float ForgerStealItemRange = 3f; public const float AstralActiveBaseHunger = 0.2f; public const float AstralActiveExtraHungerPerDistance = 0.01f; public const float AstralMoveSpeedHumanForm = 3f; public const float AstralMoveSpeedWolfForm = 9f; public const float AstralFearRadiusMultiplier = 0.35f; public const int ImitatorSecondaryRolesToChoose = 4; public const float MerchantMinimumDistanceToCoin = 40f; public const int MerchantGainPerCoin = 3; public const int MerchantStartingCoins = 10; public const int MerchantOffersCount = 4; public const int MerchantRerollCost = 3; public const float MerchantDeliveryTime = 5f; public const int MerchantPriestProtectionCost = 20; public const int MerchantHealCost = 20; public const float MerchantHealPercentage = 0.5f; public const float PeasantChargePerSecondAtMinDistance = 330f; public const float PeasantChargePerSecondAtMaxDistance = 70f; public const float PeasantChargePerSecondRange = 30f; public const float PeasantMinimumChargeToUse = 2500f; public const float PeasantChargeLossPerSecondWhenActive = 1000f; public const float GuardWarningRange = 25f; public const float GuardTakeRifleDuration = 2f; public const float ExorcistCastTime = 3f; public const float ExorcistBlindDuration = 1.5f; public const float ExorcistAdditionalHunger = 0.75f; public const int ExorcistFogEndDistance = 15; public static Color ExorcistFogColor = new Color(0.5f, 0.5f, 0f, 1f); public const float ExorcistDetectorKnockbackPower = 6f; public const float ExorcistDetectorKnockbackReductionPerSecond = 6f; public const float ForensicsAnalyzeDuration = 3f; public const float AvengerAttackRange = 3.5f; public const float AvengerAttackDownedDuration = 6f; public const float AvengerOnWolfKnockbackPower = 6f; public const float AvengerOnWolfKnockbackReductionPerSecond = 6f; public const float AvengerRadiusForChargeBonus = 30f; public const float InvestigatorPlaceCooldown = 30f; public const float InvestigatorMinimumPlaceDistance = 40f; public const float InvestigatorPercentageBase = 50f; public const float InvestigatorPercentageMultiplierPerLivingPlayerInList = 0.75f; public const float SurvivalistSaveCastTime = 4f; public const float SurvivalistHungerPercentageWhenDowned = 0.395f; public const float SurvivalistAlertRange = 40f; public const float SurvivalistHeartbeatRange = 15f; public const float SurvivalistHungerMultiplierAtCriticalHealth = 0.4f; public const float PriestProtectRange = 2.5f; public const float PriestProtectionKnockbackPower = 12f; public const float PriestProtectionKnockbackReductionPerSecond = 6f; public const float PriestProtectionForcedRotationPower = 4500f; public const float PriestProtectionForcedRotationReductionPerSecond = 3000f; public const float PriestProtectionFleeingDuration = 5f; public const float AngelProtectRange = 2.5f; public const float AngelProtectMinimumHealthPercentageOnAccidentalDeath = 0.25f; public const float AngelHealPercentage = 0.25f; public const float AngelEffectWolfOnMinimapRadius = 40f; public const float SummonerChargePerSecondPerPercentHealthMissing = 1.75f; public const float SummonerChargePerSecondMultiplierWhenStarving = 1f; public const float SummonerMinimumMaterialsRatioToSummon = 0.5f; public const float SummonerSpiritDurationAtMinimumCharge = 40f; public const float SummonerSpiritDurationAtMaximumCharge = 80f; public const float SummonerSpiritSpeedMultiplierAtMinimumCharge = 0.75f; public const float SummonerSpiritSpeedMultiplierAtMaximumCharge = 1f; public const float SummonerSpiritUnstableDuration = 20f; public const float SummonerSpiritUnstableTeleportationMinimumDistanceFromWolf = 20f; public const float SummonerSpiritUnstableTeleportationMaximumDistanceFromWolf = 40f; public const float SummonerSpiritUnstableTeleportationMinimumDistanceFromPosition = 15f; public const float SummonerSpiritAttackKnockbackPower = 15f; public const float SummonerSpiritAttackKnockbackReductionPerSecond = 21f; public const float SummonerSpiritAttackDamagePercentage = 0.15f; public const float SummonerSpiritAttackWoundedDuration = 7f; public const float SummonerSpiritAttackCooldown = 10f; public const float SummonerSpiritSpellDamagePercentage = 0.15f; public const float SummonerSpiritSpellWoundedDuration = 4f; public const float SummonerSpiritSpellCooldown = 8f; public const float SummonerInteractionRange = 2f; public const int DetectiveProgressPerSecond = 650; public const float DetectiveInvestigateRange = 2.5f; public const int DetectiveMaximumDetectionsPerPlayer = 2; public const float DetectiveCooldownOneIsEvil = 60f; public const float DetectiveCooldownPositionAtMidNight = 30f; public const float DetectiveCooldownDifferentSides = 90f; public const float DetectiveCooldownNoTransformOrSabotage = 45f; public const float DetectiveCooldownHasOneOfTheseRoles = 60f; public const float DetectiveCooldownAmountOfCollectsDone = 30f; public static Dictionary<PlayerDetectiveIntel.PlayerDetectiveIntelType, int> DetectiveChanceByIntelType = new Dictionary<PlayerDetectiveIntel.PlayerDetectiveIntelType, int> { { PlayerDetectiveIntel.PlayerDetectiveIntelType.OneIsEvil, 2 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.PositionAtMidNight, 1 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.DifferentSides, 1 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.NoTransformOrSabotage, 2 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.HasOneOfTheseRoles, 2 }, { PlayerDetectiveIntel.PlayerDetectiveIntelType.AmountOfCollectsDone, 2 } }; public const float AvatarWolfOnMinimapRadius = 40f; public const float AvengerChargeMultiplierIfNearby = 4f; public const float MegaFartChancePerFart = 0.0035f; public const float MegaFartKnockbackPower = 50f; public const float MegaFartKnockbackReductionPerSecond = 25f; public const float MidasEffectValueMultiplier = 2f; public const float VampireBaseRadius = 25f; public const float VampireEffectCurrentPercentage = 0.03f; public const float TinyMovementSpeed = 0.6f; public const float HauntedMinimumDelayServer = 3f; public const float HauntedMaximumDelayServer = 6f; public const float HauntedHealthGainPercentage = 0.25f; public const float HauntedHealthLossPercentage = 0.2f; public const float HauntedDoorRadius = 40f; public const float HauntedLanternFlickerRadius = 30f; public const float HauntedLanternFlickerDuration = 10f; public const float HauntedForcedRotationPower = 3000f; public const float HauntedForcedRotationReductionPerSecond = 2000f; public static Dictionary<HauntedEffect.HauntedPossibleEffect, int> HauntedChanceByEffect = new Dictionary<HauntedEffect.HauntedPossibleEffect, int> { { HauntedEffect.HauntedPossibleEffect.HealthGain, 2 }, { HauntedEffect.HauntedPossibleEffect.HealthLoss, 1 }, { HauntedEffect.HauntedPossibleEffect.OpenDoors, 3 }, { HauntedEffect.HauntedPossibleEffect.CloseDoors, 3 }, { HauntedEffect.HauntedPossibleEffect.Teleport, 2 }, { HauntedEffect.HauntedPossibleEffect.GainItem, 2 }, { HauntedEffect.HauntedPossibleEffect.RandomEffect, 4 }, { HauntedEffect.HauntedPossibleEffect.Sound, 3 }, { HauntedEffect.HauntedPossibleEffect.FlickerLanterns, 2 }, { HauntedEffect.HauntedPossibleEffect.ForcedRotation, 1 } }; public const int NearsightedFogEndDistance = 12; public static Color NearsightedFogColor = new Color(0f, 0f, 0.1f, 1f); public const float AssassinRange = 3.5f; public const float AssassinOnWolfKnockbackPower = 6f; public const float AssassinOnWolfKnockbackReductionPerSecond = 6f; public const float MidasPetrifyRange = 3f; public const float MidasDurationOnHuman = 30f; public const float MidasDurationOnWolf = 8f; public static Color PetrifiedFogColor = new Color(0.75f, 0.75f, 0f, 1f); public const float DisorientedMovementSpeed = 0.5f; public const float StunnedMovementSpeed = 0.5f; public const float StinkingEffectRadiusOnNonWolf = 5f; public const float StinkingEffectRadiusOnWolf = 15f; public const float NauseatedMovementSpeed = 0.8f; public const int NauseatedFogEndDistance = 30; public static Color NauseatedFogColor = new Color(0f, 0.5f, 0f, 1f); public const float PhasingMovementSpeedHumanForm = 1.5f; public const float PhasingMovementSpeedWolfForm = 1.25f; public const float BombMovementSpeed = 1.15f; public const float FleeingMovementSpeed = 1.75f; public const float PanicMovementSpeed = 0.65f; public const float ChaosMinimumDelayServer = 6f; public const float ChaosMaximumDelayServer = 12f; public static Dictionary<ChaosEffect.ChaosPossibleEffect, int> ChaosChanceByEffect = new Dictionary<ChaosEffect.ChaosPossibleEffect, int> { { ChaosEffect.ChaosPossibleEffect.CreateTraps, 1 }, { ChaosEffect.ChaosPossibleEffect.CreateGrenade, 2 }, { ChaosEffect.ChaosPossibleEffect.UseScrollOnNearbyPlayer, 3 }, { ChaosEffect.ChaosPossibleEffect.LockOrUnlockNearbyDoor, 1 }, { ChaosEffect.ChaosPossibleEffect.CreateSmoke, 2 }, { ChaosEffect.ChaosPossibleEffect.UseDiamondOnNearbyPlayer, 1 } }; public const float ChaosMaximumPlayerRange = 15f; public const float ChaosMaximumDoorRange = 20f; public const int ChaosMinimumTraps = 1; public const int ChaosMaximumTraps = 3; public const float ChaosMaximumTrapRange = 2f; public const float ChaosMaximumGrenadeRange = 2f; public const float ChaosSmokeDuration = 8f; public const float ChaosGrenadeKnockbackMultiplier = 0.7f; public const float TruesightItemLightIntensity = 2f; public const float TruesightItemLightRange = 2f; public const float LoverVillagerHungerRateBase = 0.125f; public const float LoverVillagerHungerRatePerLivingPlayer = 0.0125f; public const float LoverVillagerHealPercentageOnWolfKill = 0.33f; public const int LoverFogEndDistance = 40; public static Color LoverFogColor = new Color(1f, 0.4f, 1f, 1f); public const float MagicScrollDurationMultiplier = 0.75f; public const float GrenadeFuseTime = 2f; public const float GrenadeYAngleIncrease = 0.1f; public const float GrenadeLaunchPower = 25f; public const float GrenadeMovementReductionPercentagePerSecond = 0.5f; public const float GrenadeMovementReductionPercentagePerSecondWhenGrounded = 60f; public const float GrenadeArea = 15f; public const float GrenadeKnockbackMultiplierAtMaximumDistance = 0.4f; public const float GrenadeMaximumKnockback = 20f; public const float GrenadeKnockbackMultiplierOnCrouched = 0.65f; public const float GrenadeKnockbackReductionPerSecond = 9f; public const float GrenadeKnockbackMultiplierIfNotVisible = 0.6f; public const float GrenadeMaximumDisorientedDuration = 8f; public const float GrenadeDisorientedDurationMultiplierAtMaximumDistance = 0.4f; public const float SleepingGasPrepareTime = 3f; public const float SleepingGasDetonateSoundRange = 30f; public const float SleepingGasDuration = 35f; public const float SleepingGasInitialScaleRatio = 0.2f; public const float SleepingGasDurationForMaximumScaleRatio = 4f; public const float SleepingGasDefaultParticleSystemScale = 7f; public const float SleepingGasMaximumRadius = 40f; public const float SleepingGasSleepyMovementSpeedAtZeroStack = 0.85f; public const float SleepingGasSleepyMovementSpeedAtMaxStacks = 0.25f; public const float SleepingGasSleepyDuration = 7f; public static Color SleepingGasSleepyFogColor = Color.white; public static float SleepingGasSleepyFogEndDistanceAtZeroStack = 60f; public static float SleepingGasSleepyFogEndDistanceAtMaxStacks = 5f; public const float SleepingGasApplySleepyInterval = 1f; public const int SleepingGasSleepStacksMaximum = 1000; public const int SleepingGasSleepStacksPerHalfSecondOnHuman = 80; public const int SleepingGasSleepStacksPerHalfSecondOnWolf = 80; public const float SleepingGasSleepStacksMultiplierAtZeroRange = 1.7f; public const float SleepingGasSleepStacksMultiplierAtMaximumRange = 0.6f; public const float SleepingGasSleepDurationOnHuman = 30f; public const float SleepingGasSleepDurationOnWolf = 7f; public const float SabotageObjectRaycastRange = 7f; public const float SabotageSubtlyDurationMultiplier = 5f; public const float DiseaseEffectHealthDecrease = 0.3f; public const float DiseaseMoveSpeedMultiplier = 0.85f; public const float EmpoweredWolfHungerMultiplier = 0.75f; public const float EmpoweredMovementSpeed = 1.15f; public const float PortalSabotageStayActiveTime = 120f; public const float PortalSabotageReactivateTime = 10f; public const float PortalBonusMovementSpeed = 1.2f; public const float PortalMaximumHealthGainOnPass = 0.35f; public const float CursedNightFogEndDistanceMultiplier = 0.65f; public const float CursedNightDefaultCurseCooldown = 100f; public const float LaboratoryLightsFogEndDistance = 17.5f; public const float PlayerRaycastRange = 10f; public const float PlayerRaycastRangeWhenInvisible = 1.75f; public const float TrapSetupTime = 1f; public const float TrapDisarmTime = 2.5f; public const float TrapDisarmTimeInWolfForm = 5f; public const int SmokeBoostedRadius = 4000; public const float MaxSpeedBase = 1.5f; public const float AmogusModeKillRange = 5f; public const float AmogusModeKillCooldown = 30f; public const float AmogusModeReportRange = 10f; public const int AmogusBaseLootsSpawn = 5; public const int AmogusBaseIntervalBetweenLoots = 60; public static Dictionary<int, float> FogEndDistanceDaytimeByFogConfigPercentage = new Dictionary<int, float> { { 0, 300f }, { 10, 300f }, { 20, 300f }, { 30, 300f }, { 40, 300f }, { 50, 300f }, { 60, 300f }, { 70, 300f }, { 80, 300f }, { 90, 300f }, { 100, 300f } }; public static Dictionary<int, float> FogEndDistanceNightByFogConfigPercentage = new Dictionary<int, float> { { 0, 300f }, { 10, 150f }, { 20, 125f }, { 30, 100f }, { 40, 80f }, { 50, 65f }, { 60, 55f }, { 70, 45f }, { 80, 35f }, { 90, 26f }, { 100, 18f } }; public const int FogBonusEndDistanceForWolfForm = 25; public static int BeastMarkCooldown => Mathf.RoundToInt(60f - (float)PlayerRegistry.Count * 3f); public static float CurrentLootProgress => (float)GameManager.Instance.Score / (float)GameManager.Instance.MaxScore; public static int GetMerchantOfferTypePonderation(MerchantOffer.MerchantOfferType type) { return type switch { MerchantOffer.MerchantOfferType.Scroll => 2, MerchantOffer.MerchantOfferType.OtherGadget => 4, MerchantOffer.MerchantOfferType.Potion => 2, MerchantOffer.MerchantOfferType.ImmediateEffect => 4, MerchantOffer.MerchantOfferType.PriestProtection => 1, MerchantOffer.MerchantOfferType.Heal => 1, _ => 0, }; } public static int? GetMerchantCostForPotionEffect(Effect effect) { if (effect is AuditionEffect) { return 10; } if (effect is InvisibilityEffect) { return 20; } if (effect is NightVision) { return 15; } if (effect is SatiatedEffect) { return 15; } if (effect is SpeedEffect) { return 20; } if (effect is MidasEffect) { return 15; } if (effect is AssassinEffect) { return 40; } if (effect is StinkingEffect) { return 10; } if (effect is ClairvoyanceEffect) { return 20; } if (effect is GiantEffect) { return 15; } if (effect is TeleportationEffect) { return 10; } if (effect is VampireEffect) { return 10; } if (effect is TinyEffect) { return 10; } if (effect is HauntedEffect) { return 10; } if (effect is FlatulenceEffect) { return null; } if (effect is GlowingEffect) { return null; } if (effect is ParanoiaEffect) { return null; } if (effect is DeafnessEffect) { return null; } if (effect is NearsightedEffect) { return null; } if (effect is MuteEffect) { return null; } if (effect is ChaosEffect) { return 15; } return null; } public static int GetMerchantCostForScrollEffect(Effect effect) { if (effect is AuditionEffect) { return 10; } if (effect is InvisibilityEffect) { return 20; } if (effect is NightVision) { return 15; } if (effect is SatiatedEffect) { return 15; } if (effect is SpeedEffect) { return 20; } if (effect is ClairvoyanceEffect) { return 20; } if (effect is GiantEffect) { return 15; } if (effect is TeleportationEffect) { return 10; } if (effect is VampireEffect) { return 10; } if (effect is HauntedEffect) { return 10; } if (effect is FlatulenceEffect) { return 10; } if (effect is ParanoiaEffect) { return 10; } if (effect is DeafnessEffect) { return 10; } if (effect is NearsightedEffect) { return 10; } if (effect is MuteEffect) { return 10; } if (effect is ChaosEffect) { return 15; } return 10; } public static int? GetMerchantCostForImmediateEffect(Effect effect) { if (effect is AuditionEffect) { return 10; } if (effect is InvisibilityEffect) { return 20; } if (effect is NightVision) { return 15; } if (effect is SatiatedEffect) { return 15; } if (effect is SpeedEffect) { return 20; } if (effect is MidasEffect) { return 15; } if (effect is AssassinEffect) { return 40; } if (effect is StinkingEffect) { return 10; } if (effect is ClairvoyanceEffect) { return 20; } if (effect is GiantEffect) { return 15; } if (effect is TeleportationEffect) { return 10; } if (effect is VampireEffect) { return 10; } if (effect is TinyEffect) { return 10; } if (effect is HauntedEffect) { return 10; } if (effect is FlatulenceEffect) { return null; } if (effect is GlowingEffect) { return null; } if (effect is ParanoiaEffect) { return null; } if (effect is DeafnessEffect) { return null; } if (effect is NearsightedEffect) { return null; } if (effect is MuteEffect) { return null; } if (effect is ChaosEffect) { return 15; } return null; } public static int MediumAdditionalPlayersToAdd(int livingPlayersCount) { if (livingPlayersCount <= 5) { return 1; } if (livingPlayersCount <= 9) { return 2; } return 3; } public static int GetVillagerJobChancePonderation(PlayerCustom.PlayerPrimaryRolePower power) { return power switch { PlayerCustom.PlayerPrimaryRolePower.Peasant => 3, PlayerCustom.PlayerPrimaryRolePower.Repairer => 2, PlayerCustom.PlayerPrimaryRolePower.Guard => 2, PlayerCustom.PlayerPrimaryRolePower.Exorcist => 3, PlayerCustom.PlayerPrimaryRolePower.Forensics => 2, PlayerCustom.PlayerPrimaryRolePower.Avenger => 2, PlayerCustom.PlayerPrimaryRolePower.Investigator => 3, PlayerCustom.PlayerPrimaryRolePower.Survivalist => 3, PlayerCustom.PlayerPrimaryRolePower.Priest => 3, PlayerCustom.PlayerPrimaryRolePower.Angel => 3, PlayerCustom.PlayerPrimaryRolePower.Summoner => 2, PlayerCustom.PlayerPrimaryRolePower.Detective => 2, PlayerCustom.PlayerPrimaryRolePower.Avatar => 0, _ => 0, }; } public static int DetectiveOneIsEvilAdditionalPlayersToAdd(int livingPlayersCount) { if (livingPlayersCount <= 8) { return 1; } return 2; } public static int AvengerChargeIncreasePerWolfKill(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: return 45; case 7: return 40; case 8: return 35; case 9: return 30; case 10: return 26; case 11: return 23; case 12: return 20; case 13: return 18; case 14: return 16; case 15: return 14; default: return 12; } } public static float ExorcistChargeMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.65f, "map_dungeon" => 0.85f, "map_haddoncans" => 1f, "map_apartcan" => 0.9f, "map_laboratory" => 1f, "map_got" => 0.8f, _ => 1f, }; } public static float DetectiveMaximumRangeByMap(int mapId) { return 15f * DistanceMultiplierByMap(mapId); } public static int AvatarVillagersKilledOnDeath(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: return 1; case 11: case 12: case 13: case 14: case 15: return 2; default: return 2; } } public static int? GetCastTimeForSecondaryRole(PlayerCustom.PlayerSecondaryRole role) { return role switch { PlayerCustom.PlayerSecondaryRole.BothTeleporter => 3, PlayerCustom.PlayerSecondaryRole.BothRanger => 2, PlayerCustom.PlayerSecondaryRole.BothMedium => 3, PlayerCustom.PlayerSecondaryRole.BothScavenger => 2, _ => null, }; } public static int? GetCooldownForPrimaryRolePower(PlayerCustom.PlayerPrimaryRolePower role, int totalCycleTime) { return role switch { PlayerCustom.PlayerPrimaryRolePower.Saboteur => 40, PlayerCustom.PlayerPrimaryRolePower.Warlock => 5 * totalCycleTime, PlayerCustom.PlayerPrimaryRolePower.Deceiver => 5 * totalCycleTime, PlayerCustom.PlayerPrimaryRolePower.Tracker => 10, PlayerCustom.PlayerPrimaryRolePower.Forensics => 5 * totalCycleTime, PlayerCustom.PlayerPrimaryRolePower.Angel => 5 * totalCycleTime, _ => null, }; } public static PowerMaterialsInfo? GetMaterialsInfoForPrimaryRolePower(PlayerCustom.PlayerPrimaryRolePower power) { return power switch { PlayerCustom.PlayerPrimaryRolePower.Bomber => new PowerMaterialsInfo(100, 0f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Ritualist => new PowerMaterialsInfo(10000, 0f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Peasant => new PowerMaterialsInfo(10000, 0f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Avenger => new PowerMaterialsInfo(100, 0f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Exorcist => new PowerMaterialsInfo(75, 0.756f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Priest => new PowerMaterialsInfo(100, 0.906f, gainsMaterialsOnCollect: true, 0f), PlayerCustom.PlayerPrimaryRolePower.Summoner => new PowerMaterialsInfo(10000, 0.256f, gainsMaterialsOnCollect: false, 0f), PlayerCustom.PlayerPrimaryRolePower.Detective => new PowerMaterialsInfo(10000, 0f, gainsMaterialsOnCollect: false, 0f), _ => null, }; } public static int? GetCooldownForSecondaryRole(PlayerCustom.PlayerSecondaryRole role, int totalCycleTime) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) return role switch { PlayerCustom.PlayerSecondaryRole.BothAlcoholic => 60, PlayerCustom.PlayerSecondaryRole.BothEngineer => NetworkBool.op_Implicit(Plugin.CustomConfig.DropItemsAvailable) ? 90 : 60, PlayerCustom.PlayerSecondaryRole.BothGambler => 120, PlayerCustom.PlayerSecondaryRole.BothHowler => 90, PlayerCustom.PlayerSecondaryRole.BothIllusionist => 90, PlayerCustom.PlayerSecondaryRole.BothInfected => 90, PlayerCustom.PlayerSecondaryRole.BothMetabolic => 8 * totalCycleTime, PlayerCustom.PlayerSecondaryRole.BothSherif => 120, PlayerCustom.PlayerSecondaryRole.BothAstral => 5, PlayerCustom.PlayerSecondaryRole.BothSprinter => 90, PlayerCustom.PlayerSecondaryRole.BothStealther => 120, PlayerCustom.PlayerSecondaryRole.BothTeleporter => 90, PlayerCustom.PlayerSecondaryRole.BothScavenger => 30, PlayerCustom.PlayerSecondaryRole.BothActor => 30, PlayerCustom.PlayerSecondaryRole.BothScribe => 60, PlayerCustom.PlayerSecondaryRole.BothCarabineer => 60, PlayerCustom.PlayerSecondaryRole.BothForger => 120, _ => null, }; } public static int? GetSecondCooldownForSecondaryRole(PlayerCustom.PlayerSecondaryRole role, int totalCycleTime) { return role switch { PlayerCustom.PlayerSecondaryRole.BothScribe => 20, PlayerCustom.PlayerSecondaryRole.BothForger => 40, _ => null, }; } public static ModifiedEffectData GetModifiedEffectData(Effect effect) { if (effect is AuditionEffect) { return new ModifiedEffectData(0, 60, null, null); } if (effect is InvisibilityEffect) { return new ModifiedEffectData(1, 120, 25f, 25f); } if (effect is NightVision) { return new ModifiedEffectData(2, 90, 45f, null); } if (effect is SatiatedEffect) { return new ModifiedEffectData(3, 60, 30f, null); } if (effect is SpeedEffect) { return new ModifiedEffectData(4, 120, 30f, 30f); } if (effect is MidasEffect) { return new ModifiedEffectData(5, 90, null, null); } if (effect is AssassinEffect) { return new ModifiedEffectData(6, 120, 0f, 0f); } if (effect is StinkingEffect) { return new ModifiedEffectData(7, 60, null, null); } if (effect is ClairvoyanceEffect) { return new ModifiedEffectData(8, 75, 30f, 45f); } if (effect is GiantEffect) { return new ModifiedEffectData(9, 90, 10f, 20f); } if (effect is TeleportationEffect) { return new ModifiedEffectData(10, 75, 15f, 15f); } if (effect is VampireEffect) { return new ModifiedEffectData(11, 75, 45f, 45f); } if (effect is TinyEffect) { return new ModifiedEffectData(12, 120, 12f, null); } if (effect is HauntedEffect) { return new ModifiedEffectData(13, 60, null, null); } if (effect is ChaosEffect) { return new ModifiedEffectData(14, 75, null, null); } if (effect is FlatulenceEffect) { return new ModifiedEffectData(15, 60, null, null); } if (effect is GlowingEffect) { return new ModifiedEffectData(16, 60, 0f, 0f); } if (effect is ParanoiaEffect) { return new ModifiedEffectData(17, 45, null, null); } if (effect is DeafnessEffect) { return new ModifiedEffectData(18, 60, null, null); } if (effect is NearsightedEffect) { return new ModifiedEffectData(19, 60, null, null); } if (effect is MuteEffect) { return new ModifiedEffectData(20, 60, null, null); } return new ModifiedEffectData(99, 60, null, null); } public static int CannibalTargetAmount(int totalPlayers) { int result = 1; if (totalPlayers <= 5) { result = 2; } else if (totalPlayers <= 9) { result = 3; } else if (totalPlayers <= 11) { result = 4; } else if (totalPlayers <= 13) { result = 5; } else if (totalPlayers <= 15) { result = 6; } return result; } public static int AgentMaxSurvivorsToWin(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: return 2; case 8: case 9: case 10: case 11: case 12: return 3; case 13: case 14: case 15: return 4; default: return 4; } } public static int SpyGoal(int totalPlayers) { return 10000; } public static float SpyMaximumRange(int mapId) { return 25f * DistanceMultiplierByMap(mapId); } public static int BeastTargetAmount(int survivingPlayers) { return Mathf.CeilToInt((float)survivingPlayers * 0.6f); } public static int ScientistGoal(int totalPlayers) { return Mathf.RoundToInt((float)(PlayerRegistry.Count * 500)); } public static int BountyHunterTargetCooldown(int bountyHunterKillsCount, int bountyHunterKillsObjective, int remainingLivingPlayers, int totalPlayers) { float num = BountyHunterBaseCooldown(totalPlayers); float num2 = (float)bountyHunterKillsCount / (float)bountyHunterKillsObjective; float num3 = Mathf.Lerp(0.5f, 1.5f, num2); float num4 = (float)remainingLivingPlayers / (float)totalPlayers; float num5 = Mathf.Lerp(0.15f, 1.6f, num4); return Mathf.RoundToInt(num * num3 * num5); } public static int BountyHunterTargetAmount(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: return 3; case 11: case 12: case 13: case 14: case 15: return 4; default: return 4; } } public static int BountyHunterBaseCooldown(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: return 45; case 7: return 60; case 8: return 75; case 9: return 90; case 10: return 40; case 11: return 50; case 12: return 60; case 13: return 70; case 14: return 80; case 15: return 90; default: return 80; } } public static int VoodooReanimationCooldown(int zombiesCount, int totalPlayers) { float num = Mathf.Lerp(1f, 0.25f, CurrentLootProgress); return Mathf.RoundToInt((float)VoodooBaseCooldown(totalPlayers) * num * (1f + (float)zombiesCount * 0.5f)); } public static int VoodooBaseCooldown(int totalPlayers) { switch (totalPlayers) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: return 210; case 10: return 190; case 11: return 170; case 12: return 150; case 13: return 135; case 14: return 120; case 15: return 105; default: return 105; } } public static bool IsValidEffectForScroll(Effect effect) { return effect is AuditionEffect || effect is InvisibilityEffect || effect is NightVision || effect is SatiatedEffect || effect is SpeedEffect || effect is ClairvoyanceEffect || effect is GiantEffect || effect is TeleportationEffect || effect is VampireEffect || effect is HauntedEffect || effect is ChaosEffect || effect is FlatulenceEffect || effect is ParanoiaEffect || effect is DeafnessEffect || effect is NearsightedEffect || effect is MuteEffect; } public static float SleepingGasRadiusByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.5f, "map_dungeon" => 1f, "map_haddoncans" => 0.6f, "map_apartcan" => 0.65f, "map_laboratory" => 0.85f, "map_got" => 0.6f, _ => 1f, }; } public static float DraftModeChanceToRemoveSoloRole(PlayerCustom.PlayerNewPrimaryRole soloRole) { return soloRole switch { PlayerCustom.PlayerNewPrimaryRole.VillageIdiot => 0f, PlayerCustom.PlayerNewPrimaryRole.Cannibal => 0f, PlayerCustom.PlayerNewPrimaryRole.Agent => 0f, PlayerCustom.PlayerNewPrimaryRole.Spy => 0f, PlayerCustom.PlayerNewPrimaryRole.Scientist => 0f, PlayerCustom.PlayerNewPrimaryRole.Lover => 0f, PlayerCustom.PlayerNewPrimaryRole.Beast => 0f, PlayerCustom.PlayerNewPrimaryRole.BountyHunter => 0f, PlayerCustom.PlayerNewPrimaryRole.Voodoo => 0f, _ => 0f, }; } public static float DistanceMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.6f, "map_dungeon" => 1f, "map_haddoncans" => 0.6f, "map_apartcan" => 0.75f, "map_laboratory" => 0.75f, "map_got" => 0.65f, _ => 1f, }; } public static float WolfKillSoundRangeByMap(int mapId) { return 30f * DistanceMultiplierByMap(mapId); } public static float NightFogEndDistanceMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 0.6f, "map_dungeon" => 1f, "map_haddoncans" => 0.5f, "map_apartcan" => 0.65f, "map_laboratory" => 0.6f, "map_got" => 0.6f, _ => 1f, }; } public static float ScientistPowerMultiplierByMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 1.5f, "map_dungeon" => 1.5f, "map_haddoncans" => 1f, "map_apartcan" => 1.4f, "map_laboratory" => 1.5f, "map_got" => 1.4f, _ => 1f, }; } public static float BeastHeartbeatMaximumRange(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 12f, "map_2" => 9f, "map_dungeon" => 12f, "map_haddoncans" => 9f, "map_apartcan" => 12f, "map_laboratory" => 12f, "map_got" => 9f, _ => 12f, }; } public static float FallingHeightMultiplierForDamage(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 0.2f, "map_2" => 0.2f, "map_dungeon" => 1f, "map_haddoncans" => 1.75f, "map_apartcan" => 1f, "map_laboratory" => 1f, "map_got" => 1f, _ => 1f, }; } public static float GravityMultiplier(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 1f, "map_dungeon" => 1f, "map_haddoncans" => 1f, "map_apartcan" => 1f, "map_laboratory" => 0.5f, "map_got" => 0.75f, _ => 1f, }; } public static float LootGenerationMultiplier(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 1f, "map_2" => 1f, "map_dungeon" => 1.15f, "map_haddoncans" => 1f, "map_apartcan" => 1f, "map_laboratory" => 1f, "map_got" => 1f, _ => 1f, }; } public static int MerchantTotalCoinsOnMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => 7, "map_2" => 7, "map_dungeon" => 8, "map_haddoncans" => 6, "map_apartcan" => 6, "map_laboratory" => 8, "map_got" => 7, _ => 8, }; } public static bool ShowMinimapArrowsOnMap(int mapId) { return MapManager.FindMapNameById(mapId) switch { "map_1" => false, "map_2" => true, "map_dungeon" => false, "map_haddoncans" => false, "map_apartcan" => false, "map_laboratory" => true, "map_got" => true, _ => false, }; } } public class PowerMaterialsInfo { public int RequiredMaterials; public float StartingMaterialsPercentage; public bool GainsMaterialOnCollect; public float BonusMultiplierAtFullHealth; public PowerMaterialsInfo(int requiredMaterials, float startingMaterialsPercentage, bool gainsMaterialsOnCollect, float bonusMultiplierAtFullHealth) { RequiredMaterials = requiredMaterials; StartingMaterialsPercentage = startingMaterialsPercentage; GainsMaterialOnCollect = gainsMaterialsOnCollect; BonusMultiplierAtFullHealth = bonusMultiplierAtFullHealth; } } [NetworkBehaviourWeaved(20)] public class BeastManager : NetworkBehaviour { private float DelayToNextHeartbeat; private const float DelaySoundSlow = 2.1f; private const float DelaySoundMid = 1.42f; private const float DelaySoundFast = 0.9f; [Networked(OnChanged = "BeastActiveChanged")] [NetworkedWeaved(0, 1)] public unsafe NetworkBool BeastActive { get { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastActive. Networked properties can only be accessed when Spawned() has been called."); } return (NetworkBool)(*base.Ptr); } set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastActive. Networked properties can only be accessed when Spawned() has been called."); } Unsafe.Write(base.Ptr, value); } } [Networked(OnChanged = "BeastKillsChanged")] [NetworkedWeaved(1, 1)] public unsafe int BeastKills { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKills. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[1]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKills. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[1] = value; } } [Networked] [NetworkedWeaved(2, 1)] public unsafe int BeastKillsObjective { get { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKillsObjective. Networked properties can only be accessed when Spawned() has been called."); } return base.Ptr[2]; } set { if (base.Ptr == null) { throw new InvalidOperationException("Error when accessing PlayerCustom.BeastKillsObjective. Networked properties can only be accessed when Spawned() has been called."); } base.Ptr[2] = value; } } public static BeastManager Instance { get; private set; } public void Reset() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) BeastActive = NetworkBool.op_Implicit(false); BeastKills = 0; BeastKillsObjective = 0; } public override void Spawned() { ((NetworkBehaviour)this).Spawned(); Instance = this; } public override void Despawned(NetworkRunner runner, bool hasState) { ((NetworkBehaviour)this).Despawned(runner, hasState); Instance = null; } private void Update() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (!NetworkBool.op_Implicit(BeastActive)) { return; } if (DelayToNextHeartbeat <= 0f) { float num = BalancingValues.BeastHeartbeatMaximumRange(GameManager.Instance.MapID); float num2 = num * 0.7f; float num3 = num * 0.4f; PlayerCustom povPlayerCustom = PlayerCustomRegistry.GetPlayer(PlayerController.Local.LocalCameraHandler.PovPlayer.Ref); if (povPlayerCustom.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Beast) { List<PlayerController> list = PlayerRegistry.Where((Predicate<PlayerController>)((PlayerController o) => o.Ref != povPlayerCustom.Ref && !NetworkBool.op_Implicit(o.IsDead))).ToList(); PlayerController val = null; float? num4 = null; foreach (PlayerController item in list) { float num5 = Vector3.Distance(((Component)povPlayerCustom.PlayerController).transform.position, ((Component)item).transform.position); if (!num4.HasValue || num5 < num4.Value) { val = item; num4 = num5; } } if ((Object)(object)val != (Object)null && num4.Value <= num) { string text; float delayToNextHeartbeat; if (num4.Value > num2) { text = "BeastHeartBeatSlow"; delayToNextHeartbeat = 2f; } else if (num4.Value > num3) { text = "BeastHeartBeatMid"; delayToNextHeartbeat = 1.337f; } else { text = "BeastHeartBeatFast"; delayToNextHeartbeat = 0.841f; } AudioManager.PlayAndFollow(text, ((Component)val).transform, (MixerTarget)2, num, 0.8f); DelayToNextHeartbeat = delayToNextHeartbeat; } else { DelayToNextHeartbeat = 0.5f; } return; } PlayerCustom specificNewPrimaryRole = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Beast); float num6 = Vector3.Distance(((Component)povPlayerCustom.PlayerController).transform.position, ((Component)specificNewPrimaryRole.PlayerController).transform.position); if (num6 <= num) { string text2; float delayToNextHeartbeat2; if (num6 > num2) { text2 = "BeastHeartBeatSlow"; delayToNextHeartbeat2 = 2f; } else if (num6 > num3) { text2 = "BeastHeartBeatMid"; delayToNextHeartbeat2 = 1.337f; } else { text2 = "BeastHeartBeatFast"; delayToNextHeartbeat2 = 0.841f; } AudioManager.Play(text2, (MixerTarget)2, 0.5f, 1f); DelayToNextHeartbeat = delayToNextHeartbeat2; } else { DelayToNextHeartbeat = 0.5f; } } else { DelayToNextHeartbeat -= Time.deltaTime; } } public void ActivateBeast() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) BeastActive = NetworkBool.op_Implicit(true); } [Preserve] public static void BeastActiveChanged(Changed<BeastManager> changed) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) try { BeastManager behaviour = changed.Behaviour; if (NetworkBool.op_Implicit(behaviour.BeastActive)) { int num = BalancingValues.BeastTargetAmount(PlayerRegistry.CountWhere((Predicate<PlayerController>)((PlayerController o) => !NetworkBool.op_Implicit(o.IsDead))) - 1); PlayerCustom specificNewPrimaryRole = PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Beast); if (((SimulationBehaviour)behaviour).Runner.IsServer) { behaviour.BeastKillsObjective = num; specificNewPrimaryRole.PlayerController.Hunger = GameManager.Instance.MaxHunger; Traverse.Create((object)specificNewPrimaryRole.PlayerController).Property("WolfDelay", (object[])null).SetValue((object)TickTimer.CreateFromSeconds(((SimulationBehaviour)behaviour).Runner, 7f)); specificNewPrimaryRole.PlayerController.TransformedNight = NetworkBool.op_Implicit(true); specificNewPrimaryRole.PlayerController.IsWolf = NetworkBool.op_Implicit(true); specificNewPrimaryRole.PlayerController.MovementAction = 0; specificNewPrimaryRole.PlayerController.CanMoveAnimation = NetworkBool.op_Implicit(false); specificNewPrimaryRole.PlayerController.IsZooming = NetworkBool.op_Implicit(false); GameManager.Rpc_BroadcastFollowSound(((SimulationBehaviour)behaviour).Runner, NetworkString<_16>.op_Implicit("BeastAwakening"), ((Component)specificNewPrimaryRole.PlayerController).transform.position, 50f, 0.8f); } Traverse.Create((object)specificNewPrimaryRole.PlayerController).Field<ParticleSystem>("smokeParticleSystem").Value.Play(); PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.LocalCameraHandler.PovPlayer.Ref); if (player.NewPrimaryRole == PlayerCustom.PlayerNewPrimaryRole.Beast) { UIManager.ShowRedCenterMessage("NALES_UI_BEAST_UNLEASHED_BEAST", 0.5f, 5f, new List<object> { num }); } else { UIManager.ShowRedCenterMessage("NALES_UI_BEAST_UNLEASHED_OTHERS", 0.5f, 4f); } } } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorIndexChanged error: " + ex)); } } [Preserve] public static void BeastKillsChanged(Changed<BeastManager> changed) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) try { BeastManager behaviour = changed.Behaviour; if (NetworkBool.op_Implicit(behaviour.BeastActive) && ((SimulationBehaviour)behaviour).Runner.IsServer && behaviour.BeastKills >= behaviour.BeastKillsObjective) { PlayerCustom.Rpc_End_Game(((SimulationBehaviour)behaviour).Runner, PlayerCustomRegistry.GetSpecificNewPrimaryRole(PlayerCustom.PlayerNewPrimaryRole.Beast).Index); } } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorIndexChanged error: " + ex)); } } } [HarmonyPatch(typeof(LightingManager), "FixedUpdateNetwork")] internal class BeastNoCyclePatch { private static bool Prefix(LightingManager __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkBool.op_Implicit(BeastManager.Instance.BeastActive) || NetworkBool.op_Implicit(DraftManager.Instance.Active)) { return false; } return true; } catch (Exception ex) { Plugin.Logger.LogError((object)("BeastNoCyclePatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(Effect), "Init")] internal class BeastReducedNegativeEffectsDurationPatch { private static bool Prefix(PlayerRef targetPlayer, Effect __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) try { PlayerController player = PlayerRegistry.GetPlayer(targetPlayer); PlayerCustom.ApplyEffectToPlayer(player, __instance, ((SimulationBehaviour)__instance).Runner); return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("BeastReducedNegativeEffectsDurationPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(NetworkRunnerHandler), "StartSession")] internal class StartSessionPatch { private static void Prefix(ref int playerCount) { try { playerCount = 15; } catch (Exception ex) { Plugin.Logger.LogError((object)("CreateGamePatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerRegistry), "GetAvailable")] internal class PlayerRegistryPatch { private static bool Prefix(PlayerRegistry __instance, ref bool __result, out byte index) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) try { NetworkDictionary<PlayerRef, PlayerController> value = Traverse.Create((object)__instance).Property<NetworkDictionary<PlayerRef, PlayerController>>("ObjectByRef", (object[])null).Value; if (value.Count == 0) { index = 0; __result = true; return false; } if (value.Count == 15) { index = 0; __result = false; return false; } byte[] array = ((IEnumerable<KeyValuePair<PlayerRef, PlayerController>>)(object)value).OrderBy(delegate(KeyValuePair<PlayerRef, PlayerController> kvp) { KeyValuePair<PlayerRef, PlayerController> keyValuePair2 = kvp; return keyValuePair2.Value.Index; }).Select(delegate(KeyValuePair<PlayerRef, PlayerController> kvp) { KeyValuePair<PlayerRef, PlayerController> keyValuePair = kvp; return keyValuePair.Value.Index; }).ToArray(); for (int i = 0; i < array.Length - 1; i++) { if (array[i + 1] > array[i] + 1) { index = (byte)(array[i] + 1); __result = true; return false; } } index = (byte)(array[^1] + 1); __result = true; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("PlayerRegistryPatch error: " + ex)); index = 0; return true; } } } [HarmonyPatch(typeof(GameUI), "UpdatePlayerCount")] internal class UpdatePlayerCountPatch { private static bool Prefix(int count, GameUI __instance) { try { ((TMP_Text)Traverse.Create((object)__instance).Field<TextMeshProUGUI>("playerCount").Value).text = count + "/15"; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("UpdatePlayerCountPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(ColorManager), "Awake")] internal class ColorManagerPatch { private static void Postfix(ColorManager __instance) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) try { List<Texture> list = Traverse.Create((object)__instance).Field<Texture[]>("villagerTextures").Value.ToList(); List<Color> list2 = Traverse.Create((object)__instance).Field<Color[]>("colors").Value.ToList(); list.Add(list[0]); list.Add(list[1]); list.Add(list[2]); list2.Add(list2[0]); list2.Add(list2[1]); list2.Add(list2[2]); Traverse.Create((object)__instance).Field("villagerTextures").SetValue((object)list.ToArray()); Traverse.Create((object)__instance).Field("colors").SetValue((object)list2.ToArray()); } catch (Exception ex) { Plugin.Logger.LogError((object)("ColorManagerPatch error: " + ex)); } } } [HarmonyPatch(typeof(GameManager), "GetSpawnPosition")] internal class SpawnPositionPatch { private static bool Prefix(PlayerController playerController, GameManager __instance, ref Vector3 __result) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) try { float num = 24f; float num2 = (float)(int)playerController.Index * num; Vector3 val = Quaternion.Euler(0f, num2, 0f) * Vector3.forward * Traverse.Create((object)__instance).Field<float>("radius").Value; __result = Traverse.Create((object)__instance).Field<Transform[]>("mapSpawns").Value[__instance.MapID - 1].position + val; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("SpawnPositionPatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(LocalCameraHandler), "UpdateAnchorOffset")] internal class TinyEffectLocalCameraHandlerPatch { private static void Postfix(LocalCameraHandler __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) try { if ((int)GameManager.LocalGameState == 0 || !((Object)(object)__instance.PovPlayer != (Object)null) || NetworkBool.op_Implicit(__instance.PovPlayer.IsDead)) { return; } PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.PovPlayer.Ref); Traverse<bool> val = Traverse.Create((object)__instance).Field<bool>("_giant"); if (val.Value != NetworkBool.op_Implicit(player.Tiny)) { Transform value = Traverse.Create((object)__instance).Field<Transform>("localCameraAnchorPoint").Value; int value2 = Traverse.Create((object)__instance).Field<int>("_movementStatus").Value; Traverse<bool> val2 = Traverse.Create((object)__instance).Field<bool>("_isWolf"); float value3 = Traverse.Create((object)__instance).Field<float>("_baseCameraOffset").Value; int movementAction = __instance.PovPlayer.MovementAction; bool flag = NetworkBool.op_Implicit(__instance.PovPlayer.IsWolf); bool flag2 = NetworkBool.op_Implicit(__instance.PovPlayer.PlayerEffectManager.Giant); bool flag3 = NetworkBool.op_Implicit(player.Tiny); float num = ((movementAction == 1) ? (value3 - 0.5f) : value3); if (flag) { num = (flag3 ? ((movementAction == 1) ? 0.35f : 0.5f) : ((!flag2) ? (num + 0.25f) : ((movementAction == 1) ? 7.2f : 10.2f))); } else if (flag2) { num = ((movementAction == 1) ? 7.2f : 10.2f); } else if (flag3) { num = ((movementAction == 1) ? 0.09f : 0.12f); } Vector3 localPosition = value.localPosition; ((Vector3)(ref localPosition))..ctor(localPosition.x, num, localPosition.z); value.localPosition = localPosition; value2 = movementAction; val2.Value = flag; val.Value = flag2 || flag3; } } catch (Exception ex) { Plugin.Logger.LogError((object)("TinyEffectLocalCameraHandlerPatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerController), "UpdateCameraAnchorOffset")] internal class CameraAnchorPatch { private static void Postfix(PlayerController __instance) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) try { PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.Ref); if (NetworkBool.op_Implicit(player.Tiny)) { float num = ((__instance.MovementAction == 1) ? 0.09f : 0.12f); Transform value = Traverse.Create((object)__instance).Field<Transform>("cameraAnchorPoint").Value; Vector3 localPosition = value.localPosition; ((Vector3)(ref localPosition))..ctor(localPosition.x, num, localPosition.z); value.localPosition = localPosition; } } catch (Exception ex) { Plugin.Logger.LogError((object)("CameraAnchorPatch error: " + ex)); } } } [HarmonyPatch(typeof(LocalCameraHandler), "LateUpdate")] internal class LocalCameraHandlerLateUpdatePatch { private static bool Prefix(LocalCameraHandler __instance) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) try { if (!((Behaviour)__instance.LocalCamera).enabled || (int)GameManager.LocalGameState == 0) { return false; } if (NetworkBool.op_Implicit(PlayerCustom.Local.Dying) || NetworkBool.op_Implicit(PlayerCustom.Local.Downed) || NetworkBool.op_Implicit(PlayerCustom.Local.Asleep) || (PlayerCustom.Local.SecondaryRole == PlayerCustom.PlayerSecondaryRole.BothActor && NetworkBool.op_Implicit(PlayerCustom.Local.SecondaryRolePowerActive))) { return false; } if (UIManager.GenericChoicePanel.Active) { if ((Object)(object)__instance.PovPlayer != (Object)null && __instance.PovPlayer.Ref == PlayerController.Local.Ref) { ((Component)__instance.LocalCamera).transform.position = Traverse.Create((object)__instance).Field<Transform>("localCameraAnchorPoint").Value.position; } return false; } if ((Object)(object)__instance.PovPlayer == (Object)null) { return true; } if (__instance.PovPlayer.Ref == PlayerController.Local.Ref) { PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.PovPlayer.Ref); if (player.ForcedRotationY != 0f) { Traverse<float> obj = Traverse.Create((object)__instance).Field<float>("_cameraRotationY"); obj.Value += player.ForcedRotationY * Time.deltaTime; } } return true; } catch (Exception ex) { Plugin.Logger.LogError((object)("LocalCameraHandlerLateUpdatePatch error: " + ex)); return true; } } } [HarmonyPatch(typeof(LocalCameraHandler), "SwitchPov")] internal class LocalCameraHandlerSwitchPoVPatch { private static bool Prefix(LocalCameraHandler __instance, PlayerController spectatedPlayer, out PlayerRef __state) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.PovPlayer == (Object)null) { __state = PlayerRef.None; return true; } if ((Object)(object)PlayerCustom.Local != (Object)null && (Object)(object)PlayerCustom.Local.SummonedSpirit != (Object)null) { __state = PlayerRef.None; return false; } __state = __instance.PovPlayer.Ref; return true; } private static void Postfix(LocalCameraHandler __instance, PlayerRef __state) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)__instance.PovPlayer == (Object)null) { return; } PlayerCustom player = PlayerCustomRegistry.GetPlayer(__instance.PovPlayer.Ref); if ((Object)(object)player != (Object)null) { foreach (PlayerCustom allPlayer in PlayerCustomRegistry.AllPlayers) { allPlayer.UpdateVisibility(); allPlayer.UpdatePoacherMarkVisibility(); } } Plugin.Minimap.RefreshLegendsIfActive(); PlayerCustom.UpdateInvestigatorTargetOnMinimap(); PlayerCustom.UpdateTeleporterBeaconOnMinimap(); PlayerCustom player2 = PlayerCustomRegistry.GetPlayer(__state); player2.UpdateGuardComponent(); player2.UpdateRangerComponent(); player2.UpdateTargetArrowComponent(); player.UpdateGuardComponent(); player.UpdateRangerComponent(); player.UpdateTargetArrowComponent(); ItemCustom.UpdateAllItems(); if (UIManager.DetectivePanel.Active) { UIManager.DetectivePanel.Hide(); GameManager.Instance.gameUI.UpdateCursor(false); } } catch (Exception ex) { Plugin.Logger.LogError((object)("LocalCameraHandlerSwitchPoVPatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerController), "OnPlayerDataChanged")] internal class OnPlayerDataChangedColorPatch { private static void Postfix(Changed<PlayerController> changed) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) try { PlayerController behaviour = changed.Behaviour; string[] obj = new string[6] { "BUG2: OnPlayerDataChanged: ref ", null, null, null, null, null }; PlayerRef @ref = behaviour.Ref; obj[1] = ((object)(PlayerRef)(ref @ref)).ToString(); obj[2] = ", index: "; obj[3] = behaviour.Index.ToString(); obj[4] = ", username: "; NetworkString<_32> username = behaviour.PlayerData.Username; obj[5] = ((object)username).ToString(); LycansUtility.DebugLog(string.Concat(obj)); if (((SimulationBehaviour)behaviour).HasInputAuthority) { if (PlayerPrefs.HasKey("FavoriteColor")) { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)behaviour).Runner, behaviour.Index, PlayerPrefs.GetInt("FavoriteColor")); } else { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)behaviour).Runner, behaviour.Index, behaviour.Index); } } PlayerCustom player = PlayerCustomRegistry.GetPlayer(behaviour.Ref); if ((Object)(object)player != (Object)null) { player.UpdateColor(); } if (((SimulationBehaviour)behaviour).Runner.IsServer) { UIManager.ModInstallationPanel.AddOrUpdatePlayer(behaviour.Ref); } if (((object)behaviour.PlayerData.Username).ToString().ToLower() == "nales" && PlayerController.Local.Ref == behaviour.Ref && LycansUtility.AddDebugLogs) { CustomLogsManager.ListenToLogs = true; } } catch (Exception ex) { Plugin.Logger.LogError((object)("OnPlayerDataChangedColorPatch error: " + ex)); } } } [HarmonyPatch(typeof(PlayerEffectsManager), "GlowingChanged")] internal class GlowingChangedColorPatch { private static bool Prefix(Changed<PlayerEffectsManager> changed) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) try { PlayerEffectsManager behaviour = changed.Behaviour; PlayerController value = Traverse.Create((object)behaviour).Field<PlayerController>("_playerController").Value; PlayerCustom player = PlayerCustomRegistry.GetPlayer(value.Ref); SkinnedMeshRenderer value2 = Traverse.Create((object)value.PlayerEffectManager).Field<SkinnedMeshRenderer>("skinnedMeshRenderer").Value; Light value3 = Traverse.Create((object)value.PlayerEffectManager).Field<Light>("glowingLight").Value; if (NetworkBool.op_Implicit(behaviour.Glowing)) { Color color = ColorManager.GetColor(player.ColorIndex); ((Renderer)value2).material.SetColor(Shader.PropertyToID("_EmissionColor"), color * 3f); ((Renderer)value2).material.EnableKeyword("_EMISSION"); value3.color = color; ((Behaviour)value3).enabled = true; return false; } ((Renderer)value2).material.DisableKeyword("_EMISSION"); ((Behaviour)value3).enabled = false; return false; } catch (Exception ex) { Plugin.Logger.LogError((object)("GlowingChangedColorPatch error: " + ex)); return true; } } } public static class ColorPicker { public const int ColorsLength = 12; public const string FavoriteColorPlayerPref = "FavoriteColor"; public static void NextColor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); if (player.ColorIndex >= 11) { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, 0); } else { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, player.ColorIndex + 1); } } public static void PreviousColor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) PlayerCustom player = PlayerCustomRegistry.GetPlayer(PlayerController.Local.Ref); if (player.ColorIndex == 0) { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, 11); } else { PlayerCustom.Rpc_Change_Color(((SimulationBehaviour)player).Runner, player.Index, player.ColorIndex - 1); } } } public static class CustomLogsManager { public static bool ListenToLogs = false; public static string Filename = null; public static string CurrentString = ""; public static int CurrentCountToWrite = 100; private const int CountToWrite = 100; public static void AddLine(string line) { if (!LycansUtility.AddDebugLogs) { return; } Plugin.Logger.LogInfo((object)("CustomLog -> " + line)); if (ListenToLogs) { CurrentString = CurrentString + Environment.NewLine + line; CurrentCountToWrite--; if (CurrentCountToWrite <= 0) { WriteCurrentLog(); CurrentCountToWrite = 100; } } } private static void WriteCurrentLog() { if (ListenToLogs) { if (Filename == null) { Filename = "CustomLogs" + LycansUtility.GetFormattedCurrentDateTimeUtc.Replace(":", "").Replace("-", "").Replace("T", "") .Replace(".", "") .Replace("Z", "") + ".txt"; } File.WriteAllText(Filename, CurrentString); } } } [HarmonyPatch(typeof(NetworkRunner), "SpawnInter