using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.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 = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Sita320341.KarelianCompany")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyInformationalVersion("1.0.3")]
[assembly: AssemblyProduct("KarelianCompany")]
[assembly: AssemblyTitle("Sita320341.KarelianCompany")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
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
}
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_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0242: Unknown result type (might be due to invalid IL or missing references)
//IL_051a: Unknown result type (might be due to invalid IL or missing references)
//IL_052a: Unknown result type (might be due to invalid IL or missing references)
//IL_055f: Unknown result type (might be due to invalid IL or missing references)
//IL_056f: Unknown result type (might be due to invalid IL or missing references)
//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
//IL_0640: Unknown result type (might be due to invalid IL or missing references)
//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0603: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0665: Unknown result type (might be due to invalid IL or missing references)
//IL_0675: Unknown result type (might be due to invalid IL or missing references)
//IL_067f: Unknown result type (might be due to invalid IL or missing references)
//IL_0684: Unknown result type (might be due to invalid IL or missing references)
//IL_0689: Unknown result type (might be due to invalid IL or missing references)
//IL_068c: Unknown result type (might be due to invalid IL or missing references)
//IL_0620: Unknown result type (might be due to invalid IL or missing references)
//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
//IL_0374: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: 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;
}
AnimatorStateInfo currentAnimatorStateInfo;
switch (base.currentBehaviourStateIndex)
{
case 1:
{
if (previousState != 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_025d;
}
}
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_025d;
}
case 2:
{
if (previousState != 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_025d:
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)
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))
{
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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost))
{
((MonoBehaviour)this).StartCoroutine((IEnumerator)StabPlayer(playerId, setBerserkMode));
}
}
}
private IEnumerator<WaitForSeconds> StabPlayer(int playerId, bool setBerserkMode)
{
if (Random.Range(0, 2) == 0)
{
andruhaMouth.PlayOneShot(stabVoices[Random.Range(0, stabVoices.Count)]);
}
base.creatureAnimator.SetBool("run", false);
base.creatureAnimator.SetBool("attack", true);
yield return new WaitForSeconds(0.25f);
andruhaMouth.PlayOneShot(stab);
yield return new WaitForSeconds(0.9f);
base.creatureAnimator.SetBool("attack", false);
base.creatureAnimator.SetBool("run", true);
}
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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: 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))
{
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_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 != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost))
{
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;
murderMusicSFX.Play();
angerMeter = 0f;
base.creatureAnimator.SetBool("run", true);
}
[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)
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))
{
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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost))
{
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));
}
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)
base.creatureAnimator.SetBool("transition", true);
yield return new WaitForSeconds(1.5f);
base.inSpecialAnimation = false;
if (((NetworkBehaviour)this).IsOwner)
{
((Component)this).transform.position = setToPos;
((Behaviour)base.agent).enabled = true;
}
base.creatureAnimator.SetBool("transition", false);
base.creatureAnimator.SetBool("run", true);
Debug.DrawRay(setToPos, Vector3.up * 2f, Color.magenta, 7f);
}
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);
}
}
}
[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_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 != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost))
{
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_00c3: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
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();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_AndruhaAI()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3756768730u, new RpcReceiveHandler(__rpc_handler_3756768730));
NetworkManager.__rpc_func_table.Add(1095208204u, new RpcReceiveHandler(__rpc_handler_1095208204));
NetworkManager.__rpc_func_table.Add(233444369u, new RpcReceiveHandler(__rpc_handler_233444369));
NetworkManager.__rpc_func_table.Add(356528112u, new RpcReceiveHandler(__rpc_handler_356528112));
NetworkManager.__rpc_func_table.Add(1741764620u, new RpcReceiveHandler(__rpc_handler_1741764620));
NetworkManager.__rpc_func_table.Add(3322360426u, new RpcReceiveHandler(__rpc_handler_3322360426));
NetworkManager.__rpc_func_table.Add(3987900853u, new RpcReceiveHandler(__rpc_handler_3987900853));
NetworkManager.__rpc_func_table.Add(964239439u, new RpcReceiveHandler(__rpc_handler_964239439));
}
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)2;
((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)2;
((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)2;
((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)2;
((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)2;
((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)
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))
{
((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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 2 && (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 == 2 && !networkManager.IsClient && networkManager.IsHost)
{
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_BloodParticle()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(1829227131u, new RpcReceiveHandler(__rpc_handler_1829227131));
NetworkManager.__rpc_func_table.Add(2596258972u, new RpcReceiveHandler(__rpc_handler_2596258972));
}
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)2;
((BloodParticle)(object)target).DestroyBloodClientRPC();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "BloodParticle";
}
}
[BepInPlugin("Sita320341.KarelianCompany", "KarelianCompany", "1.0.3")]
[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.3";
}
}
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 Sita320341.KarelianCompany.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}