Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of KarelianCompany v1.0.4
plugins/KarelianCompany/Sita320341.KarelianCompany.dll
Decompiled 4 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using KarelianCompany.Configuration; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Sita320341.KarelianCompany.NetcodePatcher; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Sita320341.KarelianCompany")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.4.0")] [assembly: AssemblyInformationalVersion("1.0.4+395509337b81b97b4694bc34553e5c559d2180d3")] [assembly: AssemblyProduct("KarelianCompany")] [assembly: AssemblyTitle("Sita320341.KarelianCompany")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.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 KarelianCompany { internal class AndruhaAI : EnemyAI { private enum State { SearchingForPlayer, FollowingPlayer, ChasingPlayer } [CompilerGenerated] private sealed class <StabPlayer>d__34 : IEnumerator<WaitForSeconds>, IEnumerator, IDisposable { private int <>1__state; private WaitForSeconds <>2__current; public AndruhaAI <>4__this; WaitForSeconds IEnumerator<WaitForSeconds>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <StabPlayer>d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown int num = <>1__state; AndruhaAI andruhaAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if (Random.Range(0, 2) == 0) { andruhaAI.andruhaMouth.PlayOneShot(andruhaAI.stabVoices[Random.Range(0, andruhaAI.stabVoices.Count)]); } ((EnemyAI)andruhaAI).creatureAnimator.SetBool("run", false); ((EnemyAI)andruhaAI).creatureAnimator.SetBool("attack", true); <>2__current = new WaitForSeconds(0.25f); <>1__state = 1; return true; case 1: <>1__state = -1; andruhaAI.andruhaMouth.PlayOneShot(andruhaAI.stab); <>2__current = new WaitForSeconds(0.9f); <>1__state = 2; return true; case 2: <>1__state = -1; ((EnemyAI)andruhaAI).creatureAnimator.SetBool("attack", false); ((EnemyAI)andruhaAI).creatureAnimator.SetBool("run", 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 <TransitionAnimation>d__49 : IEnumerator<WaitForSeconds>, IEnumerator, IDisposable { private int <>1__state; private WaitForSeconds <>2__current; public AndruhaAI <>4__this; public Vector3 setToPos; WaitForSeconds IEnumerator<WaitForSeconds>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TransitionAnimation>d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; AndruhaAI andruhaAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)andruhaAI).creatureAnimator.SetBool("transition", true); <>2__current = new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)andruhaAI).inSpecialAnimation = false; if (((NetworkBehaviour)andruhaAI).IsOwner) { ((Component)andruhaAI).transform.position = setToPos; ((Behaviour)((EnemyAI)andruhaAI).agent).enabled = true; } ((EnemyAI)andruhaAI).creatureAnimator.SetBool("transition", false); ((EnemyAI)andruhaAI).creatureAnimator.SetBool("run", true); Debug.DrawRay(setToPos, Vector3.up * 2f, Color.magenta, 7f); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const int LEFT_EYE_INDEX = 17; private const int RIGHT_EYE_INDEX = 18; public Transform turnCompass; public Transform attackArea; public AudioSource murderMusicSFX; private float timeSinceHittingLocalPlayer; private float timeSinceNewRandPos; private float angerMeterCapacity; private float timeSinceLastStab; private Vector3 positionRandomness; private Vector3 StalkPos; private Random enemyRandom; private float angerMeter; private bool isBerserkMode; private bool isDeadAnimationDone; private Vector3 previousPosition; private float timeSinceStartedFollowingPlayer; public AudioSource andruhaMouth; public AudioClip rageClip; public AudioClip stab; public List<AudioClip> stabVoices = new List<AudioClip>(); public List<AudioClip> followVoices = new List<AudioClip>(); public AudioClip killVoice; public GameObject phone; public GameObject bloodParticles; private float timeSinceLastFollowAudio; private State? previousState; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { if (text == null) { Plugin.Logger.LogError((object)"Attempted to log a null string."); } else { Plugin.Logger.LogInfo((object)text); } } public override void Start() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); angerMeterCapacity = Random.Range(30f, 50f); angerMeter = 0f; timeSinceHittingLocalPlayer = 0f; timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; ((EnemyAI)this).SwitchToBehaviourClientRpc(0); base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { murderMusicSFX.Stop(); return; } if ((Object)(object)base.targetPlayer != (Object)null) { Vector3 position = ((Component)base.targetPlayer).transform.position; Transform transform = ((Component)((Component)this).gameObject.transform.GetChild(20)).gameObject.transform; Vector3 val = new Vector3(position.x, position.y + 4f, position.z) - ((Component)transform).transform.position; Quaternion val2 = Quaternion.LookRotation(val); ((Component)transform).transform.rotation = Quaternion.Inverse(val2); ((Component)((Component)((Component)this).gameObject.transform.GetChild(17)).gameObject.transform).transform.rotation = val2; ((Component)((Component)((Component)this).gameObject.transform.GetChild(18)).gameObject.transform).transform.rotation = val2; } UpdateMurderMusic(); AnimatorStateInfo currentAnimatorStateInfo; switch (base.currentBehaviourStateIndex) { case 1: { if (previousState.GetValueOrDefault() != State.FollowingPlayer) { previousState = State.FollowingPlayer; timeSinceStartedFollowingPlayer = 0f; } CalculateWalkingAnimationSpeed(5f); timeSinceStartedFollowingPlayer += Time.deltaTime; if (timeSinceLastFollowAudio > 10f && timeSinceStartedFollowingPlayer > 5f && !andruhaMouth.isPlaying) { if (Random.Range(0, 1) == 0) { andruhaMouth.PlayOneShot(followVoices[Random.Range(0, followVoices.Count)]); } timeSinceLastFollowAudio = 0f; } timeSinceLastFollowAudio += Time.deltaTime; Vector3 velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude < 0.1f) { currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("walk")) { DoAnimationClientRpc("idle"); goto IL_0251; } } velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude > 0.1f) { currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("idle")) { DoAnimationClientRpc("walk"); } } goto IL_0251; } case 2: { if (previousState.GetValueOrDefault() != State.ChasingPlayer) { PullKnifeOutServerRpc(); andruhaMouth.PlayOneShot(rageClip); previousState = State.ChasingPlayer; } CalculateWRunningAnimationSpeed(4f); if ((Object)(object)base.targetPlayer != (Object)null) { CheckCollisionWithPlayer(base.targetPlayer); } base.agent.speed = Mathf.Clamp(base.agent.speed + Time.deltaTime * 6f, 0f, 8f); base.agent.angularSpeed = 720f; base.agent.acceleration = 100f; base.addPlayerVelocityToDestination = Mathf.Lerp(base.addPlayerVelocityToDestination, 2f, Time.deltaTime); if (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 2f) { base.agent.stoppingDistance = 0f; } else { base.agent.stoppingDistance = 0.5f; } float num = 0f; float num2 = 40f; float num3 = 1.1f; float num4 = 0.9f; float pitch = num3 + (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) - num) / (num2 - num) * (num4 - num3); murderMusicSFX.pitch = pitch; murderMusicSFX.volume = Mathf.Clamp(Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) / 40f, 0.8f, 1.1f); if (Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position) < 15f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(1f, true); } timeSinceLastStab += Time.deltaTime; if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 100f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); base.currentBehaviourStateIndex = 0; } else { Vector3 val3 = ((Component)base.targetPlayer).transform.position + ((Component)base.targetPlayer).GetComponent<Rigidbody>().velocity * 0.5f; ((EnemyAI)this).SetDestinationToPosition(val3, false); } break; } IL_0251: base.addPlayerVelocityToDestination = 0f; currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("transition")) { base.agent.speed = 0f; } else { base.agent.speed = 4f; } base.agent.stoppingDistance = 4f; if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 40f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); base.currentBehaviourStateIndex = 0; } else if (angerMeter < angerMeterCapacity) { angerMeter += Time.deltaTime; float num5 = 20f; if (timeSinceStartedFollowingPlayer > 5f) { num5 = 8f; } if (TargetClosestPlayerInAnyCase() && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > num5) { ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position, false); } } else { currentAnimatorStateInfo = base.creatureAnimator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("transition")) { SwitchToChasingPlayer(); } } break; } } public override void DoAIInterval() { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.currentBehaviourStateIndex != 0) { return; } if (previousState != State.SearchingForPlayer) { DoAnimationClientRpc("idle"); previousState = State.SearchingForPlayer; } ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f); base.agent.speed = 8f; if ((Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ChooseClosestNodeToPlayer(); } if ((Object)(object)base.targetPlayer != (Object)null && ((EnemyAI)this).TargetClosestPlayer(3f, true, 360f) && base.targetPlayer.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 1.6f, 68f, 60, -1f)) { if (base.currentSearch.inProgress) { ((EnemyAI)this).StopSearch(base.currentSearch, true); } ((EnemyAI)this).SwitchToBehaviourClientRpc(1); base.currentBehaviourStateIndex = 1; } } [ServerRpc(RequireOwnership = false)] public void StabPlayerServerRpc(int playerId, bool setBerserkMode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3756768730u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setBerserkMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3756768730u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StabPlayerClientRpc(playerId, setBerserkMode); } } } [ClientRpc] public void StabPlayerClientRpc(int playerId, bool setBerserkMode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1095208204u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref setBerserkMode, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1095208204u, 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((IEnumerator)StabPlayer(playerId, setBerserkMode)); } } } [IteratorStateMachine(typeof(<StabPlayer>d__34))] private IEnumerator<WaitForSeconds> StabPlayer(int playerId, bool setBerserkMode) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <StabPlayer>d__34(0) { <>4__this = this }; } public void CheckCollisionWithPlayer(PlayerControllerB other) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead || base.currentBehaviourStateIndex != 2 || timeSinceLastStab < 1.15f || (Object)(object)other == (Object)null || Vector3.Distance(((Component)other).transform.position, ((Component)this).transform.position) > 1.5f) { return; } timeSinceLastStab = 0f; if ((Object)(object)other == (Object)(object)GameNetworkManager.Instance.localPlayerController) { other.DamagePlayer(30, true, true, (CauseOfDeath)14, 0, false, default(Vector3)); other.DropBlood(new Vector3(0f, 0f, 0f), true, false); if (other.health <= 0) { andruhaMouth.PlayOneShot(killVoice); } GameObject obj = bloodParticles; Vector3 val = new Vector3(((Component)other.gameplayCamera).transform.position.x, ((Component)other.gameplayCamera).transform.position.y - 0.2f, ((Component)other.gameplayCamera).transform.position.z); Quaternion rotation = ((Component)other.gameplayCamera).transform.rotation; GameObject val2 = Object.Instantiate<GameObject>(obj, val, Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles)); val2.transform.SetParent(((Component)base.targetPlayer).transform); Object.Destroy((Object)(object)val2, 2f); StabPlayerServerRpc((int)other.playerClientId, base.currentBehaviourStateIndex != 2); } } [ServerRpc(RequireOwnership = false)] public void InstantiateBloodParticleServerRPC(Vector3 pos, Quaternion rot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) 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(233444369u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rot); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 233444369u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; InstantiateBloodParticleClientRPC(pos, rot); } } } [ClientRpc] public void InstantiateBloodParticleClientRPC(Vector3 pos, Quaternion rot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) 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(356528112u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 356528112u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate<GameObject>(bloodParticles, pos, rot); val3.transform.SetParent(((Component)base.targetPlayer).transform); val3.GetComponent<NetworkObject>().Spawn(false); val3.AddComponent(typeof(BloodParticle)); } } } private void CalculateWalkingAnimationSpeed(float maxSpeed = 1f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, maxSpeed); float num = ((Vector3)(ref val)).magnitude / (Time.deltaTime * 2f); base.creatureAnimator.SetFloat("speedOfMovement", num); previousPosition = ((Component)this).transform.position; } private void CalculateWRunningAnimationSpeed(float maxSpeed = 1f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, maxSpeed); float num = ((Vector3)(ref val)).magnitude / (Time.deltaTime * 5f); base.creatureAnimator.SetFloat("speedOfMovement", num); previousPosition = ((Component)this).transform.position; } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f); range = senseRange; } if ((Object)(object)base.targetPlayer != (Object)null) { return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } return false; } private bool TargetClosestPlayerInAnyCase() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } public void ChooseClosestNodeToPlayer() { //IL_003d: 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) base.agent.stoppingDistance = 0f; if ((Object)(object)base.targetNode == (Object)null) { base.targetNode = base.allAINodes[0].transform; } Transform val = ChooseClosestInvisibleNodeToPosition(((Component)base.targetPlayer).transform.position, avoidLineOfSight: true); ((EnemyAI)this).SetDestinationToPosition(val.position, false); } public Transform ChooseClosestInvisibleNodeToPosition(Vector3 pos, bool avoidLineOfSight = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int>(); base.nodesTempArray = base.allAINodes.Where((GameObject x) => Vector3.Distance(pos, x.transform.position) < 20f).ToArray(); base.nodesTempArray = base.nodesTempArray.OrderBy((GameObject x) => Vector3.Distance(pos, x.transform.position)).ToArray(); Transform transform = base.nodesTempArray[0].transform; for (int i = 0; i < base.nodesTempArray.Length; i++) { if (((EnemyAI)this).PathIsIntersectedByLineOfSight(base.nodesTempArray[i].transform.position, false, avoidLineOfSight, false)) { list.Add(i); } } for (int j = 0; j < base.nodesTempArray.Length; j++) { if (!list.Contains(j)) { transform = base.nodesTempArray[j].transform; base.mostOptimalDistance = Vector3.Distance(pos, base.nodesTempArray[j].transform.position); break; } } return transform; } private void SwitchToChasingPlayer() { isBerserkMode = true; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); base.currentBehaviourStateIndex = 2; angerMeter = 0f; base.creatureAnimator.SetBool("run", true); } private bool IsAggressivelyChasing() { if (base.currentBehaviourStateIndex == 2) { return !base.isEnemyDead; } return false; } [ServerRpc(RequireOwnership = false)] public void PullKnifeOutServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1741764620u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1741764620u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PullKnifeOutClientRpc(); } } } [ClientRpc] public void PullKnifeOutClientRpc() { //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(3322360426u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3322360426u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartTransitionAnimation(); } } } private void StartTransitionAnimation() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_003b: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0054: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position, false); Vector3 position = ((Component)this).transform.position; base.inSpecialAnimation = true; ((Behaviour)base.agent).enabled = false; Vector3 val = (base.serverPosition = RoundManager.Instance.GetNavMeshPosition(position, default(NavMeshHit), 10f, -1)); ((Component)this).transform.position = val; ((Component)this).transform.localEulerAngles = new Vector3(0f, ((Component)this).transform.localEulerAngles.y, 0f); position = val; ((MonoBehaviour)this).StartCoroutine((IEnumerator)TransitionAnimation(position)); } [IteratorStateMachine(typeof(<TransitionAnimation>d__49))] private IEnumerator<WaitForSeconds> TransitionAnimation(Vector3 setToPos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TransitionAnimation>d__49(0) { <>4__this = this, setToPos = setToPos }; } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { if (!base.isEnemyDead) { _ = 1; } } 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) { base.enemyHP -= force; base.targetPlayer = playerWhoHit; ((EnemyAI)this).SwitchToBehaviourServerRpc(2); if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } private void UpdateMurderMusic() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!IsAggressivelyChasing()) { if (murderMusicSFX.isPlaying) { murderMusicSFX.Stop(); } return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController).transform.position); if (num <= 65f) { if (!murderMusicSFX.isPlaying) { murderMusicSFX.Play(); } float num2 = num / 65f; murderMusicSFX.volume = Mathf.Lerp(1f, 0f, num2); murderMusicSFX.pitch = Mathf.Lerp(1.1f, 0.9f, num2); } else if (num >= 80f && murderMusicSFX.isPlaying) { murderMusicSFX.Stop(); } } [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(3987900853u, 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, 3987900853u, 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 SwingAttackHitClientRpc() { //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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) 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(964239439u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 964239439u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val3 in array2) { PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false); if ((Object)(object)val4 != (Object)null) { timeSinceHittingLocalPlayer = 0f; val4.DamagePlayer(40, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } } 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 ((NetworkBehaviour)this).__registerRpc(3756768730u, new RpcReceiveHandler(__rpc_handler_3756768730), "StabPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1095208204u, new RpcReceiveHandler(__rpc_handler_1095208204), "StabPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(233444369u, new RpcReceiveHandler(__rpc_handler_233444369), "InstantiateBloodParticleServerRPC"); ((NetworkBehaviour)this).__registerRpc(356528112u, new RpcReceiveHandler(__rpc_handler_356528112), "InstantiateBloodParticleClientRPC"); ((NetworkBehaviour)this).__registerRpc(1741764620u, new RpcReceiveHandler(__rpc_handler_1741764620), "PullKnifeOutServerRpc"); ((NetworkBehaviour)this).__registerRpc(3322360426u, new RpcReceiveHandler(__rpc_handler_3322360426), "PullKnifeOutClientRpc"); ((NetworkBehaviour)this).__registerRpc(3987900853u, new RpcReceiveHandler(__rpc_handler_3987900853), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(964239439u, new RpcReceiveHandler(__rpc_handler_964239439), "SwingAttackHitClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3756768730(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool setBerserkMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref setBerserkMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((AndruhaAI)(object)target).StabPlayerServerRpc(playerId, setBerserkMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1095208204(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool setBerserkMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref setBerserkMode, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((AndruhaAI)(object)target).StabPlayerClientRpc(playerId, setBerserkMode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_233444369(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Quaternion rot = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); target.__rpc_exec_stage = (__RpcExecStage)1; ((AndruhaAI)(object)target).InstantiateBloodParticleServerRPC(pos, rot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_356528112(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Quaternion rot = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); target.__rpc_exec_stage = (__RpcExecStage)1; ((AndruhaAI)(object)target).InstantiateBloodParticleClientRPC(pos, rot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1741764620(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; ((AndruhaAI)(object)target).PullKnifeOutServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3322360426(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; ((AndruhaAI)(object)target).PullKnifeOutClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3987900853(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; ((AndruhaAI)(object)target).DoAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_964239439(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; ((AndruhaAI)(object)target).SwingAttackHitClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AndruhaAI"; } } internal class BloodParticle : NetworkBehaviour { public void Start() { DestroyBloodServerRPC(); } private void DestroyBlood() { Object.Destroy((Object)(object)((Component)this).gameObject, 2f); } [ServerRpc(RequireOwnership = false)] public void DestroyBloodServerRPC() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1829227131u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1829227131u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((Component)this).GetComponent<NetworkObject>().Despawn(true); DestroyBloodClientRPC(); Object.Destroy((Object)(object)((Component)this).gameObject, 1f); } } } [ClientRpc] public void DestroyBloodClientRPC() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2596258972u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2596258972u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1829227131u, new RpcReceiveHandler(__rpc_handler_1829227131), "DestroyBloodServerRPC"); ((NetworkBehaviour)this).__registerRpc(2596258972u, new RpcReceiveHandler(__rpc_handler_2596258972), "DestroyBloodClientRPC"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1829227131(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; ((BloodParticle)(object)target).DestroyBloodServerRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2596258972(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; ((BloodParticle)(object)target).DestroyBloodClientRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BloodParticle"; } } [BepInPlugin("Sita320341.KarelianCompany", "KarelianCompany", "1.0.4")] [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; Logger.LogInfo((object)"Sita320341.KarelianCompany СОСНИ ХУЙЦА!!!"); BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string path = "kareliancompanyassets"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); Logger.LogInfo((object)("Path: " + 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>("AndruhaObj"); TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("AndruhaTN"); TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("AndruhaTK"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"Failed to load custom Andruha."); return; } Logger.LogInfo((object)"Andruha loaded"); if ((Object)(object)val2 == (Object)null) { Logger.LogError((object)"Failed to load custom AndruhaTN."); return; } Logger.LogInfo((object)"AndruhaTN loaded"); if ((Object)(object)val3 == (Object)null) { Logger.LogError((object)"Failed to load custom AndruhaTK."); return; } Logger.LogInfo((object)"AndruhaTK loaded"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); Enemies.RegisterEnemy(val, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val2, val3); Logger.LogInfo((object)"Plugin Sita320341.KarelianCompany 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); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "Sita320341.KarelianCompany"; public const string PLUGIN_NAME = "KarelianCompany"; public const string PLUGIN_VERSION = "1.0.4"; } } namespace KarelianCompany.Configuration { public class PluginConfig { public ConfigEntry<int> SpawnWeight; public PluginConfig(ConfigFile cfg) { SpawnWeight = cfg.Bind<int>("General", "Spawn weight", 20, "The spawn chance weight for KarelianCompany, relative to other existing enemies.\nGoes up from 0, lower is more rare, 100 and up is very common."); 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 __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace Sita320341.KarelianCompany.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }