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 UnrealTentacle v1.0.6
DreWulff-UnrealTentacle.dll
Decompiled a month ago#define DEBUG using System; 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 ConfigHelper; using ConfigHelper.Entities; using DreWulff-UnrealTentacle.NetcodePatcher; using GameNetcodeStuff; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnrealTentacle.Configuration; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DreWulff-UnrealTentacle")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.6.0")] [assembly: AssemblyInformationalVersion("1.0.6+6afb95f29b7c862a0f80cbf4276b067a0eef8668")] [assembly: AssemblyProduct("UnrealTentacle")] [assembly: AssemblyTitle("DreWulff-UnrealTentacle")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.6.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 UnrealTentacle { [RequireComponent(typeof(Rigidbody))] internal class UnrealTentacleAI : EnemyAI { private enum State { ROAMING, ASLEEP, ATTACK } [SerializeField] private Transform tentacleBone = null; [SerializeField] private Transform tentacleTip = null; [SerializeField] private GameObject barbProjectile = null; [SerializeField] private float barbSpeed = 0f; [SerializeField] private float searchRoofTimer; [SerializeField] private SpotVerifier spotVerifier = null; private Vector3 projectedPosition; private float searchRandomFactor; private bool spottedPlayer = false; private bool spawned = false; private float lookAroundTimer; [SerializeField] private float range = 0f; private List<PlayerControllerB> closePlayers = new List<PlayerControllerB>(); private List<PlayerControllerB> onSightPlayers = new List<PlayerControllerB>(); private Vector3 targetPlayerPosition; [SerializeField] private GameObject mapDotObj = null; [SerializeField] private GameObject colliderObj = null; [SerializeField] private GameObject modelObj = null; [SerializeField] private GameObject scanNodeObj = null; [SerializeField] private int copiesToBeSpawned = 3; private float timeOfDeath; private Vector3 deadStartingPosition; private Vector3 deadTargetPosition; [HideInInspector] public Rigidbody rb = null; public void StartAttack() { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); DoAnimationClientRpc("Attack"); } private void AttackUpdate() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.targetPlayer != (Object)null) { SyncTargetPlayerServerRpc(); targetPlayerPosition = ((Component)base.targetPlayer).transform.position; } RotateTowardsPlayer(targetPlayerPosition); } private void AttackAI() { if (!TargetClosestPlayer()) { Sleep(); } } public void ShootProjectile() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.targetPlayer != (Object)null) { ShootProjectile(((Component)base.targetPlayer).transform.position); } } public void ShootProjectile(Vector3 target) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0095: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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) TentacleProjectile component = Object.Instantiate<GameObject>(barbProjectile, ((Component)tentacleTip).transform.position, ((Component)tentacleTip).transform.rotation, RoundManager.Instance.mapPropsContainer.transform).GetComponent<TentacleProjectile>(); Vector3 val = target + new Vector3(0f, 2f, 0f) - tentacleTip.position; component.StartTrajectory(((Vector3)(ref val)).normalized * barbSpeed); NetworkObject component2 = ((Component)component).GetComponent<NetworkObject>(); component2.Spawn(false); val = target + new Vector3(0f, 2f, 0f) - tentacleTip.position; component.SyncVelocity(((Vector3)(ref val)).normalized * barbSpeed); } private void RotateTowardsPlayer(Vector3 target) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) tentacleBone.LookAt(target); if (((Component)this).transform.eulerAngles.z == 180f) { tentacleBone.eulerAngles = new Vector3(tentacleBone.eulerAngles.x - 45f, tentacleBone.eulerAngles.y, tentacleBone.localScale.z + 180f); } } private void StartRoam() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(0); base.inSpecialAnimation = false; searchRandomFactor = Random.Range(0f, searchRoofTimer / 2f); DisableScanNodeClientRpc(); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } private void RoamAI() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)this).transform.position, -Physics.gravity); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 20f, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && ((RaycastHit)(ref val2)).distance < 15f && ((RaycastHit)(ref val2)).distance > 2f && searchRoofTimer <= searchRandomFactor) { projectedPosition = ((RaycastHit)(ref val2)).point; ((Component)spotVerifier).transform.position = projectedPosition; if (spotVerifier.collisionCounter <= 0) { ValidateSpotClientRpc(); } } if (searchRoofTimer <= 0f) { StartSleep(); return; } base.agent.speed = 500f; searchRoofTimer -= base.AIIntervalTime; } [ClientRpc] public void ValidateSpotClientRpc() { //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_00d5: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) 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(2372634560u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2372634560u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartSleep(); ((Component)this).transform.position = projectedPosition - new Vector3(0f, 0.05f, 0f); ((Component)this).transform.eulerAngles = new Vector3(180f, (float)Random.Range(0, 360), 0f); } } } [ClientRpc] private void DisableScanNodeClientRpc() { //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(2689186813u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2689186813u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Behaviour)base.agent).enabled = true; scanNodeObj.SetActive(false); } } } public void StartSleep() { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); for (int i = 1; i < copiesToBeSpawned; i++) { SpawnCopy(); } ((EnemyAI)this).StopSearch(base.currentSearch, true); base.inSpecialAnimation = false; base.agent.speed = 0f; ((Behaviour)base.agent).enabled = false; spottedPlayer = false; base.moveTowardsDestination = false; ReEnableEnemyClientRpc(); SetSleepSpeedClientRpc(1f); } public void Sleep() { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); spottedPlayer = false; lookAroundTimer = Random.Range(10, 20); spawned = true; DoAnimationClientRpc("Idle"); } public void SleepAI() { if (TargetClosestPlayer() && !spottedPlayer) { spottedPlayer = true; DoAnimationClientRpc("Alert"); } if (lookAroundTimer > 0f) { lookAroundTimer -= base.AIIntervalTime; return; } DoAnimationClientRpc("LookAround"); lookAroundTimer = Random.Range(10, 20); } [ClientRpc] private void ReEnableEnemyClientRpc() { //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(2585290693u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2585290693u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; modelObj.SetActive(true); mapDotObj.SetActive(true); scanNodeObj.SetActive(true); colliderObj.SetActive(true); } } } private bool TargetClosestPlayer() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance && CheckLineOfSightForPosition(((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) && base.tempDist < range) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer != (Object)null) { return true; } return false; } public bool CheckLineOfSightForPosition(Vector3 objectPosition) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Linecast(base.eye.position, objectPosition, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return false; } return true; } [ServerRpc] public void SyncTargetPlayerServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_012b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(810546370u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 810546370u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((Object)(object)base.targetPlayer == (Object)null)) { ReceiveTargetPlayerClientRpc(((Component)base.targetPlayer).transform.position); } } } [ClientRpc] public void ReceiveTargetPlayerClientRpc(Vector3 target) { //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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4161937017u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref target); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4161937017u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { targetPlayerPosition = target; } } } [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //IL_0039: 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) ((EnemyAI)this).Start(); float num = Random.Range(0.8f, 1f); ((Component)((Component)this).gameObject.transform).transform.localScale = num * ((Component)((Component)this).gameObject.transform).transform.localScale; rb = ((Component)this).gameObject.GetComponent<Rigidbody>(); LogIfDebugBuild("Unreal Tentacle Spawned"); StartRoam(); } public override void Update() { if (!base.isEnemyDead) { ((EnemyAI)this).Update(); } } public void LateUpdate() { //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_0068: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead) { if (timeOfDeath < 1f) { timeOfDeath += Time.deltaTime; Transform transform = ((Component)this).transform; Vector3 val = deadStartingPosition; Vector3 val2 = deadTargetPosition; float num = timeOfDeath * 10f; Vector3 val3 = deadTargetPosition - deadStartingPosition; transform.position = Vector3.Lerp(val, val2, num / ((Vector3)(ref val3)).magnitude); } } else { switch (base.currentBehaviourStateIndex) { case 0: break; case 1: break; case 2: AttackUpdate(); break; } } } public override void DoAIInterval() { if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } ((EnemyAI)this).DoAIInterval(); switch (base.currentBehaviourStateIndex) { case 0: RoamAI(); break; case 1: if (spawned) { SleepAI(); } break; case 2: AttackAI(); break; } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (base.isEnemyDead) { return; } base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0 && !base.isEnemyDead) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } else if (base.enemyHP > 0) { DoAnimationServerRpc("Stun"); } } } public override void KillEnemy(bool destroy = false) { ((EnemyAI)this).KillEnemy(destroy); SetDeathPositionClientRpc(); } [ServerRpc] public void DoAnimationServerRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Invalid comparison between Unknown and I4 //IL_0145: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_0100: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(942661263u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 942661263u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoAnimationClientRpc(animationName); } } [ClientRpc] public void DoAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(704630064u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 704630064u, 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(animationName); } } [ClientRpc] public void SetSleepSpeedClientRpc(float value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2450141289u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2450141289u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetFloat("AnimationSpeed", value); } } } [ClientRpc] public void SetDeathPositionClientRpc() { //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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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(1154018643u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1154018643u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; deadStartingPosition = ((Component)this).transform.position; Ray val3 = default(Ray); ((Ray)(ref val3))..ctor(base.eye.position, Vector3.down); RaycastHit val4 = default(RaycastHit); if (Physics.Linecast(base.eye.position, base.eye.position + Vector3.down * 20f, ref val4, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { deadTargetPosition = ((RaycastHit)(ref val4)).point + new Vector3(0f, 0.2f, 0f); } timeOfDeath = 0f; } } public void SpawnCopy() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { UnrealTentacleAI component = Object.Instantiate<GameObject>(base.enemyType.enemyPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, RoundManager.Instance.mapPropsContainer.transform).GetComponent<UnrealTentacleAI>(); NetworkObject component2 = ((Component)component).GetComponent<NetworkObject>(); component2.Spawn(false); component.DontSpawnCopiesClientRpc(); } } [ClientRpc] private void DontSpawnCopiesClientRpc() { //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(1200460606u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1200460606u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; copiesToBeSpawned = 0; } } } 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(2372634560u, new RpcReceiveHandler(__rpc_handler_2372634560), "ValidateSpotClientRpc"); ((NetworkBehaviour)this).__registerRpc(2689186813u, new RpcReceiveHandler(__rpc_handler_2689186813), "DisableScanNodeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2585290693u, new RpcReceiveHandler(__rpc_handler_2585290693), "ReEnableEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(810546370u, new RpcReceiveHandler(__rpc_handler_810546370), "SyncTargetPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(4161937017u, new RpcReceiveHandler(__rpc_handler_4161937017), "ReceiveTargetPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(942661263u, new RpcReceiveHandler(__rpc_handler_942661263), "DoAnimationServerRpc"); ((NetworkBehaviour)this).__registerRpc(704630064u, new RpcReceiveHandler(__rpc_handler_704630064), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(2450141289u, new RpcReceiveHandler(__rpc_handler_2450141289), "SetSleepSpeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(1154018643u, new RpcReceiveHandler(__rpc_handler_1154018643), "SetDeathPositionClientRpc"); ((NetworkBehaviour)this).__registerRpc(1200460606u, new RpcReceiveHandler(__rpc_handler_1200460606), "DontSpawnCopiesClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2372634560(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; ((UnrealTentacleAI)(object)target).ValidateSpotClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2689186813(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; ((UnrealTentacleAI)(object)target).DisableScanNodeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2585290693(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; ((UnrealTentacleAI)(object)target).ReEnableEnemyClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_810546370(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((UnrealTentacleAI)(object)target).SyncTargetPlayerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4161937017(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 target2 = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref target2); target.__rpc_exec_stage = (__RpcExecStage)1; ((UnrealTentacleAI)(object)target).ReceiveTargetPlayerClientRpc(target2); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_942661263(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00ae: 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) 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!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((UnrealTentacleAI)(object)target).DoAnimationServerRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_704630064(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((UnrealTentacleAI)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2450141289(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 sleepSpeedClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref sleepSpeedClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((UnrealTentacleAI)(object)target).SetSleepSpeedClientRpc(sleepSpeedClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1154018643(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; ((UnrealTentacleAI)(object)target).SetDeathPositionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1200460606(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; ((UnrealTentacleAI)(object)target).DontSpawnCopiesClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "UnrealTentacleAI"; } } [BepInPlugin("DreWulff-UnrealTentacle", "UnrealTentacle", "1.0.6")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle? ModAssets; internal static PluginConfig BoundConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; InitializeNetworkBehaviours(); string path = "unreal-tentacle-assets"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } EnemyType val = ModAssets.LoadAsset<EnemyType>("NaliTentacle"); TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("NaliTentacleTN"); TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("NaliTentacleTK"); GameObject val4 = ModAssets.LoadAsset<GameObject>("Barb"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(val4); BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); Enemies.RegisterEnemy(val, BoundConfig.vanillaRarities, BoundConfig.customRarities, val2, val3); Logger.LogInfo((object)"Plugin DreWulff-UnrealTentacle is loaded!"); } 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); } } } } } internal class SpotVerifier : MonoBehaviour { [HideInInspector] public int collisionCounter = 0; private void OnTriggerEnter(Collider other) { if ((StartOfRound.Instance.collidersAndRoomMaskAndDefault & (1 << ((Component)other).gameObject.layer)) != 0) { collisionCounter++; } } private void OnTriggerExit(Collider other) { if ((StartOfRound.Instance.collidersAndRoomMaskAndDefault & (1 << ((Component)other).gameObject.layer)) != 0) { collisionCounter--; } } } [RequireComponent(typeof(UnrealTentacleAI))] internal class TentacleAnimationEvents : MonoBehaviour { [SerializeField] private UnrealTentacleAI mainAI = null; public void EndSpawn() { mainAI.Sleep(); } public void StartAttack() { mainAI.StartAttack(); } public void Shoot() { mainAI.ShootProjectile(); } public void EndStun() { mainAI.DoAnimationClientRpc("Alert"); } } [RequireComponent(typeof(Rigidbody))] internal class TentacleProjectile : NetworkBehaviour { private Rigidbody rb = null; private float TTL; private void Awake() { TTL = 3f; rb = ((Component)this).GetComponent<Rigidbody>(); } private void Update() { if (TTL < 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { TTL -= Time.deltaTime; } } public void StartTrajectory(Vector3 speed) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) rb.velocity = speed; ((Component)this).transform.LookAt(((Component)this).transform.position + speed); ((Component)this).transform.Rotate(-90f, 0f, 0f); } private void OnTriggerEnter(Collider other) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (((Component)other).gameObject.CompareTag("Player")) { ((Component)other).GetComponent<PlayerControllerB>().DamagePlayer(Plugin.BoundConfig.barbDamage.Value, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); Object.Destroy((Object)(object)((Component)this).gameObject); } else if ((0x100B08u & (uint)(1 << ((Component)other).gameObject.layer)) != 0) { Object.Destroy((Object)(object)((Component)this).gameObject); } } [ClientRpc] private void StartTrajectoryClientRpc(Vector3 speed) { //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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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(486986001u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref speed); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 486986001u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { rb.velocity = speed; ((Component)this).transform.LookAt(((Component)this).transform.position + speed); ((Component)this).transform.Rotate(-90f, 0f, 0f); } } } public void SyncVelocity(Vector3 velocity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) StartTrajectoryClientRpc(velocity); } 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 ((NetworkBehaviour)this).__registerRpc(486986001u, new RpcReceiveHandler(__rpc_handler_486986001), "StartTrajectoryClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_486986001(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 speed = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref speed); target.__rpc_exec_stage = (__RpcExecStage)1; ((TentacleProjectile)(object)target).StartTrajectoryClientRpc(speed); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TentacleProjectile"; } } public static class PluginInfo { public const string PLUGIN_GUID = "DreWulff-UnrealTentacle"; public const string PLUGIN_NAME = "UnrealTentacle"; public const string PLUGIN_VERSION = "1.0.6"; } } namespace UnrealTentacle.Configuration { public class PluginConfig { public Dictionary<LevelTypes, int> vanillaRarities; public Dictionary<string, int> customRarities; public ConfigEntry<int> barbDamage; public PluginConfig(ConfigFile cfg) { Spawning.GetRarities(cfg, new Dictionary<string, int> { { "Vow", 20 }, { "March", 20 }, { "Mazon", 35 }, { "Halation", 10 }, { "Infernis", 40 }, { "Junic", 15 } }, ref vanillaRarities, ref customRarities); barbDamage = cfg.Bind<int>("Behaviour", "Barb Damage", 15, "Damage dealt by the tentacle's projectiles"); General.ClearUnusedEntries(cfg); } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace DreWulff-UnrealTentacle.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }