Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TheCabinet v1.11.0
plugins/TheCabinet/VectorV.TheCabinet.dll
Decompiled 15 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using VectorV.TheCabinet.NetcodePatcher; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("VectorV.TheCabinet")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.11.0.0")] [assembly: AssemblyInformationalVersion("1.11.0")] [assembly: AssemblyProduct("TheCabinet")] [assembly: AssemblyTitle("VectorV.TheCabinet")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.11.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] 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 TheCabinet { internal class AnimationEventHandler : MonoBehaviour { [SerializeField] private TheCabinetAI mainScript; [SerializeField] private BloodSpawner bloodSpawner; public void ToggleVulnerability(int toggle) { mainScript.IsVulnerable = toggle > 0; } public void ToggleHide(int toggle) { mainScript.IsHidden = toggle > 0; if (toggle > 0) { mainScript.DoAnimationClientRpc("EmergeMultiplier", (AnimatorControllerParameterType)1, -1f); } } public void StartMoving() { if (((NetworkBehaviour)mainScript).IsOwner) { ((EnemyAI)mainScript).agent.isStopped = false; } } public void StopMoving() { if (((NetworkBehaviour)mainScript).IsOwner) { ((EnemyAI)mainScript).agent.isStopped = true; } } public void DeadBody() { mainScript.EatBody(); } public void Blood() { bloodSpawner.PlayBloodParticles(); } public void PlayAudio(string audio) { if (audio == "reveal") { if (((EnemyAI)mainScript).creatureAnimator.GetFloat("EmergeMultiplier") < 0f) { mainScript.PlayAudio("hideQuick"); } else { mainScript.PlayAudio(audio); } } else { mainScript.PlayAudio(audio); } } } internal class BloodSpawner : MonoBehaviour { private ParticleSystem bloodParticle; [SerializeField] private GameObject bloodDecal; private List<ParticleCollisionEvent> bloodCollisionEvents = new List<ParticleCollisionEvent>(); private List<GameObject> decalsList; private void Start() { //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_003c: Unknown result type (might be due to invalid IL or missing references) bloodParticle = ((Component)this).GetComponent<ParticleSystem>(); decalsList = new List<GameObject>(); EmissionModule emission = bloodParticle.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((float)PluginConfig.ParticlesAmount.Value / bloodParticle.duration); } public void PlayBloodParticles() { bloodParticle.Play(); } private void OnParticleCollision(GameObject other) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0051: Unknown result type (might be due to invalid IL or missing references) int collisionEvents = ParticlePhysicsExtensions.GetCollisionEvents(bloodParticle, other, bloodCollisionEvents); for (int i = 0; i < collisionEvents; i++) { ParticleCollisionEvent val = bloodCollisionEvents[i]; Vector3 intersection = ((ParticleCollisionEvent)(ref val)).intersection; val = bloodCollisionEvents[i]; Vector3 normal = ((ParticleCollisionEvent)(ref val)).normal; if (PluginConfig.DecalsEnabled.Value) { SpawnBloodDecal(intersection, normal); } } } private void SpawnBloodDecal(Vector3 position, Vector3 normal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) Quaternion val = Quaternion.LookRotation(normal); GameObject val2 = Object.Instantiate<GameObject>(bloodDecal, position, val); val2.transform.Rotate(180f, 0f, Random.Range(0f, 360f)); Transform transform = val2.transform; transform.localScale *= Random.Range(0.25f, 1.5f); decalsList.Add(val2); } private void OnDestroy() { for (int num = decalsList.Count - 1; num >= 0; num--) { Object.Destroy((Object)(object)decalsList[num]); } } } public abstract class CabinetState : IState { protected TheCabinetAI owner; protected Transform transform => ((Component)owner).transform; protected Vector3 position => transform.position; protected NavMeshAgent agent => ((EnemyAI)owner).agent; protected abstract float stateSpeed { get; } public float desiredSpeed => stateSpeed; protected CabinetState(TheCabinetAI owner) { this.owner = owner; } public abstract void Enter(); public abstract void Execute(); public abstract void ExecuteSlow(); public abstract void Exit(); } internal class CabinetState_Following : CabinetState { private float stoppingDistance = 4f; private float distanceToGetUp = 5f; private float warningDuration = PluginConfig.WarningDuration.Value; private float warningMultiplier = 0.2f; private float closeDistance = 5f; private float tooFarDistance = 20f; private float isGettingMad = -1f; private bool newLook = true; private int lookAmount; private bool isWaiting; private Vector3 followedPlayerLastPosition; protected override float stateSpeed => 5f; private bool isHidden => owner.IsHidden; private bool lookedAt => owner.IsLookedAt(); public CabinetState_Following(TheCabinetAI owner) : base(owner) { } public override void Enter() { ((EnemyAI)owner).SwitchToBehaviourStateOnLocalClient(1); if (!owner.IsStun) { base.agent.speed = stateSpeed; } base.agent.stoppingDistance = stoppingDistance; newLook = true; lookAmount = 0; if (((NetworkBehaviour)owner).IsOwner) { ((EnemyAI)owner).SetMovingTowardsTargetPlayer(((EnemyAI)owner).targetPlayer); } } public override void Execute() { if (!((NetworkBehaviour)owner).IsOwner) { return; } if (isGettingMad >= 0f) { if (lookedAt) { if (newLook) { newLook = false; lookAmount++; } isGettingMad += Time.deltaTime * (1f + (float)(lookAmount - 1) * warningMultiplier); if (isGettingMad >= warningDuration) { for (int i = 0; i < owner.LookingPlayers.Length; i++) { if (owner.LookingPlayers[i]) { owner.PlayersToKill.Add(owner.PlayersScripts[i]); } } owner.ChangeStateServerRpc(State.Killing); } } else { newLook = true; isGettingMad -= Time.deltaTime; if (isGettingMad <= 0f) { isGettingMad = -1f; owner.DoAnimationClientRpc("Warning", (AnimatorControllerParameterType)4, 0f); base.agent.isStopped = false; } } } else if (isHidden && lookedAt && ((EnemyAI)owner).creatureAnimator.GetFloat("EmergeMultiplier") > 0f) { owner.DoAnimationClientRpc("EmergeMultiplier", (AnimatorControllerParameterType)1, -1f); ((EnemyAI)owner).creatureSFX.Stop(); } else if (!isHidden && lookedAt) { if (isGettingMad < 0f) { isGettingMad = 0f; } owner.DoAnimationClientRpc("Warning", (AnimatorControllerParameterType)4); } if (isGettingMad >= 0f) { owner.SetWarningGaugeClientRpc(Mathf.Clamp(isGettingMad / warningDuration, 0f, 1f)); } if (owner.IsHidden) { lookAmount = 0; } } public override void ExecuteSlow() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (isGettingMad >= 0f) { return; } if (((EnemyAI)owner).targetPlayer.isInsideFactory) { isWaiting = false; if (((EnemyAI)owner).targetPlayer.isPlayerDead) { PlayerControllerB val = TryGetClosePlayer(); if ((Object)(object)val != (Object)null) { ((EnemyAI)owner).SetMovingTowardsTargetPlayer(val); } else { owner.ChangeStateServerRpc(State.Wandering); } } else if (Vector3.Distance(((Component)((EnemyAI)owner).targetPlayer).transform.position, base.transform.position) > tooFarDistance) { PlayerControllerB val2 = TryGetClosePlayer(); if ((Object)(object)val2 != (Object)null) { ((EnemyAI)owner).SetMovingTowardsTargetPlayer(val2); } } } else { PlayerControllerB val3 = TryGetClosePlayer(); if ((Object)(object)val3 != (Object)null) { ((EnemyAI)owner).SetMovingTowardsTargetPlayer(val3); } else { isWaiting = true; } } if (owner.IsHidden && !lookedAt && !IsFollowedPlayerClose() && !isWaiting && ((EnemyAI)owner).creatureAnimator.GetFloat("EmergeMultiplier") < 0f) { owner.DoAnimationClientRpc("EmergeMultiplier", (AnimatorControllerParameterType)1); owner.DoAnimationClientRpc("Hide", (AnimatorControllerParameterType)4, 0f); } else if (!base.agent.isStopped && ((IsFollowedPlayerClose() && !IsFollowedPlayerMoving()) || isWaiting)) { base.agent.isStopped = true; owner.DoAnimationClientRpc("Hide", (AnimatorControllerParameterType)4); } } public override void Exit() { } private PlayerControllerB TryGetClosePlayer() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB result = null; float num = float.MaxValue; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(base.position.x, 0f, base.position.z); PlayerControllerB[] playersScripts = owner.PlayersScripts; Vector3 val4 = default(Vector3); foreach (PlayerControllerB val2 in playersScripts) { if (!val2.isPlayerDead) { Vector3 val3 = ((Component)val2).transform.position; ((Vector3)(ref val4))..ctor(val3.x, 0f, val3.z); float num2 = Vector3.Distance(val4, val); if (num2 < num && num2 <= closeDistance && owner.HasLineOfSight(val2)) { result = val2; num = num2; } } } return result; } private bool IsFollowedPlayerClose() { //IL_0012: 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) PlayerControllerB targetPlayer = ((EnemyAI)owner).targetPlayer; if (Vector3.Distance(((Component)targetPlayer).transform.position, base.position) < distanceToGetUp) { return true; } return false; } private bool IsFollowedPlayerMoving() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_001a: 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_0027: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB targetPlayer = ((EnemyAI)owner).targetPlayer; Vector3 val = ((Component)targetPlayer).transform.position; float num = Vector3.Distance(val, followedPlayerLastPosition); followedPlayerLastPosition = val; if (num > 0.1f) { return true; } return false; } } internal class CabinetState_Killing : CabinetState { private bool isLocalPlayerKillable; private float delay = -1f; protected override float stateSpeed => PluginConfig.KillingStateSpeed.Value; public CabinetState_Killing(TheCabinetAI owner) : base(owner) { } public override void Enter() { ((EnemyAI)owner).SwitchToBehaviourStateOnLocalClient(2); if (!owner.IsStun) { base.agent.speed = stateSpeed; } base.agent.isStopped = true; base.agent.stoppingDistance = 0f; ((EnemyAI)owner).creatureAnimator.SetBool("Angry", true); owner.ToggleHandStepsSettings(angry: true); owner.IsHidden = false; if (((NetworkBehaviour)owner).IsOwner) { SetTarget(GetNextTarget(safeMode: true)); } if (PluginConfig.DropItemsWhenAngry.Value) { owner.DropItemsClientRpc(); } } public override void Execute() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (delay <= 0f) { delay = 0.25f; AnimatorStateInfo currentAnimatorStateInfo = ((EnemyAI)owner).creatureAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Chase")) { isLocalPlayerKillable = owner.IsLocalPlayerAttackable(); } if ((isLocalPlayerKillable && !owner.KillablePlayers[Array.IndexOf(owner.PlayersScripts, owner.LocalPlayer)]) || (!isLocalPlayerKillable && owner.KillablePlayers[Array.IndexOf(owner.PlayersScripts, owner.LocalPlayer)])) { owner.NotifyKillableServerRpc(Array.IndexOf(owner.PlayersScripts, owner.LocalPlayer), isLocalPlayerKillable); } } else { delay -= Time.deltaTime; } } public override void ExecuteSlow() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)owner).targetPlayer != (Object)null) { if (((EnemyAI)owner).targetPlayer.isPlayerDead && !base.agent.isStopped) { SetTarget(GetNextTarget()); } else if ((int)owner.GetPath(((Component)((EnemyAI)owner).targetPlayer).transform.position).status != 0) { if (!((EnemyAI)owner).targetPlayer.isInsideFactory && !((EnemyAI)owner).isOutside) { SetTarget(GetNextTarget()); } else if (((EnemyAI)owner).targetPlayer.isInsideFactory && ((EnemyAI)owner).isOutside) { SetTarget(GetNextTarget()); } } } owner.ApplyFearToPlayers(); if (!base.agent.isStopped) { TryToKill(); } } public override void Exit() { owner.PlayersToKill.Clear(); owner.DoAnimationClientRpc("Angry", (AnimatorControllerParameterType)4, 0f); owner.DoAnimationClientRpc("Warning", (AnimatorControllerParameterType)4, 0f); owner.ToggleHandStepsSettings(angry: false); } private void SetTarget(PlayerControllerB player) { ((EnemyAI)owner).SetMovingTowardsTargetPlayer(player); if ((Object)(object)player == (Object)null) { ((MonoBehaviour)owner).StartCoroutine(owner.DelayedExecution(owner.ChangeStateServerRpc, State.Wandering, 1f)); } } private PlayerControllerB GetNextTarget(bool safeMode = false) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00e2: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = null; float num = float.MaxValue; NavMeshHit val2 = default(NavMeshHit); for (int i = 0; i < owner.PlayersToKill.Count; i++) { if (owner.PlayersToKill[i].isPlayerDead || !owner.PlayersToKill[i].isInsideFactory) { continue; } NavMesh.SamplePosition(((Component)owner.PlayersToKill[i]).transform.position, ref val2, 1f, base.agent.areaMask); NavMeshPath val3 = new NavMeshPath(); NavMesh.CalculatePath(base.position, ((NavMeshHit)(ref val2)).position, base.agent.areaMask, val3); if ((int)val3.status == 0) { float num2 = Vector3.Distance(base.position, val3.corners[0]); for (int j = 1; j < val3.corners.Length; j++) { num2 += Vector3.Distance(val3.corners[j - 1], val3.corners[j]); } if (num2 < num) { num = num2; val = owner.PlayersToKill[i]; } } } if (safeMode && (Object)(object)val == (Object)null) { return owner.PlayersToKill[0]; } return val; } private void TryToKill() { for (int i = 0; i < owner.PlayersToKill.Count; i++) { int num = Array.IndexOf(owner.PlayersScripts, owner.PlayersToKill[i]); if (owner.KillablePlayers[num] && !owner.IsStun) { Plugin.Logger.LogDebug((object)$"Player n°{num} is in range !"); owner.KillablePlayers[num] = false; KillPlayer(owner.PlayersToKill[i]); break; } } } private void KillPlayer(PlayerControllerB player) { Plugin.Logger.LogDebug((object)"Executing kill !"); base.agent.isStopped = true; owner.PlayersToKill.Remove(player); owner.DoAnimationClientRpc("Kill", (AnimatorControllerParameterType)9); owner.KillLocalPlayerClientRpc(Array.IndexOf(owner.PlayersScripts, player)); SetTarget(GetNextTarget()); } } internal class CabinetState_Wandering : CabinetState { private float minDistanceToNextDestination = 20f; private float waitTimeBetweenDestinations = 3f; private float lookDuration = 2f; private float proximityRadius = 40f; private float clearRadius = 50f; private Coroutine? coroutine; private bool isHiding; protected override float stateSpeed => 2f; public CabinetState_Wandering(TheCabinetAI owner) : base(owner) { } public override void Enter() { ((EnemyAI)owner).SwitchToBehaviourStateOnLocalClient(0); if (!owner.IsStun) { base.agent.speed = stateSpeed; } base.agent.stoppingDistance = 0f; ((EnemyAI)owner).targetPlayer = null; if (((NetworkBehaviour)owner).IsOwner) { FindNextDestination(); } } public override void Execute() { } public override void ExecuteSlow() { //IL_00e1: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < owner.LookingPlayers.Length; i++) { if (owner.LookingPlayers[i] && Time.time - owner.LookingPlayersTime[i] >= lookDuration) { ((EnemyAI)owner).targetPlayer = owner.PlayersScripts[i]; owner.ChangeStateServerRpc(State.Following); } } if (isHiding) { if (!CheckForNearbyPlayer(clearRadius)) { isHiding = false; owner.DoAnimationClientRpc("Hide", (AnimatorControllerParameterType)4, 0f); } } else if (CheckForNearbyPlayer(proximityRadius)) { base.agent.isStopped = true; isHiding = true; owner.DoAnimationClientRpc("Hide", (AnimatorControllerParameterType)4); } else if (coroutine == null) { if (Vector3.Distance(base.position, ((EnemyAI)owner).destination) <= 1f) { coroutine = ((MonoBehaviour)owner).StartCoroutine(WaitBeforeNewDestination()); } else if ((int)owner.GetPath(((EnemyAI)owner).destination).status != 0) { Plugin.Logger.LogInfo((object)"Destination is no longer reachable, getting a new one..."); coroutine = ((MonoBehaviour)owner).StartCoroutine(WaitBeforeNewDestination()); } else { base.agent.isStopped = false; } } } public override void Exit() { if (coroutine != null) { ((MonoBehaviour)owner).StopCoroutine(coroutine); } } private void FindNextDestination() { //IL_0035: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) List<GameObject> list = ((EnemyAI)owner).allAINodes.ToList(); if (list.Count == 0) { Plugin.Logger.LogError((object)"No AI nodes found !"); return; } for (int num = list.Count - 1; num >= 0; num--) { if (Vector3.Distance(base.position, list[num].transform.position) < minDistanceToNextDestination || (int)owner.GetPath(list[num].transform.position).status != 0) { list.RemoveAt(num); } } if (list.Count == 0) { list = ((EnemyAI)owner).allAINodes.ToList(); } ((EnemyAI)owner).SetDestinationToPosition(list[Random.Range(0, list.Count)].transform.position, false); } private IEnumerator WaitBeforeNewDestination() { ((EnemyAI)owner).moveTowardsDestination = false; yield return (object)new WaitForSeconds(waitTimeBetweenDestinations); FindNextDestination(); } private bool CheckForNearbyPlayer(float distance) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_005f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(base.position.x, 0f, base.position.z); PlayerControllerB[] playersScripts = owner.PlayersScripts; Vector3 val4 = default(Vector3); foreach (PlayerControllerB val2 in playersScripts) { Vector3 val3 = ((Component)val2).transform.position; ((Vector3)(ref val4))..ctor(val3.x, 0f, val3.z); if (Vector3.Distance(val4, val) <= distance) { return true; } } return false; } } public interface IState { float desiredSpeed { get; } void Enter(); void Execute(); void ExecuteSlow(); void Exit(); } [BepInPlugin("VectorV.TheCabinet", "TheCabinet", "1.11.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle? ModAssets; internal static PluginConfig BoundConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string path = "cabinetassets"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } EnemyType val = ModAssets.LoadAsset<EnemyType>("TheCabinet"); TerminalNode terminalNode = ModAssets.LoadAsset<TerminalNode>("TheCabinetTN"); TerminalKeyword terminalKeyword = ModAssets.LoadAsset<TerminalKeyword>("TheCabinetTK"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); RegisterEnemyWithConfig(PluginConfig.WeightDefault.Value, PluginConfig.WeightPerMoons.Value, val, terminalNode, terminalKeyword); Logger.LogInfo((object)"Plugin VectorV.TheCabinet is loaded!"); } private static void RegisterEnemyWithConfig(int configBaseRarity, string configMoonRarity, EnemyType enemy, TerminalNode terminalNode, TerminalKeyword terminalKeyword) { var (dictionary, dictionary2) = ConfigParsing(configBaseRarity, configMoonRarity); Enemies.RegisterEnemy(enemy, dictionary, dictionary2, terminalNode, terminalKeyword); } private static (Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) ConfigParsing(int configBaseRarity, string configMoonRarity) { //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) configMoonRarity += $",All:{configBaseRarity}"; Logger.LogMessage((object)("Registering using the following string :\n" + configMoonRarity)); Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>(); Dictionary<string, int> dictionary2 = new Dictionary<string, int>(); foreach (string item in from s in configMoonRarity.Split(',') select s.Trim()) { string[] array = (from s in item.Split(':') select s.Trim()).ToArray(); if (array.Length != 2) { continue; } string text = array[0].ToLowerInvariant(); if (!int.TryParse(array[1], out var result)) { continue; } if (text == "custom") { text = "modded"; } if (Enum.TryParse<LevelTypes>(text, ignoreCase: true, out LevelTypes result2)) { dictionary[result2] = result; Logger.LogDebug((object)$"Registered spawn rate for level type {result2} to {result}"); continue; } string value = text + "Level"; if (Enum.TryParse<LevelTypes>(value, ignoreCase: true, out result2)) { dictionary[result2] = result; Logger.LogDebug((object)$"Registered spawn rate for level type {result2} to {result}"); } else { dictionary2[text] = result; Logger.LogDebug((object)$"Registered spawn rate for custom level type {text} to {result}"); } } return (dictionary, dictionary2); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public class PluginConfig { public static ConfigEntry<int> WeightDefault; public static ConfigEntry<string> WeightPerMoons { get; private set; } public static ConfigEntry<float> WarningDuration { get; private set; } public static ConfigEntry<float> KillingStateSpeed { get; private set; } public static ConfigEntry<bool> DropItemsWhenAngry { get; private set; } public static ConfigEntry<float> MaxCarryWeight { get; private set; } public static ConfigEntry<bool> DecalsEnabled { get; private set; } public static ConfigEntry<int> ParticlesAmount { get; private set; } public PluginConfig(ConfigFile cfg) { WeightDefault = cfg.Bind<int>("Spawning", "Spawn weight by default", 5, "The spawn weight for The Cabinet for every Moon not specified in the setting below."); WeightPerMoons = cfg.Bind<string>("Spawning", "Spawn weight per Moons", "Experimentation:1,Assurance:0,Vow:7,Offense:0,March:8,Adamance:12,Rend:25,Dine:60,Titan:80,Embrion:40,Artifice:310,attenuation:1,retinue:8,volition:45,detritus:30,icebound:26,collateral:2,hydro:6,landslide:1,integrity:28,humidity:36,submersion:13,corrosion:2,vertigo:18,brutality:80,devastation:9,acidir:29,asteroid13:0,atlantica:0,berunah:17,calist:19,core:0,cubatres:31,demetrica:14,dreck:9,ducksteroid14:0,empra:56,etern:31,faith:19,filitrios:14,fissionc:20,gratar:0,hyve:0,hyx:20,infernis:0,junic:0,lecaro:0,motra:0,polarus:16,repress:18,roart:8,thalasso:0,trite:19,utril:11,wither:56", "The spawn weight for The Cabinet on a specific Moon.\nYou can specify any Vanilla or Modded Moon name."); WarningDuration = cfg.Bind<float>("Customization", "Warning duration", 1.5f, "The time it take for the Cabinet to get angry when looked at."); KillingStateSpeed = cfg.Bind<float>("Customization", "Killing state speed", 10f, "The movement speed of the Cabinet when angry."); DropItemsWhenAngry = cfg.Bind<bool>("Customization", "Drop items when angry", false, "Does the Cabinet drop all the items it is carrying when angry ?"); MaxCarryWeight = cfg.Bind<float>("Customization", "Max carry weight", 100f, "The maximum weight in pounds the Cabinet can carry."); DecalsEnabled = cfg.Bind<bool>("Optimization", "Decals enabled", true, "Do the blood particles spawn blood decals on collision ?\nDisable this if you experience lag spikes when the Cabinet kills someone."); ParticlesAmount = cfg.Bind<int>("Optimization", "Particles amount", 500, "The amount of blood particles emitted on kill.\nLower this if you experience lag spikes when the Cabinet kills someone."); ClearUnusedEntries(cfg); } private void ClearUnusedEntries(ConfigFile cfg) { PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null); dictionary.Clear(); cfg.Save(); } } public class StateMachine { private IState currentState; public IState CurrentState => currentState; public void ChangeState(IState newState) { currentState?.Exit(); currentState = newState; currentState.Enter(); } public void Update() { currentState?.Execute(); } public void DoAiInterval() { currentState?.ExecuteSlow(); } } public class TheCabinetAI : EnemyAI { [SerializeField] private Collider visibleCollider; [SerializeField] private Collider itemsCollider; [SerializeField] private Collider interactCollider; [SerializeField] private Collider scanCollider; [SerializeField] private Transform itemsParent; [SerializeField] private Transform deadBodyAnchor; [SerializeField] private Transform attackCapsulePoint; [SerializeField] private AudioSource warning1Source; [SerializeField] private AnimationCurve warning1Curve; [SerializeField] private AudioSource warning2Source; [SerializeField] private AnimationCurve warning2Curve; [SerializeField] private AudioSource warningDoorsSource; [SerializeField] private AudioSource handStepsSource; [SerializeField] private List<AudioClip> handStepsSounds = new List<AudioClip>(); [SerializeField] private List<AudioClip> angryHandStepsSounds = new List<AudioClip>(); [SerializeField] private List<AudioClip> openSounds = new List<AudioClip>(); [SerializeField] private List<AudioClip> hurtSounds = new List<AudioClip>(); [SerializeField] private List<AudioClip> hideSounds = new List<AudioClip>(); [SerializeField] private List<AudioClip> hideQuickSounds = new List<AudioClip>(); [SerializeField] private List<AudioClip> revealSounds = new List<AudioClip>(); [SerializeField] private AudioClip angrySound; [SerializeField] private AudioClip killSound; [SerializeField] private AudioClip deadSound; private Random syncedRandom; private StateMachine stateMachine; private PlayerControllerB[] playersScripts; private PlayerControllerB localPlayer; private Vector3 lastPosition; private int visionLayers; private bool isLocalPlayerLooking; private bool[] lookingPlayers; private float[] lookingPlayersTime; private bool[] killablePlayers; private Collider[] localAttackResult; private List<PlayerControllerB> playersToKill = new List<PlayerControllerB>(); private bool isHidden; private bool isStun; private bool isVulnerable; private List<GrabbableObject> carriedItems = new List<GrabbableObject>(); private float carriedWeight; private float annoyance; private float warningGauge; private DeadBodyInfo deadBody; public PlayerControllerB[] PlayersScripts => playersScripts; public PlayerControllerB LocalPlayer => localPlayer; public bool[] LookingPlayers => lookingPlayers; public float[] LookingPlayersTime => lookingPlayersTime; public bool[] KillablePlayers => killablePlayers; public List<PlayerControllerB> PlayersToKill => playersToKill; public bool IsHidden { get { return isHidden; } set { isHidden = value; } } public bool IsStun { get { return isStun; } set { isStun = value; } } public bool IsVulnerable { get { return isVulnerable; } set { isVulnerable = value; } } public override void Start() { ((EnemyAI)this).Start(); syncedRandom = new Random(StartOfRound.Instance.randomMapSeed); Plugin.Logger.LogDebug((object)("RANDOM SEED = " + StartOfRound.Instance.randomMapSeed)); playersScripts = StartOfRound.Instance.allPlayerScripts; localPlayer = GameNetworkManager.Instance.localPlayerController; visionLayers = (1 << LayerMask.NameToLayer("Room")) | (1 << LayerMask.NameToLayer("MiscLevelGeometry")); lookingPlayers = new bool[playersScripts.Length]; lookingPlayersTime = new float[playersScripts.Length]; killablePlayers = new bool[playersScripts.Length]; localAttackResult = (Collider[])(object)new Collider[playersScripts.Length * 2]; ToggleHandStepsSettings(angry: false); stateMachine = new StateMachine(); stateMachine.ChangeState(new CabinetState_Wandering(this)); ((MonoBehaviour)this).StartCoroutine(CheckChilds()); } public override void Update() { ((EnemyAI)this).Update(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } itemsCollider.enabled = isHidden; scanCollider.enabled = !isHidden; carriedWeight = GetCarriedWeight(); PlayWarningAudio(); if (!isStun && base.stunNormalizedTimer > 0f) { isStun = true; base.agent.speed = 0f; } else if (isStun && base.stunNormalizedTimer <= 0f) { base.agent.speed = stateMachine.CurrentState.desiredSpeed; isStun = false; } if (annoyance > 0f) { annoyance -= Time.deltaTime; if (annoyance < 0f) { annoyance = 0f; } } CheckIfLookedAt(); stateMachine.Update(); } public void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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) Vector3 val = ((Component)this).transform.position - lastPosition; float num = ((Vector3)(ref val)).magnitude / Time.deltaTime; lastPosition = ((Component)this).transform.position; base.creatureAnimator.SetFloat("Velocity", num); } public override void DoAIInterval() { if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { float num = PluginConfig.MaxCarryWeight.Value; if (num < 0f) { num = float.MaxValue; } if (((NetworkBehaviour)this).IsOwner && !IsHidden && carriedWeight > num) { DropItemsClientRpc(); } stateMachine.DoAiInterval(); ((EnemyAI)this).DoAIInterval(); } } [ServerRpc] public void ChangeStateServerRpc(State state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3842756842u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<State>(ref state, default(ForEnums)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3842756842u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.Logger.LogDebug((object)$"Server changing state to {state}"); ChangeStateClientRpc(state); } } [ClientRpc] private void ChangeStateClientRpc(State state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3716952094u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<State>(ref state, default(ForEnums)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3716952094u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.Logger.LogDebug((object)$"Client changing state to {state}"); switch (state) { case State.Wandering: stateMachine.ChangeState(new CabinetState_Wandering(this)); break; case State.Following: stateMachine.ChangeState(new CabinetState_Following(this)); break; case State.Killing: stateMachine.ChangeState(new CabinetState_Killing(this)); break; default: Plugin.Logger.LogError((object)$"Unknow state \"{state}\""); break; } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (base.isEnemyDead) { return; } PlayAudio("hit"); if (IsHidden) { annoyance += 35f; if (annoyance < 100f) { return; } } if (force > 3) { force = 3; } if (IsVulnerable) { force *= 3; } base.enemyHP -= force; isHidden = false; if (base.enemyHP <= 0) { base.creatureSFX.Stop(); base.creatureVoice.Stop(); ((EnemyAI)this).KillEnemyOnOwnerClient(false); return; } PlayAudio("hurt"); if (((NetworkBehaviour)this).IsOwner && (Object)(object)playerWhoHit != (Object)null) { if (!playersToKill.Contains(playerWhoHit)) { playersToKill.Add(playerWhoHit); } if (stateMachine.CurrentState.GetType() != typeof(CabinetState_Killing)) { ChangeStateServerRpc(State.Killing); } } } public override void KillEnemy(bool destroy = false) { itemsCollider.enabled = false; interactCollider.enabled = false; DropItemsClientRpc(); ((EnemyAI)this).KillEnemy(destroy); } [ClientRpc] public void DoAnimationClientRpc(string animationName, AnimatorControllerParameterType type = 9, float value = 1f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected I4, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3597320277u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe<AnimatorControllerParameterType>(ref type, default(ForEnums)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3597320277u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.Logger.LogDebug((object)$"ANIM \"{animationName}\" ({type}) = {value}"); switch (type - 1) { default: if ((int)type != 9) { break; } base.creatureAnimator.SetTrigger(animationName); return; case 0: base.creatureAnimator.SetFloat(animationName, value); return; case 2: base.creatureAnimator.SetInteger(animationName, Mathf.RoundToInt(value)); return; case 3: base.creatureAnimator.SetBool(animationName, value == 1f); return; case 1: break; } Plugin.Logger.LogError((object)"Unknown AnimatorControllerParameterType !"); } public NavMeshPath GetPath(Vector3 destination, Vector3? origin = null) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!origin.HasValue) { origin = ((Component)this).transform.position; } NavMeshHit val = default(NavMeshHit); NavMesh.SamplePosition(destination, ref val, 1f, base.agent.areaMask); NavMeshPath val2 = new NavMeshPath(); NavMesh.CalculatePath(origin.Value, ((NavMeshHit)(ref val)).position, base.agent.areaMask, val2); return val2; } public void CheckIfLookedAt() { //IL_0014: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) bool flag; if (!HasLineOfSight(localPlayer) || Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position) > 30f) { flag = false; } else { Bounds bounds = visibleCollider.bounds; Plane[] array = GeometryUtility.CalculateFrustumPlanes(localPlayer.gameplayCamera); flag = (GeometryUtility.TestPlanesAABB(array, bounds) ? true : false); } if (flag != isLocalPlayerLooking) { isLocalPlayerLooking = flag; NotifyLookChangeServerRpc(Array.IndexOf(playersScripts, localPlayer), isLocalPlayerLooking); } } public bool HasLineOfSight(PlayerControllerB player) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); return !Physics.Linecast(((Component)player.playerEye).transform.position, ((Component)visibleCollider).transform.position, ref val, visionLayers, (QueryTriggerInteraction)1); } [ServerRpc(RequireOwnership = false)] private void NotifyLookChangeServerRpc(int playerIndex, bool isLooking) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_008a: 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) //IL_00a4: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1517280198u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isLooking, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1517280198u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; lookingPlayers[playerIndex] = isLooking; lookingPlayersTime[playerIndex] = Time.time; } } } public bool IsLookedAt() { bool[] array = lookingPlayers; for (int i = 0; i < array.Length; i++) { if (array[i]) { return true; } } return false; } private IEnumerator CheckChilds() { while (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { yield return (object)new WaitForSeconds(0.1f); for (int num = ((Component)this).transform.childCount - 1; num >= 0; num--) { GrabbableObject component = ((Component)((Component)this).transform.GetChild(num)).GetComponent<GrabbableObject>(); if ((Object)(object)component != (Object)null) { if (((object)component).GetType() == typeof(CaveDwellerPhysicsProp)) { Plugin.Logger.LogWarning((object)"Do not the baby !"); ((Component)component).transform.SetParent((Transform)null, true); } else { ((Component)component).transform.parent = itemsParent; carriedItems.Add(component); } } } for (int num2 = carriedItems.Count - 1; num2 >= 0; num2--) { if (carriedItems[num2].isHeld) { carriedItems.RemoveAt(num2); } else if (((object)carriedItems[num2]).GetType() == typeof(FlashlightItem)) { ((Component)carriedItems[num2]).transform.rotation = ((Component)this).transform.rotation; ((Component)carriedItems[num2]).transform.Rotate(0f, 90f, 90f, (Space)1); } } } } private float GetCarriedWeight() { float num = 0f; foreach (GrabbableObject carriedItem in carriedItems) { num += (carriedItem.itemProperties.weight - 1f) * 105f; } return num; } [ClientRpc] public void DropItemsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1836630204u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1836630204u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; for (int num = carriedItems.Count - 1; num >= 0; num--) { GrabbableObject val3 = carriedItems[num]; carriedItems.RemoveAt(num); val3.parentObject = null; val3.heldByPlayerOnServer = false; ((Component)val3).transform.SetParent(StartOfRound.Instance.propsContainer, true); val3.EnablePhysics(true); val3.EnableItemMeshes(true); ((Component)val3).transform.localScale = val3.originalScale; val3.isHeld = false; val3.isPocketed = false; val3.startFallingPosition = ((Component)val3).transform.parent.InverseTransformPoint(((Component)val3).transform.position); val3.FallToGround(true, false, default(Vector3)); val3.fallTime = Random.Range(-0.3f, 0.05f); ((MonoBehaviour)this).StartCoroutine(PlayDropSFX(val3)); } } } private IEnumerator PlayDropSFX(GrabbableObject item) { GrabbableObject item2 = item; yield return (object)new WaitUntil((Func<bool>)(() => item2.hasHitGround)); item2.PlayDropSFX(); } public bool IsLocalPlayerAttackable() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_002b: Unknown result type (might be due to invalid IL or missing references) int num = Physics.OverlapCapsuleNonAlloc(attackCapsulePoint.position, attackCapsulePoint.position + attackCapsulePoint.up * 2f, 1f, localAttackResult, LayerMask.GetMask(new string[1] { "Player" })); for (int i = 0; i < num; i++) { PlayerControllerB component = ((Component)localAttackResult[i]).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && ((NetworkBehaviour)((Component)localAttackResult[i]).GetComponent<PlayerControllerB>()).IsOwner) { return true; } } return false; } [ServerRpc(RequireOwnership = false)] public void NotifyKillableServerRpc(int playerIndex, bool killable) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_008a: 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) //IL_00a4: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3549461775u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref killable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3549461775u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; killablePlayers[playerIndex] = killable; } } } [ClientRpc] public void KillLocalPlayerClientRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2709832295u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2709832295u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(KillPlayer(playerIndex)); } } } private IEnumerator KillPlayer(int playerId) { PlayerControllerB killPlayer = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)killPlayer) { killPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)6, 0, default(Vector3), false); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)killPlayer.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 2f)); if ((Object)(object)killPlayer.deadBody == (Object)null) { Plugin.Logger.LogError((object)"Dead body was not found !"); yield break; } deadBody = killPlayer.deadBody; deadBody.attachedTo = deadBodyAnchor; deadBody.attachedLimb = killPlayer.deadBody.bodyParts[5]; deadBody.matchPositionExactly = true; } public void EatBody() { deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.matchPositionExactly = false; ((Component)deadBody).gameObject.SetActive(false); } public void ToggleHandStepsSettings(bool angry) { handStepsSource.volume = (angry ? 1f : 0.3f); handStepsSource.minDistance = (angry ? 5f : 1f); handStepsSource.maxDistance = (angry ? 40f : 20f); } public void PlayWarningAudio() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Angry")) { AudioSource obj = warning1Source; obj.volume -= 0.01f; AudioSource obj2 = warning2Source; obj2.volume -= 0.01f; AudioSource obj3 = warningDoorsSource; obj3.volume -= 0.01f; return; } currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); bool flag = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Warning"); if (flag && (!warning1Source.isPlaying || !warning2Source.isPlaying)) { base.creatureSFX.Stop(); base.creatureVoice.Stop(); warning1Source.Stop(); warning2Source.Stop(); warningDoorsSource.Stop(); warning1Source.Play(); warning2Source.Play(); warningDoorsSource.Play(); } else if (!flag && (warning1Source.isPlaying || warning2Source.isPlaying)) { warning1Source.Stop(); warning2Source.Stop(); warningDoorsSource.Stop(); } float num = 1.8f; warning1Source.volume = warning1Curve.Evaluate(warningGauge); warning1Source.pitch = 1f + warningGauge * (num - 1f); warning2Source.volume = warning2Curve.Evaluate(warningGauge); warning2Source.pitch = 1f + warningGauge * (num - 1f); } [ClientRpc] public void SetWarningGaugeClientRpc(float value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(723951595u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 723951595u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; warningGauge = value; } } } public void OpenCabinet(PlayerControllerB player) { OpenCabinetServerRpc(Array.IndexOf(playersScripts, player)); } [ServerRpc(RequireOwnership = false)] private void OpenCabinetServerRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4137568779u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4137568779u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; annoyance += 25f; if (annoyance >= 100f) { if (!playersToKill.Contains(playersScripts[playerIndex])) { playersToKill.Add(playersScripts[playerIndex]); } ChangeStateServerRpc(State.Killing); } else { DoAnimationClientRpc("Interact", (AnimatorControllerParameterType)9); } } public IEnumerator DelayedExecution<T>(Action<T> method, T param, float delay) { yield return (object)new WaitForSeconds(delay); method?.Invoke(param); } public void PlayAudio(string audio) { switch (audio) { case "angry": base.creatureVoice.Stop(); base.creatureVoice.clip = angrySound; base.creatureVoice.Play(); break; case "die": base.creatureSFX.PlayOneShot(deadSound); break; case "handStep": handStepsSource.pitch = Random.Range(0.9f, 1.1f); handStepsSource.PlayOneShot(handStepsSounds[Random.Range(0, handStepsSounds.Count - 1)]); break; case "handStepAngry": handStepsSource.pitch = Random.Range(0.9f, 1.1f); handStepsSource.PlayOneShot(angryHandStepsSounds[Random.Range(0, angryHandStepsSounds.Count - 1)]); break; case "hide": { base.creatureVoice.Stop(); base.creatureSFX.Stop(); int index = syncedRandom.Next(hideSounds.Count); base.creatureSFX.clip = hideSounds[index]; base.creatureSFX.Play(); break; } case "hideQuick": { base.creatureVoice.Stop(); base.creatureSFX.Stop(); int index = syncedRandom.Next(hideQuickSounds.Count); base.creatureSFX.clip = hideQuickSounds[index]; base.creatureSFX.Play(); break; } case "hit": base.creatureSFX.PlayOneShot(base.enemyType.hitBodySFX); WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, base.enemyType.hitBodySFX, 1f); break; case "hurt": { int index = syncedRandom.Next(hurtSounds.Count); base.creatureVoice.PlayOneShot(hurtSounds[index]); break; } case "kill": base.creatureVoice.Stop(); base.creatureVoice.clip = killSound; base.creatureVoice.Play(); break; case "open": { int index = syncedRandom.Next(openSounds.Count); base.creatureVoice.PlayOneShot(openSounds[index]); break; } case "reveal": { base.creatureVoice.Stop(); base.creatureSFX.Stop(); int index = syncedRandom.Next(revealSounds.Count); base.creatureSFX.clip = revealSounds[index]; base.creatureSFX.Play(); break; } default: Plugin.Logger.LogError((object)("\"" + audio + "\" is not a valid audio !")); break; } } public void ApplyFearToPlayers() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] array = playersScripts; foreach (PlayerControllerB val in array) { if (!val.isInsideFactory) { continue; } float num = 0f; if ((Object)(object)val == (Object)(object)base.targetPlayer) { num = 1f; } else if (playersToKill.Contains(val)) { num = 0.75f; } else { if (!(Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) <= 15f)) { continue; } num = 0.3f; } ClientRpcParams val2 = default(ClientRpcParams); val2.Send = new ClientRpcSendParams { TargetClientIds = new List<ulong> { val.actualClientId } }; ClientRpcParams clientRpcParams = val2; SetFearLevelClientRpc(num, clientRpcParams); } } [ClientRpc] private void SetFearLevelClientRpc(float amount, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2078235715u, clientRpcParams, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref amount, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2078235715u, clientRpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; localPlayer.JumpToFearLevel(amount, true); } } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3842756842u, new RpcReceiveHandler(__rpc_handler_3842756842), "ChangeStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(3716952094u, new RpcReceiveHandler(__rpc_handler_3716952094), "ChangeStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(3597320277u, new RpcReceiveHandler(__rpc_handler_3597320277), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(1517280198u, new RpcReceiveHandler(__rpc_handler_1517280198), "NotifyLookChangeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1836630204u, new RpcReceiveHandler(__rpc_handler_1836630204), "DropItemsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3549461775u, new RpcReceiveHandler(__rpc_handler_3549461775), "NotifyKillableServerRpc"); ((NetworkBehaviour)this).__registerRpc(2709832295u, new RpcReceiveHandler(__rpc_handler_2709832295), "KillLocalPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(723951595u, new RpcReceiveHandler(__rpc_handler_723951595), "SetWarningGaugeClientRpc"); ((NetworkBehaviour)this).__registerRpc(4137568779u, new RpcReceiveHandler(__rpc_handler_4137568779), "OpenCabinetServerRpc"); ((NetworkBehaviour)this).__registerRpc(2078235715u, new RpcReceiveHandler(__rpc_handler_2078235715), "SetFearLevelClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3842756842(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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) //IL_00ab: 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_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { State state = default(State); ((FastBufferReader)(ref reader)).ReadValueSafe<State>(ref state, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).ChangeStateServerRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3716952094(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { State state = default(State); ((FastBufferReader)(ref reader)).ReadValueSafe<State>(ref state, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).ChangeStateClientRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3597320277(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } AnimatorControllerParameterType type = default(AnimatorControllerParameterType); ((FastBufferReader)(ref reader)).ReadValueSafe<AnimatorControllerParameterType>(ref type, default(ForEnums)); float value = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).DoAnimationClientRpc(animationName, type, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1517280198(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); bool isLooking = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isLooking, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).NotifyLookChangeServerRpc(playerIndex, isLooking); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1836630204(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).DropItemsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3549461775(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); bool killable = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref killable, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).NotifyKillableServerRpc(playerIndex, killable); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2709832295(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).KillLocalPlayerClientRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_723951595(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float warningGaugeClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref warningGaugeClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).SetWarningGaugeClientRpc(warningGaugeClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4137568779(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).OpenCabinetServerRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2078235715(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float amount = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref amount, default(ForPrimitives)); ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((TheCabinetAI)(object)target).SetFearLevelClientRpc(amount, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TheCabinetAI"; } } public enum State { Wandering, Following, Killing } public static class PluginInfo { public const string PLUGIN_GUID = "VectorV.TheCabinet"; public const string PLUGIN_NAME = "TheCabinet"; public const string PLUGIN_VERSION = "1.11.0"; } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace VectorV.TheCabinet.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }