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.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Dawn;
using DawnHelpers;
using DroneEnemy.NetcodePatcher;
using Dusk;
using Dusk.Weights;
using GameNetcodeStuff;
using Microsoft.CodeAnalysis;
using SolidLib;
using SolidLib.Registry;
using SolidLib.Utils;
using SolidLib.Utils.AssetLoading;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("com.github.teamxiaolan.dawnlib")]
[assembly: IgnoresAccessChecksTo("com.github.teamxiaolan.dawnlib.dusk")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DroneEnemy")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Drone Enemy for Lethal Company.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DroneEnemy")]
[assembly: AssemblyTitle("DroneEnemy")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[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;
}
}
}
namespace DroneEnemy
{
public abstract class BaseDroneAI : ExtendedEnemyAI
{
public Material[] antennaMats;
public Light antennaLight;
public virtual int materialIndex => 2;
public override void Start()
{
base.Start();
((MonoBehaviour)this).StartCoroutine(AntennaCoroutine());
}
public IEnumerator AntennaCoroutine()
{
while (true)
{
((Renderer)((EnemyAI)this).skinnedMeshRenderers[0]).materials[materialIndex] = antennaMats[1];
((Behaviour)antennaLight).enabled = true;
PlayCreatureSFX("DroneBeep", 1f, 1f, 25f, oneShot: true);
yield return (object)new WaitForSeconds(0.3f);
((Renderer)((EnemyAI)this).skinnedMeshRenderers[0]).materials[materialIndex] = antennaMats[0];
((Behaviour)antennaLight).enabled = false;
yield return (object)new WaitForSeconds(3f);
}
}
protected override void __initializeVariables()
{
base.__initializeVariables();
}
protected override void __initializeRpcs()
{
base.__initializeRpcs();
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "BaseDroneAI";
}
}
public class CleanerDroneAI : BaseDroneAI
{
private enum State
{
Idle,
Sweeping,
Bumping
}
private static readonly int HitEnemyTrigger = Animator.StringToHash("hitEnemyTrigger");
private static readonly int Dead = Animator.StringToHash("dead");
private static readonly int Malfunctioning = Animator.StringToHash("malfunctioning");
[Header("Drone Parameters")]
public AISearchRoutine scoutingSearchRoutine;
public BoxCollider enemyCollider;
private float timeSincePrevMalfunction;
private int randomMalfunctionTime;
private bool isDeadAnimationDone;
private bool stunnedAnimation;
private bool _isMalfunctioning;
private bool isFlying;
private Vector3 _lastTrailPosition;
private List<GameObject> trailObjects = new List<GameObject>();
public List<PlayerControllerB> playersToShock = new List<PlayerControllerB>();
private GameObject _cachedTrailObject;
[SerializeField]
private BoxCollider trailBoundsChecker;
private Coroutine _flyingCoroutine;
private Coroutine shockCoroutine;
public override int materialIndex => 1;
public override void Start()
{
base.Start();
timeSincePrevMalfunction = 0f;
randomMalfunctionTime = enemyRandom.Next(70, 135);
((Collider)enemyCollider).isTrigger = !PluginConfig.hasCollision.Value;
isDeadAnimationDone = false;
((EnemyAI)this).currentBehaviourStateIndex = 1;
_cachedTrailObject = Registries.GameObjectRegistry.Get("WaterTrailPrefab");
}
public override void Update()
{
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).Update();
if (!((EnemyAI)this).isEnemyDead && ((NetworkBehaviour)this).IsServer)
{
if (((EnemyAI)this).stunNormalizedTimer <= 0f)
{
timeSincePrevMalfunction += Time.deltaTime;
}
if (timeSincePrevMalfunction > (float)randomMalfunctionTime)
{
Debug.Log((object)"Reached Time");
randomMalfunctionTime = enemyRandom.Next(70, 135);
timeSincePrevMalfunction = 0f;
TriggerMalfunctionServerRpc();
}
float num = Vector3.Distance(((Component)this).transform.position, _lastTrailPosition);
if (num > 1f && !isFlying)
{
_lastTrailPosition = ((Component)this).transform.position;
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(((Component)this).transform.position.x, ((Component)this).transform.position.y + 0.005f, ((Component)this).transform.position.z);
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(((Component)this).transform.rotation.x, Random.Range(0f, 360f), ((Component)this).transform.rotation.z);
GameObject val3 = Object.Instantiate<GameObject>(_cachedTrailObject, val, Quaternion.Euler(val2));
val3.GetComponent<WaterTrailInstance>().Initialize(this);
trailObjects.Add(val3);
SpawnTrailClientRpc(val2);
}
}
}
[ClientRpc]
public void SpawnTrailClientRpc(Vector3 trailRotation)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
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(2132331674u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref trailRotation);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2132331674u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
Vector3 val3 = default(Vector3);
((Vector3)(ref val3))..ctor(((Component)this).transform.position.x, ((Component)this).transform.position.y + 0.005f, ((Component)this).transform.position.z);
GameObject val4 = Object.Instantiate<GameObject>(_cachedTrailObject, val3, Quaternion.Euler(trailRotation));
val4.GetComponent<WaterTrailInstance>().Initialize(this);
trailObjects.Add(val4);
}
}
}
public override void DoAIInterval()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).DoAIInterval();
if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead)
{
return;
}
if (!scoutingSearchRoutine.inProgress)
{
Debug.Log((object)"Roam");
((EnemyAI)this).StartSearch(((Component)this).transform.position, scoutingSearchRoutine);
}
switch (((EnemyAI)this).currentBehaviourStateIndex)
{
case 0:
((EnemyAI)this).agent.speed = PluginConfig.idleSpeed.Value;
break;
case 1:
if (((EnemyAI)this).agent.isOnOffMeshLink)
{
Plugin.Logger.LogInfo((object)"Drone On NavmeshLink b");
if (_flyingCoroutine == null)
{
_flyingCoroutine = ((MonoBehaviour)this).StartCoroutine(FlyOverNavmeshLink());
}
}
((EnemyAI)this).agent.speed = PluginConfig.moveSpeed.Value;
break;
default:
Debug.Log((object)"This Behavior State doesn't exist!");
break;
case 2:
break;
}
}
private IEnumerator FlyOverNavmeshLink()
{
isFlying = true;
Plugin.Logger.LogInfo((object)"SweeperDrone started flying over navmeshlink.");
((EnemyAI)this).creatureAnimator.SetBool("flying", true);
yield return (object)new WaitForSeconds(2f);
OffMeshLinkData currentOffMeshLinkData = ((EnemyAI)this).agent.currentOffMeshLinkData;
Vector3 endPos = ((OffMeshLinkData)(ref currentOffMeshLinkData)).endPos + Vector3.up * ((EnemyAI)this).agent.baseOffset;
((EnemyAI)this).agent.isStopped = true;
while (Vector3.Distance(((Component)((EnemyAI)this).agent).transform.position, endPos) > 0.1f)
{
((Component)((EnemyAI)this).agent).transform.position = Vector3.MoveTowards(((Component)((EnemyAI)this).agent).transform.position, endPos, ((EnemyAI)this).agent.speed * Time.deltaTime);
yield return null;
}
((EnemyAI)this).creatureAnimator.SetBool("flying", false);
yield return (object)new WaitForSeconds(3f);
Plugin.Logger.LogInfo((object)"SweeperDrone finished flying over navmeshlink.");
((EnemyAI)this).agent.isStopped = false;
((EnemyAI)this).agent.CompleteOffMeshLink();
_flyingCoroutine = null;
isFlying = false;
}
[ServerRpc(RequireOwnership = false)]
private void TriggerMalfunctionServerRpc()
{
//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(2116075250u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2116075250u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
MalfunctionOnAllClientsClientRpc();
}
}
}
[ClientRpc]
private void MalfunctionOnAllClientsClientRpc()
{
//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(3425315148u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3425315148u, 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(Malfunction());
}
}
}
private IEnumerator Malfunction()
{
if (!((EnemyAI)this).isEnemyDead)
{
((EnemyAI)this).agent.speed = 0f;
((EnemyAI)this).SwitchToBehaviourClientRpc(0);
_isMalfunctioning = true;
((EnemyAI)this).creatureAnimator.SetBool(Malfunctioning, true);
PlayCreatureSFX("CDMalfunction", 1f, 1f, 25f, oneShot: true);
WalkieTalkie.TransmitOneShotAudio(((EnemyAI)this).creatureSFX, Registries.SoundRegistry.Get("CDMalfunction"), 1f);
if (shockCoroutine == null)
{
shockCoroutine = ((MonoBehaviour)this).StartCoroutine(ShockPlayersInWater());
}
yield return (object)new WaitForSeconds(18f);
_isMalfunctioning = false;
((EnemyAI)this).creatureAnimator.SetBool(Malfunctioning, false);
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
}
}
private IEnumerator ShockPlayersInWater()
{
while (_isMalfunctioning)
{
foreach (PlayerControllerB item in new List<PlayerControllerB>(playersToShock))
{
if (item.isMovementHindered == 0)
{
ApplyShockEffect(item);
}
item.DamagePlayer(2, true, true, (CauseOfDeath)11, 0, false, default(Vector3));
}
yield return (object)new WaitForSeconds(0.1f);
}
shockCoroutine = null;
}
public void ApplyShockEffect(PlayerControllerB player)
{
player.isMovementHindered++;
player.hinderedMultiplier *= 2f;
}
public void RemoveShockEffect(PlayerControllerB player)
{
player.isMovementHindered--;
player.hinderedMultiplier *= 0.4f;
}
public override void OnCollideWithPlayer(Collider other)
{
((EnemyAI)this).OnCollideWithPlayer(other);
}
public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
{
((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
if (!((EnemyAI)this).isEnemyDead)
{
((EnemyAI)this).creatureAnimator.SetTrigger(HitEnemyTrigger);
if ((Object)(object)playerWhoHit != (Object)null)
{
((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force;
}
if (((EnemyAI)this).enemyHP <= 0 && !((EnemyAI)this).isEnemyDead && ((NetworkBehaviour)this).IsOwner)
{
((EnemyAI)this).KillEnemyOnOwnerClient(false);
}
}
}
public override void KillEnemy(bool destroy = false)
{
((EnemyAI)this).KillEnemy(destroy);
((EnemyAI)this).creatureAnimator.SetBool(Dead, true);
}
[ClientRpc]
public void DoAnimationFloatClientRpc(string animationName, float value)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
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(2381764976u, val, (RpcDelivery)0);
bool flag = animationName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2381764976u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
((EnemyAI)this).creatureAnimator.SetFloat(animationName, value);
}
}
protected override void __initializeVariables()
{
base.__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
((NetworkBehaviour)this).__registerRpc(2132331674u, new RpcReceiveHandler(__rpc_handler_2132331674), "SpawnTrailClientRpc");
((NetworkBehaviour)this).__registerRpc(2116075250u, new RpcReceiveHandler(__rpc_handler_2116075250), "TriggerMalfunctionServerRpc");
((NetworkBehaviour)this).__registerRpc(3425315148u, new RpcReceiveHandler(__rpc_handler_3425315148), "MalfunctionOnAllClientsClientRpc");
((NetworkBehaviour)this).__registerRpc(2381764976u, new RpcReceiveHandler(__rpc_handler_2381764976), "DoAnimationFloatClientRpc");
base.__initializeRpcs();
}
private static void __rpc_handler_2132331674(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 trailRotation = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref trailRotation);
target.__rpc_exec_stage = (__RpcExecStage)1;
((CleanerDroneAI)(object)target).SpawnTrailClientRpc(trailRotation);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2116075250(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;
((CleanerDroneAI)(object)target).TriggerMalfunctionServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3425315148(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;
((CleanerDroneAI)(object)target).MalfunctionOnAllClientsClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2381764976(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_0067: 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_009a: 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);
}
float value = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref value, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((CleanerDroneAI)(object)target).DoAnimationFloatClientRpc(animationName, value);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "CleanerDroneAI";
}
}
public class DroneEnemyAI : BaseDroneAI
{
private enum State
{
IdleRoaming,
Scanning
}
private static readonly int TriggerSphereAnim = Animator.StringToHash("TriggerScan");
[Header("Drone Parameters")]
public AISearchRoutine scoutingSearchRoutine;
[Space(10f)]
public Animator ScanSphereAnimator;
public GameObject scanParticleObject;
public Transform scanArea;
public AudioSource mineAudio;
public List<ParticleSystem> swParticles;
public BoxCollider enemyCollider;
private float timeSincePrevScan;
private int randomScanInterval;
private bool isDeadAnimationDone;
private bool stunnedAnimation;
private List<PlayerControllerB> playersToSlow = new List<PlayerControllerB>();
private Coroutine explodeCoroutine;
public override void Start()
{
base.Start();
timeSincePrevScan = 0f;
((Collider)enemyCollider).isTrigger = !PluginConfig.hasCollision.Value;
randomScanInterval = PluginConfig.minAttackTime.Value;
((EnemyAI)this).enemyHP = enemyRandom.Next(2, 8);
isDeadAnimationDone = false;
((EnemyAI)this).currentBehaviourStateIndex = 0;
}
public override void Update()
{
((EnemyAI)this).Update();
if (!((EnemyAI)this).isEnemyDead && ((NetworkBehaviour)this).IsServer && ((EnemyAI)this).stunNormalizedTimer <= 0f)
{
timeSincePrevScan += Time.deltaTime;
}
}
public override void DoAIInterval()
{
((EnemyAI)this).DoAIInterval();
if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead)
{
ScanningUpdate(ref scoutingSearchRoutine);
switch (((EnemyAI)this).currentBehaviourStateIndex)
{
case 0:
((EnemyAI)this).agent.speed = PluginConfig.moveSpeed.Value;
break;
case 1:
((EnemyAI)this).agent.speed = PluginConfig.idleSpeed.Value;
break;
default:
Debug.Log((object)"This Behavior State doesn't exist!");
break;
}
}
}
private void ScanningUpdate(ref AISearchRoutine routine)
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
if (((NetworkBehaviour)this).IsServer && timeSincePrevScan > (float)randomScanInterval)
{
randomScanInterval = enemyRandom.Next(PluginConfig.minAttackTime.Value, PluginConfig.maxAttackTime.Value);
timeSincePrevScan = 0f;
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
TriggerScanOnClientsServerRpc();
}
if (!routine.inProgress)
{
Debug.Log((object)"Roam");
((EnemyAI)this).StartSearch(((Component)this).transform.position, routine);
}
}
[ClientRpc]
private void UpdateScanNodeClientRpc(NetworkObjectReference objRef, int value)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2549252628u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref objRef, default(ForNetworkSerializable));
BytePacker.WriteValueBitPacked(val2, value);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2549252628u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
NetworkObject val3 = default(NetworkObject);
if (((NetworkObjectReference)(ref objRef)).TryGet(ref val3, (NetworkManager)null))
{
ScanNodeProperties componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<ScanNodeProperties>();
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.scrapValue = value;
componentInChildren.subText = $"Value: ${value}";
}
}
}
[ServerRpc(RequireOwnership = false)]
private void TriggerScanOnClientsServerRpc()
{
//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(555519031u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 555519031u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ScanOnAllClientsClientRpc();
}
}
}
[ClientRpc]
private void ScanOnAllClientsClientRpc()
{
//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(4128408083u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4128408083u, 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(Scan());
}
}
}
[ClientRpc]
public void DoDroneSphereAnimationClientRpc()
{
//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(1917224352u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1917224352u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ScanSphereAnimator.SetTrigger(TriggerSphereAnim);
}
}
}
private IEnumerator Scan()
{
if (((EnemyAI)this).isEnemyDead)
{
yield break;
}
for (int num = playersToSlow.Count - 1; num >= 0; num--)
{
PlayerControllerB val = playersToSlow[num];
val.isMovementHindered--;
val.hinderedMultiplier *= 0.4f;
playersToSlow.Remove(val);
}
PlayCreatureSFX("ScanBegin", 1f, 1f, 25f, oneShot: true);
WalkieTalkie.TransmitOneShotAudio(((EnemyAI)this).creatureSFX, Registries.SoundRegistry.Get("ScanBegin"), 1f);
yield return (object)new WaitForSeconds(3f);
DoAnimationTriggerClientRpc("scan");
yield return (object)new WaitForSeconds(0.5f);
DoDroneSphereAnimationClientRpc();
yield return (object)new WaitForSeconds(0.15f);
scanParticleObject.SetActive(true);
foreach (ParticleSystem swParticle in swParticles)
{
swParticle.Play();
}
PlayCreatureSFX("ScanEnd", 1f, 1f, 25f, oneShot: true);
WalkieTalkie.TransmitOneShotAudio(((EnemyAI)this).creatureSFX, Registries.SoundRegistry.Get("ScanEnd"), 1f);
if (PluginConfig.screenShake.Value)
{
float num2 = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position);
if (num2 < 14f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)3);
}
else if (num2 < 24f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
}
}
int num3 = 1;
int num4 = 8;
int num5 = 256;
int num6 = num3 | num4 | num5;
Collider[] array = Physics.OverlapBox(scanArea.position, scanArea.localScale, Quaternion.identity, num4);
if (array.Length != 0)
{
Collider[] array2 = array;
RaycastHit val3 = default(RaycastHit);
foreach (Collider val2 in array2)
{
Vector3 position = ((Component)this).transform.position;
Bounds bounds = val2.bounds;
if (Physics.Linecast(position, ((Bounds)(ref bounds)).center, ref val3, num6) && (Object)(object)((RaycastHit)(ref val3)).collider != (Object)(object)val2 && !PluginConfig.hitThroughWalls.Value)
{
continue;
}
PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val2, false, false);
if ((Object)(object)val4 != (Object)null)
{
val4.DamagePlayer(PluginConfig.scanDamage.Value, true, true, (CauseOfDeath)11, 0, false, default(Vector3));
if (val4.isPlayerDead && (Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController)
{
DuskAchievementExtensions.TryTriggerAchievement(DuskModContent.Achievements, MyModKeys.ShockinglyBadAchievement);
}
val4.isMovementHindered++;
val4.hinderedMultiplier *= 2f;
playersToSlow.Add(val4);
}
}
yield return (object)new WaitForSeconds((float)enemyRandom.Next(1, 5));
for (int num7 = playersToSlow.Count - 1; num7 >= 0; num7--)
{
PlayerControllerB val5 = playersToSlow[num7];
val5.isMovementHindered--;
val5.hinderedMultiplier *= 0.4f;
playersToSlow.Remove(val5);
}
}
yield return (object)new WaitForSeconds(2f);
((EnemyAI)this).SwitchToBehaviourClientRpc(0);
}
public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
{
if (((EnemyAI)this).isEnemyDead)
{
return;
}
((EnemyAI)this).creatureAnimator.SetTrigger("HitEnemy");
if (((EnemyAI)this).enemyHP > 1)
{
((EnemyAI)this).HitEnemy(force, playerWhoHit, true, hitID);
}
else
{
((EnemyAI)this).HitEnemy(force, playerWhoHit, false, hitID);
}
((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force;
if (((EnemyAI)this).enemyHP > 0 || !((NetworkBehaviour)this).IsOwner)
{
return;
}
((MonoBehaviour)this).StopCoroutine(Scan());
List<PlayerControllerB> list = playersToSlow;
foreach (PlayerControllerB item in list)
{
item.isMovementHindered--;
item.hinderedMultiplier *= 0.4f;
playersToSlow.Remove(item);
}
((MonoBehaviour)this).StartCoroutine(KillDroneDelay());
}
public IEnumerator KillDroneDelay()
{
mineAudio.PlayOneShot(Registries.SoundRegistry.Get("MineTrigger"), 1f);
WalkieTalkie.TransmitOneShotAudio(mineAudio, Registries.SoundRegistry.Get("MineTrigger"), 1f);
yield return (object)new WaitForSeconds(PluginConfig.explosionSpeed.Value);
if (((NetworkBehaviour)this).IsOwner && !((EnemyAI)this).isEnemyDead)
{
((EnemyAI)this).KillEnemyOnOwnerClient(false);
}
yield return (object)new WaitUntil((Func<bool>)(() => ((EnemyAI)this).isEnemyDead));
DestroyDroneServerRpc();
}
public override void KillEnemy(bool destroy = false)
{
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: 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_00de: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).KillEnemy(destroy);
if (((NetworkBehaviour)this).IsHost)
{
int num = enemyRandom.Next(1, 100);
if (num <= PluginConfig.scrapChance.Value || PluginConfig.scrapChance.Value == 100)
{
Plugin.Logger.LogInfo((object)("Scrap Chance on random was " + num + "of Config value " + PluginConfig.scrapChance.Value));
Plugin.Logger.LogInfo((object)"Spawning Drone Scrap ");
Vector3 val = ((Component)this).transform.position + Vector3.up * 0.6f;
val += new Vector3(Random.Range(-0.8f, 0.8f), 0f, Random.Range(-0.8f, 0.8f));
SolidLibUtils.Instance.SpawnItem(((object)MyModKeys.ShockWaveDroneScrap).ToString(), val, (Action<GameObject>)delegate
{
});
}
}
}
[ServerRpc(RequireOwnership = false)]
public void DestroyDroneServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3970229352u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3970229352u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (((NetworkBehaviour)this).IsServer)
{
SetOffMineAnimation();
}
DestroyDroneClientRpc();
}
}
[ClientRpc]
public void DestroyDroneClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1405841301u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1405841301u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (!((NetworkBehaviour)this).IsServer)
{
SetOffMineAnimation();
}
}
}
public override void OnDestroy()
{
((EnemyAI)this).OnDestroy();
List<PlayerControllerB> list = playersToSlow;
foreach (PlayerControllerB item in list)
{
item.isMovementHindered--;
item.hinderedMultiplier *= 0.4f;
playersToSlow.Remove(item);
}
}
public void SetOffMineAnimation()
{
if (explodeCoroutine == null)
{
Plugin.Logger.LogInfo((object)"Start Explosion Coroutine");
explodeCoroutine = ((MonoBehaviour)this).StartCoroutine(detonateMineDelayed());
}
else
{
Plugin.Logger.LogInfo((object)"Explosion already started");
}
}
private IEnumerator detonateMineDelayed()
{
Detonate();
yield return (object)new WaitForSeconds(0.2f);
if (((NetworkBehaviour)this).IsServer)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
public void Detonate()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
Plugin.Logger.LogInfo((object)"Detonating");
CreateExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: true, PluginConfig.deathExplosionDamage.Value, 5.7f, 6.4f, 6, (CauseOfDeath)3);
}
public void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_0288: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_038f: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)$"Spawning explosion at pos: {explosionPosition}");
Transform val = null;
if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null)
{
val = RoundManager.Instance.mapPropsContainer.transform;
}
if (spawnExplosionEffect)
{
Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true);
}
float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition);
if (num < 14f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
}
else if (num < 25f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
}
Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, LayerMask.GetMask(new string[5] { "Enemies", "Player", "MapHazard", "Colliders", "Rooms" }), (QueryTriggerInteraction)2);
Dictionary<PlayerControllerB, int> dictionary = new Dictionary<PlayerControllerB, int>();
Dictionary<EnemyAICollisionDetect, int> dictionary2 = new Dictionary<EnemyAICollisionDetect, int>();
List<Landmine> list = new List<Landmine>();
Collider[] array2 = array;
RaycastHit val3 = default(RaycastHit);
PlayerControllerB key = default(PlayerControllerB);
EnemyAICollisionDetect key2 = default(EnemyAICollisionDetect);
foreach (Collider val2 in array2)
{
if (((Component)val2).GetComponent<IHittable>() == null)
{
continue;
}
float num2 = Vector3.Distance(explosionPosition, ((Component)val2).transform.position);
if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)val2).transform.position + Vector3.up * 0.3f, ref val3, 256, (QueryTriggerInteraction)1))
{
continue;
}
if (((Component)val2).gameObject.layer == 3 && ((Component)val2).TryGetComponent<PlayerControllerB>(ref key) && !dictionary.ContainsKey(key))
{
dictionary.Add(key, (int)((float)damage * (1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange)))));
}
else if (((Component)val2).gameObject.layer == 19 && ((Component)val2).TryGetComponent<EnemyAICollisionDetect>(ref key2) && !dictionary2.ContainsKey(key2))
{
dictionary2.Add(key2, enemyHitForce);
}
else if (((Component)val2).gameObject.layer == 21)
{
Landmine componentInChildren = ((Component)val2).gameObject.GetComponentInChildren<Landmine>();
if ((Object)(object)componentInChildren != (Object)null && num2 < 6f && !list.Contains(componentInChildren))
{
list.Add(componentInChildren);
}
}
}
foreach (PlayerControllerB key3 in dictionary.Keys)
{
key3.DamagePlayer(dictionary[key3], true, false, (CauseOfDeath)13, 6, false, key3.velocityLastFrame);
if (key3.isPlayerDead && (Object)(object)key3 == (Object)(object)GameNetworkManager.Instance.localPlayerController)
{
DuskAchievementExtensions.TryTriggerAchievement(DuskModContent.Achievements, MyModKeys.ShockinglyBadAchievement);
}
}
foreach (EnemyAICollisionDetect key4 in dictionary2.Keys)
{
key4.mainScript.HitEnemyOnLocalClient(dictionary2[key4], default(Vector3), attacker, false, -1);
}
foreach (Landmine item in list)
{
((MonoBehaviour)item).StartCoroutine(item.TriggerOtherMineDelayed(item));
}
for (int j = 0; j < array.Length; j++)
{
Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
component.AddExplosionForce(70f, explosionPosition, 10f);
}
}
}
protected override void __initializeVariables()
{
base.__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
((NetworkBehaviour)this).__registerRpc(2549252628u, new RpcReceiveHandler(__rpc_handler_2549252628), "UpdateScanNodeClientRpc");
((NetworkBehaviour)this).__registerRpc(555519031u, new RpcReceiveHandler(__rpc_handler_555519031), "TriggerScanOnClientsServerRpc");
((NetworkBehaviour)this).__registerRpc(4128408083u, new RpcReceiveHandler(__rpc_handler_4128408083), "ScanOnAllClientsClientRpc");
((NetworkBehaviour)this).__registerRpc(1917224352u, new RpcReceiveHandler(__rpc_handler_1917224352), "DoDroneSphereAnimationClientRpc");
((NetworkBehaviour)this).__registerRpc(3970229352u, new RpcReceiveHandler(__rpc_handler_3970229352), "DestroyDroneServerRpc");
((NetworkBehaviour)this).__registerRpc(1405841301u, new RpcReceiveHandler(__rpc_handler_1405841301), "DestroyDroneClientRpc");
base.__initializeRpcs();
}
private static void __rpc_handler_2549252628(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
NetworkObjectReference objRef = default(NetworkObjectReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref objRef, default(ForNetworkSerializable));
int value = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref value);
target.__rpc_exec_stage = (__RpcExecStage)1;
((DroneEnemyAI)(object)target).UpdateScanNodeClientRpc(objRef, value);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_555519031(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;
((DroneEnemyAI)(object)target).TriggerScanOnClientsServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4128408083(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;
((DroneEnemyAI)(object)target).ScanOnAllClientsClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1917224352(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;
((DroneEnemyAI)(object)target).DoDroneSphereAnimationClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3970229352(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;
((DroneEnemyAI)(object)target).DestroyDroneServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1405841301(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;
((DroneEnemyAI)(object)target).DestroyDroneClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "DroneEnemyAI";
}
}
public static class DuskModBypass
{
public static DuskMod CreateBareMod(BaseUnityPlugin plugin)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Expected O, but got Unknown
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Expected O, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Expected O, but got Unknown
DuskMod val = (DuskMod)FormatterServices.GetUninitializedObject(typeof(DuskMod));
Type type = ((object)val).GetType();
type.GetField("_basePath", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, Path.GetDirectoryName(((object)plugin).GetType().Assembly.Location));
type.GetField("<ConfigManager>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, (object?)new ConfigManager(plugin.Config));
BepInPlugin value = (BepInPlugin)((object)plugin).GetType().GetCustomAttribute(typeof(BepInPlugin));
type.GetField("<Plugin>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, value);
type.GetField("<Assembly>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, ((object)plugin).GetType().Assembly);
type.GetField("<Logger>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, Logger.CreateLogSource(plugin.Info.Metadata.GUID));
type.GetField("<Content>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, ScriptableObject.CreateInstance<ContentContainer>());
FieldInfo field = type.GetField("_allMods", BindingFlags.Static | BindingFlags.NonPublic);
List<DuskMod> list = (List<DuskMod>)field.GetValue(null);
list.Add(val);
return val;
}
}
public class ExtendedEnemyAI : EnemyAI
{
protected Random enemyRandom;
[SerializeField]
private AudioSource movementSource;
public override void Start()
{
((EnemyAI)this).Start();
enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex);
}
public void LogIfDebugBuild(string text)
{
Assembly callingAssembly = Assembly.GetCallingAssembly();
if (callingAssembly.GetCustomAttributes(inherit: false).OfType<DebuggableAttribute>().Any((DebuggableAttribute da) => da.IsJITTrackingEnabled))
{
SolidLib.Log.LogInfo((object)text);
}
}
public virtual void AnimationEventC()
{
}
public virtual void AnimationEventD()
{
}
public virtual void AnimationEventE()
{
}
public virtual void AnimationEventStringA(string value)
{
}
public virtual void AnimationEventStringB(string value)
{
}
public virtual void AnimationEventStringC(string value)
{
}
public virtual void AnimationEventFloatA(float value)
{
}
public virtual void AnimationEventFloatB(float value)
{
}
public virtual void AnimationEventFloatC(float value)
{
}
public virtual void AnimationEventBoolA(bool value)
{
}
public virtual void AnimationEventBoolB(bool value)
{
}
public virtual void AnimationEventBoolC(bool value)
{
}
[ClientRpc]
public void DoAnimFloatClientRpc(string parameter, float value)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
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(2388512463u, val, (RpcDelivery)0);
bool flag = parameter != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(parameter, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2388512463u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
LogIfDebugBuild($"Set AnimFloat: {parameter} To {value}");
base.creatureAnimator.SetFloat(parameter, value);
}
}
[ClientRpc]
public void DoAnimIntegerClientRpc(string parameter, int value)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: 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_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
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(2657563125u, val, (RpcDelivery)0);
bool flag = parameter != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(parameter, false);
}
BytePacker.WriteValueBitPacked(val2, value);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2657563125u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
LogIfDebugBuild($"Set AnimInteger: {parameter} To {value}");
base.creatureAnimator.SetInteger(parameter, value);
}
}
[ClientRpc]
public void DoAnimBoolClientRpc(string parameter, bool value)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
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(1512945790u, val, (RpcDelivery)0);
bool flag = parameter != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(parameter, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1512945790u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
LogIfDebugBuild($"Set AnimBool: {parameter} To {value}");
base.creatureAnimator.SetBool(parameter, value);
}
}
[ClientRpc]
public void DoAnimationTriggerClientRpc(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(2288742606u, 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, 2288742606u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
LogIfDebugBuild("AnimTrigger: " + animationName);
base.creatureAnimator.SetTrigger(animationName);
}
}
[ServerRpc(RequireOwnership = false)]
public void PlayCreatureSFXServerRpc(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f, bool oneShot = false, bool loop = false)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: 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_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3264900342u, val, (RpcDelivery)0);
bool flag = clipName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDistance, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref oneShot, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref loop, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3264900342u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayCreatureSFXClientRpc(clipName, volume, pitch, maxDistance, oneShot, loop);
}
}
[ClientRpc]
public void PlayCreatureSFXClientRpc(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f, bool oneShot = false, bool loop = false)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: 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_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: 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(1316102658u, val, (RpcDelivery)0);
bool flag = clipName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDistance, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref oneShot, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref loop, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1316102658u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayCreatureSFX(clipName, volume, pitch, maxDistance, oneShot, loop);
}
}
public void PlayCreatureSFX(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f, bool oneShot = false, bool loop = false)
{
base.creatureSFX.loop = loop;
base.creatureSFX.maxDistance = maxDistance;
base.creatureSFX.pitch = pitch;
if (oneShot)
{
base.creatureSFX.PlayOneShot(GetAudioClipFromNameRegistrar(clipName), volume);
}
else
{
base.creatureSFX.Play((double)volume);
}
}
[ServerRpc(RequireOwnership = false)]
public void PlayCreatureVoiceServerRpc(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f, bool oneShot = false, bool loop = false)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: 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_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2067794608u, val, (RpcDelivery)0);
bool flag = clipName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDistance, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref oneShot, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref loop, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2067794608u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayCreatureVoiceClientRpc(clipName, volume, pitch, maxDistance, oneShot, loop);
}
}
[ClientRpc]
public void PlayCreatureVoiceClientRpc(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f, bool oneShot = false, bool loop = false)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: 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_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: 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(997213586u, val, (RpcDelivery)0);
bool flag = clipName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDistance, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref oneShot, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref loop, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 997213586u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayCreatureVoice(clipName, volume, pitch, maxDistance, oneShot, loop);
}
}
public void PlayCreatureVoice(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f, bool oneShot = false, bool loop = false)
{
base.creatureVoice.loop = loop;
base.creatureVoice.maxDistance = maxDistance;
base.creatureVoice.pitch = pitch;
if (oneShot)
{
base.creatureVoice.PlayOneShot(GetAudioClipFromNameRegistrar(clipName), volume);
}
else
{
base.creatureVoice.Play((double)volume);
}
}
[ServerRpc(RequireOwnership = false)]
public void PlayMovementAudioServerRpc(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: 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_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1412959632u, val, (RpcDelivery)0);
bool flag = clipName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDistance, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1412959632u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayMovementAudioClientRpc(clipName, volume, pitch, maxDistance);
}
}
[ClientRpc]
public void PlayMovementAudioClientRpc(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: 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_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: 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(1810794435u, val, (RpcDelivery)0);
bool flag = clipName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false);
}
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDistance, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1810794435u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayMovementAudio(clipName, volume, pitch, maxDistance);
}
}
public void PlayMovementAudio(string clipName, float volume = 1f, float pitch = 1f, float maxDistance = 25f)
{
movementSource.maxDistance = maxDistance;
movementSource.pitch = pitch;
movementSource.PlayOneShot(GetAudioClipFromNameRegistrar(clipName), volume);
}
private AudioClip GetAudioClipFromNameRegistrar(string clipName)
{
AudioClip result = default(AudioClip);
if (!Registries.SoundRegistry.TryGetValue(clipName, ref result))
{
SolidLib.Log.LogWarning((object)("[SoundManager] Failed to get " + clipName + " from SoundRegistry, Are you sure it exists?"));
return null;
}
return result;
}
protected override void __initializeVariables()
{
((EnemyAI)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Expected O, but got Unknown
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Expected O, but got Unknown
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Expected O, but got Unknown
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Expected O, but got Unknown
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Expected O, but got Unknown
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(2388512463u, new RpcReceiveHandler(__rpc_handler_2388512463), "DoAnimFloatClientRpc");
((NetworkBehaviour)this).__registerRpc(2657563125u, new RpcReceiveHandler(__rpc_handler_2657563125), "DoAnimIntegerClientRpc");
((NetworkBehaviour)this).__registerRpc(1512945790u, new RpcReceiveHandler(__rpc_handler_1512945790), "DoAnimBoolClientRpc");
((NetworkBehaviour)this).__registerRpc(2288742606u, new RpcReceiveHandler(__rpc_handler_2288742606), "DoAnimationTriggerClientRpc");
((NetworkBehaviour)this).__registerRpc(3264900342u, new RpcReceiveHandler(__rpc_handler_3264900342), "PlayCreatureSFXServerRpc");
((NetworkBehaviour)this).__registerRpc(1316102658u, new RpcReceiveHandler(__rpc_handler_1316102658), "PlayCreatureSFXClientRpc");
((NetworkBehaviour)this).__registerRpc(2067794608u, new RpcReceiveHandler(__rpc_handler_2067794608), "PlayCreatureVoiceServerRpc");
((NetworkBehaviour)this).__registerRpc(997213586u, new RpcReceiveHandler(__rpc_handler_997213586), "PlayCreatureVoiceClientRpc");
((NetworkBehaviour)this).__registerRpc(1412959632u, new RpcReceiveHandler(__rpc_handler_1412959632), "PlayMovementAudioServerRpc");
((NetworkBehaviour)this).__registerRpc(1810794435u, new RpcReceiveHandler(__rpc_handler_1810794435), "PlayMovementAudioClientRpc");
((EnemyAI)this).__initializeRpcs();
}
private static void __rpc_handler_2388512463(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_0067: 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_009a: 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 parameter = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref parameter, false);
}
float value = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref value, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((ExtendedEnemyAI)(object)target).DoAnimFloatClientRpc(parameter, value);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2657563125(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_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool flag = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
string parameter = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref parameter, false);
}
int value = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref value);
target.__rpc_exec_stage = (__RpcExecStage)1;
((ExtendedEnemyAI)(object)target).DoAnimIntegerClientRpc(parameter, value);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1512945790(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_0067: 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_009a: 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 parameter = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref parameter, false);
}
bool value = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((ExtendedEnemyAI)(object)target).DoAnimBoolClientRpc(parameter, value);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2288742606(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;
((ExtendedEnemyAI)(object)target).DoAnimationTriggerClientRpc(animationName);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3264900342(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_0067: 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_0082: 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_009d: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: 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 clipName = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false);
}
float volume = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref volume, default(ForPrimitives));
float pitch = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref pitch, default(ForPrimitives));
float maxDistance = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref maxDistance, default(ForPrimitives));
bool oneShot = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref oneShot, default(ForPrimitives));
bool loop = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref loop, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((ExtendedEnemyAI)(object)target).PlayCreatureSFXServerRpc(clipName, volume, pitch, maxDistance, oneShot, loop);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1316102658(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_0067: 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_0082: 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_009d: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: 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 clipName = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false);
}
float volume = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref volume, default(ForPrimitives));
float pitch = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref pitch, default(ForPrimitives));
float maxDistance = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref maxDistance, default(ForPrimitives));
bool oneShot = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref oneShot, default(ForPrimitives));
bool loop = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref loop, default(Fo