Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of JackensteinApparatus v1.1.1
Zeldahu.JackensteinApparatus.dll
Decompiled 3 weeks agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JackensteinApparatus.Configuration; using JackensteinApparatus.External; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using Zeldahu.JackensteinApparatus.NetcodePatcher; [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("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: AssemblyCompany("Zeldahu.JackensteinApparatus")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: AssemblyInformationalVersion("1.1.1")] [assembly: AssemblyProduct("JackensteinApparatus")] [assembly: AssemblyTitle("Zeldahu.JackensteinApparatus")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace JackensteinApparatus { [HarmonyPatch(typeof(EntranceTeleport))] internal class EntranceTeleportPatch { [HarmonyPrefix] [HarmonyPatch("TeleportPlayer")] public static void TeleportPlayer(ref EntranceTeleport __instance) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (__instance.FindExitPoint()) { JackensteinAI jackensteinAI = Object.FindObjectOfType<JackensteinAI>(); if ((Object)(object)jackensteinAI != (Object)null && (Object)(object)((GrabbableObject)jackensteinAI.targetApparatus).playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { Vector3 position = __instance.entrancePoint.position; Debug.Log((object)("Apparatus went through a door, marking previous location as " + ((object)(Vector3)(ref position)).ToString())); jackensteinAI.UpdatePathfindingToDoorServerRpc(new NetworkObjectReference(((Component)__instance).gameObject), ((Component)__instance).transform.position); } } } } internal class JackensteinAI : EnemyAI { private enum State { Chasing } [CompilerGenerated] private sealed class <ApparatusDepositedCoroutine>d__34 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JackensteinAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ApparatusDepositedCoroutine>d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.hasStartedDeathAnimation = true; <>4__this.sprite.SetActive(false); <>4__this.spriteSad.SetActive(true); <>4__this.musicLoopSource.Stop(); <>4__this.mammaMiaSource.Play(); ((EnemyAI)<>4__this).agent.speed = 0f; <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; Landmine.SpawnExplosion(((Component)<>4__this).transform.position, true, 0f, 5f, 10, 50f, (GameObject)null, false); <>4__this.dancersParticles.Play(); <>4__this.spriteSad.SetActive(false); <>2__current = (object)new WaitForSeconds(20f); <>1__state = 2; return true; case 2: <>1__state = -1; if (((NetworkBehaviour)<>4__this).IsServer) { ((Component)<>4__this).GetComponent<NetworkObject>().Despawn(true); } 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(); } } [CompilerGenerated] private sealed class <RandomTaunts>d__29 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JackensteinAI <>4__this; private int <tauntId>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RandomTaunts>d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.PlayLaughSoundClientRpc(); break; case 1: <>1__state = -1; break; } if (<>4__this.isChasing) { if (Random.RandomRangeInt(1, 101) <= <>4__this.randomTauntChance && !<>4__this.hasStartedDeathAnimation) { <>4__this.randomTauntChance = 0; if (Random.RandomRangeInt(1, 101) <= 40) { <>4__this.PlayLaughSoundClientRpc(); } else { <tauntId>5__1 = Random.RandomRangeInt(0, <>4__this.tauntsList.Count); <>4__this.PlayRareTauntClientRpc(<tauntId>5__1); } } else { <>4__this.randomTauntChance += 2; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } 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(); } } [CompilerGenerated] private sealed class <SpawnAnimationCoroutine>d__26 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JackensteinAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnAnimationCoroutine>d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.musicIntroSource.Play(); <>2__current = (object)new WaitForSeconds(7.569f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.takingTooLongGlobalSource.Play(); <>2__current = (object)new WaitForSeconds(3.257f); <>1__state = 2; return true; case 2: <>1__state = -1; ((Component)<>4__this.musicLoopSource).gameObject.SetActive(true); <>4__this.sprite.SetActive(true); <>4__this.isChasing = true; <>4__this.hasfinishedSpawning = true; if (((NetworkBehaviour)<>4__this).IsServer) { ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.RandomTaunts()); } 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 EntranceTeleport doorTarget = null; public Vector3 doorTargetPosition = Vector3.zero; private bool isChasing = false; public GameObject sprite = null; public GameObject spriteSad = null; public AudioSource musicIntroSource = null; public AudioSource musicLoopSource = null; public AudioSource takingTooLongGlobalSource = null; public AudioSource laughSource = null; public AudioSource localTauntsSource = null; public List<AudioClip> tauntsList = new List<AudioClip>(); public GameObject explosionSource = null; public AudioSource mammaMiaSource = null; public ParticleSystem dancersParticles = null; public LungProp targetApparatus = null; private int randomTauntChance = 0; private bool hasExploded = false; private bool hasfinishedSpawning = false; private bool hasStartedDeathAnimation = false; private float leniencyTimer = 0f; public override void Start() { ((EnemyAI)this).Start(); Debug.LogError((object)"YOUR TAKING TOO LONG"); if (!Plugin.BoundConfig.JackensteinDopplerToggle.Value) { musicIntroSource.dopplerLevel = 0f; musicLoopSource.dopplerLevel = 0f; takingTooLongGlobalSource.dopplerLevel = 0f; laughSource.dopplerLevel = 0f; localTauntsSource.dopplerLevel = 0f; } } public override void Update() { ((EnemyAI)this).Update(); if (((NetworkBehaviour)this).IsServer && hasfinishedSpawning) { ((EnemyAI)this).SyncPositionToClients(); if (leniencyTimer > 0f) { leniencyTimer -= Time.deltaTime; } } } public override void DoAIInterval() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_0356: 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_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.currentBehaviourStateIndex != 0) { return; } if (isChasing && !((GrabbableObject)targetApparatus).isHeld) { isChasing = false; ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position, false); StopChaseClientRpc(); ((MonoBehaviour)this).StopCoroutine(RandomTaunts()); } if (!isChasing && ((GrabbableObject)targetApparatus).isHeld && hasfinishedSpawning && !hasStartedDeathAnimation) { isChasing = true; StartChaseClientRpc(); ((MonoBehaviour)this).StartCoroutine(RandomTaunts()); leniencyTimer = 0.25f; } if (isChasing) { if (((GrabbableObject)targetApparatus).isInFactory == base.isOutside) { if ((Object)(object)doorTarget == (Object)null) { Debug.Log((object)"doorTarget is null, assigning closest door"); EntranceTeleport[] array = Object.FindObjectsByType<EntranceTeleport>((FindObjectsSortMode)0); float num = 1000f; EntranceTeleport[] array2 = array; foreach (EntranceTeleport val in array2) { if (Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) < num) { num = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); doorTarget = val; doorTargetPosition = ((Component)val).transform.position; } } } ((EnemyAI)this).SetDestinationToPosition(doorTargetPosition, false); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)targetApparatus).transform.position, false); } if (Vector3.Distance(doorTargetPosition, ((Component)this).transform.position) < 3f) { if (!doorTarget.FindExitPoint()) { return; } GameObject val2 = Object.Instantiate<GameObject>(GetEnemies.Jackenstein.enemyType.enemyPrefab, doorTarget.exitScript.entrancePoint.position, Quaternion.identity); val2.GetComponent<NetworkObject>().Spawn(true); val2.GetComponent<JackensteinAI>().SpawnFromDoor(musicLoopSource.time); val2.GetComponent<JackensteinAI>().targetApparatus = targetApparatus; val2.GetComponent<JackensteinAI>().SyncTargetApparatusClientRpc(new NetworkObjectReference(((Component)targetApparatus).gameObject)); ((Component)this).GetComponent<NetworkObject>().Despawn(true); } if (Vector3.Distance(((Component)targetApparatus).transform.position, ((Component)this).transform.position) < 3f && !hasExploded && !hasStartedDeathAnimation && leniencyTimer <= 0f) { hasExploded = true; ExplosionClientRpc(); ((Component)targetApparatus).GetComponent<NetworkObject>().Despawn(true); ((Component)this).GetComponent<NetworkObject>().Despawn(true); } } if (((GrabbableObject)targetApparatus).isInShipRoom && ((GrabbableObject)targetApparatus).isInElevator && !hasStartedDeathAnimation) { ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position, false); ApparatusDepositedClientRpc(); } } public void SpawnFirstTime(LungProp apparatus) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) targetApparatus = apparatus; SyncTargetApparatusClientRpc(new NetworkObjectReference(((Component)targetApparatus).gameObject)); PlaySpawnAnimationClientRpc(); } [ClientRpc] public void PlaySpawnAnimationClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4197329062u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4197329062u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(SpawnAnimationCoroutine()); } } } [IteratorStateMachine(typeof(<SpawnAnimationCoroutine>d__26))] private IEnumerator SpawnAnimationCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnAnimationCoroutine>d__26(0) { <>4__this = this }; } public void SpawnFromDoor(float musicLoopTime) { SpawnFromDoorClientRpc(musicLoopTime); } [ClientRpc] public void SpawnFromDoorClientRpc(float musicLoopTime) { //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(898119841u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref musicLoopTime, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 898119841u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; musicLoopSource.time = musicLoopTime; ((Component)musicLoopSource).gameObject.SetActive(true); sprite.SetActive(true); hasfinishedSpawning = true; isChasing = true; if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(RandomTaunts()); } } } [IteratorStateMachine(typeof(<RandomTaunts>d__29))] private IEnumerator RandomTaunts() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RandomTaunts>d__29(0) { <>4__this = this }; } [ClientRpc] public void ExplosionClientRpc() { //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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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(2351750094u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2351750094u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position, true, 30f, 60f, 50, 50f, (GameObject)null, false); Object.Instantiate<GameObject>(explosionSource, ((Component)this).transform.position, Quaternion.identity); } } } [ClientRpc] public void StopChaseClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(107260u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 107260u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; sprite.SetActive(false); musicLoopSource.Pause(); } } } [ClientRpc] public void StartChaseClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1897134328u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1897134328u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; sprite.SetActive(true); musicLoopSource.Play(); } } } [ClientRpc] public void ApparatusDepositedClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2802460002u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2802460002u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(ApparatusDepositedCoroutine()); } } } [IteratorStateMachine(typeof(<ApparatusDepositedCoroutine>d__34))] private IEnumerator ApparatusDepositedCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ApparatusDepositedCoroutine>d__34(0) { <>4__this = this }; } [ClientRpc] public void PlayLaughSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4229305412u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4229305412u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; laughSource.Play(); } } } [ClientRpc] public void PlayRareTauntClientRpc(int tauntId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2285674759u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, tauntId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2285674759u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; localTauntsSource.clip = tauntsList[tauntId]; localTauntsSource.Play(); } } } [ServerRpc(RequireOwnership = false)] public void UpdatePathfindingToDoorServerRpc(NetworkObjectReference newDoorTargetReference, Vector3 newDoorTargetPosition) { //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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_010f: 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(2023238315u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref newDoorTargetReference, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref newDoorTargetPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2023238315u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"Server : Updating door target"); GameObject val3 = NetworkObjectReference.op_Implicit(newDoorTargetReference); doorTarget = val3.GetComponent<EntranceTeleport>(); doorTargetPosition = newDoorTargetPosition; } } } [ClientRpc] public void SyncTargetApparatusClientRpc(NetworkObjectReference apparatus) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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(157261369u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref apparatus, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 157261369u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = NetworkObjectReference.op_Implicit(apparatus); targetApparatus = val3.GetComponent<LungProp>(); } } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4197329062u, new RpcReceiveHandler(__rpc_handler_4197329062), "PlaySpawnAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(898119841u, new RpcReceiveHandler(__rpc_handler_898119841), "SpawnFromDoorClientRpc"); ((NetworkBehaviour)this).__registerRpc(2351750094u, new RpcReceiveHandler(__rpc_handler_2351750094), "ExplosionClientRpc"); ((NetworkBehaviour)this).__registerRpc(107260u, new RpcReceiveHandler(__rpc_handler_107260), "StopChaseClientRpc"); ((NetworkBehaviour)this).__registerRpc(1897134328u, new RpcReceiveHandler(__rpc_handler_1897134328), "StartChaseClientRpc"); ((NetworkBehaviour)this).__registerRpc(2802460002u, new RpcReceiveHandler(__rpc_handler_2802460002), "ApparatusDepositedClientRpc"); ((NetworkBehaviour)this).__registerRpc(4229305412u, new RpcReceiveHandler(__rpc_handler_4229305412), "PlayLaughSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(2285674759u, new RpcReceiveHandler(__rpc_handler_2285674759), "PlayRareTauntClientRpc"); ((NetworkBehaviour)this).__registerRpc(2023238315u, new RpcReceiveHandler(__rpc_handler_2023238315), "UpdatePathfindingToDoorServerRpc"); ((NetworkBehaviour)this).__registerRpc(157261369u, new RpcReceiveHandler(__rpc_handler_157261369), "SyncTargetApparatusClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_4197329062(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; ((JackensteinAI)(object)target).PlaySpawnAnimationClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_898119841(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float musicLoopTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref musicLoopTime, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JackensteinAI)(object)target).SpawnFromDoorClientRpc(musicLoopTime); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2351750094(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; ((JackensteinAI)(object)target).ExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_107260(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; ((JackensteinAI)(object)target).StopChaseClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1897134328(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; ((JackensteinAI)(object)target).StartChaseClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2802460002(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; ((JackensteinAI)(object)target).ApparatusDepositedClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4229305412(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; ((JackensteinAI)(object)target).PlayLaughSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2285674759(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 tauntId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref tauntId); target.__rpc_exec_stage = (__RpcExecStage)1; ((JackensteinAI)(object)target).PlayRareTauntClientRpc(tauntId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2023238315(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_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference newDoorTargetReference = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref newDoorTargetReference, default(ForNetworkSerializable)); Vector3 newDoorTargetPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newDoorTargetPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((JackensteinAI)(object)target).UpdatePathfindingToDoorServerRpc(newDoorTargetReference, newDoorTargetPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_157261369(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference apparatus = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref apparatus, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JackensteinAI)(object)target).SyncTargetApparatusClientRpc(apparatus); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JackensteinAI"; } } internal class TemporaryExplosionEffect : MonoBehaviour { [CompilerGenerated] private sealed class <Despawn>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TemporaryExplosionEffect <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Despawn>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; Object.Destroy((Object)(object)((Component)<>4__this).gameObject); 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 audioSource = null; public ParticleSystem particleSystem = null; public void Start() { audioSource.Play(); particleSystem.Play(); ((MonoBehaviour)this).StartCoroutine(Despawn()); } [IteratorStateMachine(typeof(<Despawn>d__3))] private IEnumerator Despawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Despawn>d__3(0) { <>4__this = this }; } } [HarmonyPatch(typeof(LungProp))] internal class LungPropPatch { [HarmonyPrefix] [HarmonyPatch("EquipItem")] public static void EquipItem(ref LungProp __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (__instance.isLungDocked && ((NetworkBehaviour)__instance).IsServer && Random.Range(1, 101) <= Plugin.BoundConfig.JackensteinSpawnChance.Value) { Vector3 val = RoundManager.Instance.GetNavMeshPosition(((Component)__instance).transform.position, default(NavMeshHit), 5f, -1); if (!RoundManager.Instance.GotNavMeshPositionResult) { val = ((Component)__instance).transform.position; } GameObject val2 = Object.Instantiate<GameObject>(GetEnemies.Jackenstein.enemyType.enemyPrefab, val, Quaternion.identity); val2.GetComponent<NetworkObject>().Spawn(true); val2.GetComponent<JackensteinAI>().SpawnFirstTime(__instance); } } } [BepInPlugin("Zeldahu.JackensteinApparatus", "Jackenstein Apparatus", "1.1.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string PLUGIN_GUID = "Zeldahu.JackensteinApparatus"; private const string PLUGIN_NAME = "Jackenstein Apparatus"; private const string PLUGIN_VERSION = "1.1.1"; internal static ManualLogSource Logger; public static AssetBundle? ModAssets; private readonly Harmony harmony = new Harmony("Zeldahu.JackensteinApparatus"); internal static PluginConfig BoundConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string path = "jackensteinapparatus"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } harmony.PatchAll(); Logger.LogInfo((object)"Plugin Zeldahu.JackensteinApparatus is loaded!"); EnemyType val = ModAssets.LoadAsset<EnemyType>("Jackenstein"); TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("JackensteinTN"); TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("JackensteinTK"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); Enemies.RegisterEnemy(val, 0, (LevelTypes)(-1), val2, val3); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "Zeldahu.JackensteinApparatus"; public const string PLUGIN_NAME = "JackensteinApparatus"; public const string PLUGIN_VERSION = "1.1.1"; } } namespace JackensteinApparatus.External { [HarmonyPatch(typeof(Terminal))] internal class GetEnemies { public static SpawnableEnemyWithRarity Masked; public static SpawnableEnemyWithRarity HoardingBug; public static SpawnableEnemyWithRarity SnareFlea; public static SpawnableEnemyWithRarity Jester; public static SpawnableEnemyWithRarity Bracken; public static SpawnableEnemyWithRarity Thumper; public static SpawnableEnemyWithRarity CoilHead; public static SpawnableEnemyWithRarity CircuitBees; public static SpawnableEnemyWithRarity EarthLeviathan; public static SpawnableEnemyWithRarity BunkerSpider; public static SpawnableEnemyWithRarity ForestKeeper; public static SpawnableEnemyWithRarity GhostGirl; public static SpawnableEnemyWithRarity TulipSnake; public static SpawnableEnemyWithRarity EyelessDog; public static SpawnableEnemyWithRarity Maneater; public static SpawnableEnemyWithRarity Nutcracker; public static SpawnableEnemyWithRarity Barber; public static SpawnableEnemyWithRarity Butler; public static SpawnableEnemyWithRarity OldBird; public static SpawnableEnemyWithRarity ShyGuy; public static SpawnableEnemyWithRarity RedwoodTitan; public static SpawnableEnemyWithRarity RedwoodGiant; public static SpawnableEnemyWithRarity Locker; public static SpawnableEnemyWithRarity Bruce; public static SpawnableEnemyWithRarity SparkTower; public static SpawnableEnemyWithRarity Jackenstein; public static SpawnableMapObject Landmine; public static SpawnableMapObject Turret; public static SpawnableMapObject SpikeTrap; public static SpawnableMapObject Seamine; public static SpawnableMapObject BigBertha; [HarmonyPatch("Start")] [HarmonyPostfix] public static void GetEnemy(Terminal __instance) { SelectableLevel[] moonsCatalogueList = __instance.moonsCatalogueList; foreach (SelectableLevel val in moonsCatalogueList) { foreach (SpawnableEnemyWithRarity enemy in val.Enemies) { if (enemy.enemyType.enemyName == "Masked" && Masked == null) { Masked = enemy; } else if (enemy.enemyType.enemyName == "Hoarding bug" && HoardingBug == null) { HoardingBug = enemy; } else if (enemy.enemyType.enemyName == "Centipede" && SnareFlea == null) { SnareFlea = enemy; } else if (enemy.enemyType.enemyName == "Jester" && Jester == null) { Jester = enemy; } else if (enemy.enemyType.enemyName == "Flowerman" && Bracken == null) { Bracken = enemy; } else if (enemy.enemyType.enemyName == "Crawler" && Thumper == null) { Thumper = enemy; } else if (enemy.enemyType.enemyName == "Spring" && CoilHead == null) { CoilHead = enemy; } else if (enemy.enemyType.enemyName == "Bunker Spider" && BunkerSpider == null) { BunkerSpider = enemy; } else if (enemy.enemyType.enemyName == "Girl" && GhostGirl == null) { GhostGirl = enemy; } else if (enemy.enemyType.enemyName == "Maneater" && Maneater == null) { Maneater = enemy; } else if (enemy.enemyType.enemyName == "Nutcracker" && Nutcracker == null) { Nutcracker = enemy; } else if (enemy.enemyType.enemyName == "Clay Surgeon" && Barber == null) { Barber = enemy; } else if (enemy.enemyType.enemyName == "Butler" && Butler == null) { Butler = enemy; } else if (enemy.enemyType.enemyName == "Shy guy" && ShyGuy == null) { ShyGuy = enemy; } else if (enemy.enemyType.enemyName == "Locker" && Locker == null) { Locker = enemy; } else if (enemy.enemyType.enemyName == "Jackenstein" && Jackenstein == null) { Jackenstein = enemy; } } foreach (SpawnableEnemyWithRarity daytimeEnemy in val.DaytimeEnemies) { if (daytimeEnemy.enemyType.enemyName == "Red Locust Bees" && CircuitBees == null) { CircuitBees = daytimeEnemy; } else if (daytimeEnemy.enemyType.enemyName == "Tulip Snake" && TulipSnake == null) { TulipSnake = daytimeEnemy; } } foreach (SpawnableEnemyWithRarity outsideEnemy in val.OutsideEnemies) { if (outsideEnemy.enemyType.enemyName == "Earth Leviathan" && EarthLeviathan == null) { EarthLeviathan = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "ForestGiant" && ForestKeeper == null) { ForestKeeper = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "MouthDog" && EyelessDog == null) { EyelessDog = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "RadMech" && OldBird == null) { OldBird = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "Redwood Titan" && RedwoodTitan == null) { RedwoodTitan = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "RedWoodGiant" && RedwoodGiant == null) { RedwoodGiant = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "Bruce" && Bruce == null) { Bruce = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "SparkTower" && SparkTower == null) { SparkTower = outsideEnemy; } } SpawnableMapObject[] spawnableMapObjects = val.spawnableMapObjects; foreach (SpawnableMapObject val2 in spawnableMapObjects) { if (((Object)val2.prefabToSpawn).name == "Landmine" && Landmine == null) { Landmine = val2; } else if (((Object)val2.prefabToSpawn).name == "TurretContainer" && Turret == null) { Turret = val2; } else if (((Object)val2.prefabToSpawn).name == "SpikeRoofTrapHazard" && SpikeTrap == null) { SpikeTrap = val2; } else if (((Object)val2.prefabToSpawn).name == "Seamine" && Seamine == null) { Seamine = val2; } else if (((Object)val2.prefabToSpawn).name == "Bertha" && BigBertha == null) { BigBertha = val2; } } } } } } namespace JackensteinApparatus.Configuration { public class PluginConfig { public ConfigEntry<int> JackensteinSpawnChance; public ConfigEntry<bool> JackensteinDopplerToggle; public PluginConfig(ConfigFile cfg) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown JackensteinSpawnChance = cfg.Bind<int>("Jackenstein", "Spawn Chance", 100, new ConfigDescription("How likely it is for Jackenstein to spawn when pulling the apparatus", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); JackensteinDopplerToggle = cfg.Bind<bool>("Jackenstein", "Doppler effect", true, "Should a doppler effect be applied on Jackenstein's audio?"); ClearUnusedEntries(cfg); } private void ClearUnusedEntries(ConfigFile cfg) { PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null); dictionary.Clear(); cfg.Save(); } } } 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 Zeldahu.JackensteinApparatus.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }