#define DEBUG using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Dawn.Utils; using Dusk; using GameNetcodeStuff; using HarmonyLib; using Jinn; using Microsoft.CodeAnalysis; using Reiko888.Jinn.NetcodePatcher; using Unity.Netcode; using UnityEngine; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: AssemblyCompany("Reiko888.Jinn")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+1bdd1797a975dcb3af3acccccff4703b1e5fd62f")] [assembly: AssemblyProduct("Jinn")] [assembly: AssemblyTitle("Reiko888.Jinn")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class GramophoneProp : NetworkBehaviour { public InteractTrigger windingTrigger; public AudioSource windingAudioSource; public AudioClip windingLoopSFX; public Animator gramophoneAnimator; private bool isDefeated = false; public void OnWindingStarted() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!isDefeated) { SetWindingStateServerRpc(isWinding: true); JinnAI jinnAI = Object.FindObjectOfType(); if ((Object)(object)jinnAI != (Object)null) { jinnAI.HearGramophoneServerRpc(((Component)this).transform.position); } } } public void OnWindingStopped() { if (!isDefeated) { SetWindingStateServerRpc(isWinding: false); } } public void OnWindingComplete(PlayerControllerB playerWhoWoundIt) { if (!isDefeated) { isDefeated = true; CompleteWindingServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void SetWindingStateServerRpc(bool isWinding) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3505332847u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isWinding, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3505332847u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetWindingStateClientRpc(isWinding); } } } [ClientRpc] public void SetWindingStateClientRpc(bool isWinding) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1959246616u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isWinding, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1959246616u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (isDefeated) { return; } if (isWinding) { if ((Object)(object)windingAudioSource != (Object)null && (Object)(object)windingLoopSFX != (Object)null) { windingAudioSource.clip = windingLoopSFX; windingAudioSource.loop = true; if (!windingAudioSource.isPlaying) { windingAudioSource.Play(); } } if ((Object)(object)gramophoneAnimator != (Object)null) { gramophoneAnimator.SetBool("isWinding", true); } } else { if ((Object)(object)windingAudioSource != (Object)null && windingAudioSource.isPlaying) { windingAudioSource.Stop(); } if ((Object)(object)gramophoneAnimator != (Object)null) { gramophoneAnimator.SetBool("isWinding", false); } } } [ServerRpc(RequireOwnership = false)] public void CompleteWindingServerRpc() { //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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1629078729u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1629078729u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { return; } JinnAI jinnAI = Object.FindObjectOfType(); Item val3 = null; foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == "Cursed Gramophone") { val3 = items; break; } } if ((Object)(object)val3 != (Object)null) { GameObject val4 = Object.Instantiate(val3.spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, StartOfRound.Instance.propsContainer); GrabbableObject component = val4.GetComponent(); component.fallTime = 0f; component.targetFloorPosition = component.GetItemFloorPosition(((Component)this).transform.position); NetworkObject component2 = val4.GetComponent(); component2.Spawn(false); int scrapValue = (int)((float)Random.Range(150, 350) * RoundManager.Instance.scrapValueMultiplier); component.SetScrapValue(scrapValue); if ((Object)(object)jinnAI != (Object)null) { jinnAI.SyncScrapValueClientRpc(NetworkObjectReference.op_Implicit(component2), scrapValue); } } if ((Object)(object)jinnAI != (Object)null) { jinnAI.DefeatObakeServerRpc(); } ((NetworkBehaviour)this).NetworkObject.Despawn(true); } 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 ((NetworkBehaviour)this).__registerRpc(3505332847u, new RpcReceiveHandler(__rpc_handler_3505332847), "SetWindingStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(1959246616u, new RpcReceiveHandler(__rpc_handler_1959246616), "SetWindingStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(1629078729u, new RpcReceiveHandler(__rpc_handler_1629078729), "CompleteWindingServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3505332847(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 windingStateServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref windingStateServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GramophoneProp)(object)target).SetWindingStateServerRpc(windingStateServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1959246616(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 windingStateClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref windingStateClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GramophoneProp)(object)target).SetWindingStateClientRpc(windingStateClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1629078729(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; ((GramophoneProp)(object)target).CompleteWindingServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GramophoneProp"; } } namespace Obake { public class RapierItem : GrabbableObject { [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Animator anim; public int layerIndex; public RapierItem <>4__this; private int 5__1; private AnimatorStateInfo 5__2; private AnimatorClipInfo[] 5__3; private string 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Debug.Log((object)$"[RapierDebug-Trace] --- STARTING 1-SECOND ANIMATION TRACE ON LAYER {layerIndex} ---"); 5__1 = 0; break; case 1: <>1__state = -1; 5__3 = null; 5__4 = null; 5__1++; break; } if (5__1 < 10 && !((Object)(object)anim == (Object)null)) { 5__2 = anim.GetCurrentAnimatorStateInfo(layerIndex); 5__3 = anim.GetCurrentAnimatorClipInfo(layerIndex); 5__4 = ((5__3.Length != 0) ? ((Object)((AnimatorClipInfo)(ref 5__3[0])).clip).name : "NO CLIP (Empty State)"); Debug.Log((object)$"[RapierDebug-Trace] +{(float)5__1 * 0.1f}s | Clip: {5__4} | Normalized Time: {((AnimatorStateInfo)(ref 5__2)).normalizedTime:F2} | Transitioning: {anim.IsInTransition(layerIndex)}"); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } Debug.Log((object)"[RapierDebug-Trace] --- TRACE FINISHED ---"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public AudioSource rapierAudio; private List objectsHitByRapierList = new List(); public PlayerControllerB previousPlayerHeldBy; private RaycastHit[] objectsHitByRapier; public int rapierHitForce = 1; public AudioClip[] hitSFX; public AudioClip[] swingSFX; private int rapierMask = 1084754248; private float timeAtLastDamageDealt; public ParticleSystem bloodParticle; public RuntimeAnimatorController rapierLocalAnimator; public RuntimeAnimatorController rapierRemoteAnimator; private static readonly Dictionary _SAVED_ANIMATORS = new Dictionary(); private bool _animatorReplaced; private AnimatorStateInfo _savedState; private float _savedNormalizedTime; private bool _savedCrouching; private bool _savedWalking; private bool _savedJumping; private bool _savedSprinting; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); previousPlayerHeldBy = base.playerHeldBy; if ((Object)(object)base.playerHeldBy != (Object)null) { previousPlayerHeldBy.equippedUsableItemQE = true; EnableRapierAnimator(); base.playerHeldBy.playerBodyAnimator.SetBool(base.itemProperties.grabAnim, true); } } public override void GrabItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { EnableRapierAnimator(); } ((GrabbableObject)this).GrabItem(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); DisableRapierAnimator(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); DisableRapierAnimator(); } private void EnableRapierAnimator() { Debug.Log((object)$"[RapierDebug] EnableRapierAnimator called. Current _animatorReplaced status: {_animatorReplaced}"); if (_animatorReplaced) { return; } if ((Object)(object)base.playerHeldBy == (Object)null) { Debug.LogWarning((object)"[RapierDebug] EnableRapierAnimator failed: playerHeldBy is null."); return; } Debug.Log((object)$"[RapierDebug] Rapier animators in Inspector - Local: {(Object)(object)rapierLocalAnimator != (Object)null}, Remote: {(Object)(object)rapierRemoteAnimator != (Object)null}"); if (!_SAVED_ANIMATORS.ContainsKey(base.playerHeldBy.playerClientId)) { Debug.Log((object)$"[RapierDebug] Saving original animator for client {base.playerHeldBy.playerClientId}: {((Object)base.playerHeldBy.playerBodyAnimator.runtimeAnimatorController).name}"); _SAVED_ANIMATORS[base.playerHeldBy.playerClientId] = base.playerHeldBy.playerBodyAnimator.runtimeAnimatorController; } SaveAnimatorState(base.playerHeldBy.playerBodyAnimator); if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { Debug.Log((object)"[RapierDebug] Applying LOCAL rapier animator."); base.playerHeldBy.playerBodyAnimator.runtimeAnimatorController = rapierLocalAnimator; } else { Debug.Log((object)"[RapierDebug] Applying REMOTE rapier animator."); base.playerHeldBy.playerBodyAnimator.runtimeAnimatorController = rapierRemoteAnimator; } Debug.Log((object)"[RapierDebug] Rebinding and Updating animator..."); base.playerHeldBy.playerBodyAnimator.Rebind(); base.playerHeldBy.playerBodyAnimator.Update(0f); RestoreAnimatorState(base.playerHeldBy.playerBodyAnimator, isEquipping: true); _animatorReplaced = true; Debug.Log((object)"[RapierDebug] EnableRapierAnimator finished successfully."); } private void DisableRapierAnimator() { Debug.Log((object)$"[RapierDebug] DisableRapierAnimator called. Current _animatorReplaced status: {_animatorReplaced}"); if (!_animatorReplaced) { return; } PlayerControllerB val = (PlayerControllerB)(((Object)(object)base.playerHeldBy != (Object)null) ? ((object)base.playerHeldBy) : ((object)previousPlayerHeldBy)); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)"[RapierDebug] DisableRapierAnimator failed: Both playerHeldBy and previousPlayerHeldBy are null."); return; } SaveAnimatorState(val.playerBodyAnimator); if (_SAVED_ANIMATORS.TryGetValue(val.playerClientId, out RuntimeAnimatorController value)) { Debug.Log((object)$"[RapierDebug] Restoring original animator for client {val.playerClientId}: {((Object)value).name}"); val.playerBodyAnimator.runtimeAnimatorController = value; _SAVED_ANIMATORS.Remove(val.playerClientId); } else { Debug.LogError((object)$"[RapierDebug] FATAL: Could not find original animator in dictionary for client {val.playerClientId}!"); } Debug.Log((object)"[RapierDebug] Rebinding and Updating original animator..."); val.playerBodyAnimator.Rebind(); val.playerBodyAnimator.Update(0f); RestoreAnimatorState(val.playerBodyAnimator, isEquipping: false); _animatorReplaced = false; Debug.Log((object)"[RapierDebug] DisableRapierAnimator finished successfully."); } private void SaveAnimatorState(Animator anim) { //IL_0004: 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) _savedState = anim.GetCurrentAnimatorStateInfo(0); _savedNormalizedTime = ((AnimatorStateInfo)(ref _savedState)).normalizedTime; _savedCrouching = anim.GetBool("crouching"); _savedWalking = anim.GetBool("Walking"); _savedJumping = anim.GetBool("Jumping"); _savedSprinting = anim.GetBool("Sprinting"); Debug.Log((object)$"[RapierDebug] Saved State -> Hash: {((AnimatorStateInfo)(ref _savedState)).fullPathHash}, Time: {_savedNormalizedTime}, Walk: {_savedWalking}, Crouch: {_savedCrouching}"); } private void RestoreAnimatorState(Animator anim, bool isEquipping) { Debug.Log((object)$"[RapierDebug] Restoring Animator State. isEquipping: {isEquipping}"); try { anim.Play(((AnimatorStateInfo)(ref _savedState)).fullPathHash, 0, _savedNormalizedTime); anim.SetBool("crouching", _savedCrouching); anim.SetBool("Walking", _savedWalking); anim.SetBool("Jumping", _savedJumping); anim.SetBool("Sprinting", _savedSprinting); if (isEquipping) { Debug.Log((object)"[RapierDebug] Forcing 'HoldRapier' on layer 2..."); anim.Play("HoldRapier", 2, 0f); } } catch (Exception ex) { Debug.LogError((object)("[RapierDebug] Exception during RestoreAnimatorState: " + ex.Message)); } } public override void ItemActivate(bool used, bool buttonDown = true) { Debug.Log((object)$"[RapierDebug-Attack] ItemActivate called. buttonDown: {buttonDown}, IsOwner: {((NetworkBehaviour)this).IsOwner}"); if ((Object)(object)rapierAudio != (Object)null && swingSFX != null && swingSFX.Length != 0) { int num = Random.Range(0, swingSFX.Length); rapierAudio.PlayOneShot(swingSFX[num], 1f); } if ((Object)(object)base.playerHeldBy != (Object)null) { previousPlayerHeldBy = base.playerHeldBy; if (((NetworkBehaviour)base.playerHeldBy).IsOwner) { Debug.Log((object)"[RapierDebug-Attack] Triggering 'SwingRapier' on player animator."); base.playerHeldBy.playerBodyAnimator.SetTrigger("SwingRapier"); ((MonoBehaviour)this).StartCoroutine(TraceAnimatorState(base.playerHeldBy.playerBodyAnimator, 2)); } } if (((NetworkBehaviour)this).IsOwner) { Debug.Log((object)"[RapierDebug-Attack] We are the owner. Calling HitRapier()..."); HitRapier(); } } [IteratorStateMachine(typeof(d__29))] private IEnumerator TraceAnimatorState(Animator anim, int layerIndex) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this, anim = anim, layerIndex = layerIndex }; } public void HitRapier(bool cancel = false) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: 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_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)$"[RapierDebug-Attack] HitRapier started. cancel: {cancel}"); if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogWarning((object)"[RapierDebug-Attack] HitRapier aborted: previousPlayerHeldBy is null."); return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; int num = -1; bool flag3 = false; float num2 = Time.realtimeSinceStartup - timeAtLastDamageDealt; if (!cancel && num2 > 0.43f) { Debug.Log((object)$"[RapierDebug-Attack] Swing valid. Cooldown cleared ({num2}s elapsed). Casting sphere..."); previousPlayerHeldBy.twoHanded = false; objectsHitByRapier = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * 0.1f, 0.3f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 2f, rapierMask, (QueryTriggerInteraction)2); objectsHitByRapierList = objectsHitByRapier.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); Debug.Log((object)$"[RapierDebug-Attack] SphereCast found {objectsHitByRapierList.Count} colliders."); List list = new List(); IHittable val2 = default(IHittable); for (int i = 0; i < objectsHitByRapierList.Count; i++) { RaycastHit val = objectsHitByRapierList[i]; GameObject gameObject = ((Component)((RaycastHit)(ref val)).collider).gameObject; if (gameObject.layer == 8 || gameObject.layer == 11) { val = objectsHitByRapierList[i]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; Debug.Log((object)$"[RapierDebug-Attack] Hit surface: {((Object)gameObject).name} (Layer: {gameObject.layer})"); string tag = gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; break; } } continue; } Debug.Log((object)$"[RapierDebug-Attack] Hit potential entity: {((Object)gameObject).name} (Layer: {gameObject.layer})"); val = objectsHitByRapierList[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { val = objectsHitByRapierList[i]; if (!((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)) { val = objectsHitByRapierList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; RaycastHit val3 = objectsHitByRapierList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val3)).point, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { goto IL_0321; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; try { val = objectsHitByRapierList[i]; 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) && (!StartOfRound.Instance.hangarDoorsClosed || component.mainScript.isInsidePlayerShip == previousPlayerHeldBy.isInHangarShipRoom)) { Debug.Log((object)("[RapierDebug-Attack] Valid Enemy Hit: " + ((Object)((Component)component.mainScript).gameObject).name)); goto IL_0464; } Debug.Log((object)"[RapierDebug-Attack] Enemy hit rejected (Already hit this swing, or ship door blocked)."); continue; } val = objectsHitByRapierList[i]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { Debug.Log((object)"[RapierDebug-Attack] Valid Object Hit (Turret, Mine, etc)."); goto IL_0464; } if (!flag3) { flag3 = true; Debug.Log((object)"[RapierDebug-Attack] Valid Player Hit."); goto IL_0464; } goto end_IL_035c; IL_0464: bool flag4 = val2.Hit(rapierHitForce, forward, previousPlayerHeldBy, true, 5); if (flag4 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2 && flag4) { flag2 = true; timeAtLastDamageDealt = Time.realtimeSinceStartup; if ((Object)(object)bloodParticle != (Object)null) { bloodParticle.Play(true); } } end_IL_035c:; } catch (Exception) { } continue; } } goto IL_0321; IL_0321: Debug.Log((object)("[RapierDebug-Attack] Entity " + ((Object)gameObject).name + " rejected (No IHittable, is self, or blocked by wall).")); } } else if (cancel) { } if (!flag) { return; } if ((Object)(object)rapierAudio != (Object)null && hitSFX != null && hitSFX.Length != 0) { int num3 = Random.Range(0, hitSFX.Length); rapierAudio.PlayOneShot(hitSFX[num3], 1f); } if ((Object)(object)Object.FindObjectOfType() != (Object)null) { Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); } if (!flag2 && num != -1) { if ((Object)(object)rapierAudio != (Object)null) { rapierAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); } if ((Object)(object)rapierAudio != (Object)null) { WalkieTalkie.TransmitOneShotAudio(rapierAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } } HitRapierServerRpc(num); } [ServerRpc] public void HitRapierServerRpc(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 val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1802279907u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1802279907u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitRapierClientRpc(hitSurfaceID); } } [ClientRpc] public void HitRapierClientRpc(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 val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(31426271u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 31426271u, val, (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) { if ((Object)(object)rapierAudio != (Object)null && hitSFX != null && hitSFX.Length != 0) { int num = Random.Range(0, hitSFX.Length); rapierAudio.PlayOneShot(hitSFX[num], 1f); } if (hitSurfaceID != -1 && (Object)(object)rapierAudio != (Object)null) { rapierAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(rapierAudio, 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 ((NetworkBehaviour)this).__registerRpc(1802279907u, new RpcReceiveHandler(__rpc_handler_1802279907), "HitRapierServerRpc"); ((NetworkBehaviour)this).__registerRpc(31426271u, new RpcReceiveHandler(__rpc_handler_31426271), "HitRapierClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1802279907(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; ((RapierItem)(object)target).HitRapierServerRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_31426271(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; ((RapierItem)(object)target).HitRapierClientRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RapierItem"; } } } namespace Jinn { internal class JinnAI : EnemyAI { [CompilerGenerated] private sealed class d__72 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JinnAI <>4__this; private Light[] 5__1; private Dictionary 5__2; private List 5__3; private float 5__4; private Light[] <>s__5; private int <>s__6; private Light 5__7; private string 5__8; private List.Enumerator <>s__9; private Light 5__10; private float 5__11; private Dictionary.Enumerator <>s__12; private KeyValuePair 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__72(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>s__5 = null; 5__7 = null; 5__8 = null; <>s__9 = default(List.Enumerator); 5__10 = null; <>s__12 = default(Dictionary.Enumerator); 5__13 = default(KeyValuePair); <>1__state = -2; } private bool MoveNext() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Invalid comparison between Unknown and I4 //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isFlickeringLights = true; 5__1 = Object.FindObjectsOfType(); 5__2 = new Dictionary(); 5__3 = new List(); 5__4 = 100f; <>s__5 = 5__1; for (<>s__6 = 0; <>s__6 < <>s__5.Length; <>s__6++) { 5__7 = <>s__5[<>s__6]; if (!((Object)(object)5__7 == (Object)null) && (int)5__7.type != 1) { 5__8 = ((Object)((Component)5__7).gameObject).name.ToLower(); if (!5__8.Contains("helmet") && !5__8.Contains("visor") && !5__8.Contains("sun")) { Vector3 val = ((Component)5__7).transform.position - ((Component)<>4__this).transform.position; if (((Vector3)(ref val)).sqrMagnitude <= 5__4) { 5__3.Add(5__7); 5__2[5__7] = 5__7.intensity; } 5__8 = null; 5__7 = null; } } } <>s__5 = null; break; case 1: <>1__state = -1; break; } if (((EnemyAI)<>4__this).stunNormalizedTimer > 0f && !((EnemyAI)<>4__this).isEnemyDead) { <>s__9 = 5__3.GetEnumerator(); try { while (<>s__9.MoveNext()) { 5__10 = <>s__9.Current; if ((Object)(object)5__10 != (Object)null && 5__2.ContainsKey(5__10)) { 5__11 = Random.value; if (5__11 > 0.8f) { 5__10.intensity = 5__2[5__10] * 2.5f; } else if (5__11 > 0.5f) { 5__10.intensity = 5__2[5__10] * 0.1f; } else { 5__10.intensity = 5__2[5__10]; } } 5__10 = null; } } finally { ((IDisposable)<>s__9).Dispose(); } <>s__9 = default(List.Enumerator); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } <>s__12 = 5__2.GetEnumerator(); try { while (<>s__12.MoveNext()) { 5__13 = <>s__12.Current; if ((Object)(object)5__13.Key != (Object)null) { 5__13.Key.intensity = 5__13.Value; } 5__13 = default(KeyValuePair); } } finally { ((IDisposable)<>s__12).Dispose(); } <>s__12 = default(Dictionary.Enumerator); <>4__this.isFlickeringLights = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Random enemyRandom = null; private int baseSpeed; private int attackCooldownSlow; private float minDistance; private float maxDistance; private bool canTeleport; private float teleportWarningDelay; private float maxDistanceAfterWarning; private float minDistanceAfterWarning; private bool canBeBurned; private bool burnLights; private int flashlightDrainPercentage; private int burnSlowdown; private int attackDamage; public SkinnedMeshRenderer skin; public Material[] thisMaterial; public GameObject BloodParticles; public GameObject TeleportSwirl; private GameObject currentNetworkSwirl; public GameObject GramophonePropPrefab; private bool hasHeardGramophone = false; private Vector3 lastPosition; private bool hasLOS; public float chaseTimer = 0f; private bool isPreparingTeleport = false; private float teleportWarningTimer = 0f; private Vector3 pendingTeleportPosition; private PlayerControllerB pendingTeleportTarget; private bool hasAttemptedLastDitchTp = false; private bool isManifesting = false; private bool isFlickeringLights = false; private bool wasBeingBurned = false; public bool isCurrentlyBurning = false; private bool isChasingPitch = false; public Renderer[] rapierRenderers; private float gramoDash; private float timeSinceLastAttack; private float timeSinceSeen; private float timesinceHearingGramophone; private float tpRollTimer; private float continuousChaseTimer = 0f; public float teleportCooldown = 15f; private float teleportCooldownTimer = 0f; private Vector3 targetGramophonePos; public AudioSource movementAudio; public AudioClip unsheathSFX; public AudioClip laughSFX; public AudioClip swingSFX; public AudioClip[] teleportSFX; public AudioClip chargeUpTPSFX; public AudioClip creaturePainSFX; public ParticleSystem mistParticles; public ParticleSystem decayingMatterParticles; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { if (Plugin.Logger != null) { Plugin.Logger.LogInfo((object)text); } else { Debug.Log((object)("[Jinn] " + text)); } } public override void Start() { ((EnemyAI)this).Start(); base.updatePositionThreshold = 0.5f; baseSpeed = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnBaseSpeed").Value; attackCooldownSlow = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnAttackCooldownSlow").Value; minDistance = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnMinVisibleDist").Value; maxDistance = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnMaxVisibleDist").Value; canTeleport = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnCanTeleport").Value; teleportWarningDelay = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnTPWarnDelay").Value; maxDistanceAfterWarning = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnMaxDistAfterDelay").Value; minDistanceAfterWarning = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnMinnDistAfterDelay").Value; canBeBurned = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnCanBeBurned").Value; burnLights = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnBurnLights").Value; flashlightDrainPercentage = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnFlashlightConsumption").Value; burnSlowdown = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnBurnSlowdown").Value; attackDamage = ((AssetBundleLoader)(object)ContentHandler.Instance.jinnAssets).GetConfig("ConfigJinnAttackDamage").Value; List list = new List(); if ((Object)(object)skin != (Object)null) { list.AddRange(((Renderer)skin).materials); } if (rapierRenderers != null) { Renderer[] array = rapierRenderers; foreach (Renderer val in array) { if ((Object)(object)val != (Object)null) { list.AddRange(val.materials); } } } thisMaterial = list.ToArray(); ((EnemyAI)this).GetAINodes(); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Play(); } LogIfDebugBuild("Jinn Spawned"); SpawnCursedGramophoneLocally(); } private void OnEnable() { JinnEventManager.OnShipLeft += HandleShipLeft; } private void OnDisable() { JinnEventManager.OnShipLeft -= HandleShipLeft; } private void HandleShipLeft() { Plugin.Logger.LogInfo((object)"Ship is leaving! Cleaning up"); if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Stop(); } ((EnemyAI)this).KillEnemy(true); } private Vector3 GetFloorPosition(Vector3 startPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 val = startPos + Vector3.up * 0.5f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, 10f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val2)).point; } return startPos; } public void SpawnCursedGramophoneLocally() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_014d: 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) if (!((NetworkBehaviour)this).IsServer) { return; } if ((Object)(object)GramophonePropPrefab == (Object)null) { LogIfDebugBuild("GramophonePropPrefab is missing! Cannot spawn the prop."); return; } Vector3 startPos = ((Component)this).transform.position + Vector3.up * 1.5f; bool flag = false; RandomScrapSpawn[] array = Object.FindObjectsOfType(); if (array != null && array.Length != 0 && base.allAINodes != null && base.allAINodes.Length != 0) { for (int i = 0; i < 15; i++) { RandomScrapSpawn val = array[enemyRandom.Next(0, array.Length)]; bool flag2 = false; GameObject[] allAINodes = base.allAINodes; foreach (GameObject val2 in allAINodes) { if ((Object)(object)val2 != (Object)null && Vector3.Distance(((Component)val).transform.position, val2.transform.position) <= 15f) { flag2 = true; break; } } if (flag2) { Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)val).transform.position, RoundManager.Instance.navHit, 3f, -1); if (RoundManager.Instance.GotNavMeshPositionResult) { startPos = navMeshPosition; flag = true; break; } } } } if (!flag && base.allAINodes != null && base.allAINodes.Length != 0) { GameObject val3 = base.allAINodes[enemyRandom.Next(0, base.allAINodes.Length)]; if ((Object)(object)val3 != (Object)null) { startPos = val3.transform.position; LogIfDebugBuild("Failed to find valid scrap node. Falling back to an AI Node"); } } startPos = GetFloorPosition(startPos); GameObject val4 = Object.Instantiate(GramophonePropPrefab, startPos, Quaternion.identity); val4.GetComponent().Spawn(false); LogIfDebugBuild("Dropped Gramophone PROP at valid node, snapped to the floor!"); } public void SpawnRapierLocally() { //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) //IL_00a6: 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_00b0: 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_00bc: 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) //IL_00ea: 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_0118: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsServer) { return; } Item val = null; foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == "Rapier") { val = items; break; } } if ((Object)(object)val == (Object)null) { LogIfDebugBuild("Rapier item not found in allItemsList!"); return; } Vector3 val2 = ((Component)this).transform.position + Vector3.up * 1.5f; Vector3 val3 = RoundManager.Instance.GetNavMeshPosition(val2, RoundManager.Instance.navHit, 5f, -1); if (!RoundManager.Instance.GotNavMeshPositionResult) { val3 = val2; } GameObject val4 = Object.Instantiate(val.spawnPrefab, val3, Quaternion.identity, StartOfRound.Instance.propsContainer); GrabbableObject component = val4.GetComponent(); component.fallTime = 0f; component.targetFloorPosition = component.GetItemFloorPosition(val3); int scrapValue = (int)((float)Random.Range(val.minValue, val.maxValue) * RoundManager.Instance.scrapValueMultiplier); component.SetScrapValue(scrapValue); NetworkObject component2 = val4.GetComponent(); component2.Spawn(false); SyncScrapValueClientRpc(NetworkObjectReference.op_Implicit(component2), scrapValue); component.EnableItemMeshes(true); LogIfDebugBuild("Dropped Rapier item upon Jinn defeat"); } [ClientRpc] public void SyncScrapValueClientRpc(NetworkObjectReference netObjRef, int scrapValue) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3032411812u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, scrapValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3032411812u, val, (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 netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { component.SetScrapValue(scrapValue); } } } public override void Update() { //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); timeSinceLastAttack += Time.deltaTime; if (isCurrentlyBurning) { base.stunNormalizedTimer = 1f; } SetVisibility(); DrainLocalFlashlightBattery(); if ((Object)(object)base.creatureVoice != (Object)null) { float num = (isChasingPitch ? 0.8f : 1f); base.creatureVoice.pitch = Mathf.Lerp(base.creatureVoice.pitch, num, Time.deltaTime * 0.8f); } if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (!hasLOS && chaseTimer > 0f) { chaseTimer -= Time.deltaTime; } if (!((NetworkBehaviour)this).IsOwner) { return; } timeSinceSeen += Time.deltaTime; timesinceHearingGramophone += Time.deltaTime; if (IsBeingBurnedByFlashlight()) { base.agent.speed = burnSlowdown; if (!wasBeingBurned) { wasBeingBurned = true; SetBurningStateClientRpc(isBurning: true); } } else if (wasBeingBurned) { wasBeingBurned = false; SetBurningStateClientRpc(isBurning: false); } if (base.stunNormalizedTimer > 0f && !isFlickeringLights && !base.isEnemyDead) { ((MonoBehaviour)this).StartCoroutine(FlickerLightsDuringStun()); } if ((Object)(object)base.targetPlayer != (Object)null) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position); if (num2 <= maxDistance && !isManifesting) { isManifesting = true; SetManifestingStateServerRpc(manifesting: true); } else if (num2 > maxDistance + 5f && isManifesting) { isManifesting = false; } } else { isManifesting = false; } if (isPreparingTeleport) { teleportWarningTimer -= Time.deltaTime; if (teleportWarningTimer <= 0f) { ExecuteDelayedTeleport(); } } if (base.isEnemyDead) { base.agent.speed = 0f; return; } if (teleportCooldownTimer > 0f) { teleportCooldownTimer -= Time.deltaTime; } if ((Object)(object)base.targetPlayer != (Object)null) { continuousChaseTimer += Time.deltaTime; if (continuousChaseTimer >= 5f && !isPreparingTeleport && teleportCooldownTimer <= 0f) { tpRollTimer += Time.deltaTime; if (tpRollTimer >= 5f) { tpRollTimer = 0f; if (Random.value <= 0.8f) { LogIfDebugBuild("Teleport has been accepted"); TpNearestNode(base.targetPlayer); } else { LogIfDebugBuild("Teleport denied. Will try again in 5 seconds."); } } } } else { continuousChaseTimer = 0f; tpRollTimer = 0f; } if (hasHeardGramophone) { base.agent.speed = gramoDash; if (timesinceHearingGramophone > 35f) { hasHeardGramophone = false; LogIfDebugBuild("Gramophone timeout reached. Baclk to normal speed."); } } else if (timeSinceLastAttack < 2f) { base.agent.speed = attackCooldownSlow; } else { base.agent.speed = baseSpeed; } base.syncMovementSpeed = base.agent.speed; } public override void DoAIInterval() { //IL_0037: 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_00a8: 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_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_032b: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (hasHeardGramophone) { if (!(Vector3.Distance(((Component)this).transform.position, targetGramophonePos) <= 3f)) { base.moveTowardsDestination = true; ((EnemyAI)this).SetDestinationToPosition(targetGramophonePos, true); return; } hasHeardGramophone = false; CancelGramophoneServerRpc(); } if ((Object)(object)base.targetPlayer != (Object)null) { if (((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer.gameplayCamera).transform.position, 120f, 60, -1f, (Transform)null)) { hasLOS = true; if (!isChasingPitch) { SetPitchStateServerRpc(chasing: true); } timeSinceSeen = 0f; chaseTimer = 10f; lastPosition = ((Component)base.targetPlayer).transform.position; hasAttemptedLastDitchTp = false; if (base.currentSearch != null && base.currentSearch.inProgress) { ((EnemyAI)this).StopSearch(base.currentSearch, true); } ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); return; } hasLOS = false; if (chaseTimer <= 0f) { if (isChasingPitch) { SetPitchStateServerRpc(chasing: false); } CheckAndFireLastDitchTeleport(); base.targetPlayer = null; if (base.currentSearch == null || !base.currentSearch.inProgress) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } } else { ((EnemyAI)this).SetDestinationToPosition(lastPosition, false); if (Vector3.Distance(((Component)this).transform.position, lastPosition) <= 2f) { CheckAndFireLastDitchTeleport(); chaseTimer = 0f; } else if (chaseTimer <= 7f) { CheckAndFireLastDitchTeleport(); } } return; } hasLOS = false; if (((EnemyAI)this).TargetClosestPlayer(5f, true, 120f, false, false, true)) { hasLOS = true; if (!isChasingPitch) { SetPitchStateServerRpc(chasing: true); } timeSinceSeen = 0f; chaseTimer = 10f; lastPosition = ((Component)base.targetPlayer).transform.position; hasAttemptedLastDitchTp = false; if (base.currentSearch != null && base.currentSearch.inProgress) { ((EnemyAI)this).StopSearch(base.currentSearch, true); } ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); } else if (base.currentSearch == null || !base.currentSearch.inProgress) { if (isChasingPitch) { SetPitchStateServerRpc(chasing: false); } ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } } [ServerRpc(RequireOwnership = false)] public void SetPitchStateServerRpc(bool chasing) { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(572835169u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref chasing, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 572835169u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetPitchStateClientRpc(chasing); } } } [ClientRpc] public void SetPitchStateClientRpc(bool chasing) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4086901024u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref chasing, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4086901024u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isChasingPitch = chasing; } } } private void CheckAndFireLastDitchTeleport() { if (!hasAttemptedLastDitchTp && !isPreparingTeleport && (Object)(object)base.targetPlayer != (Object)null && teleportCooldownTimer <= 0f) { hasAttemptedLastDitchTp = true; if (Random.value <= 0.75f) { LogIfDebugBuild("Lost target, attempting TP."); TpToCutoffNode(base.targetPlayer); } } } private void TpToCutoffNode(PlayerControllerB targetPlayer) { //IL_004c: 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_0086: 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_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) //IL_00a1: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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) if (!canTeleport || (Object)(object)targetPlayer == (Object)null || targetPlayer.isPlayerDead || base.allAINodes == null || base.allAINodes.Length == 0) { return; } Vector3 velocity = targetPlayer.thisController.velocity; if (((Vector3)(ref velocity)).sqrMagnitude < 1f) { LogIfDebugBuild("Player is standing still. Falling back to normal LDTp."); TpNearestNode(targetPlayer); return; } Vector3 val = ((Component)targetPlayer).transform.position + ((Vector3)(ref velocity)).normalized * 15f; List list = new List(); float num = 12f; GameObject[] allAINodes = base.allAINodes; foreach (GameObject val2 in allAINodes) { if (!((Object)(object)val2 == (Object)null) && Vector3.Distance(val2.transform.position, val) <= num) { list.Add(val2); } } if (list.Count > 0) { GameObject val3 = list[enemyRandom.Next(0, list.Count)]; pendingTeleportPosition = val3.transform.position; pendingTeleportTarget = targetPlayer; teleportWarningTimer = teleportWarningDelay; isPreparingTeleport = true; if ((Object)(object)movementAudio != (Object)null && (Object)(object)chargeUpTPSFX != (Object)null) { movementAudio.PlayOneShot(chargeUpTPSFX, 0.8f); } if (!((NetworkBehaviour)this).IsServer || !((Object)(object)TeleportSwirl != (Object)null)) { return; } Vector3 val4 = pendingTeleportPosition + Vector3.up * 1.5f; currentNetworkSwirl = Object.Instantiate(TeleportSwirl, val4, Quaternion.identity); if ((Object)(object)currentNetworkSwirl != (Object)null) { NetworkObject component = currentNetworkSwirl.GetComponent(); if ((Object)(object)component != (Object)null) { component.Spawn(true); } } } else { LogIfDebugBuild("No nodes found ahead of the player. Falling back to normal LDTp."); TpNearestNode(targetPlayer); } } private bool IsBeingBurnedByFlashlight() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_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) if (!canBeBurned) { return false; } PlayerControllerB[] allPlayersInLineOfSight = ((EnemyAI)this).GetAllPlayersInLineOfSight(360f, 15, (Transform)null, -1f, -1); if (allPlayersInLineOfSight == null || allPlayersInLineOfSight.Length == 0) { return false; } PlayerControllerB[] array = allPlayersInLineOfSight; foreach (PlayerControllerB val in array) { Vector3 val2 = ((Component)this).transform.position - ((Component)val).transform.position; float num = Vector3.Angle(((Component)val).transform.forward, val2); if (Mathf.Abs(num) > 30f) { continue; } if ((Object)(object)val.pocketedFlashlight != (Object)null && val.pocketedFlashlight.isBeingUsed && val.pocketedFlashlight.insertedBattery != null && val.pocketedFlashlight.insertedBattery.charge > 0f) { return true; } GrabbableObject currentlyHeldObjectServer = val.currentlyHeldObjectServer; if (val.isHoldingObject && (Object)(object)currentlyHeldObjectServer != (Object)null) { FlashlightItem val3 = (FlashlightItem)(object)((currentlyHeldObjectServer is FlashlightItem) ? currentlyHeldObjectServer : null); if (val3 != null && ((GrabbableObject)val3).isBeingUsed && ((GrabbableObject)val3).insertedBattery != null && ((GrabbableObject)val3).insertedBattery.charge > 0f) { return true; } } } return false; } [ClientRpc] public void SetBurningStateClientRpc(bool isBurning) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1937438416u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isBurning, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1937438416u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isCurrentlyBurning = isBurning; base.creatureAnimator.SetBool("isBeingBurned", isBurning); if (isBurning) { LogIfDebugBuild("Jinn is being burned"); if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Pause(); } if ((Object)(object)base.creatureSFX != (Object)null && (Object)(object)creaturePainSFX != (Object)null) { base.creatureSFX.PlayOneShot(creaturePainSFX); } if (burnLights && !isFlickeringLights && !base.isEnemyDead) { ((MonoBehaviour)this).StartCoroutine(FlickerLightsDuringStun()); } } else if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Play(); } } [ServerRpc(RequireOwnership = false)] public void SetManifestingStateServerRpc(bool manifesting) { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3194650752u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref manifesting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3194650752u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetManifestingStateClientRpc(manifesting); } } } [ClientRpc] public void SetManifestingStateClientRpc(bool manifesting) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1475831853u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref manifesting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1475831853u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger("isManifesting"); base.creatureSFX.PlayOneShot(unsheathSFX); } } } [IteratorStateMachine(typeof(d__72))] private IEnumerator FlickerLightsDuringStun() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__72(0) { <>4__this = this }; } private void TpNearestNode(PlayerControllerB targetPlayer) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00f0: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) if (!canTeleport || (Object)(object)targetPlayer == (Object)null || targetPlayer.isPlayerDead || base.allAINodes == null || base.allAINodes.Length == 0) { return; } List list = new List(); float num = 10f; GameObject[] allAINodes = base.allAINodes; foreach (GameObject val in allAINodes) { if (!((Object)(object)val == (Object)null) && Vector3.Distance(val.transform.position, ((Component)targetPlayer).transform.position) <= num) { list.Add(val); } } if (list.Count > 0) { GameObject val2 = list[enemyRandom.Next(0, list.Count)]; pendingTeleportPosition = val2.transform.position; pendingTeleportTarget = targetPlayer; teleportWarningTimer = teleportWarningDelay; isPreparingTeleport = true; teleportCooldownTimer = teleportCooldown; if ((Object)(object)movementAudio != (Object)null && (Object)(object)chargeUpTPSFX != (Object)null) { movementAudio.PlayOneShot(chargeUpTPSFX, 0.8f); } LogIfDebugBuild($"Found {list.Count} nodes. Spawning warning swirl and starting timer"); if (!((NetworkBehaviour)this).IsServer || !((Object)(object)TeleportSwirl != (Object)null)) { return; } Vector3 val3 = pendingTeleportPosition + Vector3.up * 1.5f; currentNetworkSwirl = Object.Instantiate(TeleportSwirl, val3, Quaternion.identity); if (!((Object)(object)currentNetworkSwirl != (Object)null)) { return; } NetworkObject component = currentNetworkSwirl.GetComponent(); if ((Object)(object)component != (Object)null) { try { component.Spawn(true); } catch (Exception ex) { LogIfDebugBuild("DEBUG CRITICAL ERROR: Netcode threw an exception during Spawn()! " + ex.Message + "\n" + ex.StackTrace); } } } else { LogIfDebugBuild("No AI nodes found within 10 units. Teleport cancelled"); } } private void ExecuteDelayedTeleport() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) isPreparingTeleport = false; tpRollTimer = 0f; if (((NetworkBehaviour)this).IsServer && (Object)(object)currentNetworkSwirl != (Object)null) { currentNetworkSwirl.GetComponent().Despawn(true); currentNetworkSwirl = null; } if ((Object)(object)pendingTeleportTarget == (Object)null || pendingTeleportTarget.isPlayerDead) { LogIfDebugBuild("Target lost, no tp for me :("); return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)pendingTeleportTarget).transform.position); float num2 = Vector3.Distance(pendingTeleportPosition, ((Component)pendingTeleportTarget).transform.position); if (num <= 4f) { LogIfDebugBuild($"Player is only {num} units away from Obake. Canceling teleport to attack"); } else if (num <= num2) { LogIfDebugBuild($"Obake ({num}u) is closer than smoke ({num2}u). Cancelling teleport"); } else if (num2 <= maxDistanceAfterWarning && num2 >= minDistanceAfterWarning) { LogIfDebugBuild($"Player is {num2} units away from Swirl. I am tp'ing!!"); if (((NetworkBehaviour)this).IsServer) { TeleportObakeClientRpc(pendingTeleportPosition); } else { TeleportObakeServerRpc(pendingTeleportPosition); } } else { LogIfDebugBuild($"Player too far from TP smoke! They are {num2} units away from Swirl."); } } private void TeleportObakeLocally(Vector3 newPos) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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) ((Behaviour)base.agent).enabled = false; ((Component)this).transform.position = newPos; ((Behaviour)base.agent).enabled = true; if (base.agent.isOnNavMesh) { base.agent.Warp(newPos); } base.serverPosition = newPos; if ((Object)(object)base.creatureSFX != (Object)null && teleportSFX != null) { AudioClip val = ((teleportSFX.Length != 0) ? teleportSFX[enemyRandom.Next(teleportSFX.Length)] : null); if ((Object)(object)val != (Object)null) { base.creatureSFX.PlayOneShot(val); } } if ((Object)(object)base.creatureSFX != (Object)null && (Object)(object)laughSFX != (Object)null) { base.creatureSFX.PlayOneShot(laughSFX); } } [ServerRpc(RequireOwnership = false)] public void TeleportObakeServerRpc(Vector3 newPos) { //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_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_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3735536817u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3735536817u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TeleportObakeClientRpc(newPos); } } } [ClientRpc] public void TeleportObakeClientRpc(Vector3 newPos) { //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_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_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2313155807u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2313155807u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TeleportObakeLocally(newPos); } } } private void DrainLocalFlashlightBattery() { //IL_0056: 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) if ((Object)(object)GameNetworkManager.Instance == (Object)null || base.isEnemyDead) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || localPlayerController.isPlayerDead) { return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController).transform.position); FlashlightItem val = null; if ((Object)(object)localPlayerController.pocketedFlashlight != (Object)null) { GrabbableObject pocketedFlashlight = localPlayerController.pocketedFlashlight; FlashlightItem val2 = (FlashlightItem)(object)((pocketedFlashlight is FlashlightItem) ? pocketedFlashlight : null); if (val2 != null) { val = val2; goto IL_00c9; } } if ((Object)(object)localPlayerController.currentlyHeldObjectServer != (Object)null) { GrabbableObject currentlyHeldObjectServer = localPlayerController.currentlyHeldObjectServer; FlashlightItem val3 = (FlashlightItem)(object)((currentlyHeldObjectServer is FlashlightItem) ? currentlyHeldObjectServer : null); if (val3 != null) { val = val3; } } goto IL_00c9; IL_00c9: if (!((Object)(object)val != (Object)null)) { return; } if (num > 30f || !((GrabbableObject)val).isBeingUsed) { if (val.flashlightInterferenceLevel == 1) { val.flashlightInterferenceLevel = 0; } } else if (((GrabbableObject)val).insertedBattery != null && ((GrabbableObject)val).insertedBattery.charge > 0f) { float num2 = (float)flashlightDrainPercentage / 100f; Battery insertedBattery = ((GrabbableObject)val).insertedBattery; insertedBattery.charge -= Time.deltaTime * num2; val.flashlightInterferenceLevel = 1; LogIfDebugBuild($"Distance: {num}. Battery now at: {((GrabbableObject)val).insertedBattery.charge}"); if (((GrabbableObject)val).insertedBattery.charge <= 0f) { ((GrabbableObject)val).insertedBattery.charge = 0f; ((GrabbableObject)val).insertedBattery.empty = true; ((GrabbableObject)val).UseUpBatteries(); val.flashlightInterferenceLevel = 0; ((GrabbableObject)val).SyncBatteryServerRpc(0); } } } private void SetVisibility() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance == (Object)null) { return; } float num = Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, ((Component)this).transform.position + Vector3.up * 0.7f); float num2 = (num - minDistance) / (maxDistance - minDistance); float num3 = Mathf.Clamp(num2, 0.01f, 1f); if (base.stunNormalizedTimer > 0f) { float num4 = 10f; num3 = ((Mathf.Repeat(Time.time * num4, 1f) > 0.5f) ? 1f : 0.01f); } for (int i = 0; i < thisMaterial.Length; i++) { if ((Object)(object)thisMaterial[i] != (Object)null && thisMaterial[i].HasProperty("_AlphaCutoff")) { thisMaterial[i].SetFloat("_AlphaCutoff", num3); } } FadeTransparentParticle(mistParticles, num3); FadeTransparentParticle(decayingMatterParticles, num3); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null && !localPlayerController.isPlayerDead && num < 15f && num > maxDistance + 2f) { localPlayerController.IncreaseFearLevelOverTime(0.37f, 0.25f); } } private void FadeTransparentParticle(ParticleSystem ps, float fadeValue) { //IL_0052: 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_0072: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ps == (Object)null)) { ParticleSystemRenderer component = ((Component)ps).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).material != (Object)null && ((Renderer)component).material.HasProperty("_Color")) { Color color = ((Renderer)component).material.GetColor("_Color"); color.a = 1f - fadeValue; ((Renderer)component).material.SetColor("_Color", color); } } } [ServerRpc(RequireOwnership = false)] public void HearGramophoneServerRpc(Vector3 gramophonePosition) { //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_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_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2444941071u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gramophonePosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2444941071u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HearGramophoneClientRpc(gramophonePosition); } } } [ClientRpc] public void HearGramophoneClientRpc(Vector3 gramophonePosition) { //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_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_0106: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(808673045u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gramophonePosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 808673045u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!hasHeardGramophone) { hasHeardGramophone = true; timesinceHearingGramophone = 0f; gramoDash = (float)baseSpeed * 1.5f; targetGramophonePos = gramophonePosition; LogIfDebugBuild("The Jinn hears the Gramophone"); } } } [ServerRpc(RequireOwnership = false)] public void CancelGramophoneServerRpc() { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3913330384u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3913330384u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CancelGramophoneClientRpc(); } } } [ClientRpc] public void CancelGramophoneClientRpc() { //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 val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2465833126u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2465833126u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (hasHeardGramophone) { hasHeardGramophone = false; LogIfDebugBuild("Gramophone reached"); } } } public void DefeatObake() { if (!base.isEnemyDead) { LogIfDebugBuild("Gramophone fully wound"); DefeatObakeServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void DefeatObakeServerRpc() { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1152763372u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1152763372u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DefeatObakeClientRpc(); } } } [ClientRpc] public void DefeatObakeClientRpc() { //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 val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2175510022u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2175510022u, val, (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) { return; } LogIfDebugBuild("Jinn defeated"); if (((NetworkBehaviour)this).IsServer && (Object)(object)currentNetworkSwirl != (Object)null) { NetworkObject component = currentNetworkSwirl.GetComponent(); if ((Object)(object)component != (Object)null && component.IsSpawned) { component.Despawn(true); } } if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Stop(); } SpawnRapierLocally(); ((EnemyAI)this).KillEnemy(true); } public override void OnCollideWithPlayer(Collider other) { //IL_0051: 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) ((EnemyAI)this).OnCollideWithPlayer(other); if (timeSinceLastAttack < 2f) { return; } PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { timeSinceLastAttack = 0f; val.DamagePlayer(attackDamage, true, true, (CauseOfDeath)14, 0, false, default(Vector3)); HitPlayerServerRpc(); if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(1f, true); } } } [ServerRpc(RequireOwnership = false)] public void HitPlayerServerRpc() { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(162999686u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 162999686u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitPlayerClientRpc(); } } } [ClientRpc] public void HitPlayerClientRpc() { //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 val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(375208838u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 375208838u, val, (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.creatureAnimator.SetTrigger("isAttacking"); if ((Object)(object)BloodParticles != (Object)null) { ParticleSystem component = BloodParticles.GetComponent(); if ((Object)(object)component != (Object)null) { component.Play(); } } base.creatureSFX.PlayOneShot(swingSFX); } if (((NetworkBehaviour)this).IsOwner) { base.agent.speed = attackCooldownSlow; } } 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 ((NetworkBehaviour)this).__registerRpc(3032411812u, new RpcReceiveHandler(__rpc_handler_3032411812), "SyncScrapValueClientRpc"); ((NetworkBehaviour)this).__registerRpc(572835169u, new RpcReceiveHandler(__rpc_handler_572835169), "SetPitchStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(4086901024u, new RpcReceiveHandler(__rpc_handler_4086901024), "SetPitchStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(1937438416u, new RpcReceiveHandler(__rpc_handler_1937438416), "SetBurningStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(3194650752u, new RpcReceiveHandler(__rpc_handler_3194650752), "SetManifestingStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(1475831853u, new RpcReceiveHandler(__rpc_handler_1475831853), "SetManifestingStateClientRpc"); ((NetworkBehaviour)this).__registerRpc(3735536817u, new RpcReceiveHandler(__rpc_handler_3735536817), "TeleportObakeServerRpc"); ((NetworkBehaviour)this).__registerRpc(2313155807u, new RpcReceiveHandler(__rpc_handler_2313155807), "TeleportObakeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2444941071u, new RpcReceiveHandler(__rpc_handler_2444941071), "HearGramophoneServerRpc"); ((NetworkBehaviour)this).__registerRpc(808673045u, new RpcReceiveHandler(__rpc_handler_808673045), "HearGramophoneClientRpc"); ((NetworkBehaviour)this).__registerRpc(3913330384u, new RpcReceiveHandler(__rpc_handler_3913330384), "CancelGramophoneServerRpc"); ((NetworkBehaviour)this).__registerRpc(2465833126u, new RpcReceiveHandler(__rpc_handler_2465833126), "CancelGramophoneClientRpc"); ((NetworkBehaviour)this).__registerRpc(1152763372u, new RpcReceiveHandler(__rpc_handler_1152763372), "DefeatObakeServerRpc"); ((NetworkBehaviour)this).__registerRpc(2175510022u, new RpcReceiveHandler(__rpc_handler_2175510022), "DefeatObakeClientRpc"); ((NetworkBehaviour)this).__registerRpc(162999686u, new RpcReceiveHandler(__rpc_handler_162999686), "HitPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(375208838u, new RpcReceiveHandler(__rpc_handler_375208838), "HitPlayerClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3032411812(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) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int scrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValue); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).SyncScrapValueClientRpc(netObjRef, scrapValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_572835169(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 pitchStateServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitchStateServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).SetPitchStateServerRpc(pitchStateServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4086901024(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 pitchStateClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitchStateClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).SetPitchStateClientRpc(pitchStateClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1937438416(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 burningStateClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref burningStateClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).SetBurningStateClientRpc(burningStateClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3194650752(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 manifestingStateServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref manifestingStateServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).SetManifestingStateServerRpc(manifestingStateServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1475831853(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 manifestingStateClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref manifestingStateClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).SetManifestingStateClientRpc(manifestingStateClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3735536817(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 newPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).TeleportObakeServerRpc(newPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2313155807(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 newPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).TeleportObakeClientRpc(newPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2444941071(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 gramophonePosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gramophonePosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).HearGramophoneServerRpc(gramophonePosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_808673045(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 gramophonePosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gramophonePosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((JinnAI)(object)target).HearGramophoneClientRpc(gramophonePosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3913330384(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; ((JinnAI)(object)target).CancelGramophoneServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2465833126(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; ((JinnAI)(object)target).CancelGramophoneClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1152763372(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; ((JinnAI)(object)target).DefeatObakeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2175510022(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; ((JinnAI)(object)target).DefeatObakeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_162999686(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; ((JinnAI)(object)target).HitPlayerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_375208838(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; ((JinnAI)(object)target).HitPlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "JinnAI"; } } internal class JinnContentHandler : ContentHandler { public class JinnAssets : AssetBundleLoader { [LoadFromBundle("Jinn.prefab")] public GameObject Jinn { get; private set; } = null; public JinnAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class GramophoneAssets : AssetBundleLoader { public GramophoneAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class RapierAssets : AssetBundleLoader { public RapierAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } internal JinnAssets? jinnAssets; internal GramophoneAssets? gramophoneAssets; internal RapierAssets? rapierAssets; public JinnContentHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent("jinn", ref jinnAssets, false); ((ContentHandler)this).RegisterContent("gramophone", ref gramophoneAssets, false); ((ContentHandler)this).RegisterContent("rapier", ref rapierAssets, false); } } [HarmonyPatch(typeof(Terminal))] internal class TerminalVideoInjectorPatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void InjectVideo(Terminal __instance) { if ((Object)(object)ContentHandler.Instance.jinnAssets.Jinn == (Object)null) { return; } JinnTerminalAssets component = ContentHandler.Instance.jinnAssets.Jinn.GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.bestiaryVideo == (Object)null) { return; } foreach (TerminalNode enemyFile in __instance.enemyFiles) { if ((Object)(object)enemyFile != (Object)null && ((Object)enemyFile).name == "JinnBestiaryNode") { enemyFile.displayVideo = component.bestiaryVideo; return; } } Plugin.Logger.LogWarning((object)"Could not find a TerminalNode named 'JinnBestiaryNode' in the Bestiary."); } } [HarmonyPatch] public static class JinnEventManager { public static event Action OnShipLeft; public static event Action OnPlayerDied; public static event Action OnPlayerDisconnect; [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPostfix] private static void TriggerShipLeave() { JinnEventManager.OnShipLeft?.Invoke(); } } [BepInPlugin("reiko888.Jinn", "Jinn", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { public const string modGUID = "reiko888.Jinn"; public const string modName = "Jinn"; public const string modVersion = "1.0.0"; public static Plugin Instance = null; internal static ManualLogSource Logger = null; internal static readonly Harmony harmony = new Harmony("reiko888.Jinn"); internal static DuskMod mod = null; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Logger = ((BaseUnityPlugin)this).Logger; AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "jinn_contentcontainer"); mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); mod.RegisterContentHandlers(); harmony.PatchAll(Assembly.GetExecutingAssembly()); Logger.LogInfo((object)"Plugin Jinn is loaded!"); } } public class JinnTerminalAssets : MonoBehaviour { public VideoClip bestiaryVideo; } public static class PluginInfo { public const string PLUGIN_GUID = "Reiko888.Jinn"; public const string PLUGIN_NAME = "Jinn"; public const string PLUGIN_VERSION = "1.0.0"; } } 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 Reiko888.Jinn.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }