#define DEBUG using 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.Cryptography; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CharlottesLabyrinth; using CharlottesLabyrinth.NetcodePatcher; using CodeRebirth.src.MiscScripts; using Dawn.Utils; using ExampleEnemy; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using WeatherRegistry; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CharlottesLabyrinth")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.4.0")] [assembly: AssemblyInformationalVersion("1.0.4")] [assembly: AssemblyProduct("CharlottesLabyrinth")] [assembly: AssemblyTitle("CharlottesLabyrinth")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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; } } } public class KyokosSpear : GrabbableObject { public int shovelHitForce = 1; public bool attacking; public bool isHoldingButton; private RaycastHit rayHit; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByShovel; private List objectsHitByShovelList = new List(); public AudioClip reelUp; public AudioClip swing; public AudioClip[] hitSFX; public AudioSource shovelAudio; private PlayerControllerB previousPlayerHeldBy; public Animator spearAnimator; private int shovelMask = 1084754248; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!attacking && buttonDown) { attacking = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpShovel()); } } private IEnumerator reelUpShovel() { spearAnimator.SetTrigger("AttackNormal"); base.playerHeldBy.playerBodyAnimator.SetBool("crouching", false); base.playerHeldBy.playerBodyAnimator.SetTrigger("SwitchHoldAnimationTwoHanded"); base.playerHeldBy.playerBodyAnimator.SetBool("HoldPatcherTool", true); base.playerHeldBy.playerBodyAnimator.SetBool("PullingCameraRight", true); base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.SetBool("HoldPatcherTool", false); base.playerHeldBy.playerBodyAnimator.SetBool("PullingCameraRight", false); SwingShovel(!base.isHeld); yield return (object)new WaitForSeconds(0.5f); yield return (object)new WaitForEndOfFrame(); HitShovel(!base.isHeld); yield return (object)new WaitForSeconds(0.5f); attacking = false; reelingUpCoroutine = null; } [ServerRpc] public void ReelUpSFXServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2393832603u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2393832603u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ReelUpSFXClientRpc(); } } [ClientRpc] public void ReelUpSFXClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2174232780u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2174232780u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { shovelAudio.PlayOneShot(reelUp); } } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public void SwingShovel(bool cancel = false) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!cancel) { shovelAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitShovel(bool cancel = false) { //IL_0063: 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_0082: 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_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_01fc: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogError((object)"Previousplayerheldby is null on this client when HitShovel is called."); return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; objectsHitByShovel = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, shovelMask, (QueryTriggerInteraction)2); objectsHitByShovelList = objectsHitByShovel.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); List list = new List(); IHittable val2 = default(IHittable); for (int num2 = 0; num2 < objectsHitByShovelList.Count; num2++) { RaycastHit val = objectsHitByShovelList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByShovelList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByShovelList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByShovelList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByShovelList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; RaycastHit val3 = objectsHitByShovelList[num2]; if (Physics.Linecast(position, ((RaycastHit)(ref val3)).point, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; try { val = objectsHitByShovelList[num2]; EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { if (!((Object)(object)component.mainScript == (Object)null) && !list.Contains(component.mainScript)) { goto IL_035f; } continue; } val = objectsHitByShovelList[num2]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { goto IL_035f; } if (!flag3) { flag3 = true; goto IL_035f; } goto end_IL_02c3; IL_035f: bool flag4 = val2.Hit(shovelHitForce, forward, previousPlayerHeldBy, true, 1); if (flag4 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag4; } end_IL_02c3:; } catch (Exception arg) { Debug.Log((object)$"Exception caught when hitting object with shovel from player #{previousPlayerHeldBy.playerClientId}: {arg}"); } continue; } } val = objectsHitByShovelList[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByShovelList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; break; } } } } if (flag) { RoundManager.PlayRandomClip(shovelAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { shovelAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(shovelAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } HitShovelServerRpc(num); } } [ServerRpc] public void HitShovelServerRpc(int hitSurfaceID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(963831900u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, hitSurfaceID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 963831900u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitShovelClientRpc(hitSurfaceID); } } [ClientRpc] public void HitShovelClientRpc(int hitSurfaceID) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(54649613u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, hitSurfaceID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 54649613u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { RoundManager.PlayRandomClip(shovelAudio, hitSFX, true, 1f, 0, 1000); if (hitSurfaceID != -1) { HitSurfaceWithShovel(hitSurfaceID); } } } private void HitSurfaceWithShovel(int hitSurfaceID) { shovelAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(shovelAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } protected override void __initializeVariables() { ((GrabbableObject)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 ((NetworkBehaviour)this).__registerRpc(2393832603u, new RpcReceiveHandler(__rpc_handler_2393832603), "ReelUpSFXServerRpc"); ((NetworkBehaviour)this).__registerRpc(2174232780u, new RpcReceiveHandler(__rpc_handler_2174232780), "ReelUpSFXClientRpc"); ((NetworkBehaviour)this).__registerRpc(963831900u, new RpcReceiveHandler(__rpc_handler_963831900), "HitShovelServerRpc"); ((NetworkBehaviour)this).__registerRpc(54649613u, new RpcReceiveHandler(__rpc_handler_54649613), "HitShovelClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2393832603(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((KyokosSpear)(object)target).ReelUpSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2174232780(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; ((KyokosSpear)(object)target).ReelUpSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_963831900(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_0070: 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_009d: 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 { int hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((KyokosSpear)(object)target).HitShovelServerRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_54649613(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 hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((KyokosSpear)(object)target).HitShovelClientRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "KyokosSpear"; } } public class LabyrinthController : NetworkBehaviour { public WanderingCharlotteOffset currentWanderingCharlotteOffset; public Animator wanderingCharlotteAnimator; public Animator outsideWanderingCharlotteAnimator; public AudioSource wanderingCharlotteAudioSource; public AudioSource outsideWanderingCharlotteAudioSource; public List wanderingCharlotteOffsets = new List(); public List wanderingOutsideCharlotteOffsets = new List(); public List objectsToEnableWhenCollapse = new List(); public List labyrinthLights = new List(); public List labyrinthVolumes = new List(); public Transform qbSpawnPosition; public EnemyType qbEnemyType; public bool hasDisabledCollapseObjects = false; public bool isCollapsing = false; public VolumeProfile collapsingProfile; private PlayerControllerB player; [SerializeField] private AudioSource musicSource1; [SerializeField] private AudioSource musicSource2; [SerializeField] private AudioClip interiorCollapsingSong; [SerializeField] private AudioClip moonCollapsingSong; [SerializeField] private AudioClip charlotteRumbleClip; [SerializeField] private AudioClip charlotteBreakWallEnterClip; [SerializeField] private AudioClip charlotteBreakWallExitClip; [SerializeField] private AudioClip charlotteEmergeClip; [SerializeField] private float fadeSourceSpeed; [SerializeField] private float songMaxVolume; private bool isPlayingSong1; private Coroutine fadeSourceCoroutine; private RoundManager roundManager; private float timeSinceCollapseStarted = 0f; private float currWanderTime = 0f; private float timeUntilWanderAgain = 5f; public static LabyrinthController Instance { get; private set; } private void Awake() { Instance = this; } private void Start() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) roundManager = Object.FindObjectOfType(); if (((NetworkBehaviour)this).IsOwner) { RoundManager.Instance.SpawnEnemyGameObject(qbSpawnPosition.position, 0f, 1, qbEnemyType); } player = GameNetworkManager.Instance.localPlayerController; if (!Plugin.MusicEnabled.Value) { musicSource1.Stop(); musicSource2.Stop(); } musicSource1.volume = Plugin.MusicMaxVolume.Value; musicSource2.volume = Plugin.MusicMaxVolume.Value; } private void Update() { currWanderTime += Time.deltaTime; if (isCollapsing && Plugin.MusicEnabled.Value) { CheckIfStopSource(); } if (isCollapsing) { WanderingCharlotte(); } if (isCollapsing) { timeSinceCollapseStarted += Time.deltaTime; } } private void WanderingCharlotte() { if (currWanderTime > timeUntilWanderAgain) { CharlotteChooseServerRpc(); } } [ServerRpc] public void CharlotteChooseServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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)base.__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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2974428696u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2974428696u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; int num = 0; if (!StartOfRound.Instance.allPlayersDead) { num = ChooseRandomPlayer(); } if (wanderingOutsideCharlotteOffsets.Count > 0 && timeSinceCollapseStarted > 7f && (AllPlayersOutside() || !StartOfRound.Instance.allPlayerScripts[num].isInsideFactory)) { int rand = Random.Range(0, wanderingOutsideCharlotteOffsets.Count); CharlotteWanderOutsideClientRpc(rand); return; } int num2 = 0; WanderingCharlotteOffset wanderingCharlotteOffset = null; foreach (WanderingCharlotteOffset wanderingCharlotteOffset2 in wanderingCharlotteOffsets) { if (Vector3.Distance(wanderingCharlotteOffset2.groundParticleSystem.transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.position) < 20f) { wanderingCharlotteOffset = wanderingCharlotteOffset2; break; } num2++; } if ((Object)(object)wanderingCharlotteOffset == (Object)null) { num2 = Random.Range(0, wanderingCharlotteOffsets.Count); } CharlotteChooseClientRpc(num2); } private bool AllPlayersOutside() { bool result = true; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerDead && val.isInsideFactory) { result = false; } } return result; } private int ChooseRandomPlayer() { int num = 0; bool flag = false; while (!flag && !StartOfRound.Instance.allPlayersDead) { num = Random.Range(0, StartOfRound.Instance.allPlayerScripts.Count()); if (!StartOfRound.Instance.allPlayerScripts[num].isPlayerDead && StartOfRound.Instance.allPlayerScripts[num].isPlayerControlled) { flag = true; } } return num; } [ClientRpc] public void CharlotteWanderOutsideClientRpc(int rand) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1363687108u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, rand); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1363687108u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; currWanderTime = -3f; currentWanderingCharlotteOffset = wanderingOutsideCharlotteOffsets[rand]; ((MonoBehaviour)this).StartCoroutine(CharlotteWanderOutsideCoroutine()); } } } [ClientRpc] public void CharlotteChooseClientRpc(int rand) { //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) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2340899945u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, rand); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2340899945u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; currWanderTime = 0f; currentWanderingCharlotteOffset = wanderingCharlotteOffsets[rand]; ((Component)wanderingCharlotteAnimator).transform.position = ((Component)currentWanderingCharlotteOffset).transform.position; ((Component)wanderingCharlotteAnimator).transform.rotation = ((Component)currentWanderingCharlotteOffset).transform.rotation; ((MonoBehaviour)this).StartCoroutine(CharlotteWanderCoroutine()); } } } public IEnumerator CharlotteWanderCoroutine() { if (Vector3.Distance(currentWanderingCharlotteOffset.groundParticleSystem.transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 30f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } ParticleSystem groundParticleSystem = currentWanderingCharlotteOffset.groundParticleSystem.GetComponent(); ParticleSystem entrancePointParticleSystem1 = currentWanderingCharlotteOffset.entrancePointParticleSystem1.GetComponent(); ParticleSystem entrancePointParticleSystem2 = currentWanderingCharlotteOffset.entrancePointParticleSystem2.GetComponent(); ParticleSystem entrancePointParticleSystem3 = currentWanderingCharlotteOffset.entrancePointParticleSystem3.GetComponent(); ParticleSystem exitPointParticleSystem = currentWanderingCharlotteOffset.exitPointParticleSystem.GetComponent(); groundParticleSystem.Play(); entrancePointParticleSystem1.Play(); currentWanderingCharlotteOffset.PlaySoundAtEntrance(charlotteRumbleClip); yield return (object)new WaitForSeconds(1.5f); wanderingCharlotteAnimator.SetTrigger(currentWanderingCharlotteOffset.stateType.ToString()); yield return (object)new WaitForSeconds(0.2f); currentWanderingCharlotteOffset.PlaySoundAtEntrance(charlotteBreakWallEnterClip); wanderingCharlotteAudioSource.PlayOneShot(charlotteEmergeClip); if (Vector3.Distance(currentWanderingCharlotteOffset.groundParticleSystem.transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 20f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } currentWanderingCharlotteOffset.entrancePointDecal.SetActive(true); entrancePointParticleSystem2.Play(); entrancePointParticleSystem3.Play(); yield return (object)new WaitForSeconds(0.3f); currentWanderingCharlotteOffset.PlaySoundAtExit(charlotteBreakWallExitClip); exitPointParticleSystem.Play(); currentWanderingCharlotteOffset.exitPointDecal.SetActive(true); } public IEnumerator CharlotteWanderOutsideCoroutine() { if (Vector3.Distance(currentWanderingCharlotteOffset.groundParticleSystem.transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 50f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } ParticleSystem groundParticleSystem = currentWanderingCharlotteOffset.groundParticleSystem.GetComponent(); ParticleSystem entrancePointParticleSystem1 = currentWanderingCharlotteOffset.entrancePointParticleSystem1.GetComponent(); ParticleSystem entrancePointParticleSystem2 = currentWanderingCharlotteOffset.entrancePointParticleSystem2.GetComponent(); ParticleSystem entrancePointParticleSystem3 = currentWanderingCharlotteOffset.entrancePointParticleSystem3.GetComponent(); ParticleSystem exitPointParticleSystem = currentWanderingCharlotteOffset.exitPointParticleSystem.GetComponent(); groundParticleSystem.Play(); entrancePointParticleSystem1.Play(); currentWanderingCharlotteOffset.PlaySoundAtEntrance(charlotteRumbleClip); yield return (object)new WaitForSeconds(1.5f); outsideWanderingCharlotteAnimator.SetTrigger(currentWanderingCharlotteOffset.stateType.ToString()); yield return (object)new WaitForSeconds(0.2f); currentWanderingCharlotteOffset.PlaySoundAtEntrance(charlotteBreakWallEnterClip); outsideWanderingCharlotteAudioSource.PlayOneShot(charlotteEmergeClip); if (Vector3.Distance(currentWanderingCharlotteOffset.groundParticleSystem.transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 50f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } currentWanderingCharlotteOffset.entrancePointDecal.SetActive(true); entrancePointParticleSystem2.Play(); entrancePointParticleSystem3.Play(); yield return (object)new WaitForSeconds(0.3f); currentWanderingCharlotteOffset.PlaySoundAtExit(charlotteBreakWallExitClip); exitPointParticleSystem.Play(); currentWanderingCharlotteOffset.exitPointDecal.SetActive(true); } private void CheckIfStopSource() { if (player.isPlayerDead && (Object)(object)player.spectatedPlayerScript != (Object)null) { if (player.spectatedPlayerScript.isInsideFactory && !isPlayingSong1) { ChangeSong(interiorCollapsingSong); } else if (!player.spectatedPlayerScript.isInsideFactory && isPlayingSong1) { ChangeSong(moonCollapsingSong); } } else if (player.isInsideFactory && !isPlayingSong1) { ChangeSong(interiorCollapsingSong); } else if (!player.isInsideFactory && isPlayingSong1) { ChangeSong(moonCollapsingSong); } } [ServerRpc(RequireOwnership = false)] public void StartCollapseLabyrinthServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(689911344u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 689911344u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartCollapseLabyrinthClientRpc(); } } } [ClientRpc] public void StartCollapseLabyrinthClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2405009467u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2405009467u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!isCollapsing) { ((MonoBehaviour)this).StartCoroutine(LabyrinthCollapseCoroutine()); } } } private IEnumerator LabyrinthCollapseCoroutine() { if (((NetworkBehaviour)this).IsServer && Random.Range(0, 100) < 70 && RoundManager.Instance.minEnemiesToSpawn < 2) { RoundManager.Instance.minEnemiesToSpawn = 2; } yield return (object)new WaitForSeconds(1f); if (((NetworkBehaviour)this).IsServer) { roundManager.FlickerLights(false, false); } yield return (object)new WaitForSeconds(0.5f); foreach (GameObject item in objectsToEnableWhenCollapse) { item.SetActive(true); } yield return (object)new WaitForSeconds(1f); if (((NetworkBehaviour)this).IsServer) { roundManager.SwitchPower(false); } yield return (object)new WaitForSeconds(1f); HUDManager.Instance.RadiationWarningHUD(); isCollapsing = true; if (Plugin.MusicEnabled.Value) { if (player.isInsideFactory) { ChangeSong(interiorCollapsingSong); } else if (!player.isInsideFactory) { ChangeSong(moonCollapsingSong); } } if (((NetworkBehaviour)this).IsServer) { roundManager.SwitchPower(true); } yield return (object)new WaitForSeconds(0.5f); foreach (EnableWhenCollapse light in labyrinthLights) { light.LightGoBrrrr(); } foreach (Volume volume in labyrinthVolumes) { volume.profile = collapsingProfile; } } public void ChangeSong(AudioClip newSong) { if (fadeSourceCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(fadeSourceCoroutine); } fadeSourceCoroutine = ((MonoBehaviour)this).StartCoroutine(FadeSource(newSong, 0f)); isPlayingSong1 = !isPlayingSong1; } private IEnumerator FadeSource(AudioClip newSong, float delayBeforeSwitching) { float timeToFade = fadeSourceSpeed + delayBeforeSwitching; float timeElapsed = 0f; if (isPlayingSong1) { musicSource2.clip = newSong; musicSource2.Play(); while (timeElapsed < timeToFade) { musicSource2.volume = Mathf.Lerp(0f, Plugin.MusicMaxVolume.Value, timeElapsed / timeToFade); musicSource1.volume = Mathf.Lerp(Plugin.MusicMaxVolume.Value, 0f, timeElapsed / timeToFade); timeElapsed += Time.deltaTime; yield return null; } musicSource2.volume = Plugin.MusicMaxVolume.Value; musicSource1.volume = 0f; } else { musicSource1.clip = newSong; musicSource1.Play(); while (timeElapsed < timeToFade) { musicSource2.volume = Mathf.Lerp(Plugin.MusicMaxVolume.Value, 0f, timeElapsed / timeToFade); musicSource1.volume = Mathf.Lerp(0f, Plugin.MusicMaxVolume.Value, timeElapsed / timeToFade); timeElapsed += Time.deltaTime; yield return null; } musicSource2.volume = 0f; musicSource1.volume = Plugin.MusicMaxVolume.Value; } } protected override void __initializeVariables() { ((NetworkBehaviour)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 ((NetworkBehaviour)this).__registerRpc(2974428696u, new RpcReceiveHandler(__rpc_handler_2974428696), "CharlotteChooseServerRpc"); ((NetworkBehaviour)this).__registerRpc(1363687108u, new RpcReceiveHandler(__rpc_handler_1363687108), "CharlotteWanderOutsideClientRpc"); ((NetworkBehaviour)this).__registerRpc(2340899945u, new RpcReceiveHandler(__rpc_handler_2340899945), "CharlotteChooseClientRpc"); ((NetworkBehaviour)this).__registerRpc(689911344u, new RpcReceiveHandler(__rpc_handler_689911344), "StartCollapseLabyrinthServerRpc"); ((NetworkBehaviour)this).__registerRpc(2405009467u, new RpcReceiveHandler(__rpc_handler_2405009467), "StartCollapseLabyrinthClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2974428696(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((LabyrinthController)(object)target).CharlotteChooseServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1363687108(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 rand = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref rand); target.__rpc_exec_stage = (__RpcExecStage)1; ((LabyrinthController)(object)target).CharlotteWanderOutsideClientRpc(rand); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2340899945(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 rand = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref rand); target.__rpc_exec_stage = (__RpcExecStage)1; ((LabyrinthController)(object)target).CharlotteChooseClientRpc(rand); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_689911344(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; ((LabyrinthController)(object)target).StartCollapseLabyrinthServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2405009467(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; ((LabyrinthController)(object)target).StartCollapseLabyrinthClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "LabyrinthController"; } } public class MoveBackAndForth : MonoBehaviour { [SerializeField] private Vector3 frequency; [SerializeField] private Vector3 magnitude; [SerializeField] private Vector3 offset; private void Update() { //IL_009e: 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) float num = Mathf.Sin(Time.time * frequency.x + offset.x) * magnitude.x; float num2 = Mathf.Sin(Time.time * frequency.y + offset.y) * magnitude.y; float num3 = Mathf.Sin(Time.time * frequency.z + offset.z) * magnitude.z; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num, num2, num3); ((Component)this).transform.Translate(val * Time.deltaTime); } } public class QBHittable : MonoBehaviour, IHittable { public QBController qbController; bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID = -1) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) qbController.HitFromTurret(hitDirection); return true; } } public class QBPhysicsProp : GrabbableObject { public Animator animator = null; public QBController qbController = null; public PlayerControllerB? previousPlayerHeldBy = null; [HideInInspector] public static readonly int RunSpeedFloat = Animator.StringToHash("RunSpeed"); public override void EquipItem() { ((GrabbableObject)this).EquipItem(); qbController.PickUpQBLocalClient(); previousPlayerHeldBy = base.playerHeldBy; } public override void FallWithCurve() { if (((EnemyAI)qbController).inSpecialAnimation) { ((GrabbableObject)this).FallWithCurve(); } } public override void Start() { //IL_007e: 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_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_00a1: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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) base.propColliders = ((Component)this).gameObject.GetComponentsInChildren(); for (int i = 0; i < base.propColliders.Length; i++) { if (!((Component)base.propColliders[i]).CompareTag("DoNotSet") && !((Component)base.propColliders[i]).CompareTag("Enemy")) { base.propColliders[i].excludeLayers = LayerMask.op_Implicit(-2621449); } } base.originalScale = ((Component)this).transform.localScale; if (base.itemProperties.itemSpawnsOnGround) { base.startFallingPosition = ((Component)this).transform.position; if ((Object)(object)((Component)this).transform.parent != (Object)null) { base.startFallingPosition = ((Component)this).transform.parent.InverseTransformPoint(base.startFallingPosition); } ((GrabbableObject)this).FallToGround(false, false, default(Vector3)); } else { base.fallTime = 1f; base.hasHitGround = true; base.reachedFloorTarget = true; base.targetFloorPosition = ((Component)this).transform.localPosition; } if (base.itemProperties.isScrap) { base.fallTime = 1f; base.hasHitGround = true; } if (base.itemProperties.isScrap && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { base.radarIcon = Object.Instantiate(StartOfRound.Instance.itemRadarIconPrefab, RoundManager.Instance.mapPropsContainer.transform).transform; } if (!base.itemProperties.isScrap) { HoarderBugAI.grabbableObjectsInMap.Add(((Component)this).gameObject); } MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { ((Renderer)componentsInChildren[j]).renderingLayerMask = 1u; } SkinnedMeshRenderer[] componentsInChildren2 = ((Component)this).gameObject.GetComponentsInChildren(); for (int k = 0; k < componentsInChildren2.Length; k++) { ((Renderer)componentsInChildren2[k]).renderingLayerMask = 1u; } } public override void Update() { //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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_0179: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { Animator obj = animator; int runSpeedFloat = RunSpeedFloat; Vector3 velocity = ((EnemyAI)qbController).agent.velocity; obj.SetFloat(runSpeedFloat, ((Vector3)(ref velocity)).magnitude / 3f); if (!base.wasOwnerLastFrame) { base.wasOwnerLastFrame = true; } } else if (base.wasOwnerLastFrame) { base.wasOwnerLastFrame = false; } if (!base.isHeld && (Object)(object)base.parentObject == (Object)null) { if (base.fallTime < 1f) { base.reachedFloorTarget = false; ((GrabbableObject)this).FallWithCurve(); if (((Component)this).transform.localPosition.y - base.targetFloorPosition.y < 0.05f && !base.hasHitGround) { ((GrabbableObject)this).PlayDropSFX(); ((GrabbableObject)this).OnHitGround(); } return; } if (!base.reachedFloorTarget) { if (!base.hasHitGround) { ((GrabbableObject)this).PlayDropSFX(); ((GrabbableObject)this).OnHitGround(); } base.reachedFloorTarget = true; if (base.floorYRot == -1) { ((Component)this).transform.rotation = Quaternion.Euler(base.itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, base.itemProperties.restingRotation.z); } else { ((Component)this).transform.rotation = Quaternion.Euler(base.itemProperties.restingRotation.x, (float)(base.floorYRot + base.itemProperties.floorYOffset) + 90f, base.itemProperties.restingRotation.z); } } if (((EnemyAI)qbController).inSpecialAnimation) { ((Component)this).transform.localPosition = base.targetFloorPosition; } } else if (base.isHeld || base.isHeldByEnemy) { base.reachedFloorTarget = false; } } public override void LateUpdate() { //IL_002e: 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_005c: 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_0072: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_008c: 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_0092: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)qbController).inSpecialAnimation && (Object)(object)base.parentObject != (Object)null) { ((Component)this).transform.rotation = base.parentObject.rotation; ((Component)this).transform.Rotate(base.itemProperties.rotationOffset); ((Component)this).transform.position = base.parentObject.position; Vector3 positionOffset = base.itemProperties.positionOffset; positionOffset = base.parentObject.rotation * positionOffset; Transform transform = ((Component)this).transform; transform.position += positionOffset; } } public override void EnableItemMeshes(bool enable) { MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (!((Component)componentsInChildren[i]).gameObject.CompareTag("DoNotSet") && !((Component)componentsInChildren[i]).gameObject.CompareTag("InteractTrigger") && !((Component)componentsInChildren[i]).gameObject.CompareTag("Enemy")) { ((Renderer)componentsInChildren[i]).enabled = enable; } } SkinnedMeshRenderer[] componentsInChildren2 = ((Component)this).gameObject.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren2.Length; j++) { ((Renderer)componentsInChildren2[j]).enabled = enable; } } public override void DiscardItem() { qbController.DropQbLocalClient(); DropBabyServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); previousPlayerHeldBy = base.playerHeldBy; ((GrabbableObject)this).DiscardItem(); } [ServerRpc(RequireOwnership = false)] public void DropBabyServerRpc(int playerClientId) { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1798048404u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerClientId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1798048404u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.SetTrigger("drop"); DropBabyClientRpc(playerClientId); } } } [ClientRpc] public void DropBabyClientRpc(int playerClientId) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3995923262u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerClientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3995923262u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerClientId != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { qbController.DropQbLocalClient(); } } } protected override void __initializeVariables() { ((GrabbableObject)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 ((NetworkBehaviour)this).__registerRpc(1798048404u, new RpcReceiveHandler(__rpc_handler_1798048404), "DropBabyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3995923262u, new RpcReceiveHandler(__rpc_handler_3995923262), "DropBabyClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1798048404(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 playerClientId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBPhysicsProp)(object)target).DropBabyServerRpc(playerClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3995923262(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 playerClientId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerClientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBPhysicsProp)(object)target).DropBabyClientRpc(playerClientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "QBPhysicsProp"; } } public class QBSpikeTrapDetect : NetworkBehaviour { public QBController qbController; private Transform spikeRoofTrapCurrTransform; public void OnTriggerEnter(Collider other) { SpikeRoofTrap val = default(SpikeRoofTrap); if (((Component)other).TryGetComponent(ref val)) { spikeRoofTrapCurrTransform = ((Component)val.stickingPointsContainer).transform; AddStickPointServerRpc(); qbController.SpikeTrapDeathServerRpc(); } } [ServerRpc] public void AddStickPointServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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)base.__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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1736775760u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1736775760u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AddStickPointClientRpc(); } } [ClientRpc] public void AddStickPointClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(91649286u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 91649286u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; qbController.qbRagdollAttachPoints.Add(spikeRoofTrapCurrTransform); } } } protected override void __initializeVariables() { ((NetworkBehaviour)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 ((NetworkBehaviour)this).__registerRpc(1736775760u, new RpcReceiveHandler(__rpc_handler_1736775760), "AddStickPointServerRpc"); ((NetworkBehaviour)this).__registerRpc(91649286u, new RpcReceiveHandler(__rpc_handler_91649286), "AddStickPointClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1736775760(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((QBSpikeTrapDetect)(object)target).AddStickPointServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_91649286(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; ((QBSpikeTrapDetect)(object)target).AddStickPointClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "QBSpikeTrapDetect"; } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Tartarus { public class TogglePerWeather : MonoBehaviour { public enum State { None, Eclipsed, Rainy, Flooded, Forsaken, Hurricane, Hallowed, Earthquakes } public bool isAnimator; [Header("State")] public State preferredState; private void Start() { if (Enabled()) { WeatherRegistryCheck(); } else { NonWeatherRegistryCheck(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void WeatherRegistryCheck() { if (preferredState.ToString() == WeatherManager.GetCurrentWeatherName(RoundManager.Instance.currentLevel, false) && isAnimator) { ((Component)this).GetComponent().SetTrigger(preferredState.ToString()); } else if (!WeatherMatches() && !isAnimator) { ((Component)this).gameObject.SetActive(false); } } public void NonWeatherRegistryCheck() { if (WeatherMatches() && isAnimator) { ((Component)this).GetComponent().SetTrigger(preferredState.ToString()); } else if (!WeatherMatches() && !isAnimator) { ((Component)this).gameObject.SetActive(false); } } public bool Enabled() { if (Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry")) { return true; } return false; } public bool WeatherMatches() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Invalid comparison between Unknown and I4 //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 if (preferredState == State.None && (int)TimeOfDay.Instance.currentLevelWeather == -1) { return true; } if (preferredState == State.Eclipsed && (int)TimeOfDay.Instance.currentLevelWeather == 5) { return true; } if (preferredState == State.Rainy && (int)TimeOfDay.Instance.currentLevelWeather == 1) { return true; } if (preferredState == State.Flooded && (int)TimeOfDay.Instance.currentLevelWeather == 4) { return true; } return false; } } } namespace CodeRebirth.src.MiscScripts { public class ShipAnimator : MonoBehaviour { public AnimationClip shipLandAnimation = null; public AnimationClip shipNormalLeaveAnimation = null; private Animator hangarShipAnimator = null; public AnimationClip originalShipLandClip = null; public AnimationClip originalShipLeaveClip = null; private RuntimeAnimatorController animatorController = null; public AnimatorOverrideController overrideController = null; private void Start() { hangarShipAnimator = StartOfRound.Instance.shipAnimator; animatorController = hangarShipAnimator.runtimeAnimatorController; AnimationClip[] animationClips = animatorController.animationClips; foreach (AnimationClip val in animationClips) { if (((Object)val).name == "HangarShipLandB") { originalShipLandClip = val; } else if (((Object)val).name == "ShipLeave") { originalShipLeaveClip = val; } } ((MonoBehaviour)this).StartCoroutine(WaitToReplaceClip()); } private IEnumerator WaitToReplaceClip() { while (true) { Plugin.Logger.LogError((object)"REPLACING??"); yield return (object)new WaitUntil((Func)(() => RoundManager.Instance.currentLevel.sceneName == "CharlottesLabyrinth" && !StartOfRound.Instance.inShipPhase)); ReplaceAnimationClip(); Plugin.Logger.LogError((object)"REPLACED!!!"); yield return (object)new WaitUntil((Func)(() => RoundManager.Instance.currentLevel.sceneName != "CharlottesLabyrinth" || StartOfRound.Instance.inShipPhase)); Plugin.Logger.LogError((object)"UNREPLACED!!!"); UnReplaceAnimationClip(); } } private void ReplaceAnimationClip() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown overrideController = new AnimatorOverrideController(animatorController); overrideController[originalShipLandClip] = shipLandAnimation; overrideController[originalShipLeaveClip] = shipNormalLeaveAnimation; hangarShipAnimator.runtimeAnimatorController = (RuntimeAnimatorController)(object)overrideController; } public void KillAllPlayersAnimEvent() { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerControlled || val.isPlayerDead) { } } } private void UnReplaceAnimationClip() { hangarShipAnimator.runtimeAnimatorController = animatorController; } } } namespace ExampleEnemy { public class QBController : EnemyAI { public enum State { Wander, Sit, Held } public BoxCollider collisionThing; public BoxCollider interactCollider; public BoxCollider scanNode; public GameObject qbRagdollPrefab; public PlayerControllerB playerHolding; public QBPhysicsProp propScript; public List audioClips = new List(); public Transform turnCompass = null; public Transform attackArea = null; public ParticleSystem deathParticles; public float wanderMoveSpeed; public float chaseMoveSpeed; public float trySitInterval; public float tryGetUpInterval; private Coroutine dropQbCoroutine; private Coroutine dropBabyCoroutine; public List qbRagdolls = new List(); public List qbRagdollAttachPoints = new List(); private bool holdingQb = false; private float timeSinceSatDown; private float timeSinceLastSat; private float timeSinceNewRandPos; private float timeSinceAttacking; private float timeSinceAlerted; private float timeSinceDropped; private Vector3 StalkPos; private Random enemyRandom = null; private bool isDeadAnimationDone; [Header("State")] public State stateType; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { } public override void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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) ((EnemyAI)this).Start(); ((GrabbableObject)propScript).originalScale = ((Component)this).transform.localScale; timeSinceNewRandPos = 0f; timeSinceAlerted = 0f; enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); base.isOutside = false; } public override void Update() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (qbRagdolls.Count > 0 && qbRagdolls.Count == qbRagdollAttachPoints.Count) { int num = 0; foreach (Transform qbRagdoll in qbRagdolls) { qbRagdoll.position = qbRagdollAttachPoints[num].position; num++; } } if (base.isEnemyDead) { if (!isDeadAnimationDone) { LogIfDebugBuild("Stopping enemy voice with janky code."); isDeadAnimationDone = true; StopSfxClientRpc(); } } else { timeSinceAttacking += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; timeSinceAlerted += Time.deltaTime; timeSinceLastSat += Time.deltaTime; timeSinceSatDown += Time.deltaTime; timeSinceDropped += Time.deltaTime; ((EnemyAI)this).DoAIInterval(); } } public override void DoAIInterval() { if (stateType == State.Held) { return; } if (((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).DoAIInterval(); } if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead || !((NetworkBehaviour)this).IsOwner) { return; } switch (stateType) { case State.Wander: ChangeSpeedClientRpc(wanderMoveSpeed); if (timeSinceLastSat > trySitInterval && timeSinceDropped > 2f) { float num2 = Random.Range(0, 100); if (num2 < 25f) { PlaySoundClientRpc(0); ChangeStateClientRpc(State.Sit); DoAnimationClientRpc("sitDown"); timeSinceSatDown = 0f; } else { timeSinceLastSat = 0f; } } break; case State.Sit: ChangeSpeedClientRpc(0f); if (timeSinceSatDown > tryGetUpInterval) { float num = Random.Range(0, 100); if (num < 25f) { PlaySoundClientRpc(1); ChangeStateClientRpc(State.Wander); DoAnimationClientRpc("getUp"); timeSinceLastSat = 0f; } else { timeSinceSatDown = 0f; } } break; default: LogIfDebugBuild("This Behavior State doesn't exist!"); break; } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void ChangeSpeedClientRpc(float speed) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(828867089u, val2, (RpcDelivery)1); ((FastBufferWriter)(ref val)).WriteValueSafe(ref speed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 828867089u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.agent.speed = speed; } } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void StopSfxClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2844141494u, val2, (RpcDelivery)1); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2844141494u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureVoice.Stop(); } } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void ChangeSfxClipClientRpc(int clipNum) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(794199885u, val2, (RpcDelivery)1); BytePacker.WriteValueBitPacked(val, clipNum); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 794199885u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureSFX.clip = audioClips[clipNum]; base.creatureSFX.Play(); } } } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, false, true); return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } private bool TargetClosestPlayerInAnyCase() { //IL_001f: 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) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } public void HitFromTurret(Vector3 hitDirection) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_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) if (!base.isEnemyDead) { base.enemyHP--; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { DeathServerRpc(hitDirection * 10f + hitDirection * 10f); } } } public override void HitFromExplosion(float distance) { //IL_0050: 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_0065: 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) //IL_0074: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).HitFromExplosion(distance); if (!base.isEnemyDead) { base.enemyHP--; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { DeathServerRpc(((Component)this).transform.forward * 50f + ((Component)this).transform.up * 50f); } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!base.isEnemyDead) { base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { DeathServerRpc(Vector3.down); } } } [ServerRpc] public void DeathServerRpc(Vector3 bodyVelocity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_00cf: 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 //IL_0160: 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)) { 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1205418331u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref bodyVelocity); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1205418331u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeStateClientRpc(State.Held); GameObject val3 = Object.Instantiate(qbRagdollPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); val3.GetComponent().Spawn(false); Rigidbody[] componentsInChildren = val3.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].velocity = bodyVelocity; } ((MonoBehaviour)this).StartCoroutine(DeathCoroutine(3f)); DeathClientRpc(); } } [ServerRpc] public void SpikeTrapDeathServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_012c: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1973894588u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1973894588u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeStateClientRpc(State.Held); GameObject val3 = Object.Instantiate(qbRagdollPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); val3.GetComponent().Spawn(false); qbRagdolls.Add(val3.transform); ((MonoBehaviour)this).StartCoroutine(DeathCoroutine(3f)); DeathClientRpc(); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DeathClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(400727888u, val2, (RpcDelivery)1); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 400727888u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Collider)interactCollider).enabled = false; ((Collider)collisionThing).enabled = false; ((Collider)scanNode).enabled = false; SkinnedMeshRenderer[] skinnedMeshRenderers = base.skinnedMeshRenderers; foreach (SkinnedMeshRenderer val3 in skinnedMeshRenderers) { ((Renderer)val3).enabled = false; } base.enemyHP = 1; } } public IEnumerator DeathCoroutine(float delayTime) { yield return (object)new WaitForSeconds(delayTime); if (RoundManager.Instance.allEnemyVents.Length != 0) { bool foundValidVent = false; EnemyVent[] allEnemyVents = RoundManager.Instance.allEnemyVents; foreach (EnemyVent enemyVent in allEnemyVents) { bool hasNearbyPlayer = false; GameObject[] allPlayerObjects = StartOfRound.Instance.allPlayerObjects; foreach (GameObject player in allPlayerObjects) { if (Vector3.Distance(player.transform.position, ((Component)enemyVent).transform.position) < 15f) { hasNearbyPlayer = true; } } if (!hasNearbyPlayer) { foundValidVent = true; ((Collider)interactCollider).enabled = true; ((Collider)collisionThing).enabled = true; ((Collider)scanNode).enabled = true; SkinnedMeshRenderer[] skinnedMeshRenderers = base.skinnedMeshRenderers; foreach (SkinnedMeshRenderer skinnedMeshRenderer in skinnedMeshRenderers) { ((Renderer)skinnedMeshRenderer).enabled = true; } ((Behaviour)base.agent).enabled = false; ((Component)this).transform.position = ((Component)enemyVent.floorNode).transform.position; ((Behaviour)base.agent).enabled = true; ChangeStateClientRpc(State.Wander); break; } } if (!foundValidVent) { ((MonoBehaviour)this).StartCoroutine(DeathCoroutine(3f)); } } else { ((MonoBehaviour)this).StartCoroutine(DeathCoroutine(3f)); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DoAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(491036845u, val2, (RpcDelivery)1); bool flag = animationName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 491036845u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogIfDebugBuild("Animation: " + animationName); base.creatureAnimator.SetTrigger(animationName); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void PlaySoundClientRpc(int index) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1813149629u, val2, (RpcDelivery)1); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1813149629u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureVoice.PlayOneShot(audioClips[index]); } } } [ClientRpc] public 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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(5798017u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForEnums)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 5798017u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stateType = state; } } } public void PickUpQBLocalClient() { base.currentOwnershipOnThisClient = (int)((GrabbableObject)propScript).playerHeldBy.playerClientId; base.inSpecialAnimation = true; ((Behaviour)base.agent).enabled = false; holdingQb = true; if (dropQbCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dropQbCoroutine); } if (((NetworkBehaviour)this).IsServer && stateType != State.Held) { ChangeStateClientRpc(State.Held); DoAnimationClientRpc("pickUp"); } playerHolding = ((GrabbableObject)propScript).playerHeldBy; } public void DropQbLocalClient() { //IL_005a: 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) //IL_007c: 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) //IL_008b: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00db: 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) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0119: 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_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) holdingQb = false; playerHolding = null; timeSinceDropped = 0f; if (base.currentBehaviourStateIndex != 0) { return; } if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); } base.serverPosition = ((Component)this).transform.position; bool flag = true; Vector3 itemFloorPosition = ((GrabbableObject)propScript).GetItemFloorPosition(((Component)propScript.previousPlayerHeldBy).transform.position + Vector3.up * 0.5f); Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(itemFloorPosition, default(NavMeshHit), 10f, -1); if (!RoundManager.Instance.GotNavMeshPositionResult || base.DebugEnemy) { flag = false; itemFloorPosition = ((GrabbableObject)propScript).startFallingPosition; if ((Object)(object)((Component)propScript).transform.parent != (Object)null) { itemFloorPosition = ((Component)propScript).transform.parent.TransformPoint(((GrabbableObject)propScript).startFallingPosition); } Transform val = ChooseClosestNodeToPositionNoPathCheck(itemFloorPosition); navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)val).transform.position, default(NavMeshHit), 5f, -1); } if ((Object)(object)((Component)propScript).transform.parent == (Object)null) { ((GrabbableObject)propScript).targetFloorPosition = navMeshPosition; } else { ((GrabbableObject)propScript).targetFloorPosition = ((Component)propScript).transform.parent.InverseTransformPoint(navMeshPosition); } if (flag) { if (dropQbCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dropQbCoroutine); } dropQbCoroutine = ((MonoBehaviour)this).StartCoroutine(DropQbAnimation(navMeshPosition)); } else { ((Component)this).transform.position = navMeshPosition; base.inSpecialAnimation = false; } } public Transform ChooseClosestNodeToPositionNoPathCheck(Vector3 pos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) base.nodesTempArray = base.allAINodes.OrderBy((GameObject x) => Vector3.Distance(pos, x.transform.position)).ToArray(); return base.nodesTempArray[0].transform; } private IEnumerator DropQbAnimation(Vector3 dropOnPosition) { //IL_000e: 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) DoAnimationClientRpc("drop"); float time = Time.realtimeSinceStartup; yield return (object)new WaitUntil((Func)(() => ((GrabbableObject)propScript).reachedFloorTarget || Time.realtimeSinceStartup - time > 2f)); if (base.currentBehaviourStateIndex == 0) { ((Component)this).transform.position = dropOnPosition; base.inSpecialAnimation = false; ChangeStateClientRpc(State.Wander); } dropQbCoroutine = null; } 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 ((NetworkBehaviour)this).__registerRpc(828867089u, new RpcReceiveHandler(__rpc_handler_828867089), "ChangeSpeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(2844141494u, new RpcReceiveHandler(__rpc_handler_2844141494), "StopSfxClientRpc"); ((NetworkBehaviour)this).__registerRpc(794199885u, new RpcReceiveHandler(__rpc_handler_794199885), "ChangeSfxClipClientRpc"); ((NetworkBehaviour)this).__registerRpc(1205418331u, new RpcReceiveHandler(__rpc_handler_1205418331), "DeathServerRpc"); ((NetworkBehaviour)this).__registerRpc(1973894588u, new RpcReceiveHandler(__rpc_handler_1973894588), "SpikeTrapDeathServerRpc"); ((NetworkBehaviour)this).__registerRpc(400727888u, new RpcReceiveHandler(__rpc_handler_400727888), "DeathClientRpc"); ((NetworkBehaviour)this).__registerRpc(491036845u, new RpcReceiveHandler(__rpc_handler_491036845), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(1813149629u, new RpcReceiveHandler(__rpc_handler_1813149629), "PlaySoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(5798017u, new RpcReceiveHandler(__rpc_handler_5798017), "ChangeStateClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_828867089(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 speed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref speed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).ChangeSpeedClientRpc(speed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2844141494(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; ((QBController)(object)target).StopSfxClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_794199885(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 clipNum = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipNum); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).ChangeSfxClipClientRpc(clipNum); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1205418331(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_0083: 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_009d: 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 { Vector3 bodyVelocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bodyVelocity); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).DeathServerRpc(bodyVelocity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1973894588(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).SpikeTrapDeathServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_400727888(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; ((QBController)(object)target).DeathClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_491036845(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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1813149629(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).PlaySoundClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_5798017(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(ref state, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((QBController)(object)target).ChangeStateClientRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "QBController"; } } } namespace CharlottesLabyrinth { public static class Assets { public static AssetBundle MainAssetBundle; public static void PopulateAssets() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); MainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "charlotteslabyrinth")); if ((Object)(object)MainAssetBundle == (Object)null) { Plugin.Logger.LogError((object)"Failed to load custom assets."); } } } internal class CharlotteController : NetworkBehaviour { public Animator animator; public AudioSource audioSource; public Transform killDetectArea; public List charlotteTeeth; private Transform lockedPlayer; private Vector3 lockedPlayerPosition; private void LateUpdate() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)lockedPlayer != (Object)null) { lockedPlayer.position = lockedPlayerPosition; GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(1.4f, 1f); } } public void TriggerCharlotteInitially() { //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_004c: Unknown result type (might be due to invalid IL or missing references) lockedPlayer = ((Component)GameNetworkManager.Instance.localPlayerController).transform; lockedPlayerPosition = lockedPlayer.position; if ((Object)(object)LabyrinthController.Instance != (Object)null) { LabyrinthController.Instance.StartCollapseLabyrinthServerRpc(); } TriggerCharlotteServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController)); } [ServerRpc(RequireOwnership = false)] public void TriggerCharlotteServerRpc(NetworkBehaviourReference playerRef) { //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) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1046585246u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref playerRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1046585246u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TriggerCharlotteClientRpc(playerRef); } } } [ClientRpc] public void TriggerCharlotteClientRpc(NetworkBehaviourReference playerRef) { //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) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_012a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1561612640u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref playerRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1561612640u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = default(PlayerControllerB); ((NetworkBehaviourReference)(ref playerRef)).TryGet(ref val3, (NetworkManager)null); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(((Component)val3).transform.position.x, ((Component)this).transform.position.y, ((Component)val3).transform.position.z); ((Component)this).transform.LookAt(val4); animator.SetTrigger("CharlotteInteract"); } } } public void KillDetect() { //IL_0012: 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_0022: 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) lockedPlayer = null; int num = 8; int num2 = 0; Collider[] array = Physics.OverlapBox(killDetectArea.position, killDetectArea.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { if (((Component)val).CompareTag("Player")) { num2++; CheckAnimationGrabPlayerServerRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)((Component)val).GetComponent()), num2); if (num2 > 7) { num2 = 0; } } } } [ServerRpc(RequireOwnership = false)] public void CheckAnimationGrabPlayerServerRpc(NetworkBehaviourReference playerRef, int currPlayerKilled) { //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_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_008c: 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) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(836578551u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref playerRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, currPlayerKilled); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 836578551u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ConfirmAnimationGrabPlayerClientRpc(playerRef, currPlayerKilled); } } } [ClientRpc] public void ConfirmAnimationGrabPlayerClientRpc(NetworkBehaviourReference playerRef, int currPlayerKilled) { //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_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_008c: 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) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(450243815u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref playerRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, currPlayerKilled); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 450243815u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(AnimationGrabPlayer(playerRef, currPlayerKilled)); } } } private IEnumerator AnimationGrabPlayer(NetworkBehaviourReference playerRef, int currPlayerKilled) { //IL_000e: 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) PlayerControllerB playerDying = default(PlayerControllerB); ((NetworkBehaviourReference)(ref playerRef)).TryGet(ref playerDying, (NetworkManager)null); if (((NetworkBehaviour)playerDying).IsOwner) { playerDying.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 8, default(Vector3), false); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func)(() => (Object)(object)playerDying.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f)); if ((Object)(object)playerDying.deadBody != (Object)null) { Debug.LogWarning((object)("Teeth count: " + charlotteTeeth.Count + ", player killed:" + currPlayerKilled)); playerDying.deadBody.attachedTo = charlotteTeeth[currPlayerKilled]; playerDying.deadBody.attachedLimb = playerDying.deadBody.bodyParts[6]; playerDying.deadBody.matchPositionExactly = true; } else { Debug.Log((object)"Player body was not spawned in time for animation."); } yield return (object)new WaitForSeconds(2.5f); if ((Object)(object)playerDying.deadBody != (Object)null) { playerDying.deadBody.attachedTo = null; playerDying.deadBody.attachedLimb = null; playerDying.deadBody.matchPositionExactly = false; } } public void PlaySound(AudioClip audioClip) { audioSource.PlayOneShot(audioClip); } protected override void __initializeVariables() { ((NetworkBehaviour)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 ((NetworkBehaviour)this).__registerRpc(1046585246u, new RpcReceiveHandler(__rpc_handler_1046585246), "TriggerCharlotteServerRpc"); ((NetworkBehaviour)this).__registerRpc(1561612640u, new RpcReceiveHandler(__rpc_handler_1561612640), "TriggerCharlotteClientRpc"); ((NetworkBehaviour)this).__registerRpc(836578551u, new RpcReceiveHandler(__rpc_handler_836578551), "CheckAnimationGrabPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(450243815u, new RpcReceiveHandler(__rpc_handler_450243815), "ConfirmAnimationGrabPlayerClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1046585246(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_004f: 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) { NetworkBehaviourReference playerRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CharlotteController)(object)target).TriggerCharlotteServerRpc(playerRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1561612640(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_004f: 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) { NetworkBehaviourReference playerRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CharlotteController)(object)target).TriggerCharlotteClientRpc(playerRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_836578551(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference playerRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); int currPlayerKilled = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currPlayerKilled); target.__rpc_exec_stage = (__RpcExecStage)1; ((CharlotteController)(object)target).CheckAnimationGrabPlayerServerRpc(playerRef, currPlayerKilled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_450243815(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference playerRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); int currPlayerKilled = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currPlayerKilled); target.__rpc_exec_stage = (__RpcExecStage)1; ((CharlotteController)(object)target).ConfirmAnimationGrabPlayerClientRpc(playerRef, currPlayerKilled); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CharlotteController"; } } public class CharlottesDollRoomController : NetworkBehaviour { [SerializeField] private List faceAudioSources; [SerializeField] private AudioSource doorAudioSource; [SerializeField] private Animator m_Animator; [SerializeField] private Transform purpleIdolDetectBox; [SerializeField] private AudioClip doorCloseSound; [SerializeField] private AudioClip doorOpenSound; [SerializeField] private AudioClip tentaclesShiftSound; public Transform dollSpawnPositionTransform; private Vector3 initialDollSpawnPosition; private bool foundIdol = false; public GrabbableObject charlottesDoll; private GrabbableObject spawnedDollRef; private bool startedFloodTrap = false; private float timeSinceAlive = 0f; private GameObject objectToSpawn; private Item objectToSpawnItem; public int valueOfDoll; private bool dollIsSpawned = false; public List itemPlacePositions = new List(); public List itemsPlaced = new List(); public List itemsTryingToBePlaced = new List(); public Transform pyotrTargetPoint; public static CharlottesDollRoomController Instance { get; private set; } private void Awake() { Instance = this; } private void Start() { SpawnDollServerRpc(); } [ServerRpc(RequireOwnership = true)] private void SpawnDollServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_00c2: 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)base.__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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(923711147u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 923711147u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; GameObject val3 = Object.Instantiate(((Component)charlottesDoll).gameObject, dollSpawnPositionTransform.position, dollSpawnPositionTransform.rotation, ((Component)this).transform); spawnedDollRef = val3.GetComponent(); spawnedDollRef.SetScrapValue(valueOfDoll); ((NetworkBehaviour)spawnedDollRef).NetworkObject.Spawn(false); initialDollSpawnPosition = ((Component)spawnedDollRef).transform.position; SpawnItemClientRpc(valueOfDoll, NetworkObjectReference.op_Implicit(((Component)spawnedDollRef).gameObject)); dollIsSpawned = true; } } [ClientRpc] public void SpawnItemClientRpc(int scrapValueSpawned, NetworkObjectReference objectSpawned) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3791597228u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, scrapValueSpawned); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectSpawned, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3791597228u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref objectSpawned)).TryGet(ref val3, (NetworkManager)null); ((Component)val3).GetComponent().SetScrapValue(scrapValueSpawned); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)scrapValueSpawned; } } } private void Update() { //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) timeSinceAlive += Time.deltaTime; if ((Object)(object)spawnedDollRef != (Object)null && ((Component)spawnedDollRef).transform.position != initialDollSpawnPosition && !startedFloodTrap && timeSinceAlive > 2f && dollIsSpawned) { startedFloodTrap = true; LabyrinthController.Instance.StartCollapseLabyrinthServerRpc(); } } public void OnTriggerEnter(Collider other) { GrabbableObject item = default(GrabbableObject); if (((Component)other).TryGetComponent(ref item) && !itemsPlaced.Contains(item) && itemsTryingToBePlaced.Contains(item)) { itemsPlaced.Add(item); itemsTryingToBePlaced.Remove(item); } } public void OnTriggerExit(Collider other) { GrabbableObject item = default(GrabbableObject); if (((Component)other).TryGetComponent(ref item) && itemsPlaced.Contains(item)) { itemsPlaced.Remove(item); } } protected override void __initializeVariables() { ((NetworkBehaviour)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 ((NetworkBehaviour)this).__registerRpc(923711147u, new RpcReceiveHandler(__rpc_handler_923711147), "SpawnDollServerRpc"); ((NetworkBehaviour)this).__registerRpc(3791597228u, new RpcReceiveHandler(__rpc_handler_3791597228), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_923711147(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((CharlottesDollRoomController)(object)target).SpawnDollServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3791597228(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_0060: 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 scrapValueSpawned = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValueSpawned); NetworkObjectReference objectSpawned = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectSpawned, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CharlottesDollRoomController)(object)target).SpawnItemClientRpc(scrapValueSpawned, objectSpawned); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CharlottesDollRoomController"; } } public class EnableWhenCollapse : MonoBehaviour { private bool hasBeenAdded = false; public List lightCookies = new List(); private int currCookie = 0; private Light light; private void Update() { if (!hasBeenAdded && !((Object)(object)LabyrinthController.Instance == (Object)null) && !LabyrinthController.Instance.hasDisabledCollapseObjects) { Light val = default(Light); Volume item = default(Volume); if (((Component)this).TryGetComponent(ref val)) { light = val; LabyrinthController.Instance.labyrinthLights.Add(this); hasBeenAdded = true; } else if (((Component)this).TryGetComponent(ref item)) { LabyrinthController.Instance.labyrinthVolumes.Add(item); hasBeenAdded = true; } else { LabyrinthController.Instance.objectsToEnableWhenCollapse.Add(((Component)this).gameObject); ((Component)this).gameObject.SetActive(false); hasBeenAdded = true; } } } public void LightGoBrrrr() { ((MonoBehaviour)this).StartCoroutine(LightGoBrrrCoroutine(0.5f)); } private IEnumerator LightGoBrrrCoroutine(float timeBetweenSwap) { yield return (object)new WaitForSeconds(timeBetweenSwap); if (!((Object)(object)light == (Object)null) && lightCookies.Count != 0) { currCookie++; if (currCookie >= lightCookies.Count) { currCookie = 0; } light.cookie = (Texture)(object)lightCookies[currCookie]; ((MonoBehaviour)this).StartCoroutine(LightGoBrrrCoroutine(Random.Range(0.3f, 0.5f))); } } } public static class Extensions { public static IEnumerator WaitUntilSpawned(this NetworkObject networkObject) { yield return (object)new WaitUntil((Func)(() => networkObject.IsSpawned)); } private static IEnumerator RunActionAfterSpawned(NetworkObject networkObject, Action action) { yield return networkObject.WaitUntilSpawned(); action(); } public static void OnSpawn(this NetworkObject networkObject, Action action) { ((MonoBehaviour)networkObject).StartCoroutine(RunActionAfterSpawned(networkObject, action)); } public static void SetLayer(this GameObject obj, LayerMask layerMask, bool children) { //IL_0002: 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) obj.layer = LayerMask.op_Implicit(layerMask); if (children && obj.transform.childCount > 0) { Transform[] componentsInChildren = obj.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val in array) { ((Component)val).gameObject.layer = LayerMask.op_Implicit(layerMask); } } } public static void SetLayer(this GameObject obj, string layerName, bool children) { //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_000e: 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) LayerMask val = LayerMask.op_Implicit(LayerMask.NameToLayer(layerName)); obj.layer = LayerMask.op_Implicit(val); if (children && obj.transform.childCount > 0) { Transform[] componentsInChildren = obj.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val2 in array) { ((Component)val2).gameObject.layer = LayerMask.op_Implicit(val); } } } public static Transform GetClosest(this Transform _transform, params Component[] array) { //IL_0017: 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) Transform result = null; float num = float.PositiveInfinity; foreach (Component val in array) { float num2 = Vector3.Distance(_transform.position, val.transform.position); if (num2 < num) { num = num2; result = val.transform; } } return result; } public static void SetColliderEnabled(this GameObject obj, bool enable, bool children) { obj.GetComponent().enabled = enable; if (children) { Collider[] componentsInChildren = obj.GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { val.enabled = enable; } } } public static void SetTag(this GameObject obj, string newTag, bool children) { obj.tag = newTag; if (children) { Transform[] componentsInChildren = obj.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val in array) { ((Component)val).gameObject.tag = newTag; } } } public static void AddComponent(this GameObject obj, bool children) where T : Component { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown obj.AddComponent(); if (!children) { return; } foreach (Transform item in obj.transform) { Transform val = item; ((Component)val).gameObject.AddComponent(); } } public static T GetVariableFromString(this Component comp, string varName) { return (T)((object)comp).GetType().GetField(varName).GetValue(comp); } public static void MoveTowards(this Transform trans, Vector3 target, float maxDistanceDelta) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) trans.position = Vector3.MoveTowards(trans.position, target, maxDistanceDelta); } public static Vector3 GetCenter(this GameObject obj) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00fa: Unknown result type (might be due to invalid IL or missing references) List list = new List(); List list2 = new List(); List list3 = new List(); Renderer[] componentsInChildren = obj.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Bounds bounds = val.bounds; list.Add(((Bounds)(ref bounds)).center.x); bounds = val.bounds; list2.Add(((Bounds)(ref bounds)).center.y); bounds = val.bounds; list3.Add(((Bounds)(ref bounds)).center.z); } float num = (Mathf.Max(list.ToArray()) + Mathf.Min(list.ToArray())) / 2f; float num2 = (Mathf.Max(list2.ToArray()) + Mathf.Min(list2.ToArray())) / 2f; float num3 = (Mathf.Max(list3.ToArray()) + Mathf.Min(list3.ToArray())) / 2f; return new Vector3(num, num2, num3); } public static Vector3 GetBottom(this GameObject obj) { //IL_0009: 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_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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_0053: 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_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) //IL_006e: Unknown result type (might be due to invalid IL or missing references) MeshFilter[] componentsInChildren = obj.GetComponentsInChildren(); Vector3 center = obj.GetCenter(); Vector3 val = componentsInChildren[0].mesh.vertices[0]; MeshFilter[] array = componentsInChildren; foreach (MeshFilter val2 in array) { Mesh mesh = val2.mesh; Vector3[] vertices = mesh.vertices; foreach (Vector3 val3 in vertices) { if (val3.y < val.y) { val = val3; } } } center.y = val.y; return center; } public static Vector3 GetCenterNew(this GameObject obj) { //IL_0003: 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_0026: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0093: Unknown result type (might be due to invalid IL or missing references) Bounds val = default(Bounds); bool flag = true; foreach (Transform item in obj.transform) { Transform val2 = item; if (Object.op_Implicit((Object)(object)((Component)val2).GetComponent())) { if (flag) { flag = false; val = ((Renderer)((Component)val2).GetComponent()).bounds; } else { ((Bounds)(ref val)).Encapsulate(((Renderer)((Component)val2).GetComponent()).bounds); } } } return ((Bounds)(ref val)).center; } public static Transform[] GetAllChildren(this Transform trans) { return ((Component)trans).GetComponentsInChildren(); } public static void SetAlpha(this Image image, float alpha) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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) Color color = ((Graphic)image).color; color.a = alpha; ((Graphic)image).color = color; } public static void SetAlpha(this Material mat, float alpha) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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) Color color = mat.color; color.a = alpha; mat.color = color; } public static void SetX(this Transform trans, float newX, bool relative) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) Vector3 position = trans.position; position.x = (relative ? (position.x + newX) : newX); trans.position = position; } public static void SetY(this Transform trans, float newY, bool relative) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) Vector3 position = trans.position; position.y = (relative ? (position.y + newY) : newY); trans.position = position; } public static void SetZ(this Transform trans, float newZ, bool relative) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) Vector3 position = trans.position; position.z = (relative ? (position.z + newZ) : newZ); trans.position = position; } public static bool IsSimilar(this Material mat, Material other) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0050: 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_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) Texture2D val = (Texture2D)mat.mainTexture; Texture2D val2 = (Texture2D)other.mainTexture; if ((Object)(object)mat.mainTexture == (Object)null && (Object)(object)other.mainTexture == (Object)null) { return mat.color == other.color; } return mat.color == other.color && (Object)(object)val == (Object)(object)val2; } } public class Ext { public static void LoadSceneOffline(string sceneName) { SceneManager.LoadScene(sceneName); } public static Scene GetActiveScene() { //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_0009: Unknown result type (might be due to invalid IL or missing references) return SceneManager.GetActiveScene(); } public static int CryptoRandomInt(int min, int max) { return RandomNumberGenerator.GetInt32(min, max); } public static float CryptoRandomFloat(float min, float max) { RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create(); byte[] array = new byte[4]; randomNumberGenerator.GetBytes(array); float num = BitConverter.ToSingle(array, 0); return num * (max - min) + min; } public static IEnumerator WaitAndDo(Action firstAction, float time, Action secondAction) { firstAction(); yield return (object)new WaitForSeconds(time); secondAction(); } public static IEnumerator WaitAndDo(Func condition, Action action) { while (condition()) { yield return null; } action(); } } public class MathExt { public static float Wrap(float value, float min, float max) { if (value % 1f == 0f) { while (value > max || value < min) { if (value > max) { value += min - max - 1f; } else if (value < min) { value += max - min + 1f; } } return value; } float num = value + 1f; while (value != num) { num = value; if (value < min) { value = max - (min - value); } else if (value > max) { value = min + (value - max); } } return value; } public static int Wrap(int value, int min, int max) { if (value % 1 == 0) { while (value > max || value < min) { if (value > max) { value += min - max - 1; } else if (value < min) { value += max - min + 1; } } return value; } int num = value + 1; while (value != num) { num = value; if (value < min) { value = max - (min - value); } else if (value > max) { value = min + (value - max); } } return value; } public static bool Chance(float chance) { return chance > Random.Range(0f, 1f); } public static bool CryptoChance(float chance) { return chance > Ext.CryptoRandomFloat(0f, 1f); } public static T Choose(params T[] array) { int num = array.Length; return array[Random.Range(0, num)]; } public static T Choose(List list) { return Choose(list.ToArray()); } public static T CryptoChoose(params T[] array) { int max = array.Length; return array[Ext.CryptoRandomInt(0, max)]; } public static T CryptoChoose(List list) { return CryptoChoose(list.ToArray()); } } public class FacePlayerPerAxis : MonoBehaviour { public bool followX = true; public bool followY = true; public bool followZ = true; private Transform playerCamera; public Transform turnAxis; private bool gotPlayer; private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_008d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance.audioListener != (Object)null) { Vector3 position = ((Component)StartOfRound.Instance.audioListener).transform.position; if (!followX) { position.x = ((Component)this).transform.position.x; } if (!followY) { position.y = ((Component)this).transform.position.y; } if (!followZ) { position.z = ((Component)this).transform.position.z; } ((Component)this).transform.LookAt(position, turnAxis.up); } } } public class LabyrinthApparatus : MonoBehaviour { [SerializeField] private List faceAudioSources; [SerializeField] private AudioSource doorAudioSource; [SerializeField] private Animator m_Animator; [SerializeField] private Transform purpleIdolDetectBox; [SerializeField] private AudioClip doorCloseSound; [SerializeField] private AudioClip doorOpenSound; [SerializeField] private AudioClip tentaclesShiftSound; private bool foundIdol = false; private Vector3 purpleIdolSpawnPosition; private bool startedFloodTrap = false; private float timeSinceAlive = 0f; private void Start() { } public void TookApparatus() { LabyrinthController.Instance.StartCollapseLabyrinthServerRpc(); } } public class OutsideWanderingCharlotte : MonoBehaviour { private void Update() { if ((Object)(object)LabyrinthController.Instance != (Object)null) { if ((Object)(object)LabyrinthController.Instance.outsideWanderingCharlotteAnimator == (Object)null) { LabyrinthController.Instance.outsideWanderingCharlotteAnimator = ((Component)this).GetComponent(); } else if ((Object)(object)LabyrinthController.Instance.outsideWanderingCharlotteAudioSource == (Object)null) { LabyrinthController.Instance.outsideWanderingCharlotteAudioSource = ((Component)this).GetComponent(); } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("CharlottesLabyrinth", "CharlottesLabyrinth", "1.0.4")] public class Plugin : BaseUnityPlugin { public const string ModGUID = "CharlottesLabyrinth"; private string sAssemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); public static Plugin Instance; public static ShipAnimator shipAnimator; internal static readonly Harmony Harmony = new Harmony("CharlottesLabyrinth"); public const string Id = "CharlottesLabyrinth"; internal static ConfigEntry PolinaWanderSpeed { get; private set; } internal static ConfigEntry PolinaChaseSpeed { get; private set; } internal static ConfigEntry PolinaBashDamage { get; private set; } internal static ConfigEntry PolinaSyringeDamage { get; private set; } internal static ConfigEntry MusicMaxVolume { get; private set; } internal static ConfigEntry MusicEnabled { get; private set; } internal static ManualLogSource Logger { get; private set; } = null; public static string Name => "CharlottesLabyrinth"; public static string Version => "1.0.4"; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Logger.LogDebug((object)"Thank you for trying out Charlotte's Labyrinth! I sincerely hope you enjoy the mod :) -Teaisnt"); BindConfigs(); Harmony.PatchAll(); NetcodePatch(); } private void BindConfigs() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown PolinaWanderSpeed = ((BaseUnityPlugin)this).Config.Bind("Polina Options", "Polina wander speed", 2, "Configure how fast Polina moves while wandering."); PolinaChaseSpeed = ((BaseUnityPlugin)this).Config.Bind("Polina Options", "Polina chase speed", 4, "Configure how fast Polina moves while chasing."); PolinaBashDamage = ((BaseUnityPlugin)this).Config.Bind("Polina Options", "Polina bash damage", 10, "Configure the amount of damage daelt by the bash attack from Polina."); PolinaSyringeDamage = ((BaseUnityPlugin)this).Config.Bind("Polina Options", "Polina syringe damage", 5, "Configure the amount of damage daelt by the syringe attack from Polina."); MusicEnabled = ((BaseUnityPlugin)this).Config.Bind("Music", "Enable music", true, "Configure whether music plays in the interior."); MusicMaxVolume = ((BaseUnityPlugin)this).Config.Bind("Music", "Max volume of songs", 0.15f, new ConfigDescription("Configure how loud each song will be when playing at max volume. Not recommended to set that high but if you want to lose your ears then go for it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); } private void NetcodePatch() { try { IEnumerable loadableTypes = AssemblyExtensions.GetLoadableTypes(Assembly.GetExecutingAssembly()); foreach (Type item in loadableTypes) { MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array = methods; foreach (MethodInfo methodInfo in array) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } catch (Exception ex) { Logger.LogError((object)("NetcodePatcher Failed! This Is Very Bad. Exception: " + ex.Message)); } } } [HarmonyPatch] public class StartUpPatch { [HarmonyPatch(typeof(GameNetworkManager), "Start")] [HarmonyPostfix] public static void InitializeAssets() { QBController qBController = Resources.FindObjectsOfTypeAll().First(); GameObject qbRagdollPrefab = qBController.qbRagdollPrefab; NetworkManager.Singleton.AddNetworkPrefab(qbRagdollPrefab); } } internal class PlushiePhysicsProp : PhysicsProp { public Animator animator; public AudioSource audioSource; public AudioClip squeezeClip; public List randomClipList; public float randClipPlayChance = 100f; public float randomSoundDelay = 0.2f; public override void EquipItem() { ((PhysicsProp)this).EquipItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); animator.SetTrigger("SqueezePlushie"); audioSource.PlayOneShot(squeezeClip); if (randomClipList.Count > 0) { TryPlayRandSoundServerRpc(); } } [ServerRpc] private void TryPlayRandSoundServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2117477458u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2117477458u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int num = Random.Range(0, 100); if ((float)num < randClipPlayChance) { TryPlayRandSoundClientRpc(); } } } [ClientRpc] private void TryPlayRandSoundClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1217967316u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1217967316u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(PlayExtraSound(randomSoundDelay)); } } } private IEnumerator PlayExtraSound(float waitForSeconds) { yield return (object)new WaitForSeconds(waitForSeconds); int rand = Random.Range(0, randomClipList.Count); audioSource.PlayOneShot(randomClipList[rand]); } protected override void __initializeVariables() { ((PhysicsProp)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 ((NetworkBehaviour)this).__registerRpc(2117477458u, new RpcReceiveHandler(__rpc_handler_2117477458), "TryPlayRandSoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(1217967316u, new RpcReceiveHandler(__rpc_handler_1217967316), "TryPlayRandSoundClientRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_2117477458(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((PlushiePhysicsProp)(object)target).TryPlayRandSoundServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1217967316(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; ((PlushiePhysicsProp)(object)target).TryPlayRandSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PlushiePhysicsProp"; } } internal class PolinaAI : EnemyAI { public enum State { Wander, Attack, Chase, Guard } public float fov; public GrabbableObject focusedScrap; public List stabbedPlayers = new List(); public List durationPlayerAffected = new List(); public List audioClips = new List(); public Transform turnCompass = null; public Transform attackArea = null; public ParticleSystem deathParticles; public float wanderMoveSpeed; public float chaseMoveSpeed; private int scrapMask = 64; private int visibleThreatsMask = 524296; private float timeSinceNewRandPos; private float timeSinceAttacking; private Vector3 StalkPos; private Random enemyRandom = null; private bool isDeadAnimationDone; [Header("State")] public State stateType; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { } public override void Start() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); LogIfDebugBuild("Example Enemy Spawned"); base.creatureAnimator.SetTrigger("wander"); timeSinceNewRandPos = 0f; enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { //IL_00fd: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { if (!isDeadAnimationDone) { LogIfDebugBuild("Stopping enemy voice with janky code."); isDeadAnimationDone = true; StopSfxClientRpc(); PlaySoundClientRpc(3); } return; } timeSinceAttacking += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; base.creatureAnimator.SetFloat("speed", base.agent.speed); if (stateType == State.Chase) { base.creatureAnimator.SetBool("isChasing", true); } else { base.creatureAnimator.SetBool("isChasing", false); } if ((Object)(object)base.targetPlayer != (Object)null && (stateType == State.Chase || stateType == State.Attack)) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } if (stabbedPlayers.Count <= 0) { return; } int index = 0; List list = new List(); foreach (PlayerControllerB stabbedPlayer in stabbedPlayers) { list.Add(stabbedPlayer); } foreach (PlayerControllerB item in list) { durationPlayerAffected[index] += Time.deltaTime; if (durationPlayerAffected[index] > 5f) { stabbedPlayers.RemoveAt(index); durationPlayerAffected.RemoveAt(index); item.drunknessInertia = 0f; item.increasingDrunknessThisFrame = false; } else { item.drunknessInertia = Mathf.Clamp(item.drunknessInertia + Time.deltaTime * item.drunknessSpeed, 0.1f, 3f); item.increasingDrunknessThisFrame = true; } } } public override void DoAIInterval() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_013a: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (stateType) { case State.Wander: { base.agent.speed = Plugin.PolinaWanderSpeed.Value; if (FoundClosestPlayerInRange(25f, 1f)) { LogIfDebugBuild("Start Target Player"); ((EnemyAI)this).StopSearch(base.currentSearch, true); DoAnimationClientRpc("chase"); ChangeStateClientRpc(State.Chase); break; } GrabbableObject val = null; int num = 0; int num2 = Physics.OverlapSphereNonAlloc(base.eye.position + base.eye.forward * 28f + base.eye.up * 6f, 30f, RoundManager.Instance.tempColliderResults, scrapMask, (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { float num3 = Vector3.Angle(((Component)RoundManager.Instance.tempColliderResults[i]).transform.position - base.eye.position, base.eye.forward); float num4 = Vector3.Distance(base.eye.position, ((Component)RoundManager.Instance.tempColliderResults[i]).transform.position); if ((!(num4 > 20f) || !(num3 > fov)) && num4 < 20f && Object.op_Implicit((Object)(object)((Component)RoundManager.Instance.tempColliderResults[i]).gameObject.GetComponent())) { GrabbableObject component = ((Component)RoundManager.Instance.tempColliderResults[i]).gameObject.GetComponent(); if (component.scrapValue > 3 && component.scrapValue > num) { val = component; } } if ((Object)(object)val != (Object)null) { focusedScrap = val; } if ((Object)(object)focusedScrap != (Object)null) { ChangeStateClientRpc(State.Guard); } } break; } case State.Chase: base.agent.speed = Plugin.PolinaChaseSpeed.Value; if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 15f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 30f) { LogIfDebugBuild("Stop Target Player"); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ChangeStateClientRpc(State.Wander); ChangeSfxClipClientRpc(5); DoAnimationClientRpc("wander"); } else { ChasingPlayer(); } break; case State.Attack: base.agent.speed = 0.5f; break; case State.Guard: if (FoundClosestPlayerInRange(3f, 3f)) { LogIfDebugBuild("Start Target Player"); if (base.currentSearch != null) { ((EnemyAI)this).StopSearch(base.currentSearch, true); } DoAnimationClientRpc("chase"); ChangeStateClientRpc(State.Chase); focusedScrap = null; } else if ((Object)(object)focusedScrap != (Object)null) { base.destination = GetDestinationFromPosition(((Component)focusedScrap).transform.position); if (Vector3.Distance(((Component)this).transform.position, base.destination) < 1f) { base.agent.speed = 0f; } else { base.agent.speed = Plugin.PolinaWanderSpeed.Value; } } else { ChangeStateClientRpc(State.Wander); } break; default: LogIfDebugBuild("This Behavior State doesn't exist!"); break; } } public Vector3 GetDestinationFromPosition(Vector3 position, bool checkForPath = false) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_00fe: 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) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_008f: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_0065: 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_00cc: Unknown result type (might be due to invalid IL or missing references) if (checkForPath) { position = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 1.75f, base.agentMask); if (base.path1 == null) { base.path1 = new NavMeshPath(); } if (!base.agent.CalculatePath(position, base.path1)) { return Vector3.zero; } int cornersNonAlloc = base.path1.GetCornersNonAlloc(RoundManager.Instance.storedPathCorners); if (Vector3.Distance(RoundManager.Instance.storedPathCorners[cornersNonAlloc - 1], RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 2.7f, base.agentMask)) > 1.55f) { return Vector3.zero; } } base.moveTowardsDestination = true; base.movingTowardsTargetPlayer = false; return RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, -1f, -1); } [ClientRpc(/*Could not decode attribute arguments.*/)] public void StopSfxClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4251533636u, val2, (RpcDelivery)1); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4251533636u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureVoice.Stop(); } } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void ChangeSfxClipClientRpc(int clipNum) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2300189411u, val2, (RpcDelivery)1); BytePacker.WriteValueBitPacked(val, clipNum); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2300189411u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureSFX.clip = audioClips[clipNum]; base.creatureSFX.Play(); } } } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, false, true); return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } private bool TargetClosestPlayerInAnyCase() { //IL_001f: 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) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } private void ChasingPlayer() { //IL_0047: 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) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner) { if (enemyRandom.Next(0, 1) == 0 && timeSinceAttacking > 1f && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 4f) { ((MonoBehaviour)this).StartCoroutine(SwingAttack()); } else { StalkPos = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.forward * 2f; } ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } private IEnumerator SwingAttack() { timeSinceAttacking = 0f; ChangeStateClientRpc(State.Attack); PlaySoundClientRpc(1); yield return (object)new WaitForSeconds(0.3f); if (base.isEnemyDead) { yield break; } float attackChoice = Random.Range(0, 100); if (attackChoice > 50f) { DoAnimationClientRpc("startBashAttack"); yield return (object)new WaitForSeconds(1.1f); SwingAttackHitServerRpc(); if (stateType == State.Attack) { ChangeStateClientRpc(State.Chase); } } else { DoAnimationClientRpc("startSyringeAttack"); yield return (object)new WaitForSeconds(1f); SyringeAttackHitServerRpc(); if (stateType == State.Attack) { ChangeStateClientRpc(State.Chase); } } } public override void OnCollideWithPlayer(Collider other) { } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (base.isEnemyDead) { return; } base.enemyHP -= force; PlaySoundClientRpc(2); if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0 && !base.isEnemyDead) { DeathServerRpc(); ((MonoBehaviour)this).StopCoroutine(SwingAttack()); ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } else { ((MonoBehaviour)this).StartCoroutine(TakeDamage()); } } } [ServerRpc] public void DeathServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1206937300u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1206937300u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DeathClientRpc(); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DeathClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1043843096u, val2, (RpcDelivery)1); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1043843096u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(DeathCoroutine()); } } } public IEnumerator DeathCoroutine() { base.creatureVoice.PlayOneShot(audioClips[3]); base.creatureSFX.Stop(); deathParticles.Play(); List materialList = new List(); float duration = 0f; SkinnedMeshRenderer[] skinnedMeshRenderers = base.skinnedMeshRenderers; foreach (SkinnedMeshRenderer renderer in skinnedMeshRenderers) { Material[] materials = ((Renderer)renderer).materials; foreach (Material material in materials) { materialList.Add(material); } } while (duration < 1f) { foreach (Material material2 in materialList) { material2.SetAlpha(1f - duration); } duration += Time.deltaTime / 3f; yield return null; } foreach (Material material3 in materialList) { material3.SetAlpha(0f); } } private IEnumerator TakeDamage() { DoAnimationClientRpc("takeDamage"); yield return (object)new WaitForSeconds(1f); } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DoAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3097297379u, val2, (RpcDelivery)1); bool flag = animationName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3097297379u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LogIfDebugBuild("Animation: " + animationName); base.creatureAnimator.SetTrigger(animationName); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void PlaySoundClientRpc(int index) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4130239434u, val2, (RpcDelivery)1); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4130239434u, val2, (RpcDelivery)1); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureVoice.PlayOneShot(audioClips[index]); } } } [ClientRpc] public 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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(233811141u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForEnums)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 233811141u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stateType = state; } } } [ServerRpc] public void SwingAttackHitServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2899806010u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2899806010u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BashDamagePlayerClientRpc(); } } [ServerRpc] public void SyringeAttackHitServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(538952453u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 538952453u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyringeDamagePlayerClientRpc(); } } [ClientRpc] public void BashDamagePlayerClientRpc() { //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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1518948935u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1518948935u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.lossyScale, Quaternion.identity, num, (QueryTriggerInteraction)1); if (array.Length == 0) { return; } if (((NetworkBehaviour)this).IsServer) { PlaySoundClientRpc(4); } Collider[] array2 = array; foreach (Collider val3 in array2) { if (!((Object)(object)((Component)val3).GetComponent() != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false); val4.externalForceAutoFade = Vector3.zero; val4.DamagePlayer(Plugin.PolinaBashDamage.Value, true, true, (CauseOfDeath)1, 0, false, Vector3.Normalize(((Component)val4.gameplayCamera).transform.position - ((Component)this).transform.position) * 90f / Vector3.Distance(((Component)val4.gameplayCamera).transform.position, ((Component)this).transform.position)); val4.externalForceAutoFade += Vector3.Normalize(((Component)val4).transform.position - ((Component)this).transform.position + Vector3.up) * 45f / Vector3.Distance(((Component)val4.gameplayCamera).transform.position, ((Component)this).transform.position); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } } [ClientRpc] public void SyringeDamagePlayerClientRpc() { //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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(942859427u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 942859427u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.lossyScale, Quaternion.identity, num, (QueryTriggerInteraction)1); if (array.Length == 0) { return; } if (((NetworkBehaviour)this).IsServer) { PlaySoundClientRpc(5); } Collider[] array2 = array; foreach (Collider val3 in array2) { if (!((Object)(object)((Component)val3).GetComponent() != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { ((Component)val3).GetComponent().DamagePlayer(Plugin.PolinaSyringeDamage.Value, true, true, (CauseOfDeath)14, 0, false, default(Vector3)); stabbedPlayers.Add(((Component)val3).GetComponent()); durationPlayerAffected.Add(0f); HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", 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 //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4251533636u, new RpcReceiveHandler(__rpc_handler_4251533636), "StopSfxClientRpc"); ((NetworkBehaviour)this).__registerRpc(2300189411u, new RpcReceiveHandler(__rpc_handler_2300189411), "ChangeSfxClipClientRpc"); ((NetworkBehaviour)this).__registerRpc(1206937300u, new RpcReceiveHandler(__rpc_handler_1206937300), "DeathServerRpc"); ((NetworkBehaviour)this).__registerRpc(1043843096u, new RpcReceiveHandler(__rpc_handler_1043843096), "DeathClientRpc"); ((NetworkBehaviour)this).__registerRpc(3097297379u, new RpcReceiveHandler(__rpc_handler_3097297379), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(4130239434u, new RpcReceiveHandler(__rpc_handler_4130239434), "PlaySoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(233811141u, new RpcReceiveHandler(__rpc_handler_233811141), "ChangeStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(2899806010u, new RpcReceiveHandler(__rpc_handler_2899806010), "SwingAttackHitServerRpc"); ((NetworkBehaviour)this).__registerRpc(538952453u, new RpcReceiveHandler(__rpc_handler_538952453), "SyringeAttackHitServerRpc"); ((NetworkBehaviour)this).__registerRpc(1518948935u, new RpcReceiveHandler(__rpc_handler_1518948935), "BashDamagePlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(942859427u, new RpcReceiveHandler(__rpc_handler_942859427), "SyringeDamagePlayerClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_4251533636(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; ((PolinaAI)(object)target).StopSfxClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2300189411(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 clipNum = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref clipNum); target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).ChangeSfxClipClientRpc(clipNum); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1206937300(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).DeathServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1043843096(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; ((PolinaAI)(object)target).DeathClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3097297379(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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4130239434(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).PlaySoundClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_233811141(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(ref state, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).ChangeStateClientRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2899806010(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).SwingAttackHitServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_538952453(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((PolinaAI)(object)target).SyringeAttackHitServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1518948935(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; ((PolinaAI)(object)target).BashDamagePlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_942859427(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; ((PolinaAI)(object)target).SyringeDamagePlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PolinaAI"; } } public class PyotrAI : EnemyAI, IVisibleThreat { public float ballHitUpwardAmount = 0.5f; public AnimationCurve grenadeFallCurve; public AnimationCurve grenadeVerticalFallCurve; public AnimationCurve soccerBallVerticalOffset; public AnimationCurve grenadeVerticalFallCurveNoBounce; private Ray soccerRay; private RaycastHit soccerHit; private int soccerBallMask = 369101057; private float hitTimer; public Dictionary threats = new Dictionary(); public Transform focusedThreatTransform; public Threat focusedThreat; public bool focusingOnThreat; public bool focusedThreatIsInView; private int focusLevel; private float fearLevel; private float fearLevelNoDistComparison; private Vector3 agentLocalVelocity; private float velX; private float velZ; private Vector3 previousPosition; public Transform animationContainer; private Ray lookRay; public float fov; public float visionDistance; private int visibleThreatsMask = 524296; private int scrapMask = 64; private int leadershipLevel; private int previousBehaviourState = -1; public PyotrGroup scoutingGroup; private float miscAnimationTimer; private int currentMiscAnimation; private Vector3 lookTarget; private Vector3 peekTarget; private float peekTimer; public AISearchRoutine scoutingSearchRoutine; public static Vector3 baboonCampPosition; public float scoutTimer; public float timeToScout; private float timeSinceRestWhileScouting; private float restingDuringScouting; private bool eyesClosed; private bool restingAtCamp; private float restAtCampTimer; private float chosenDistanceToCamp = 1f; private float timeSincePingingBirdInterest; private float timeSinceLastMiscAnimation; private float timeSinceUpdatedDestination = 0f; private int aggressiveMode; private int previousAggressiveMode; private float fightTimer; public AudioSource aggressionAudio; private Vector3 debugSphere; public Collider ownCollider; private float timeSinceAggressiveDisplay; private float timeSpentFocusingOnThreat; private float timeSinceFighting; private bool doingKillAnimation; private Coroutine killAnimCoroutine; private float timeSinceHitting; public Transform deadBodyPoint; public AudioClip[] cawScreamSFX; public AudioClip[] cawLaughSFX; public AudioClip pyotrBashSound; private float noiseTimer; private float noiseInterval; public GrabbableObject focusedScrap; public GrabbableObject heldScrap; public bool movingToScrap; public Transform grabTarget; private bool oddAIInterval; private DeadBodyInfo killAnimationBody; private float timeSinceBeingAttackedByPlayer; private float timeSinceJoiningOrLeavingScoutingGroup; private PyotrAI biggestBaboon; ThreatType IVisibleThreat.type => (ThreatType)7; GrabbableObject IVisibleThreat.GetHeldObject() { return null; } bool IVisibleThreat.IsThreatDead() { return false; } int IVisibleThreat.SendSpecialBehaviour(int id) { return 0; } int IVisibleThreat.GetThreatLevel(Vector3 seenByPosition) { int num = 0; num = 1; if (aggressiveMode == 2) { num++; } if (scoutingGroup != null && !scoutingGroup.isEmpty) { num++; } return num; } int IVisibleThreat.GetInterestLevel() { return 0; } Transform IVisibleThreat.GetThreatLookTransform() { return base.eye; } Transform IVisibleThreat.GetThreatTransform() { return ((Component)this).transform; } Vector3 IVisibleThreat.GetThreatVelocity() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //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_0022: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { return base.agent.velocity; } return Vector3.zero; } float IVisibleThreat.GetVisibility() { if (base.isEnemyDead) { return 0f; } if (restingAtCamp) { return 0.6f; } return 1f; } public override void Start() { //IL_0048: 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) ((EnemyAI)this).Start(); if (((NetworkBehaviour)this).IsOwner) { Random random = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); leadershipLevel = random.Next(0, 500); ((EnemyAI)this).StartSearch(((Component)this).transform.position, scoutingSearchRoutine); SyncInitialValuesServerRpc(leadershipLevel, baboonCampPosition); } } [ServerRpc] public void SyncInitialValuesServerRpc(int syncLeadershipLevel, Vector3 campPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_00b7: 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_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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1741341585u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, syncLeadershipLevel); ((FastBufferWriter)(ref val)).WriteValueSafe(ref campPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1741341585u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncInitialValuesClientRpc(syncLeadershipLevel, campPosition); } } [ClientRpc] public void SyncInitialValuesClientRpc(int syncLeadershipLevel, Vector3 campPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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) //IL_00fa: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(658517639u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, syncLeadershipLevel); ((FastBufferWriter)(ref val)).WriteValueSafe(ref campPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 658517639u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; leadershipLevel = syncLeadershipLevel; baboonCampPosition = campPosition; ((Component)this).transform.localScale = ((Component)this).transform.localScale * Mathf.Max((float)leadershipLevel / 200f * 0.6f, 0.9f); } } } public override void OnCollideWithPlayer(Collider other) { //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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004a: 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_0059: 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_0063: 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_0072: 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_007e: 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_008d: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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) ((EnemyAI)this).OnCollideWithPlayer(other); if (timeSinceHitting < 0.5f) { return; } Vector3 val = Vector3.Normalize(((Component)this).transform.position + Vector3.up * 0.7f - (((Component)other).transform.position + Vector3.up * 0.4f)) * 0.5f; if (Physics.Linecast(((Component)this).transform.position + Vector3.up * 0.7f + val, ((Component)other).transform.position + Vector3.up * 0.4f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, base.inSpecialAnimation || doingKillAnimation, false); if ((Object)(object)val2 != (Object)null) { timeSinceHitting = 0f; val2.DamagePlayer(20, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); if (val2.isPlayerDead) { StabPlayerDeathAnimServerRpc((int)val2.playerClientId); return; } base.creatureAnimator.ResetTrigger("startBashAttack"); base.creatureAnimator.SetTrigger("startBashAttack"); PlaySound(pyotrBashSound); } } public override void OnCollideWithEnemy(Collider other, EnemyAI enemyScript = null) { ((EnemyAI)this).OnCollideWithEnemy(other, (EnemyAI)null); } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (base.isEnemyDead) { return; } base.creatureAnimator.SetTrigger("takeDamage"); if ((Object)(object)playerWhoHit != (Object)null) { timeSinceBeingAttackedByPlayer = 0f; if (threats.TryGetValue(((Component)playerWhoHit).transform, out Threat value)) { value.hasAttacked = true; fightTimer = 7f; } } base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } StopKillAnimation(); } public override void KillEnemy(bool destroy = false) { ((EnemyAI)this).KillEnemy(destroy); base.creatureAnimator.SetBool("IsDead", true); StopKillAnimation(); } public void StopKillAnimation() { if (killAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(killAnimCoroutine); } base.agent.acceleration = 17f; base.inSpecialAnimation = false; doingKillAnimation = false; if ((Object)(object)killAnimationBody != (Object)null) { killAnimationBody.attachedLimb = null; killAnimationBody.attachedTo = null; killAnimationBody = null; } } [ServerRpc(RequireOwnership = false)] public void StabPlayerDeathAnimServerRpc(int playerObject) { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3448799424u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerObject); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3448799424u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!doingKillAnimation) { doingKillAnimation = true; StabPlayerDeathAnimClientRpc(playerObject); } } } [ClientRpc] public void StabPlayerDeathAnimClientRpc(int playerObject) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(530686194u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerObject); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 530686194u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; doingKillAnimation = true; base.inSpecialAnimation = true; base.agent.acceleration = 70f; base.agent.speed = 0f; if (killAnimCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(killAnimCoroutine); } killAnimCoroutine = ((MonoBehaviour)this).StartCoroutine(killPlayerAnimation(playerObject)); } } private IEnumerator killPlayerAnimation(int playerObject) { PlayerControllerB killedPlayer = StartOfRound.Instance.allPlayerScripts[playerObject]; base.creatureAnimator.ResetTrigger("KillAnimation"); base.creatureAnimator.SetTrigger("KillAnimation"); float startTime = Time.realtimeSinceStartup; yield return (object)new WaitUntil((Func)(() => Time.realtimeSinceStartup - startTime > 1f || (Object)(object)killedPlayer.deadBody != (Object)null)); if ((Object)(object)killedPlayer.deadBody != (Object)null) { killAnimationBody = killedPlayer.deadBody; killAnimationBody.attachedLimb = killedPlayer.deadBody.bodyParts[5]; killAnimationBody.attachedTo = deadBodyPoint; killAnimationBody.matchPositionExactly = true; killAnimationBody.canBeGrabbedBackByPlayers = false; yield return null; yield return (object)new WaitForSeconds(1.7f); killAnimationBody.attachedLimb = null; killAnimationBody.attachedTo = null; } base.agent.acceleration = 17f; base.inSpecialAnimation = false; doingKillAnimation = false; } private void InteractWithScrap() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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) if ((Object)(object)focusedScrap != (Object)null) { if (base.debugEnemyAI) { Debug.DrawRay(((Component)focusedScrap).transform.position, Vector3.up * 3f, Color.yellow); } if (!CanGrabScrap(focusedScrap)) { focusedScrap = null; } else if (timeSinceUpdatedDestination > 0.5f && base.currentBehaviourStateIndex != 3 && Vector3.Distance(((Component)this).transform.position, ((Component)focusedScrap).transform.position) < 1.4f) { BeginHitScrap(((Component)this).transform.position, hitByEnemy: false); timeSinceUpdatedDestination = 0f; } } } public Vector3 GetDestinationFromPosition(Vector3 position, bool checkForPath = false) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_00fe: 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) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_008f: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_0065: 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_00cc: Unknown result type (might be due to invalid IL or missing references) if (checkForPath) { position = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 1.75f, base.agentMask); if (base.path1 == null) { base.path1 = new NavMeshPath(); } if (!base.agent.CalculatePath(position, base.path1)) { return Vector3.zero; } int cornersNonAlloc = base.path1.GetCornersNonAlloc(RoundManager.Instance.storedPathCorners); if (Vector3.Distance(RoundManager.Instance.storedPathCorners[cornersNonAlloc - 1], RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 2.7f, base.agentMask)) > 1.55f) { return Vector3.zero; } } base.moveTowardsDestination = true; base.movingTowardsTargetPlayer = false; return RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, -1f, -1); } public void BeginHitScrap(Vector3 hitFromPosition, bool hitByEnemy) { //IL_00eb: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) if (timeSinceUpdatedDestination < 0.5f || (hitByEnemy && !((NetworkBehaviour)this).IsServer) || focusedScrap.isHeld || (Object)(object)focusedScrap.parentObject != (Object)null || ((Object)(object)((Component)focusedScrap).transform.parent != (Object)(object)StartOfRound.Instance.elevatorTransform && (Object)(object)((Component)focusedScrap).transform.parent != (Object)(object)RoundManager.Instance.spawnedScrapContainer && (Object)(object)((Component)focusedScrap).transform.parent != (Object)(object)StartOfRound.Instance.propsContainer) || Time.realtimeSinceStartup - hitTimer < 0.35f || !CanUpdateDestination()) { return; } UpdateDestination(CharlottesDollRoomController.Instance.pyotrTargetPoint.position, checkForPath: true); NavMeshHit hit = default(NavMeshHit); base.agent.SamplePathPosition(StartOfRound.Instance.walkableSurfacesMask, 5f, ref hit); if (Vector3.Distance(((NavMeshHit)(ref hit)).position, ((Component)this).transform.position) < 2f) { BeginHitScrap(hitFromPosition, hitByEnemy); return; } if (Vector3.Distance(CharlottesDollRoomController.Instance.pyotrTargetPoint.position, ((Component)focusedScrap).transform.position) < 15f && !CharlottesDollRoomController.Instance.itemsPlaced.Contains(focusedScrap)) { CharlottesDollRoomController.Instance.itemsPlaced.Add(focusedScrap); CharlottesDollRoomController.Instance.itemsTryingToBePlaced.Remove(focusedScrap); focusedScrap = null; ((EnemyAI)this).SwitchToBehaviourState(0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, scoutingSearchRoutine); return; } if (!CharlottesDollRoomController.Instance.itemsTryingToBePlaced.Contains(focusedScrap) && !CharlottesDollRoomController.Instance.itemsPlaced.Contains(focusedScrap)) { CharlottesDollRoomController.Instance.itemsTryingToBePlaced.Add(focusedScrap); } hitTimer = Time.realtimeSinceStartup; if (!CanUpdateDestination()) { return; } base.currentBehaviourStateIndex = 3; base.creatureAnimator.SetTrigger("startBashAttack"); ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { }, 0.5f, delegate { //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_0016: 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_0020: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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) //IL_007f: 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_0088: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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) Vector3 val = ((NavMeshHit)(ref hit)).position + Vector3.up * 0.07f; if (!(val == Vector3.zero)) { bool setInShipRoom = false; Bounds bounds = StartOfRound.Instance.shipBounds.bounds; bool setInElevator; if (!((Bounds)(ref bounds)).Contains(val)) { setInElevator = false; val = StartOfRound.Instance.propsContainer.InverseTransformPoint(val); } else { setInElevator = true; bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; setInShipRoom = ((Bounds)(ref bounds)).Contains(val); val = StartOfRound.Instance.elevatorTransform.InverseTransformPoint(val); } KickBallLocalClient(val, setInElevator, setInShipRoom); KickBallServerRpc(val, (int)GameNetworkManager.Instance.localPlayerController.playerClientId, setInElevator, setInShipRoom); } })); } private bool CanUpdateDestination() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return TestDestinationToPosition(CharlottesDollRoomController.Instance.pyotrTargetPoint.position, checkForPath: true); } public bool TestDestinationToPosition(Vector3 position, bool checkForPath = false) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0038: 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_0074: 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_008a: Unknown result type (might be due to invalid IL or missing references) if (checkForPath) { position = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 1.75f, base.agentMask); NavMeshPath val = new NavMeshPath(); if (!base.agent.CalculatePath(position, val)) { return false; } int cornersNonAlloc = val.GetCornersNonAlloc(RoundManager.Instance.storedPathCorners); if (Vector3.Distance(RoundManager.Instance.storedPathCorners[cornersNonAlloc - 1], RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 2.7f, base.agentMask)) > 1.55f) { return false; } } base.moveTowardsDestination = true; base.movingTowardsTargetPlayer = false; return true; } private void UpdateDestination(Vector3 position, bool checkForPath) { //IL_0015: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (!(timeSinceUpdatedDestination < 0.5f)) { Vector3 destination = base.destination; base.destination = GetDestinationFromPosition(position, checkForPath); if (base.destination != destination) { timeSinceUpdatedDestination = 0f; } } } [ServerRpc(RequireOwnership = false)] public void KickBallServerRpc(Vector3 dest, int playerWhoKicked, bool setInElevator, bool setInShipRoom) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_007e: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1741324269u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref dest); BytePacker.WriteValueBitPacked(val, playerWhoKicked); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setInShipRoom, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1741324269u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerWhoKicked != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { KickBallLocalClient(dest, setInElevator, setInShipRoom); } KickBallClientRpc(dest, setInElevator, setInShipRoom); } } [ClientRpc] public void KickBallClientRpc(Vector3 dest, bool setInElevator, bool setInShipRoom) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_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_00a5: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(8736421u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref dest); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setInShipRoom, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 8736421u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { KickBallLocalClient(dest, setInElevator, setInShipRoom); } } } private void KickBallLocalClient(Vector3 destinationPos, bool setInElevator, bool setInShipRoom) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(MoveScrapCoroutine(destinationPos, setInElevator, setInShipRoom, 0.25f)); } private IEnumerator MoveScrapCoroutine(Vector3 destinationPos, bool setInElevator, bool setInShipRoom, float timeToMove) { //IL_000e: 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) if (!((Object)(object)focusedScrap == (Object)null)) { PlaySound(pyotrBashSound); Vector3 localStart = ((Component)StartOfRound.Instance.propsContainer).transform.InverseTransformPoint(((Component)focusedScrap).transform.position); float elapsedTime = 0f; while (elapsedTime < timeToMove) { float t = elapsedTime / timeToMove; focusedScrap.targetFloorPosition = Vector3.Lerp(localStart, destinationPos, t); elapsedTime += Time.deltaTime; focusedScrap.fallTime = 1f; yield return null; } focusedScrap.fallTime = 0f; focusedScrap.hasHitGround = false; if (setInElevator) { ((Component)focusedScrap).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); } else { ((Component)focusedScrap).transform.SetParent(StartOfRound.Instance.propsContainer, true); } GameNetworkManager.Instance.localPlayerController.SetItemInElevator(setInElevator, setInShipRoom, focusedScrap); focusedScrap.startFallingPosition = ((Component)focusedScrap).transform.parent.InverseTransformPoint(((Component)focusedScrap).transform.position + Vector3.up * 0.07f); focusedScrap.targetFloorPosition = destinationPos; } } private bool CanGrabScrap(GrabbableObject scrap) { //IL_0085: 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) if (scrap.itemProperties.itemId == 1531) { return false; } if (scrap.isInShipRoom && !base.isInsidePlayerShip) { return false; } if (base.isEnemyDead) { return false; } if (!scrap.heldByPlayerOnServer && !scrap.isHeld && ((Object)(object)scrap == (Object)(object)heldScrap || !scrap.isHeldByEnemy)) { return Vector3.Distance(((Component)scrap).transform.position, baboonCampPosition) > 8f; } return false; } public override void ReachedNodeInSearch() { ((EnemyAI)this).ReachedNodeInSearch(); if (base.currentSearch.nodesEliminatedInCurrentSearch > 14 && timeSinceRestWhileScouting > 17f && timeSinceAggressiveDisplay > 6f) { timeSinceRestWhileScouting = 0f; restingDuringScouting = 12f; } } public override void DoAIInterval() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_0822: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_09af: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09c9: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Unknown result type (might be due to invalid IL or missing references) //IL_09d3: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Unknown result type (might be due to invalid IL or missing references) //IL_09e6: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0a04: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a1e: Unknown result type (might be due to invalid IL or missing references) //IL_0a23: Unknown result type (might be due to invalid IL or missing references) //IL_0a2d: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a37: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a52: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Unknown result type (might be due to invalid IL or missing references) //IL_0ab1: Unknown result type (might be due to invalid IL or missing references) //IL_0a74: Unknown result type (might be due to invalid IL or missing references) //IL_0a7e: Unknown result type (might be due to invalid IL or missing references) //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0ab6: Unknown result type (might be due to invalid IL or missing references) //IL_0ab8: Unknown result type (might be due to invalid IL or missing references) //IL_0aba: Unknown result type (might be due to invalid IL or missing references) //IL_0abf: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead) { base.agent.speed = 0f; if (scoutingSearchRoutine.inProgress) { ((EnemyAI)this).StopSearch(scoutingSearchRoutine, false); } return; } if (base.stunNormalizedTimer > 0f || miscAnimationTimer > 0f) { base.agent.speed = 0f; if (doingKillAnimation && base.stunNormalizedTimer >= 0f) { StopKillAnimation(); } if ((Object)(object)base.stunnedByPlayer != (Object)null) { PingBaboonInterest(((Component)base.stunnedByPlayer.gameplayCamera).transform.position, 4); } } if (base.inSpecialAnimation) { base.agent.speed = 0f; return; } if (!eyesClosed) { DoLOSCheck(); } InteractWithScrap(); switch (base.currentBehaviourStateIndex) { case 0: if (previousBehaviourState != base.currentBehaviourStateIndex) { timeToScout = Random.Range(25, 70); scoutTimer = 0f; restingAtCamp = false; restAtCampTimer = 0f; SetAggressiveMode(0); previousBehaviourState = base.currentBehaviourStateIndex; } if (!((NetworkBehaviour)this).IsOwner) { break; } if ((Object)(object)focusedScrap != (Object)null) { if (Vector3.Distance(((Component)focusedScrap).transform.position, ((Component)this).transform.position) < 1.5f) { base.agent.speed = 0f; } else { base.agent.speed = 5f; } UpdateDestination(((Component)focusedScrap).transform.position + Vector3.forward, checkForPath: true); } if (scoutingGroup == null || (Object)(object)scoutingGroup.leader == (Object)(object)this || !scoutingGroup.members.Contains(this)) { _ = scoutingGroup; if (restingDuringScouting >= 0f) { if (scoutingSearchRoutine.inProgress) { ((EnemyAI)this).StopSearch(scoutingSearchRoutine, false); } base.creatureAnimator.SetBool("isChasing", true); restingDuringScouting -= base.AIIntervalTime; base.agent.speed = 0f; } else { if (!scoutingSearchRoutine.inProgress && (Object)(object)focusedScrap == (Object)null) { ((EnemyAI)this).StartSearch(baboonCampPosition, scoutingSearchRoutine); } if (base.creatureAnimator.GetBool("isChasing")) { EnemyGetUpServerRpc(); base.creatureAnimator.SetBool("isChasing", false); } base.agent.speed = 5f; } } else { if (scoutingSearchRoutine.inProgress) { ((EnemyAI)this).StopSearch(scoutingSearchRoutine, true); } if (base.creatureAnimator.GetBool("isChasing")) { EnemyGetUpServerRpc(); base.creatureAnimator.SetBool("isChasing", false); } base.agent.speed = 6f; if (Vector3.Distance(((Component)this).transform.position, ((Component)scoutingGroup.leader).transform.position) > 60f || ((EnemyAI)this).PathIsIntersectedByLineOfSight(((Component)scoutingGroup.leader).transform.position, false, false, false)) { LeaveCurrentScoutingGroup(sync: true); } else if (Vector3.Distance(base.destination, ((Component)scoutingGroup.leader).transform.position) > 8f && (Object)(object)focusedScrap == (Object)null) { UpdateDestination(RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(((Component)scoutingGroup.leader).transform.position, 6f, RoundManager.Instance.navHit), checkForPath: true); } } if (scoutTimer < timeToScout && (Object)(object)heldScrap == (Object)null) { scoutTimer += base.AIIntervalTime; } else { ((EnemyAI)this).SwitchToBehaviourState(1); } break; case 1: if (previousBehaviourState != base.currentBehaviourStateIndex) { restingDuringScouting = 0f; scoutTimer = 0f; chosenDistanceToCamp = Random.Range(1f, 7f); LeaveCurrentScoutingGroup(sync: true); SetAggressiveMode(0); previousBehaviourState = base.currentBehaviourStateIndex; } if (scoutingSearchRoutine.inProgress) { ((EnemyAI)this).StopSearch(scoutingSearchRoutine, true); } if ((Object)(object)focusedScrap != (Object)null && !CharlottesDollRoomController.Instance.itemsPlaced.Contains(focusedScrap)) { UpdateDestination(((Component)focusedScrap).transform.position + Vector3.forward, checkForPath: true); } break; case 2: { if (previousBehaviourState != base.currentBehaviourStateIndex) { timeSpentFocusingOnThreat = 0f; base.creatureAnimator.SetBool("isChasing", false); EnemyGetUpServerRpc(); previousBehaviourState = base.currentBehaviourStateIndex; } if (focusedThreat == null || !focusingOnThreat) { StopFocusingThreat(); } if (scoutingSearchRoutine.inProgress) { ((EnemyAI)this).StopSearch(scoutingSearchRoutine, false); } base.agent.speed = 4f; float num = fearLevelNoDistComparison * 2f; if (focusedThreat.interestLevel <= 0 || base.enemyHP <= 3) { num = Mathf.Max(num, 1f); } float num2 = GetComfortableDistanceToThreat(focusedThreat) + num; float num3 = Vector3.Distance(((Component)this).transform.position, focusedThreat.lastSeenPosition); bool flag = false; float num4 = Time.realtimeSinceStartup - focusedThreat.timeLastSeen; if (num4 > 5f) { SetThreatInView(inView: false); focusLevel = 0; StopFocusingThreat(); break; } if (num4 > 3f) { SetThreatInView(inView: false); focusLevel = 1; if (num2 - num3 > 2f) { StopFocusingThreat(); break; } } else if (num4 > 1f) { flag = true; focusedThreatIsInView = false; SetThreatInView(inView: false); focusLevel = 2; SetAggressiveMode(0); } else if (num4 < 0.55f) { flag = true; SetThreatInView(inView: true); } bool flag2 = (fearLevel > 0f && fearLevel < 4f) || focusedThreat.interestLevel > 0 || fearLevel < -6f || focusedThreat.hasAttacked; if (aggressiveMode == 2) { focusLevel = 3; Vector3 val = focusedThreat.threatScript.GetThreatTransform().position + focusedThreat.threatScript.GetThreatVelocity() * 10f; Debug.DrawRay(val, Vector3.up * 5f, Color.red, base.AIIntervalTime); UpdateDestination(val, checkForPath: true); if (fightTimer > 4f || timeSinceBeingAttackedByPlayer < 4f || (fightTimer > 2f && (fearLevel >= 1f || !flag2)) || (base.enemyHP <= 3 && !flag2)) { scoutTimer = timeToScout - 20f; fightTimer = -7f; SetAggressiveMode(1); } else if (num3 > 4f) { fightTimer += base.AIIntervalTime * 2f; } else if (num3 > 1f) { fightTimer += base.AIIntervalTime; } else { fightTimer += base.AIIntervalTime / 2f; } break; } bool flag3 = false; if ((Object)(object)focusedScrap != (Object)null && (!flag || fearLevel <= 2f)) { UpdateDestination(((Component)focusedScrap).transform.position + Vector3.forward, checkForPath: true); flag3 = true; } Vector3 val2 = focusedThreat.lastSeenPosition + focusedThreat.threatScript.GetThreatVelocity() * -17f; Debug.DrawRay(val2, Vector3.up * 3f, Color.red, base.AIIntervalTime); Ray val3 = default(Ray); ((Ray)(ref val3))..ctor(((Component)this).transform.position + Vector3.up * 0.5f, Vector3.Normalize((((Component)this).transform.position + Vector3.up * 0.5f - val2) * 100f)); RaycastHit val5 = default(RaycastHit); Vector3 val4 = ((!Physics.Raycast(val3, ref val5, num2 - num3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) ? RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val3)).GetPoint(num2 - num3), RoundManager.Instance.navHit, 8f, -1) : RoundManager.Instance.GetNavMeshPosition(((RaycastHit)(ref val5)).point, RoundManager.Instance.navHit, 8f, -1)); Debug.DrawRay(val4, Vector3.up, Color.blue, base.AIIntervalTime); if (fightTimer > 7f && timeSinceFighting > 4f) { fightTimer = -6f; SetAggressiveMode(2); break; } bool flag4 = false; if (scoutingGroup != null) { for (int i = 0; i < scoutingGroup.members.Count; i++) { if (scoutingGroup.members[i].aggressiveMode == 2) { flag4 = true; } } } float num5 = GetComfortableDistanceToThreat(focusedThreat) - num3; if (fearLevel <= -5f) { if (noiseTimer >= noiseInterval) { noiseInterval = Random.Range(0.2f, 0.7f); noiseTimer = 0f; RoundManager.PlayRandomClip(base.creatureVoice, cawLaughSFX, true, 1f, 1105, 1000); } else { noiseTimer += Time.deltaTime; } } if ((flag && ((num5 > 8f && flag2) || num3 < 5f)) || timeSinceBeingAttackedByPlayer < 4f) { if (timeSinceFighting > 5f) { fightTimer += base.AIIntervalTime * 10.6f / (focusedThreat.distanceToThreat * 0.3f); } SetAggressiveMode(1); } else if (num5 > 4f && fearLevel < 3f && flag2) { fightTimer += base.AIIntervalTime * 7.4f / (focusedThreat.distanceToThreat * 0.3f); SetAggressiveMode(1); } else { if (!(num5 < 2f)) { break; } if (timeSinceAggressiveDisplay > 2.5f) { SetAggressiveMode(0); } fightTimer -= Mathf.Max(-6f, base.AIIntervalTime * 0.2f); if (timeSpentFocusingOnThreat > 4f + (float)focusedThreat.interestLevel * 8f && !flag4) { if (fightTimer > 4f) { fightTimer -= Mathf.Max(-6f, base.AIIntervalTime * 0.5f * (focusedThreat.distanceToThreat * 0.1f)); } else { StopFocusingThreat(); } } } break; } case 3: if (scoutingSearchRoutine.inProgress) { ((EnemyAI)this).StopSearch(scoutingSearchRoutine, false); } base.agent.speed = 0f; if (timeSinceUpdatedDestination > 0.5f) { base.currentBehaviourStateIndex = 0; } break; } } private void StopFocusingThreat() { if (base.currentBehaviourStateIndex == 2) { aggressiveMode = 0; focusingOnThreat = false; focusedThreatIsInView = false; focusedThreatTransform = null; focusedThreat = null; if ((Object)(object)heldScrap == (Object)null) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); } else { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); } StopFocusingThreatServerRpc((Object)(object)heldScrap == (Object)null); } } [ServerRpc] public void StopFocusingThreatServerRpc(bool enterScoutingMode) { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2033874396u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enterScoutingMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2033874396u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopFocusingThreatClientRpc(enterScoutingMode); } } [ClientRpc] public void StopFocusingThreatClientRpc(bool enterScoutingMode) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1235366102u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enterScoutingMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1235366102u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { aggressiveMode = 0; focusedThreatTransform = null; focusedThreat = null; if (enterScoutingMode) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); } else { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); } } } private void SetAggressiveMode(int mode) { if (aggressiveMode != mode) { aggressiveMode = mode; SetAggressiveModeServerRpc(mode); } } [ServerRpc] public void SetAggressiveModeServerRpc(int mode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(863516347u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, mode); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 863516347u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAggressiveModeClientRpc(mode); } } [ClientRpc] public void SetAggressiveModeClientRpc(int mode) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(987980034u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, mode); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 987980034u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { aggressiveMode = mode; } } } private void SetThreatInView(bool inView) { if (focusedThreatIsInView != inView) { focusedThreatIsInView = inView; SetThreatInViewServerRpc(inView); } } [ServerRpc] public void SetThreatInViewServerRpc(bool inView) { //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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1444303054u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inView, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1444303054u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetThreatInViewClientRpc(inView); } } [ClientRpc] public void SetThreatInViewClientRpc(bool inView) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1358342937u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inView, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1358342937u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { focusedThreatIsInView = inView; } } } [ServerRpc] public void EnemyEnterRestModeServerRpc(bool sleep, bool atCamp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Invalid comparison between Unknown and I4 //IL_013d: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3532884324u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref sleep, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref atCamp, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3532884324u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EnemyEnterRestModeClientRpc(sleep, atCamp); } } [ClientRpc] public void EnemyEnterRestModeClientRpc(bool sleep, bool atCamp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(537845835u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref sleep, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref atCamp, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 537845835u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; restingAtCamp = atCamp; if (sleep) { eyesClosed = true; base.creatureAnimator.SetBool("isChasing", false); } else { eyesClosed = false; base.creatureAnimator.SetBool("isChasing", true); } } } [ServerRpc] public void EnemyGetUpServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(471502079u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 471502079u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EnemyGetUpClientRpc(); } } [ClientRpc] public void EnemyGetUpClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1473363069u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1473363069u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { base.creatureAnimator.SetBool("isChasing", false); } } } public override void OnDrawGizmos() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (!base.debugEnemyAI) { return; } if (base.currentBehaviourStateIndex == 1) { Gizmos.DrawCube(((Component)this).transform.position + Vector3.up * 2f, new Vector3(0.2f, 0.2f, 0.2f)); } else if (scoutingGroup != null) { if ((Object)(object)scoutingGroup.leader == (Object)(object)this) { Gizmos.DrawSphere(((Component)this).transform.position + Vector3.up * 2f, 0.6f); return; } Gizmos.DrawLine(((Component)scoutingGroup.leader).transform.position + Vector3.up * 2f, ((Component)this).transform.position + Vector3.up * 2f); Gizmos.DrawSphere(((Component)this).transform.position + Vector3.up * 2f, 0.1f); } } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_003e: 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_0073: 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_015f: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || base.isEnemyDead) { return; } ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); if (Vector3.Distance(noisePosition, ((Component)this).transform.position + Vector3.up * 0.4f) < 0.75f || noiseID == 1105 || noiseID == 24751) { return; } float num = Vector3.Distance(noisePosition, ((Component)this).transform.position); float num2 = noiseLoudness / num; if (eyesClosed) { num2 *= 0.75f; } if (num2 < 0.12f && peekTimer >= 0f && focusLevel > 0) { return; } if (focusLevel >= 3) { if (num > 3f || num2 <= 0.06f) { return; } } else if (focusLevel == 2) { if (num > 25f || num2 <= 0.05f) { return; } } else if (focusLevel == 1 && (num > 40f || num2 <= 0.05f)) { return; } PingBaboonInterest(noisePosition, focusLevel); } public override void Update() { //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { return; } base.creatureAnimator.SetFloat("speed", base.agent.speed); timeSinceHitting += Time.deltaTime; if (base.stunNormalizedTimer > 0f || miscAnimationTimer > 0f) { base.agent.speed = 0f; } base.creatureAnimator.SetBool("stunned", base.stunNormalizedTimer > 0f); if (miscAnimationTimer <= 0f) { currentMiscAnimation = -1; } else { miscAnimationTimer -= Time.deltaTime; } CalculateAnimationDirection(2f); timeSinceUpdatedDestination += Time.deltaTime; timeSinceLastMiscAnimation += Time.deltaTime; timeSincePingingBirdInterest += Time.deltaTime; timeSinceBeingAttackedByPlayer += Time.deltaTime; timeSinceJoiningOrLeavingScoutingGroup += Time.deltaTime; if (base.debugEnemyAI) { if (focusedThreat != null && focusingOnThreat) { HUDManager.Instance.SetDebugText(string.Format("{0}; {1}; \n Focused threat level: {2}", fearLevel.ToString("0.0"), fearLevelNoDistComparison.ToString("0.0"), focusedThreat.threatLevel)); } else { HUDManager.Instance.SetDebugText(fearLevel.ToString("0.0") + "; " + fearLevelNoDistComparison.ToString("0.0")); } } switch (aggressiveMode) { case 0: if (previousAggressiveMode != aggressiveMode) { previousAggressiveMode = aggressiveMode; } if (aggressionAudio.volume <= 0f) { aggressionAudio.Stop(); } else { aggressionAudio.volume = Mathf.Max(aggressionAudio.volume - Time.deltaTime * 5f, 0f); } timeSinceAggressiveDisplay = 0f; break; case 1: if (previousAggressiveMode != aggressiveMode) { base.creatureAnimator.SetBool("isChasing", true); RoundManager.PlayRandomClip(base.creatureVoice, cawScreamSFX, true, 1f, 1105, 1000); aggressionAudio.Play(); previousAggressiveMode = aggressiveMode; } timeSinceAggressiveDisplay += Time.deltaTime; aggressionAudio.volume = Mathf.Min(aggressionAudio.volume + Time.deltaTime * 4f, 1f); break; case 2: if (previousAggressiveMode != aggressiveMode) { base.creatureAnimator.SetBool("isChasing", true); aggressionAudio.Play(); previousAggressiveMode = aggressiveMode; } timeSinceAggressiveDisplay += Time.deltaTime; aggressionAudio.volume = Mathf.Min(aggressionAudio.volume + Time.deltaTime * 5f, 1f); break; } switch (base.currentBehaviourStateIndex) { case 0: restingAtCamp = false; eyesClosed = false; focusedThreatTransform = null; break; case 1: focusedThreatTransform = null; break; case 2: if ((Object)(object)focusedThreatTransform != (Object)null && focusedThreatIsInView) { lookTarget = focusedThreatTransform.position; } timeSpentFocusingOnThreat += Time.deltaTime; timeSinceFighting += Time.deltaTime; break; } } private float GetComfortableDistanceToThreat(Threat focusedThreat) { return Mathf.Min((float)focusedThreat.threatLevel * 6f, 25f); } private void ReactToThreat(Threat closestThreat) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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) if (Vector3.Distance(closestThreat.lastSeenPosition, baboonCampPosition) < 18f) { closestThreat.interestLevel++; } if (closestThreat != focusedThreat && (focusedThreat == null || focusedThreat.threatLevel <= closestThreat.threatLevel) && closestThreat.distanceToThreat < GetComfortableDistanceToThreat(closestThreat)) { NetworkObject component = ((Component)closestThreat.threatScript.GetThreatTransform()).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { Debug.LogError((object)"Baboon: Error, threat did not contain network object. All objects implementing IVisibleThreat must have a NetworkObject"); return; } fightTimer = 0f; focusingOnThreat = true; StartFocusOnThreatServerRpc(NetworkObjectReference.op_Implicit(component)); focusedThreat = closestThreat; focusedThreatTransform = closestThreat.threatScript.GetThreatLookTransform(); } } [ServerRpc] public void StartFocusOnThreatServerRpc(NetworkObjectReference netObject) { //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_012a: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3432123218u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3432123218u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartFocusOnThreatClientRpc(netObject); } } [ClientRpc] public void StartFocusOnThreatClientRpc(NetworkObjectReference netObject) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3045414500u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3045414500u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref netObject)).TryGet(ref val3, (NetworkManager)null)) { Debug.LogError((object)$"Baboon: Error, could not get network object from id for StartFocusOnThreatClientRpc; id: {val3.NetworkObjectId}"); return; } IVisibleThreat val4 = default(IVisibleThreat); if (!((Component)((Component)val3).transform).TryGetComponent(ref val4)) { Debug.LogError((object)$"Baboon: Error, threat transform did not contain IVisibleThreat in StartFocusOnThreatClientRpc; id: {val3.NetworkObjectId}"); return; } focusingOnThreat = true; focusedThreatTransform = val4.GetThreatLookTransform(); } } private float ReactToOtherBaboonSighted(PyotrAI otherBaboon) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) float num = 0f; if (((EnemyAI)otherBaboon).isEnemyDead) { num += 4f; } else if (((EnemyAI)otherBaboon).currentBehaviourStateIndex != 1 && base.currentBehaviourStateIndex != 1) { if (((EnemyAI)otherBaboon).currentBehaviourStateIndex == 2 && otherBaboon.focusedThreatIsInView && (Object)(object)otherBaboon.focusedThreatTransform != (Object)null) { int pingImportance = 3; if (otherBaboon.fearLevel > 2f || otherBaboon.focusLevel >= 3) { pingImportance = 4; } PingBaboonInterest(otherBaboon.focusedThreatTransform.position, pingImportance); } if (timeSinceJoiningOrLeavingScoutingGroup < 4f || ((EnemyAI)otherBaboon).currentBehaviourStateIndex == 1) { return num; } if (scoutingGroup != null && Time.realtimeSinceStartup - scoutingGroup.timeAtLastCallToGroup < 1f) { return num; } if (scoutingGroup == null || (!scoutingGroup.members.Contains(otherBaboon) && (Object)(object)scoutingGroup.leader != (Object)(object)otherBaboon)) { if (otherBaboon.scoutingGroup != null) { if (otherBaboon.scoutingGroup.leader.leadershipLevel > biggestBaboon.leadershipLevel) { biggestBaboon = otherBaboon; } return num; } if (otherBaboon.leadershipLevel > biggestBaboon.leadershipLevel) { biggestBaboon = otherBaboon; return num; } } } return num; } private void DoLOSCheck() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004a: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_0613: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Expected O, but got Unknown //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) Threat val = null; Threat val2 = null; float num = 0f; float num2 = 0f; float num3 = 0f; float num4 = 0f; int num5 = Physics.OverlapSphereNonAlloc(base.eye.position + base.eye.forward * 38f + base.eye.up * 8f, 40f, RoundManager.Instance.tempColliderResults, visibleThreatsMask, (QueryTriggerInteraction)2); biggestBaboon = this; if (scoutingGroup != null && (Object)(object)scoutingGroup.leader != (Object)null) { biggestBaboon = scoutingGroup.leader; } RaycastHit val3 = default(RaycastHit); IVisibleThreat val4 = default(IVisibleThreat); for (int i = 0; i < num5; i++) { if ((Object)(object)RoundManager.Instance.tempColliderResults[i] == (Object)(object)ownCollider) { continue; } float num6 = Vector3.Distance(base.eye.position, ((Component)RoundManager.Instance.tempColliderResults[i]).transform.position); float num7 = Vector3.Angle(((Component)RoundManager.Instance.tempColliderResults[i]).transform.position - base.eye.position, base.eye.forward); if (num6 > 2f && num7 > fov) { continue; } if (Physics.Linecast(((Component)this).transform.position + Vector3.up * 0.7f, ((Component)RoundManager.Instance.tempColliderResults[i]).transform.position + Vector3.up * 0.5f, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { if (base.debugEnemyAI) { Debug.DrawRay(((RaycastHit)(ref val3)).point, Vector3.up * 0.5f, Color.magenta, base.AIIntervalTime); } continue; } EnemyAI component = ((Component)((Component)RoundManager.Instance.tempColliderResults[i]).transform).GetComponent(); if ((Object)(object)component != (Object)null && ((object)component).GetType() == typeof(PyotrAI)) { float num8 = ReactToOtherBaboonSighted(component as PyotrAI); num3 += num8; num4 += num8; } else { if (!((Component)((Component)RoundManager.Instance.tempColliderResults[i]).transform).TryGetComponent(ref val4)) { continue; } float visibility = val4.GetVisibility(); if (visibility < 1f && (visibility == 0f || (visibility < 0.2f && num6 > 10f) || (visibility < 0.6f && num6 > 20f && num7 > 30f) || (visibility < 0.8f && num6 > 16f && num7 > 80f))) { continue; } if (base.debugEnemyAI) { Debug.Log((object)$"Baboon hawk: Seeing visible threat: {((Object)((Component)RoundManager.Instance.tempColliderResults[i]).transform).name}; type: {val4.type}"); } if (!threats.TryGetValue(((Component)RoundManager.Instance.tempColliderResults[i]).transform, out Threat value)) { value = new Threat(); } else { if (Time.realtimeSinceStartup - value.timeLastSeen < 0.5f) { continue; } value.distanceMovedTowardsBaboon = value.distanceToThreat - num6; } value.type = val4.type; value.timeLastSeen = Time.realtimeSinceStartup; value.lastSeenPosition = ((Component)RoundManager.Instance.tempColliderResults[i]).transform.position + Vector3.up * 0.5f; value.distanceToThreat = num6; value.threatLevel = val4.GetThreatLevel(base.eye.position); value.threatScript = val4; if (value.distanceMovedTowardsBaboon > 1f) { Threat obj = value; obj.threatLevel++; } else if (Mathf.Abs(value.distanceMovedTowardsBaboon) < 1f || value.distanceMovedTowardsBaboon < -1f) { Threat obj2 = value; obj2.threatLevel--; } value.interestLevel = val4.GetInterestLevel(); float num9 = (float)value.threatLevel / (value.distanceToThreat * 0.2f); if (Vector3.Distance(value.lastSeenPosition, baboonCampPosition) < 9f) { Threat obj3 = value; obj3.interestLevel += 2; num9 *= 0.5f; } if (value.hasAttacked) { Threat obj4 = value; obj4.interestLevel++; num9 = ((scoutingGroup == null || scoutingGroup.members.Count <= 3) ? (num9 + 2f) : (num9 - (float)scoutingGroup.members.Count / 1.5f)); } num3 += num9; num4 += (float)value.threatLevel; if ((float)value.threatLevel < num2) { val2 = value; num2 = value.threatLevel; } else if (num9 > num) { num = num9; val = value; } threats.TryAdd(((Component)RoundManager.Instance.tempColliderResults[i]).transform, value); } } oddAIInterval = !oddAIInterval; if (oddAIInterval && aggressiveMode != 2 && !eyesClosed && !restingAtCamp) { GrabbableObject val5 = null; int num10 = 0; num5 = Physics.OverlapSphereNonAlloc(base.eye.position + base.eye.forward * 28f + base.eye.up * 6f, 30f, RoundManager.Instance.tempColliderResults, scrapMask, (QueryTriggerInteraction)2); RaycastHit val6 = default(RaycastHit); for (int j = 0; j < num5; j++) { float num11 = Vector3.Angle(((Component)RoundManager.Instance.tempColliderResults[j]).transform.position - base.eye.position, base.eye.forward); float num12 = Vector3.Distance(base.eye.position, ((Component)RoundManager.Instance.tempColliderResults[j]).transform.position); if (num12 > 2f && num11 > fov) { Debug.Log((object)$"Baboon #{base.thisEnemyIndex}; could not see threat, b"); } else if (!Physics.Linecast(((Component)this).transform.position + Vector3.up * 0.7f, ((Component)RoundManager.Instance.tempColliderResults[j]).transform.position + Vector3.up * 0.5f, ref val6, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && num12 < 20f && Object.op_Implicit((Object)(object)((Component)RoundManager.Instance.tempColliderResults[j]).gameObject.GetComponent())) { GrabbableObject component2 = ((Component)RoundManager.Instance.tempColliderResults[j]).gameObject.GetComponent(); if (component2.scrapValue > 3 && component2.scrapValue > num10 && CanGrabScrap(component2)) { num10 = component2.scrapValue; val5 = component2; } } } if ((Object)(object)val5 != (Object)null && !CharlottesDollRoomController.Instance.itemsPlaced.Contains(val5)) { focusedScrap = val5; } } if ((Object)(object)biggestBaboon != (Object)(object)this) { JoinScoutingGroup(biggestBaboon); } if (scoutingGroup != null) { num3 -= (float)scoutingGroup.members.Count; num4 -= (float)scoutingGroup.members.Count; } fearLevel = num3 + 1f; fearLevelNoDistComparison = num4; float num13 = 0f; if (focusingOnThreat) { num13 = 2f; } if (fearLevel > num13 && val != null) { ReactToThreat(val); } else if (fearLevel <= 0f - num13 && val2 != null) { ReactToThreat(val2); } } public void PingBaboonInterest(Vector3 interestPosition, int pingImportance) { //IL_0082: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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) if (focusedThreat != null && pingImportance < focusLevel) { Debug.Log((object)$"Baboon bird #{base.thisEnemyIndex}: Did NOT listen to ping of importance {pingImportance} as focus level is {focusLevel}"); } else if ((pingImportance >= focusLevel || !(timeSincePingingBirdInterest < Mathf.Max(0.6f, (float)focusLevel / 2f))) && (!focusingOnThreat || !(Vector3.Distance(focusedThreat.lastSeenPosition, interestPosition) < 4f))) { timeSincePingingBirdInterest = 0f; peekTimer = 0.7f / (float)Mathf.Max(focusLevel / Mathf.Max(pingImportance, 1), 1); peekTarget = interestPosition; if (base.currentBehaviourStateIndex == 1) { eyesClosed = false; peekTimer = Mathf.Max(peekTimer, 1.5f); } PingBirdInterestServerRpc(peekTarget, peekTimer); } } [ServerRpc] public void PingBirdInterestServerRpc(Vector3 lookPosition, float timeToPeek) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_00d0: 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_00ea: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3855210695u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lookPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref timeToPeek, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3855210695u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PingBirdInterestClientRpc(lookPosition, timeToPeek); } } [ClientRpc] public void PingBirdInterestClientRpc(Vector3 lookPosition, float timeToPeek) { //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_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) //IL_0105: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2197714140u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lookPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref timeToPeek, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2197714140u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { peekTimer = timeToPeek; peekTarget = lookPosition; } } } private void JoinScoutingGroup(PyotrAI otherBaboon) { //IL_0031: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if ((otherBaboon.scoutingGroup == null || otherBaboon.scoutingGroup != scoutingGroup || !otherBaboon.scoutingGroup.members.Contains(this)) && !((EnemyAI)this).PathIsIntersectedByLineOfSight(((Component)otherBaboon).transform.position, true, false, false) && !(Vector3.Distance(((Component)this).transform.position, ((Component)otherBaboon).transform.position) > 56f)) { timeSinceJoiningOrLeavingScoutingGroup = 0f; if (otherBaboon.scoutingGroup != scoutingGroup) { LeaveCurrentScoutingGroup(sync: false); } if (otherBaboon.scoutingGroup == null) { otherBaboon.StartScoutingGroup(this, syncWithClients: true); } else if (scoutingGroup == null) { scoutingGroup = otherBaboon.scoutingGroup; JoinScoutingGroupServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)otherBaboon).NetworkObject)); StartMiscAnimationServerRpc(0); } } } public void StartScoutingGroup(PyotrAI firstMember, bool syncWithClients) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) if (scoutingGroup != null) { return; } timeSinceJoiningOrLeavingScoutingGroup = 0f; scoutingGroup = new PyotrGroup(); scoutingGroup.leader = this; scoutingGroup.members.Add(firstMember); firstMember.scoutingGroup = scoutingGroup; scoutingGroup.isEmpty = false; if (syncWithClients) { if (miscAnimationTimer <= 0f) { StartMiscAnimationServerRpc(0); } StartScoutingGroupServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)firstMember).NetworkObject)); } } private void LeaveCurrentScoutingGroup(bool sync) { if (scoutingGroup == null) { return; } timeSinceJoiningOrLeavingScoutingGroup = 0f; if (scoutingGroup.members.Contains(this)) { scoutingGroup.members.Remove(this); if (scoutingGroup.members.Count <= 0) { scoutingGroup.isEmpty = true; } } else if ((Object)(object)scoutingGroup.leader == (Object)(object)this) { if (scoutingGroup.members != null && scoutingGroup.members.Count > 0) { int num = -1; int index = -1; for (int i = 0; i < scoutingGroup.members.Count; i++) { if (scoutingGroup.members[i].leadershipLevel > num) { index = i; num = scoutingGroup.members[i].leadershipLevel; } } scoutingGroup.leader = scoutingGroup.members[index]; scoutingGroup.members.RemoveAt(index); } else { scoutingGroup.isEmpty = true; } } else { Debug.LogError((object)$"Baboon #{base.thisEnemyIndex}: Scouting group was not null but did not contain me as a member!"); } scoutingGroup = null; } [ServerRpc] public void LeaveScoutingGroupServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1840536190u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1840536190u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LeaveScoutingGroupClientRpc(); } } [ClientRpc] public void LeaveScoutingGroupClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4003314357u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4003314357u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LeaveCurrentScoutingGroup(sync: false); } } } [ServerRpc] public void StartScoutingGroupServerRpc(NetworkObjectReference leaderNetworkObject) { //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_012a: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3160691917u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref leaderNetworkObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3160691917u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartScoutingGroupClientRpc(leaderNetworkObject); } } [ClientRpc] public void StartScoutingGroupClientRpc(NetworkObjectReference leaderNetworkObject) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3414796545u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref leaderNetworkObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3414796545u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref leaderNetworkObject)).TryGet(ref val3, (NetworkManager)null)) { Debug.LogError((object)$"Baboon enemy #{base.thisEnemyIndex}: Could not get network object from reference in JoinScoutingGroupClientRpc; {((NetworkObjectReference)(ref leaderNetworkObject)).NetworkObjectId}"); return; } PyotrAI component = ((Component)val3).gameObject.GetComponent(); StartScoutingGroup(component, syncWithClients: false); } } [ServerRpc] public void JoinScoutingGroupServerRpc(NetworkObjectReference otherBaboonNetworkObject) { //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_012a: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(912944027u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref otherBaboonNetworkObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 912944027u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; JoinScoutingGroupClientRpc(otherBaboonNetworkObject); } } [ClientRpc] public void JoinScoutingGroupClientRpc(NetworkObjectReference otherBaboonNetworkObject) { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(128548268u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref otherBaboonNetworkObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 128548268u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref otherBaboonNetworkObject)).TryGet(ref val3, (NetworkManager)null)) { Debug.LogError((object)$"Baboon enemy #{base.thisEnemyIndex}: Could not get network object from reference in JoinScoutingGroupClientRpc; {((NetworkObjectReference)(ref otherBaboonNetworkObject)).NetworkObjectId}"); return; } PyotrAI component = ((Component)val3).gameObject.GetComponent(); if ((component.scoutingGroup != scoutingGroup || !component.scoutingGroup.members.Contains(this)) && component.scoutingGroup != null) { if (component.scoutingGroup != scoutingGroup) { LeaveCurrentScoutingGroup(sync: false); } scoutingGroup = component.scoutingGroup; if (!scoutingGroup.members.Contains(this)) { scoutingGroup.members.Add(this); } } } public void CallToOtherBaboon(BaboonBirdAI otherBaboon) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!(timeSinceJoiningOrLeavingScoutingGroup <= 1f)) { if (scoutingGroup != null) { scoutingGroup.timeAtLastCallToGroup = Time.realtimeSinceStartup; } StartMiscAnimation(0); otherBaboon.PingBaboonInterest(((Component)this).transform.position, 2); } } private void StartMiscAnimation(int anim) { if (!base.isEnemyDead && !(timeSinceLastMiscAnimation <= 0.4f)) { timeSinceLastMiscAnimation = 0f; StartMiscAnimationServerRpc(anim); } } [ServerRpc] public void StartMiscAnimationServerRpc(int miscAnimationId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2964212229u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, miscAnimationId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2964212229u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.isEnemyDead && base.enemyType.miscAnimations.Length > miscAnimationId && !((Object)(object)base.creatureVoice == (Object)null) && (currentMiscAnimation == -1 || base.enemyType.miscAnimations[currentMiscAnimation].priority <= base.enemyType.miscAnimations[miscAnimationId].priority)) { StartMiscAnimationClientRpc(miscAnimationId); } } } [ClientRpc] public void StartMiscAnimationClientRpc(int miscAnimationId) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2090041292u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, miscAnimationId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2090041292u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.isEnemyDead && base.enemyType.miscAnimations.Length > miscAnimationId && !((Object)(object)base.creatureVoice == (Object)null) && (currentMiscAnimation == -1 || base.enemyType.miscAnimations[currentMiscAnimation].priority <= base.enemyType.miscAnimations[miscAnimationId].priority)) { currentMiscAnimation = miscAnimationId; miscAnimationTimer = base.enemyType.miscAnimations[miscAnimationId].AnimLength; if (!base.inSpecialAnimation || doingKillAnimation) { base.creatureVoice.pitch = Random.Range(0.8f, 1.2f); base.creatureVoice.PlayOneShot(base.enemyType.miscAnimations[miscAnimationId].AnimVoiceclip, Random.Range(0.6f, 1f)); WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, base.enemyType.miscAnimations[miscAnimationId].AnimVoiceclip, 0.7f); } } } private void CalculateAnimationDirection(float maxSpeed = 1f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0033: 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_003d: 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_009c: Unknown result type (might be due to invalid IL or missing references) agentLocalVelocity = animationContainer.InverseTransformDirection(Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, 1f) / (Time.deltaTime * 2f)); velX = Mathf.Lerp(velX, agentLocalVelocity.x, 10f * Time.deltaTime); velZ = Mathf.Lerp(velZ, agentLocalVelocity.z, 10f * Time.deltaTime); previousPosition = ((Component)this).transform.position; } public void PlaySound(AudioClip audioClip) { base.creatureVoice.PlayOneShot(audioClip); } 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 //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1741341585u, new RpcReceiveHandler(__rpc_handler_1741341585), "SyncInitialValuesServerRpc"); ((NetworkBehaviour)this).__registerRpc(658517639u, new RpcReceiveHandler(__rpc_handler_658517639), "SyncInitialValuesClientRpc"); ((NetworkBehaviour)this).__registerRpc(3448799424u, new RpcReceiveHandler(__rpc_handler_3448799424), "StabPlayerDeathAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(530686194u, new RpcReceiveHandler(__rpc_handler_530686194), "StabPlayerDeathAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(1741324269u, new RpcReceiveHandler(__rpc_handler_1741324269), "KickBallServerRpc"); ((NetworkBehaviour)this).__registerRpc(8736421u, new RpcReceiveHandler(__rpc_handler_8736421), "KickBallClientRpc"); ((NetworkBehaviour)this).__registerRpc(2033874396u, new RpcReceiveHandler(__rpc_handler_2033874396), "StopFocusingThreatServerRpc"); ((NetworkBehaviour)this).__registerRpc(1235366102u, new RpcReceiveHandler(__rpc_handler_1235366102), "StopFocusingThreatClientRpc"); ((NetworkBehaviour)this).__registerRpc(863516347u, new RpcReceiveHandler(__rpc_handler_863516347), "SetAggressiveModeServerRpc"); ((NetworkBehaviour)this).__registerRpc(987980034u, new RpcReceiveHandler(__rpc_handler_987980034), "SetAggressiveModeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1444303054u, new RpcReceiveHandler(__rpc_handler_1444303054), "SetThreatInViewServerRpc"); ((NetworkBehaviour)this).__registerRpc(1358342937u, new RpcReceiveHandler(__rpc_handler_1358342937), "SetThreatInViewClientRpc"); ((NetworkBehaviour)this).__registerRpc(3532884324u, new RpcReceiveHandler(__rpc_handler_3532884324), "EnemyEnterRestModeServerRpc"); ((NetworkBehaviour)this).__registerRpc(537845835u, new RpcReceiveHandler(__rpc_handler_537845835), "EnemyEnterRestModeClientRpc"); ((NetworkBehaviour)this).__registerRpc(471502079u, new RpcReceiveHandler(__rpc_handler_471502079), "EnemyGetUpServerRpc"); ((NetworkBehaviour)this).__registerRpc(1473363069u, new RpcReceiveHandler(__rpc_handler_1473363069), "EnemyGetUpClientRpc"); ((NetworkBehaviour)this).__registerRpc(3432123218u, new RpcReceiveHandler(__rpc_handler_3432123218), "StartFocusOnThreatServerRpc"); ((NetworkBehaviour)this).__registerRpc(3045414500u, new RpcReceiveHandler(__rpc_handler_3045414500), "StartFocusOnThreatClientRpc"); ((NetworkBehaviour)this).__registerRpc(3855210695u, new RpcReceiveHandler(__rpc_handler_3855210695), "PingBirdInterestServerRpc"); ((NetworkBehaviour)this).__registerRpc(2197714140u, new RpcReceiveHandler(__rpc_handler_2197714140), "PingBirdInterestClientRpc"); ((NetworkBehaviour)this).__registerRpc(1840536190u, new RpcReceiveHandler(__rpc_handler_1840536190), "LeaveScoutingGroupServerRpc"); ((NetworkBehaviour)this).__registerRpc(4003314357u, new RpcReceiveHandler(__rpc_handler_4003314357), "LeaveScoutingGroupClientRpc"); ((NetworkBehaviour)this).__registerRpc(3160691917u, new RpcReceiveHandler(__rpc_handler_3160691917), "StartScoutingGroupServerRpc"); ((NetworkBehaviour)this).__registerRpc(3414796545u, new RpcReceiveHandler(__rpc_handler_3414796545), "StartScoutingGroupClientRpc"); ((NetworkBehaviour)this).__registerRpc(912944027u, new RpcReceiveHandler(__rpc_handler_912944027), "JoinScoutingGroupServerRpc"); ((NetworkBehaviour)this).__registerRpc(128548268u, new RpcReceiveHandler(__rpc_handler_128548268), "JoinScoutingGroupClientRpc"); ((NetworkBehaviour)this).__registerRpc(2964212229u, new RpcReceiveHandler(__rpc_handler_2964212229), "StartMiscAnimationServerRpc"); ((NetworkBehaviour)this).__registerRpc(2090041292u, new RpcReceiveHandler(__rpc_handler_2090041292), "StartMiscAnimationClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1741341585(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_0070: 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_009f: 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_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 { int syncLeadershipLevel = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref syncLeadershipLevel); Vector3 campPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref campPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).SyncInitialValuesServerRpc(syncLeadershipLevel, campPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_658517639(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0052: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int syncLeadershipLevel = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref syncLeadershipLevel); Vector3 campPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref campPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).SyncInitialValuesClientRpc(syncLeadershipLevel, campPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3448799424(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 playerObject = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObject); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StabPlayerDeathAnimServerRpc(playerObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_530686194(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 playerObject = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObject); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StabPlayerDeathAnimClientRpc(playerObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1741324269(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_006a: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 dest = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dest); int playerWhoKicked = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoKicked); bool setInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setInElevator, default(ForPrimitives)); bool setInShipRoom = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setInShipRoom, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).KickBallServerRpc(dest, playerWhoKicked, setInElevator, setInShipRoom); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_8736421(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_0057: 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) //IL_0077: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 dest = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dest); bool setInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setInElevator, default(ForPrimitives)); bool setInShipRoom = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setInShipRoom, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).KickBallClientRpc(dest, setInElevator, setInShipRoom); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2033874396(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 { bool enterScoutingMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enterScoutingMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StopFocusingThreatServerRpc(enterScoutingMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1235366102(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) { bool enterScoutingMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enterScoutingMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StopFocusingThreatClientRpc(enterScoutingMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_863516347(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_0070: 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_009d: 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 { int aggressiveModeServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref aggressiveModeServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).SetAggressiveModeServerRpc(aggressiveModeServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_987980034(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 aggressiveModeClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref aggressiveModeClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).SetAggressiveModeClientRpc(aggressiveModeClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1444303054(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 { bool threatInViewServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref threatInViewServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).SetThreatInViewServerRpc(threatInViewServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1358342937(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) { bool threatInViewClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref threatInViewClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).SetThreatInViewClientRpc(threatInViewClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3532884324(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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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 { bool sleep = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref sleep, default(ForPrimitives)); bool atCamp = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref atCamp, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).EnemyEnterRestModeServerRpc(sleep, atCamp); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_537845835(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_004a: 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_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool sleep = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref sleep, default(ForPrimitives)); bool atCamp = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref atCamp, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).EnemyEnterRestModeClientRpc(sleep, atCamp); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_471502079(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).EnemyGetUpServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1473363069(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; ((PyotrAI)(object)target).EnemyGetUpClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3432123218(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_009c: 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 { NetworkObjectReference netObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StartFocusOnThreatServerRpc(netObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3045414500(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_004f: 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) { NetworkObjectReference netObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StartFocusOnThreatClientRpc(netObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3855210695(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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bc: 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 { Vector3 lookPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lookPosition); float timeToPeek = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref timeToPeek, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).PingBirdInterestServerRpc(lookPosition, timeToPeek); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2197714140(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_005c: 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) { Vector3 lookPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lookPosition); float timeToPeek = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref timeToPeek, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).PingBirdInterestClientRpc(lookPosition, timeToPeek); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1840536190(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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).LeaveScoutingGroupServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4003314357(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; ((PyotrAI)(object)target).LeaveScoutingGroupClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3160691917(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_009c: 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 { NetworkObjectReference leaderNetworkObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderNetworkObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StartScoutingGroupServerRpc(leaderNetworkObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3414796545(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_004f: 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) { NetworkObjectReference leaderNetworkObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderNetworkObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StartScoutingGroupClientRpc(leaderNetworkObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_912944027(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_009c: 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 { NetworkObjectReference otherBaboonNetworkObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref otherBaboonNetworkObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).JoinScoutingGroupServerRpc(otherBaboonNetworkObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_128548268(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_004f: 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) { NetworkObjectReference otherBaboonNetworkObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref otherBaboonNetworkObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).JoinScoutingGroupClientRpc(otherBaboonNetworkObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2964212229(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_0070: 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_009d: 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 { int miscAnimationId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref miscAnimationId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StartMiscAnimationServerRpc(miscAnimationId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2090041292(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 miscAnimationId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref miscAnimationId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PyotrAI)(object)target).StartMiscAnimationClientRpc(miscAnimationId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PyotrAI"; } } public class PyotrGroup { public bool isEmpty; public PyotrAI leader; public List members = new List(); public float timeAtLastCallToGroup; } public class WanderingCharlotteOffset : MonoBehaviour { public enum State { Standard, Standard2, Standard3, Standard4, Hall, Outside1, Outside2, Outside3 } public AudioSource middlePointAudioSource; public AudioSource entrancePointAudioSource; public AudioSource exitPointAudioSource; public GameObject entrancePointDecal; public GameObject entrancePointParticleSystem1; public GameObject entrancePointParticleSystem2; public GameObject entrancePointParticleSystem3; public GameObject exitPointParticleSystem; public GameObject exitPointDecal; public GameObject groundParticleSystem; public bool isOutside = false; [Header("State")] public State stateType; private void Update() { if ((Object)(object)LabyrinthController.Instance != (Object)null) { if (isOutside && !LabyrinthController.Instance.wanderingOutsideCharlotteOffsets.Contains(this)) { LabyrinthController.Instance.wanderingOutsideCharlotteOffsets.Add(this); } else if (!isOutside && !LabyrinthController.Instance.wanderingCharlotteOffsets.Contains(this)) { LabyrinthController.Instance.wanderingCharlotteOffsets.Add(this); } } } public void PlaySoundAtMidpoint(AudioClip audioClip) { middlePointAudioSource.PlayOneShot(audioClip); } public void PlaySoundAtEntrance(AudioClip audioClip) { entrancePointAudioSource.PlayOneShot(audioClip); } public void PlaySoundAtExit(AudioClip audioClip) { exitPointAudioSource.PlayOneShot(audioClip); } } } namespace CharlottesLabyrinth.Patches { internal static class NetworkManagerPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void StartOfRound_Awake(ref StartOfRound __instance) { ((NetworkBehaviour)__instance).NetworkObject.OnSpawn(CreateNetworkManager); } private static void CreateNetworkManager() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)StartOfRound.Instance).IsServer || ((NetworkBehaviour)StartOfRound.Instance).IsHost) { GameObject val = Object.Instantiate(((Component)Plugin.shipAnimator).gameObject); SceneManager.MoveGameObjectToScene(val, ((Component)StartOfRound.Instance).gameObject.scene); val.GetComponent().Spawn(false); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace CharlottesLabyrinth.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }