Decompiled source of CodeRebirth v1.1.11
plugins/CodeRebirth/CodeRebirth.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CodeRebirth.NetcodePatcher; using CodeRebirth.src; using CodeRebirth.src.Content.Enemies; using CodeRebirth.src.Content.Items; using CodeRebirth.src.Content.Maps; using CodeRebirth.src.Content.Unlockables; using CodeRebirth.src.Content.Weapons; using CodeRebirth.src.MiscScripts; using CodeRebirth.src.MiscScripts.CustomPasses; using CodeRebirth.src.MiscScripts.DissolveEffect; using CodeRebirth.src.ModCompats; using CodeRebirth.src.Patches; using CodeRebirth.src.Util; using CodeRebirth.src.Util.Extensions; using CodeRebirthLib; using CodeRebirthLib.AssetManagement; using CodeRebirthLib.ContentManagement; using CodeRebirthLib.ContentManagement.Enemies; using CodeRebirthLib.ContentManagement.Items; using CodeRebirthLib.ContentManagement.MapObjects; using CodeRebirthLib.ContentManagement.Unlockables; using CodeRebirthLib.ContentManagement.Weathers; using CodeRebirthLib.Data; using CodeRebirthLib.Exceptions; using CodeRebirthLib.Extensions; using CodeRebirthLib.MiscScriptManagement; using CodeRebirthLib.Util; using CodeRebirthLib.Util.INetworkSerializables; using CodeRebirthLib.Util.Pathfinding; using CullFactory.Behaviours.API; using DigitalRuby.ThunderAndLightning; using GameNetcodeStuff; using HarmonyLib; using IL.GameNetcodeStuff; using LethalCompanyInputUtils.Api; using LethalLevelLoader; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MoreCompany.Cosmetics; using On; using On.GameNetcodeStuff; using OpenBodyCams; using TMPro; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Rendering.RendererUtils; using UnityEngine.SceneManagement; using UnityEngine.Serialization; using UnityEngine.UI; using UnityEngine.VFX; using UnityEngine.VFX.Utility; using UnityEngine.Video; using WeatherRegistry; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("LethalLevelLoader")] [assembly: IgnoresAccessChecksTo("LethalLib")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("WeatherRegistry")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CodeRebirth")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Content mod that adds Custom Weathers, Items, Enemies and more.")] [assembly: AssemblyFileVersion("1.1.11.0")] [assembly: AssemblyInformationalVersion("1.1.11+4132b8c9cfbf6dabff3583f0fca39ff27ad2159a")] [assembly: AssemblyProduct("CodeRebirth")] [assembly: AssemblyTitle("CodeRebirth")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.11.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class Guardsman : CodeRebirthEnemyAI, IVisibleThreat { [Header("Audio")] [SerializeField] private AudioClip _slamAudioClip; [SerializeField] private AudioClip _ripApartAudioClip; [SerializeField] private AudioClip[] _enemySpottedAudioClips = Array.Empty<AudioClip>(); [SerializeField] private Transform[] _enemyHoldingPoints = Array.Empty<Transform>(); [SerializeField] private Transform _spotlightHead; [SerializeField] private float _enemySizeThreshold = 69f; [SerializeField] private GameObject _dustLandDecal; [SerializeField] private ParticleSystem _dustParticleSystem; private Coroutine? _messWithSizeOverTimeRoutine; private bool _killingLargeEnemy; private float _bufferTimer; private List<IHittable> _iHittableList = new List<IHittable>(); private List<EnemyAI> _enemyAIList = new List<EnemyAI>(); private Collider[] _cachedHits = (Collider[])(object)new Collider[24]; internal HashSet<EnemyType> _internalEnemyBlacklist = new HashSet<EnemyType>(); private static readonly int RunSpeedFloat = Animator.StringToHash("RunSpeed"); private static readonly int IsDeadAnimation = Animator.StringToHash("isDead"); private static readonly int KillLargeAnimation = Animator.StringToHash("killLarge"); public static readonly int KillSmallAnimation = Animator.StringToHash("killSmall"); public ThreatType type => (ThreatType)6; int IVisibleThreat.SendSpecialBehaviour(int id) { return 0; } int IVisibleThreat.GetThreatLevel(Vector3 seenByPosition) { return 18; } int IVisibleThreat.GetInterestLevel() { return 0; } Transform IVisibleThreat.GetThreatLookTransform() { return ((Component)this).transform; } Transform IVisibleThreat.GetThreatTransform() { return ((Component)this).transform; } Vector3 IVisibleThreat.GetThreatVelocity() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { return ((EnemyAI)this).agent.velocity; } return Vector3.zero; } float IVisibleThreat.GetVisibility() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).isEnemyDead) { return 0f; } Vector3 velocity = ((EnemyAI)this).agent.velocity; if (((Vector3)(ref velocity)).sqrMagnitude > 0f) { return 1f; } return 0.75f; } bool IVisibleThreat.IsThreatDead() { return ((EnemyAI)this).isEnemyDead; } GrabbableObject? IVisibleThreat.GetHeldObject() { return null; } public override void Start() { base.Start(); CREnemyDefinition val = default(CREnemyDefinition); if (CRModEnemyExtensions.TryGetFromEnemyName(Plugin.Mod.EnemyRegistry(), "Guardsman", ref val)) { IEnumerable<string> source = from s in ((CRContentDefinition)val).GetGeneralConfig<string>("Guardsman | Enemy Blacklist").Value.Split(',') select s.Trim(); foreach (string nameEntry in source.ToList()) { _internalEnemyBlacklist.UnionWith(VanillaEnemies.AllEnemyTypes.Where((EnemyType et) => et.enemyName.Equals(nameEntry, StringComparison.OrdinalIgnoreCase))); } } foreach (EnemyType item in _internalEnemyBlacklist) { Plugin.ExtendedLogging($"Adding {item} to Guardsman's internal blacklist."); } ((MonoBehaviour)this).StartCoroutine(StartDelay()); ((MonoBehaviour)this).StartCoroutine(ProjectorUnparentDelay()); } public override void Update() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); _idleTimer -= Time.deltaTime; if (_idleTimer < 0f) { _idleTimer = enemyRandom.NextFloat(_idleAudioClips.minTime, _idleAudioClips.maxTime); ((EnemyAI)this).creatureVoice.PlayOneShot(_idleAudioClips.audioClips[enemyRandom.Next(_idleAudioClips.audioClips.Length)]); } if (_killingLargeEnemy && (Object)(object)targetEnemy != (Object)null) { Vector3 position = (_enemyHoldingPoints[0].position + _enemyHoldingPoints[1].position) / 2f; ((Component)targetEnemy).transform.position = position; ((Component)targetEnemy).transform.LookAt(_spotlightHead); } if (_bufferTimer > 0f && (Object)(object)targetEnemy != (Object)null) { Vector3 val = ((Component)targetEnemy).transform.position - ((Component)this).transform.position; Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val2, 5f * Time.deltaTime); } } public override void DoAIInterval() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } Animator creatureAnimator = ((EnemyAI)this).creatureAnimator; int runSpeedFloat = RunSpeedFloat; Vector3 velocity = ((EnemyAI)this).agent.velocity; creatureAnimator.SetFloat(runSpeedFloat, ((Vector3)(ref velocity)).magnitude / 3f); if ((Object)(object)targetEnemy != (Object)null && targetEnemy.isEnemyDead) { targetEnemy = null; } _bufferTimer -= ((EnemyAI)this).AIIntervalTime; if (!(_bufferTimer > 0f)) { if ((Object)(object)targetEnemy == (Object)null) { HandleWandering(); } else { KillLargeOrSmallEnemy(targetEnemy); } } } private void HandleWandering() { //IL_005d: 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_0080: 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) foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy == (Object)null) && !spawnedEnemy.isEnemyDead && !(spawnedEnemy is Guardsman) && !(spawnedEnemy is SandWormAI) && !_internalEnemyBlacklist.Contains(spawnedEnemy.enemyType) && !(Vector3.Distance(((Component)this).transform.position, ((Component)spawnedEnemy).transform.position) > 45f) && !EnemyHasLineOfSightToPosition(((Component)spawnedEnemy).transform.position, 60f, 45f)) { SetEnemyTargetServerRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)spawnedEnemy)); smartAgentNavigator.StopSearchRoutine(); break; } } } private void KillLargeOrSmallEnemy(EnemyAI _targetEnemy) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) smartAgentNavigator.DoPathingToDestination(((Component)_targetEnemy).transform.position); if (!(Vector3.Distance(((Component)_targetEnemy).transform.position, ((Component)this).transform.position) > 12.5f + ((EnemyAI)this).agent.stoppingDistance)) { if (CalculateEnemySize(_targetEnemy) > _enemySizeThreshold) { _bufferTimer = 7.5f; smartAgentNavigator.cantMove = true; smartAgentNavigator.StopAgent(); MiscSoundsClientRpc(1); creatureNetworkAnimator.SetTrigger(KillLargeAnimation, true); } else { _bufferTimer = 7.5f; smartAgentNavigator.cantMove = true; smartAgentNavigator.StopAgent(); MiscSoundsClientRpc(0); creatureNetworkAnimator.SetTrigger(KillSmallAnimation, true); } } } public override void KillEnemy(bool destroy = false) { base.KillEnemy(destroy); if (((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).creatureAnimator.SetBool(IsDeadAnimation, true); } } public override void EnemySetAsTarget(EnemyAI? enemy) { base.EnemySetAsTarget(enemy); ((EnemyAI)this).creatureVoice.PlayOneShot(_enemySpottedAudioClips[enemyRandom.Next(_enemySpottedAudioClips.Length)]); } [ClientRpc] public void MiscSoundsClientRpc(int soundID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3248493385u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3248493385u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { switch (soundID) { case 0: ((EnemyAI)this).creatureSFX.PlayOneShot(_slamAudioClip); break; case 1: ((EnemyAI)this).creatureSFX.PlayOneShot(_ripApartAudioClip); break; } } } private IEnumerator MessWithSizeOverTime(int sizeMultiplier) { while (!((Object)(object)targetEnemy == (Object)null)) { ((Component)targetEnemy).transform.localScale = new Vector3(((Component)targetEnemy).transform.localScale.x, ((Component)targetEnemy).transform.localScale.y, ((Component)targetEnemy).transform.localScale.z) + new Vector3((float)sizeMultiplier * Time.deltaTime, 0f, 0f); yield return null; } ((MonoBehaviour)this).StopCoroutine(_messWithSizeOverTimeRoutine); } private IEnumerator StartDelay() { smartAgentNavigator.cantMove = true; smartAgentNavigator.StopAgent(); yield return (object)new WaitForSeconds(10f); ((EnemyAI)this).skinnedMeshRenderers[0].updateWhenOffscreen = false; smartAgentNavigator.cantMove = false; smartAgentNavigator.StartSearchRoutine(100f); } private IEnumerator ProjectorUnparentDelay() { yield return (object)new WaitUntil((Func<bool>)(() => _dustLandDecal.activeSelf)); Vector3 position = _dustLandDecal.transform.position; _dustLandDecal.transform.SetParent(RoundManager.Instance.mapPropsContainer.transform); _dustLandDecal.transform.position = position; _dustLandDecal.gameObject.SetActive(true); } private float CalculateEnemySize(EnemyAI enemyAi) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) NavMeshAgent component = ((Component)enemyAi).gameObject.GetComponent<NavMeshAgent>(); if ((Object)(object)component == (Object)null) { return 10f; } return 3.14159f * component.radius * component.radius * component.height * (((Component)enemyAi).transform.localScale.x * ((Component)enemyAi).transform.localScale.y * ((Component)enemyAi).transform.localScale.z); } private IEnumerator StartSearchRoutineWithDelay() { yield return (object)new WaitForSeconds(3f); smartAgentNavigator.cantMove = false; smartAgentNavigator.StopAgent(); if (!((Object)(object)targetEnemy != (Object)null)) { smartAgentNavigator.StartSearchRoutine(100f); } } public void MessWithSizeAnimEvent(int sizeMultiplier) { if (_messWithSizeOverTimeRoutine != null) { ((MonoBehaviour)this).StopCoroutine(_messWithSizeOverTimeRoutine); } _messWithSizeOverTimeRoutine = ((MonoBehaviour)this).StartCoroutine(MessWithSizeOverTime(sizeMultiplier)); } public void StartKillLargeEnemyAnimEvent() { _killingLargeEnemy = true; } public void SmashEnemyAnimEvent() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(StartSearchRoutineWithDelay()); _dustParticleSystem.Play(); Vector3 val = (_enemyHoldingPoints[0].position + _enemyHoldingPoints[1].position) / 2f; int num = Physics.OverlapSphereNonAlloc(val, 6f, _cachedHits, MoreLayerMasks.PlayersAndInteractableAndEnemiesAndPropsHazardMask, (QueryTriggerInteraction)2); _iHittableList.Clear(); _enemyAIList.Clear(); IHittable val2 = default(IHittable); for (int i = 0; i < num; i++) { if (!((Component)_cachedHits[i]).TryGetComponent<IHittable>(ref val2)) { continue; } EnemyAICollisionDetect val3 = (EnemyAICollisionDetect)(object)((val2 is EnemyAICollisionDetect) ? val2 : null); if (val3 != null) { if (val3.mainScript is Guardsman || _enemyAIList.Contains(val3.mainScript)) { continue; } _enemyAIList.Add(val3.mainScript); } _iHittableList.Add(val2); } foreach (IHittable iHittable in _iHittableList) { iHittable.Hit(99, val, (PlayerControllerB)null, true, -1); } foreach (EnemyAI enemyAI in _enemyAIList) { ((Component)enemyAI).gameObject.transform.localScale = new Vector3(((Component)enemyAI).transform.localScale.x, ((Component)enemyAI).transform.localScale.y * 0.1f, ((Component)enemyAI).transform.localScale.z); bool flag = !enemyAI.enemyType.canDie; if (((NetworkBehaviour)enemyAI).IsOwner) { enemyAI.KillEnemyOnOwnerClient(flag); } } } public void RipApartEnemyAnimEvent() { ((MonoBehaviour)this).StartCoroutine(StartSearchRoutineWithDelay()); _killingLargeEnemy = false; if (!((Object)(object)targetEnemy == (Object)null) && ((NetworkBehaviour)targetEnemy).IsOwner) { targetEnemy.KillEnemyOnOwnerClient(true); } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Guardsman() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3248493385u, new RpcReceiveHandler(__rpc_handler_3248493385)); } private static void __rpc_handler_3248493385(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundID); target.__rpc_exec_stage = (__RpcExecStage)2; ((Guardsman)(object)target).MiscSoundsClientRpc(soundID); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Guardsman"; } } public class MonarchBeamController : MonoBehaviour { public Transform _raycastDirectionBeamTransform; public Transform _startBeamTransform; public AudioClip _beamSound; public VisualEffect? _monarchParticle; [SerializeField] private SkinnedMeshRenderer _wingMesh; [SerializeField] private Transform _endBeamTransform; public void OnValidate() { if (!((Object)(object)_monarchParticle == (Object)null)) { _monarchParticle.SetSkinnedMeshRenderer("wingMesh", _wingMesh); } } public void Start() { if (!((Object)(object)_monarchParticle == (Object)null)) { _monarchParticle.SetSkinnedMeshRenderer("wingMesh", _wingMesh); } } public void SetBeamPosition(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _endBeamTransform.position = position; } } public class PeaceKeeper : CodeRebirthEnemyAI, IVisibleThreat { public enum PeaceKeeperState { Idle, FollowPlayer, AttackingPlayer } [SerializeField] private Transform _gunStartTransform; [SerializeField] private Transform _gunEndTransform; [Header("Movement")] [SerializeField] private float _walkingSpeed = 2f; [SerializeField] private float _chasingSpeed = 5f; [SerializeField] private float _shootingSpeed = 0.1f; [Header("Visuals")] [SerializeField] private GameObject _gunParticleSystemGO; [SerializeField] private GameObject _fakeGunGO; [Header("Audio")] [SerializeField] private AudioSource _treadsSource; [SerializeField] private AudioSource _aggroSFX; [SerializeField] private AudioClip _revUpSound; [SerializeField] private AudioClip _revDownSound; [SerializeField] private AudioClip _bitchSlapSound; [SerializeField] private AudioClip _bitchSlapStartSound; private Vector3 _lastPosition = Vector3.zero; private List<Material> _materials = new List<Material>(); private float _backOffTimer; private bool _isShooting; private bool _killedByPlayer; private float _damageInterval; private Coroutine? _bitchSlappingRoutine; private Coroutine? _rotatingToHitter; private Collider[] _cachedColliders = (Collider[])(object)new Collider[30]; private static readonly int ShootingAnimation = Animator.StringToHash("shooting"); private static readonly int IsDeadAnimation = Animator.StringToHash("isDead"); private static readonly int RunSpeedFloat = Animator.StringToHash("RunSpeed"); private static readonly int BitchSlapAnimation = Animator.StringToHash("bitchSlap"); private static readonly int ScrollSpeedID = Shader.PropertyToID("_ScrollSpeed"); public static List<PeaceKeeper> Instances = new List<PeaceKeeper>(); [Header("Gatling Gun")] [SerializeField] private float _gatlingDamageInterval = 0.21f; [SerializeField] private float _minigunRange = 30f; [SerializeField] private float _minigunWidth = 1f; [SerializeField] private int _minigunDamage = 5; [SerializeField] private Transform _leftGunStartTransform; [SerializeField] private Transform _rightGunStartTransform; public ThreatType type => (ThreatType)6; int IVisibleThreat.SendSpecialBehaviour(int id) { return 0; } int IVisibleThreat.GetThreatLevel(Vector3 seenByPosition) { return 18; } int IVisibleThreat.GetInterestLevel() { return 0; } Transform IVisibleThreat.GetThreatLookTransform() { return ((Component)this).transform; } Transform IVisibleThreat.GetThreatTransform() { return ((Component)this).transform; } Vector3 IVisibleThreat.GetThreatVelocity() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { return ((EnemyAI)this).agent.velocity; } return Vector3.zero; } float IVisibleThreat.GetVisibility() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).isEnemyDead) { return 0f; } Vector3 velocity = ((EnemyAI)this).agent.velocity; if (((Vector3)(ref velocity)).sqrMagnitude > 0f) { return 1f; } return 0.75f; } bool IVisibleThreat.IsThreatDead() { return ((EnemyAI)this).isEnemyDead; } GrabbableObject? IVisibleThreat.GetHeldObject() { return null; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); Instances.Add(this); } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); Instances.Remove(this); } public override void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) base.Start(); _lastPosition = ((Component)this).transform.position; _materials.Add(((Renderer)((EnemyAI)this).skinnedMeshRenderers[0]).materials[2]); _materials.Add(((Renderer)((EnemyAI)this).skinnedMeshRenderers[0]).materials[3]); if (((NetworkBehaviour)this).IsServer) { HandleSwitchingToIdle(); } } public override void Update() { //IL_00a7: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (((EnemyAI)this).isEnemyDead) { return; } _idleTimer -= Time.deltaTime; if (_idleTimer <= 0f) { _idleTimer = enemyRandom.NextFloat(_idleAudioClips.minTime, _idleAudioClips.maxTime); ((EnemyAI)this).creatureVoice.PlayOneShot(_idleAudioClips.audioClips[enemyRandom.Next(0, _idleAudioClips.audioClips.Length)]); } if (!_aggroSFX.isPlaying && ((EnemyAI)this).currentBehaviourStateIndex == 2) { _aggroSFX.Play(); } Vector3 val = _lastPosition - ((Component)this).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; _materials[0].SetVector(ScrollSpeedID, Vector4.op_Implicit(new Vector3(0f, 0f - magnitude, 0f))); _materials[1].SetVector(ScrollSpeedID, Vector4.op_Implicit(new Vector3(0f, magnitude, 0f))); if (magnitude > 0f) { _treadsSource.volume = 1f; } else { _treadsSource.volume = 0f; } _lastPosition = ((Component)this).transform.position; if (_bitchSlappingRoutine != null && _rotatingToHitter == null) { if (((NetworkBehaviour)this).IsServer) { RotateTowardsNearestPlayer(); } } else if (_isShooting && _gunParticleSystemGO.activeSelf) { DoGatlingGunDamage(); } } public override void DoAIInterval() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead) { Vector3 velocity = ((EnemyAI)this).agent.velocity; float num = ((Vector3)(ref velocity)).magnitude / 3f; ((EnemyAI)this).creatureAnimator.SetFloat(RunSpeedFloat, num); switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: DoIdle(); break; case 1: DoFollowPlayer(); break; case 2: DoAttackingPlayer(); break; } } } public void DoIdle() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerDead && val.isPlayerControlled && !((Object)(object)val.currentlyHeldObjectServer == (Object)null) && val.currentlyHeldObjectServer.itemProperties.isDefensiveWeapon && EnemySeesPlayer(val, 0f)) { smartAgentNavigator.StopSearchRoutine(); SetPlayerTargetServerRpc(PlayerControllerReference.op_Implicit(val)); ((EnemyAI)this).SwitchToBehaviourServerRpc(1); smartAgentNavigator.DoPathingToDestination(((Component)val).transform.position); Plugin.ExtendedLogging("Player spotted holding weapon: " + ((Object)val).name); break; } } } public void DoFollowPlayer() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null || ((EnemyAI)this).targetPlayer.isPlayerDead) { HandleSwitchingToIdle(); return; } if ((Object)(object)((EnemyAI)this).targetPlayer.currentlyHeldObjectServer == (Object)null || !((EnemyAI)this).targetPlayer.currentlyHeldObjectServer.itemProperties.isDefensiveWeapon) { _backOffTimer += ((EnemyAI)this).AIIntervalTime; if (_backOffTimer > 10f) { HandleSwitchingToIdle(); return; } } else { _backOffTimer = 0f; } smartAgentNavigator.DoPathingToDestination(((Component)((EnemyAI)this).targetPlayer).transform.position); } public void DoAttackingPlayer() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null || ((EnemyAI)this).targetPlayer.isPlayerDead) { SetShootingServerRpc(isShooting: false); ((EnemyAI)this).creatureAnimator.SetBool(ShootingAnimation, false); HandleSwitchingToIdle(); return; } smartAgentNavigator.DoPathingToDestination(((Component)((EnemyAI)this).targetPlayer).transform.position); float num = Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position); if (num > 3f) { if (!EnemySeesPlayer(((EnemyAI)this).targetPlayer, 0.6f)) { if (_isShooting) { SetShootingServerRpc(isShooting: false); ((EnemyAI)this).agent.speed = _chasingSpeed; ((EnemyAI)this).creatureAnimator.SetBool(ShootingAnimation, false); } } else if (!_isShooting) { ((EnemyAI)this).agent.speed = _shootingSpeed; SetShootingServerRpc(isShooting: true); ((EnemyAI)this).creatureAnimator.SetBool(ShootingAnimation, true); } } else { if (_isShooting) { SetShootingServerRpc(isShooting: false); ((EnemyAI)this).agent.speed = _chasingSpeed; ((EnemyAI)this).creatureAnimator.SetBool(ShootingAnimation, false); } if (_bitchSlappingRoutine == null) { _bitchSlappingRoutine = ((MonoBehaviour)this).StartCoroutine(DoBitchSlapping()); } } } [ServerRpc(RequireOwnership = false)] private void SetShootingServerRpc(bool isShooting) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) 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(3521378774u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isShooting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3521378774u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetShootingClientRpc(isShooting); } } } [ClientRpc] private void SetShootingClientRpc(bool isShooting) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3256364828u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isShooting, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3256364828u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { _isShooting = isShooting; } } } private IEnumerator RotateToTargetPlayer(PlayerControllerB player) { float timeElapsed = 0f; while (timeElapsed < 0.25f) { RotateToPlayer(player); timeElapsed += Time.deltaTime; yield return null; } _rotatingToHitter = null; } public void RotateTowardsNearestPlayer() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = null; float num = float.MaxValue; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { if (!val2.isPlayerDead && val2.isPlayerControlled) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (!(num2 > num)) { val = val2; } } } if (!((Object)(object)val == (Object)null)) { RotateToPlayer(val); } } private void RotateToPlayer(PlayerControllerB player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)player).transform.position - ((Component)this).transform.position; val.y = 0f; Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val2, 5f * Time.deltaTime); } public void HandleSwitchingToIdle() { _backOffTimer = 0f; ((EnemyAI)this).agent.speed = _walkingSpeed; ClearPlayerTargetServerRpc(); ((EnemyAI)this).SwitchToBehaviourServerRpc(0); smartAgentNavigator.StartSearchRoutine(40f); } public IEnumerator DoBitchSlapping() { ((EnemyAI)this).creatureAnimator.SetTrigger(BitchSlapAnimation); yield return (object)new WaitForSeconds(2f); _bitchSlappingRoutine = null; } public void DoGatlingGunDamage() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) if (_damageInterval < _gatlingDamageInterval) { _damageInterval += Time.deltaTime; return; } _damageInterval = 0f; if (!((NetworkBehaviour)this).IsServer) { return; } HashSet<IHittable> hashSet = new HashSet<IHittable>(); Transform[] array = (Transform[])(object)new Transform[2] { _leftGunStartTransform, _rightGunStartTransform }; Transform[] array2 = array; IHittable val4 = default(IHittable); foreach (Transform val in array2) { Vector3 position = val.position; Vector3 val2 = val.position + val.forward * _minigunRange; int num = Physics.OverlapCapsuleNonAlloc(position, val2, _minigunWidth, _cachedColliders, MoreLayerMasks.PlayersAndInteractableAndEnemiesAndPropsHazardMask, (QueryTriggerInteraction)2); for (int j = 0; j < num; j++) { Collider val3 = _cachedColliders[j]; if (!((Component)val3).TryGetComponent<IHittable>(ref val4) || hashSet.Contains(val4)) { continue; } hashSet.Add(val4); EnemyAICollisionDetect val5 = (EnemyAICollisionDetect)(object)((val4 is EnemyAICollisionDetect) ? val4 : null); if (val5 != null && (Object)(object)((Component)val5.mainScript).gameObject == (Object)(object)((Component)this).gameObject) { continue; } PlayerControllerB val6 = (PlayerControllerB)(object)((val4 is PlayerControllerB) ? val4 : null); if (val6 != null) { Vector3 val7 = ((Component)val6).transform.position - val.position; Vector3 normalized = ((Vector3)(ref val7)).normalized; val6.DamagePlayer(_minigunDamage, true, true, (CauseOfDeath)7, 0, false, normalized * 10f); val6.externalForceAutoFade += normalized * 2f; continue; } EnemyAICollisionDetect val8 = (EnemyAICollisionDetect)(object)((val4 is EnemyAICollisionDetect) ? val4 : null); if (val8 != null) { if (((NetworkBehaviour)this).IsServer) { val8.mainScript.HitEnemyOnLocalClient(_minigunDamage, val.position, (PlayerControllerB)null, true, -1); } } else if (((NetworkBehaviour)this).IsServer) { val4.Hit(_minigunDamage, val.position, (PlayerControllerB)null, true, -1); } } } } public void AlertPeaceKeeperToLocalPlayer(PlayerControllerB playerWhoHit) { if (!((EnemyAI)this).isEnemyDead && !playerWhoHit.isPlayerDead && ((EnemyAI)this).currentBehaviourStateIndex != 2) { if (((EnemyAI)this).currentBehaviourStateIndex == 1 && (Object)(object)((EnemyAI)this).targetPlayer == (Object)(object)playerWhoHit) { AlertPeaceKeeperToPlayerServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerWhoHit)); } else if (EnemySeesPlayer(playerWhoHit, 0f)) { AlertPeaceKeeperToPlayerServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, playerWhoHit)); } } } [ServerRpc(RequireOwnership = false)] private void AlertPeaceKeeperToPlayerServerRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) 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(1887417195u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1887417195u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((EnemyAI)this).targetPlayer = StartOfRound.Instance.allPlayerScripts[playerIndex]; smartAgentNavigator.StopSearchRoutine(); ((EnemyAI)this).agent.speed = _chasingSpeed; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) base.HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (((EnemyAI)this).isEnemyDead) { return; } if ((Object)(object)playerWhoHit != (Object)null) { if (((EnemyAI)this).currentBehaviourStateIndex != 2) { ((EnemyAI)this).targetPlayer = playerWhoHit; smartAgentNavigator.StopSearchRoutine(); ((EnemyAI)this).agent.speed = _chasingSpeed; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } else if (Vector3.Distance(((Component)playerWhoHit).transform.position, ((Component)this).transform.position) <= 4f && _rotatingToHitter == null) { smartAgentNavigator.DoPathingToDestination(((Component)playerWhoHit).transform.position); _rotatingToHitter = ((MonoBehaviour)this).StartCoroutine(RotateToTargetPlayer(playerWhoHit)); if (((NetworkBehaviour)this).IsServer) { creatureNetworkAnimator.SetTrigger(BitchSlapAnimation, true); } } } else if (((NetworkBehaviour)this).IsServer) { creatureNetworkAnimator.SetTrigger(BitchSlapAnimation, true); } ((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force; if (((EnemyAI)this).enemyHP <= 0) { if ((Object)(object)playerWhoHit != (Object)null) { Plugin.ExtendedLogging($"PeaceKeeper killed by player: {((Object)playerWhoHit).name} who dealt {force} damage with hit ID: {hitID}."); _killedByPlayer = true; } if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } public override void KillEnemy(bool destroy = false) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) base.KillEnemy(destroy); smartAgentNavigator.StopSearchRoutine(); _aggroSFX.Stop(); ((EnemyAI)this).creatureVoice.PlayOneShot(((EnemyAI)this).dieSFX); if (((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).creatureAnimator.SetBool(IsDeadAnimation, true); Vector3 velocity = ((EnemyAI)this).agent.velocity; float num = ((Vector3)(ref velocity)).magnitude / 3f; ((EnemyAI)this).creatureAnimator.SetFloat(RunSpeedFloat, num); _materials[0].SetVector(ScrollSpeedID, Vector4.op_Implicit(new Vector3(0f, 0f - num, 0f))); _materials[1].SetVector(ScrollSpeedID, Vector4.op_Implicit(new Vector3(0f, num, 0f))); if (num > 0f) { _treadsSource.volume = 1f; } else { _treadsSource.volume = 0f; } } } public void ReplaceAndSpawnRealGunAnimationEvent() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) Plugin.ExtendedLogging($"PeaceKeeper has been defeated by player? {_killedByPlayer}."); if (!_killedByPlayer) { _fakeGunGO.SetActive(true); return; } ((Component)_fakeGunGO.transform).gameObject.SetActive(false); CRItemDefinition val = default(CRItemDefinition); if (((NetworkBehaviour)this).IsServer && CRModItemExtensions.TryGetFromItemName(Plugin.Mod.ItemRegistry(), "Ceasefire", ref val)) { CodeRebirthUtils.Instance.SpawnScrap(val.Item, _fakeGunGO.transform.position, isQuest: false, defaultRotation: false, 0, _fakeGunGO.transform.rotation); } } public void BitchSlapAnimationEvent() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //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_00a5: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) int num = Physics.OverlapCapsuleNonAlloc(_gunStartTransform.position, _gunEndTransform.position, 2f, _cachedColliders, MoreLayerMasks.PlayersAndInteractableAndEnemiesAndPropsHazardMask, (QueryTriggerInteraction)2); IHittable val2 = default(IHittable); for (int i = 0; i < num; i++) { Collider val = _cachedColliders[i]; Plugin.ExtendedLogging("Bitch Slap hit " + ((Object)val).name); if (!((Component)val).TryGetComponent<IHittable>(ref val2)) { continue; } PlayerControllerB val3 = (PlayerControllerB)(object)((val2 is PlayerControllerB) ? val2 : null); if (val3 != null) { Vector3 val4 = ((Component)val3).transform.position - ((Component)this).transform.position; Vector3 val5 = ((Vector3)(ref val4)).normalized * 100f; val3.DamagePlayer(40, true, true, (CauseOfDeath)1, 0, false, val5); val3.externalForceAutoFade += val5; continue; } EnemyAICollisionDetect val6 = (EnemyAICollisionDetect)(object)((val2 is EnemyAICollisionDetect) ? val2 : null); if (val6 != null) { if (((NetworkBehaviour)this).IsServer && !((Object)(object)((Component)val6.mainScript).gameObject == (Object)(object)((Component)this).gameObject)) { val6.mainScript.HitEnemyOnLocalClient(2, ((Component)this).transform.position, (PlayerControllerB)null, true, -1); } } else if (((NetworkBehaviour)this).IsServer) { val2.Hit(2, ((Component)this).transform.position, (PlayerControllerB)null, true, -1); } } } public void PlayMiscSoundsAnimationEvent(int soundID) { switch (soundID) { case 0: ((EnemyAI)this).creatureSFX.PlayOneShot(_revUpSound); break; case 1: ((EnemyAI)this).creatureSFX.PlayOneShot(_revDownSound); break; case 2: ((EnemyAI)this).creatureSFX.PlayOneShot(_bitchSlapSound); break; case 3: ((EnemyAI)this).creatureSFX.PlayOneShot(_bitchSlapStartSound); break; } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PeaceKeeper() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3521378774u, new RpcReceiveHandler(__rpc_handler_3521378774)); NetworkManager.__rpc_func_table.Add(3256364828u, new RpcReceiveHandler(__rpc_handler_3256364828)); NetworkManager.__rpc_func_table.Add(1887417195u, new RpcReceiveHandler(__rpc_handler_1887417195)); } private static void __rpc_handler_3521378774(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool shootingServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref shootingServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PeaceKeeper)(object)target).SetShootingServerRpc(shootingServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3256364828(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool shootingClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref shootingClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((PeaceKeeper)(object)target).SetShootingClientRpc(shootingClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1887417195(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PeaceKeeper)(object)target).AlertPeaceKeeperToPlayerServerRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PeaceKeeper"; } } public class RabbitMagician : CodeRebirthEnemyAI { public enum RabbitMagicianState { Spawn, Idle, Attached, SwitchingTarget } [Header("Audio")] [SerializeField] private AudioClip _spottedFromGroundAudioClip; [SerializeField] private AudioClip _spottedFromBackAudioClip; [SerializeField] private AudioClip[] _fallingAudioClips; [Header("Animation")] [SerializeField] private AnimationClip _spawnAnimation; [SerializeField] private AnimationClip _spottedFromGroundAnimation; [SerializeField] private AnimationClip _spottedFromBackAnimation; [Header("Misc")] [SerializeField] private Collider[] _collidersToDisable; [SerializeField] private ParticleSystem _confettiParticles; [SerializeField] private Vector3 _offsetPosition = new Vector3(0.031f, -0.109f, -0.471f); private Coroutine? _killRoutine; private Coroutine? _attachRoutine; private Coroutine? _idleRoutine; private Transform? _targetPlayerSpine3; private static readonly int RunSpeedFloat = Animator.StringToHash("RunSpeed"); private static readonly int LatchOnAnimation = Animator.StringToHash("LatchOn"); private static readonly int SpottedFromGroundAnimation = Animator.StringToHash("SpottedFromGround"); private static readonly int SpottedFromBackAnimation = Animator.StringToHash("SpottedFromBack"); private static readonly int ResetToIdleAnimation = Animator.StringToHash("ResetToIdle"); public override void Start() { base.Start(); Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren<Collider>(); foreach (Collider val in componentsInChildren) { foreach (Collider playerCollider in GameNetworkManager.Instance.localPlayerController.GetCRPlayerData().playerColliders) { Physics.IgnoreCollision(val, playerCollider, true); } } ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); if (((NetworkBehaviour)this).IsServer) { _idleRoutine = ((MonoBehaviour)this).StartCoroutine(SwitchToIdle()); } } public override void Update() { ((EnemyAI)this).Update(); if (!((Object)(object)((EnemyAI)this).targetPlayer == (Object)null) && ((EnemyAI)this).targetPlayer.IsLocalPlayer()) { _idleTimer -= Time.deltaTime; if (!(_idleTimer > 0f)) { _idleTimer = enemyRandom.NextFloat(_idleAudioClips.minTime, _idleAudioClips.maxTime); ((EnemyAI)this).creatureVoice.PlayOneShot(_idleAudioClips.audioClips[enemyRandom.Next(0, _idleAudioClips.audioClips.Length)]); } } } public void LateUpdate() { if (((EnemyAI)this).currentBehaviourStateIndex == 3 && (Object)(object)previousTargetPlayer != (Object)null && !previousTargetPlayer.isPlayerDead) { SetPositionAndRotation(previousTargetPlayer); } else if (((EnemyAI)this).currentBehaviourStateIndex == 2 && _attachRoutine == null && !((Object)(object)((EnemyAI)this).targetPlayer == (Object)null)) { SetPositionAndRotation(((EnemyAI)this).targetPlayer); } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: DoSpawn(); break; case 1: DoIdle(); break; case 2: DoAttached(); break; case 3: DoSwitchingTarget(); break; } } public void DoSpawn() { } public void DoIdle() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (_attachRoutine != null) { return; } Animator creatureAnimator = ((EnemyAI)this).creatureAnimator; int runSpeedFloat = RunSpeedFloat; Vector3 velocity = ((EnemyAI)this).agent.velocity; creatureAnimator.SetFloat(runSpeedFloat, ((Vector3)(ref velocity)).magnitude / 3f); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerDead && val.isPlayerControlled && !val.IsPseudoDead() && PlayerLookingAtEnemy(val, 0.2f)) { SpottedSoundServerRpc(PlayerControllerReference.op_Implicit(val), fromGround: true); _attachRoutine = ((MonoBehaviour)this).StartCoroutine(AttachToPlayer(val, null)); break; } } } public void DoAttached() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null || ((EnemyAI)this).targetPlayer.isPlayerDead || ((EnemyAI)this).targetPlayer.IsPseudoDead()) { if (_killRoutine == null && _idleRoutine == null) { _idleRoutine = ((MonoBehaviour)this).StartCoroutine(SwitchToIdle()); } return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerDead && val.isPlayerControlled && !val.IsPseudoDead() && !((Object)(object)val == (Object)(object)((EnemyAI)this).targetPlayer) && PlayerLookingAtEnemy(val, 0.2f) && !(Vector3.Dot(((Component)val.gameplayCamera).transform.forward, ((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.forward) <= 0.45f)) { _killRoutine = ((MonoBehaviour)this).StartCoroutine(KillPlayerAndSwitchTarget(val)); } } } public void DoSwitchingTarget() { } private void SetPositionAndRotation(PlayerControllerB player) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (player.IsLocalPlayer()) { _targetPlayerSpine3 = ((Component)player.gameplayCamera).transform; Vector3 val = _targetPlayerSpine3.rotation * (_offsetPosition + new Vector3(0f, -0.32f, 0.1f)); ((Component)this).transform.position = _targetPlayerSpine3.position + val; ((Component)this).transform.rotation = _targetPlayerSpine3.rotation; } else { _targetPlayerSpine3 = player.upperSpine; Vector3 val = _targetPlayerSpine3.rotation * _offsetPosition; ((Component)this).transform.position = _targetPlayerSpine3.position + val; ((Component)this).transform.rotation = _targetPlayerSpine3.rotation; } } private IEnumerator KillPlayerAndSwitchTarget(PlayerControllerB newTargetPlayer) { ((EnemyAI)this).SwitchToBehaviourServerRpc(3); SpottedSoundServerRpc(PlayerControllerReference.op_Implicit(((EnemyAI)this).targetPlayer), fromGround: false); _attachRoutine = ((MonoBehaviour)this).StartCoroutine(AttachToPlayer(newTargetPlayer, ((EnemyAI)this).targetPlayer)); yield return _attachRoutine; _killRoutine = null; } [ServerRpc(RequireOwnership = false)] private void SpottedSoundServerRpc(PlayerControllerReference oldTargetPlayer, bool fromGround) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) 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(1837826546u, val, (RpcDelivery)0); bool flag = oldTargetPlayer != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref oldTargetPlayer, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref fromGround, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1837826546u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SpottedSoundClientRpc(oldTargetPlayer, fromGround); } } [ClientRpc] private void SpottedSoundClientRpc(PlayerControllerReference oldTargetPlayer, bool fromGround) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2927011943u, val, (RpcDelivery)0); bool flag = oldTargetPlayer != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref oldTargetPlayer, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref fromGround, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2927011943u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)(object)PlayerControllerReference.op_Implicit(oldTargetPlayer))) { if (fromGround) { ((EnemyAI)this).creatureSFX.PlayOneShot(_spottedFromGroundAudioClip); } else { ((EnemyAI)this).creatureSFX.PlayOneShot(_spottedFromBackAudioClip); } } } [ServerRpc(RequireOwnership = false)] private void FallSoundServerRpc(PlayerControllerReference newTargetPlayer) { //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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) 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(3953930100u, val, (RpcDelivery)0); bool flag = newTargetPlayer != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref newTargetPlayer, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3953930100u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { FallSoundClientRpc(newTargetPlayer); } } [ClientRpc] private void FallSoundClientRpc(PlayerControllerReference newTargetPlayer) { //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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3187413591u, val, (RpcDelivery)0); bool flag = newTargetPlayer != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref newTargetPlayer, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3187413591u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB player = PlayerControllerReference.op_Implicit(newTargetPlayer); if (player.IsLocalPlayer()) { ((EnemyAI)this).creatureSFX.PlayOneShot(_fallingAudioClips[Random.Range(0, _fallingAudioClips.Length)]); } } } private IEnumerator SwitchToIdle() { creatureNetworkAnimator.SetTrigger(ResetToIdleAnimation, true); yield return (object)new WaitForSeconds(_spawnAnimation.length); ((Behaviour)smartAgentNavigator).enabled = true; ((Behaviour)((EnemyAI)this).agent).enabled = true; ((EnemyAI)this).SwitchToBehaviourServerRpc(1); smartAgentNavigator.StartSearchRoutine(20f); TurnOnCollidersClientRpc(); _idleRoutine = null; } [ClientRpc] private void TurnOnCollidersClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3442952828u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3442952828u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Collider[] collidersToDisable = _collidersToDisable; foreach (Collider val3 in collidersToDisable) { ((Component)val3).gameObject.SetActive(true); } } } public IEnumerator AttachToPlayer(PlayerControllerB playerToAttachTo, PlayerControllerB? previouslyAttachedToPlayer) { smartAgentNavigator.StopSearchRoutine(); SetPlayerTargetServerRpc(PlayerControllerReference.op_Implicit(playerToAttachTo)); Plugin.ExtendedLogging($"Attaching to {playerToAttachTo} from {previouslyAttachedToPlayer}"); if ((Object)(object)previouslyAttachedToPlayer != (Object)null) { creatureNetworkAnimator.SetTrigger(SpottedFromBackAnimation, true); yield return (object)new WaitForSeconds(8.54f); if (playerToAttachTo.isPlayerDead || playerToAttachTo.IsPseudoDead()) { ((EnemyAI)this).SwitchToBehaviourServerRpc(2); SetPlayerTargetServerRpc(PlayerControllerReference.op_Implicit(playerToAttachTo)); yield break; } PlayConfettiServerRpc(); FallSoundServerRpc(PlayerControllerReference.op_Implicit(playerToAttachTo)); CodeRebirthUtils.Instance.KillPlayerOnOwnerServerRpc(PlayerControllerReference.op_Implicit(previouslyAttachedToPlayer), spawnBody: true, 0, 1, Vector3.zero); } ((Behaviour)smartAgentNavigator).enabled = false; if (!((Behaviour)((EnemyAI)this).agent).enabled) { RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position + Vector3.up * 0.5f, Vector3.down, ref val, 20f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { ((Component)this).transform.position = ((RaycastHit)(ref val)).point; } yield return null; } ((Behaviour)((EnemyAI)this).agent).enabled = false; if ((Object)(object)previouslyAttachedToPlayer == (Object)null) { creatureNetworkAnimator.SetTrigger(SpottedFromGroundAnimation, true); yield return (object)new WaitForSeconds(_spottedFromGroundAnimation.length); } else { yield return (object)new WaitForSeconds(_spottedFromBackAnimation.length - 8.54f); } if ((Object)(object)playerToAttachTo == (Object)null || playerToAttachTo.isPlayerDead || playerToAttachTo.IsPseudoDead()) { _idleRoutine = ((MonoBehaviour)this).StartCoroutine(SwitchToIdle()); _attachRoutine = null; } else { AttachedPlayerHandleLOSClientRpc(); } } [ClientRpc] private void AttachedPlayerHandleLOSClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3981890448u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3981890448u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Collider[] collidersToDisable = _collidersToDisable; foreach (Collider val3 in collidersToDisable) { ((Component)val3).gameObject.SetActive(false); } if (!((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)(object)((EnemyAI)this).targetPlayer)) { ((MonoBehaviour)this).StartCoroutine(HandleLOS()); } } } private IEnumerator HandleLOS() { bool flag = true; while (flag) { yield return (object)new WaitForSeconds(0.25f); if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null || ((EnemyAI)this).targetPlayer.isPlayerDead || ((EnemyAI)this).targetPlayer.IsPseudoDead()) { BackToIdleServerRpc(); yield break; } flag = PlayerLookingAtEnemy(((EnemyAI)this).targetPlayer, 0.2f); } StartAttachedServerRpc(); } [ServerRpc(RequireOwnership = false)] public void PlayConfettiServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3485382509u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3485382509u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayConfettiClientRpc(); } } } [ClientRpc] public void PlayConfettiClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2027265178u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2027265178u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { _confettiParticles.Play(true); } } } [ServerRpc(RequireOwnership = false)] public void BackToIdleServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2305031097u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2305031097u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { _attachRoutine = null; _idleRoutine = ((MonoBehaviour)this).StartCoroutine(SwitchToIdle()); } } } [ServerRpc(RequireOwnership = false)] public void StartAttachedServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3830928637u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3830928637u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { _attachRoutine = null; creatureNetworkAnimator.SetTrigger(LatchOnAnimation, true); ((EnemyAI)this).SwitchToBehaviourServerRpc(2); } } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RabbitMagician() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1837826546u, new RpcReceiveHandler(__rpc_handler_1837826546)); NetworkManager.__rpc_func_table.Add(2927011943u, new RpcReceiveHandler(__rpc_handler_2927011943)); NetworkManager.__rpc_func_table.Add(3953930100u, new RpcReceiveHandler(__rpc_handler_3953930100)); NetworkManager.__rpc_func_table.Add(3187413591u, new RpcReceiveHandler(__rpc_handler_3187413591)); NetworkManager.__rpc_func_table.Add(3442952828u, new RpcReceiveHandler(__rpc_handler_3442952828)); NetworkManager.__rpc_func_table.Add(3981890448u, new RpcReceiveHandler(__rpc_handler_3981890448)); NetworkManager.__rpc_func_table.Add(3485382509u, new RpcReceiveHandler(__rpc_handler_3485382509)); NetworkManager.__rpc_func_table.Add(2027265178u, new RpcReceiveHandler(__rpc_handler_2027265178)); NetworkManager.__rpc_func_table.Add(2305031097u, new RpcReceiveHandler(__rpc_handler_2305031097)); NetworkManager.__rpc_func_table.Add(3830928637u, new RpcReceiveHandler(__rpc_handler_3830928637)); } private static void __rpc_handler_1837826546(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_0074: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); PlayerControllerReference oldTargetPlayer = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref oldTargetPlayer, default(ForNetworkSerializable)); } bool fromGround = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref fromGround, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RabbitMagician)(object)target).SpottedSoundServerRpc(oldTargetPlayer, fromGround); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2927011943(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_0074: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); PlayerControllerReference oldTargetPlayer = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref oldTargetPlayer, default(ForNetworkSerializable)); } bool fromGround = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref fromGround, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((RabbitMagician)(object)target).SpottedSoundClientRpc(oldTargetPlayer, fromGround); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3953930100(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); PlayerControllerReference newTargetPlayer = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref newTargetPlayer, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((RabbitMagician)(object)target).FallSoundServerRpc(newTargetPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3187413591(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); PlayerControllerReference newTargetPlayer = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref newTargetPlayer, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)2; ((RabbitMagician)(object)target).FallSoundClientRpc(newTargetPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3442952828(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((RabbitMagician)(object)target).TurnOnCollidersClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3981890448(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((RabbitMagician)(object)target).AttachedPlayerHandleLOSClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3485382509(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; ((RabbitMagician)(object)target).PlayConfettiServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2027265178(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((RabbitMagician)(object)target).PlayConfettiClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2305031097(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; ((RabbitMagician)(object)target).BackToIdleServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3830928637(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; ((RabbitMagician)(object)target).StartAttachedServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.No
plugins/CodeRebirth/XuuXiaolan.CodeRebirthESKR.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AntlerShed.SkinRegistry; using AntlerShed.SkinRegistry.Events; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CodeRebirth.src; using CodeRebirth.src.Content.Enemies; using CodeRebirthESKR.Misc; using CodeRebirthESKR.SkinRegistry; using Microsoft.CodeAnalysis; using On; using UnityEngine; using UnityEngine.VFX; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("XuuXiaolan.CodeRebirthESKR")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.11.0")] [assembly: AssemblyInformationalVersion("1.1.11+4132b8c9cfbf6dabff3583f0fca39ff27ad2159a")] [assembly: AssemblyProduct("CodeRebirthESKR")] [assembly: AssemblyTitle("XuuXiaolan.CodeRebirthESKR")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.11.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CodeRebirthESKR { public class Configuration { public void InitConfiguration(ConfigFile configFile) { } } [BepInPlugin("XuuXiaolan.CodeRebirthESKR", "CodeRebirthESKR", "1.1.11")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } public static ConfigFile configFile { get; private set; } public static Configuration ModConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; configFile = ((BaseUnityPlugin)this).Config; ModConfig = new Configuration(); if (!Chainloader.PluginInfos.ContainsKey("antlershed.lethalcompany.enemyskinregistry")) { Logger.LogWarning((object)"EnemySkinRegistry is not installed, skipping!"); } } internal static void ExtendedLogging(object text) { if (Plugin.ModConfig.ConfigExtendedLogging.Value) { Logger.LogInfo(text); } } } public static class SkinsHandler { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void RegisterSkins() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) SkinContentHandler skinContentHandler = new SkinContentHandler(); string pluginPath = Paths.PluginPath; string[] files = Directory.GetFiles(pluginPath, "*.xskinbundle", SearchOption.AllDirectories); foreach (string text in files) { AssetBundle val = AssetBundle.LoadFromFile(text); CRSkinDefinitions[] array = val.LoadAllAssets<CRSkinDefinitions>(); CRSkinDefinitions[] array2 = array; foreach (CRSkinDefinitions cRSkinDefinitions in array2) { foreach (BaseSkin baseSkin in cRSkinDefinitions.BaseSkins) { Plugin.ExtendedLogging("Loading skin: " + baseSkin.Label); Plugin.ExtendedLogging("Author: " + cRSkinDefinitions.authorName); skinContentHandler.LoadAndRegisterSkin(baseSkin, cRSkinDefinitions.authorName, cRSkinDefinitions.config); } } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "XuuXiaolan.CodeRebirthESKR"; public const string PLUGIN_NAME = "CodeRebirthESKR"; public const string PLUGIN_VERSION = "1.1.11"; } } namespace CodeRebirthESKR.SkinRegistry { public abstract class BaseSkin : ScriptableObject, Skin { public SpawnLocation spawnLocation; [Tooltip("Label found in the config.")] [SerializeField] protected string label; [Tooltip("Internal ID, follow a format like EnemyName.SkinName or AuthorName.EnemyName.SkinName")] [SerializeField] protected string id; [Tooltip("Icon of the skin found in the config.")] [SerializeField] protected Texture2D icon; [Tooltip("The EnemyName found in the EnemyType ScriptableObject.")] [SerializeField] protected string enemyId; public string Label => label; public string Id => id; public Texture2D Icon => icon; public string EnemyId => enemyId; public abstract Skinner CreateSkinner(); } } namespace CodeRebirthESKR.SkinRegistry.Jimothy { public interface JimothyEventHandler : EnemyEventHandler { void OnGrabMapObject(GameObject obj) { } void OnDropMapObject(GameObject obj) { } } [CreateAssetMenu(fileName = "JimothySkinDefinition", menuName = "CodeRebirthESKR/JimothySkinDefinition", order = 1)] public class JimothySkin : BaseSkin { [Header("Materials")] [SerializeField] private MaterialAction smallPartsMaterialAction; [SerializeField] private MaterialAction forkliftMaterialAction; [SerializeField] private MaterialAction lightMaterialAction; [Space(10f)] [Header("Audio")] [SerializeField] private AudioAction dumpAudioAction; [SerializeField] private AudioAction hitJimothyAudioAction; [SerializeField] private AudioAction jimHonkVoiceAudioAction; [SerializeField] private AudioAction pickUpHazardAudioAction; [Space(10f)] [Header("Particles")] [Space(10f)] [Header("Armature Attachments")] [SerializeField] private ArmatureAttachment[] jimothyAttachments = Array.Empty<ArmatureAttachment>(); [SerializeField] private ArmatureAttachment[] machineAttachments = Array.Empty<ArmatureAttachment>(); public MaterialAction SmallPartsMaterialAction => smallPartsMaterialAction; public MaterialAction ForkliftMaterialAction => forkliftMaterialAction; public MaterialAction LightMaterialAction => lightMaterialAction; public AudioAction DumpAudioAction => dumpAudioAction; public AudioAction HitJimothyAudioAction => hitJimothyAudioAction; public AudioAction JimHonkVoiceAudioAction => jimHonkVoiceAudioAction; public AudioAction PickUpHazardAudioAction => pickUpHazardAudioAction; public ArmatureAttachment[] JimothyAttachments => jimothyAttachments; public ArmatureAttachment[] MachineAttachments => machineAttachments; public override Skinner CreateSkinner() { return (Skinner)(object)new JimothySkinner(this); } } public class JimothySkinner : Skinner, JimothyEventHandler, EnemyEventHandler { protected VanillaMaterial vanillaSmallPartsMaterial; protected VanillaMaterial vanillaForkliftMaterial; protected VanillaMaterial vanillaLightMaterial; protected AudioClip vanillaDumpAudio; protected AudioClip vanillaHitJimothyAudio; protected AudioClip vanillaJimHonkVoiceAudio; protected AudioClip vanillaPickUpHazardAudio; protected List<GameObject> activeAttachementsForJimothy; protected List<GameObject> activeAttachmentsForMachine; protected JimothySkin SkinData { get; } public JimothySkinner(JimothySkin skinData) { SkinData = skinData; base..ctor(); } public void Apply(GameObject enemy) { Transporter component = enemy.GetComponent<Transporter>(); activeAttachementsForJimothy = ArmatureAttachment.ApplyAttachments(SkinData.JimothyAttachments, ((EnemyAI)component).skinnedMeshRenderers[0]); activeAttachmentsForMachine = ArmatureAttachment.ApplyAttachments(SkinData.MachineAttachments, ((EnemyAI)component).skinnedMeshRenderers[1]); vanillaSmallPartsMaterial = SkinData.SmallPartsMaterialAction.Apply((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[0], 0); SkinData.SmallPartsMaterialAction.Apply((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[1], 1); vanillaForkliftMaterial = SkinData.ForkliftMaterialAction.Apply((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[1], 0); vanillaLightMaterial = SkinData.LightMaterialAction.Apply((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[1], 2); vanillaDumpAudio = SkinData.DumpAudioAction.Apply(ref component.dumpHazardSound); vanillaPickUpHazardAudio = SkinData.PickUpHazardAudioAction.Apply(ref component.pickUpHazardSound); vanillaHitJimothyAudio = SkinData.HitJimothyAudioAction.Apply(ref component.hitJimothySound); EnemySkinRegistry.RegisterEnemyEventHandler((EnemyAI)(object)component, (EnemyEventHandler)(object)this); } public void Remove(GameObject enemy) { Transporter component = enemy.GetComponent<Transporter>(); ArmatureAttachment.RemoveAttachments(activeAttachementsForJimothy); ArmatureAttachment.RemoveAttachments(activeAttachmentsForMachine); SkinData.SmallPartsMaterialAction.Remove((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[0], 0, vanillaSmallPartsMaterial); SkinData.SmallPartsMaterialAction.Remove((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[1], 1, vanillaSmallPartsMaterial); SkinData.ForkliftMaterialAction.Remove((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[1], 0, vanillaForkliftMaterial); SkinData.LightMaterialAction.Remove((Renderer)(object)((EnemyAI)component).skinnedMeshRenderers[1], 2, vanillaLightMaterial); SkinData.DumpAudioAction.Remove(ref component.dumpHazardSound, vanillaDumpAudio); SkinData.PickUpHazardAudioAction.Remove(ref component.pickUpHazardSound, vanillaPickUpHazardAudio); SkinData.HitJimothyAudioAction.Remove(ref component.hitJimothySound, vanillaHitJimothyAudio); EnemySkinRegistry.RemoveEnemyEventHandler((EnemyAI)(object)component, (EnemyEventHandler)(object)this); } } } namespace CodeRebirthESKR.SkinRegistry.Generic { public interface GenericEventHandler : EnemyEventHandler { } [CreateAssetMenu(fileName = "GenericSkin", menuName = "CodeRebirthESKR/GenericSkin", order = 1)] public class GenericSkin : BaseSkin { [Header("Materials")] [SerializeField] private MaterialAction[] allMaterialsAction; [SerializeField] private MaterialAction mapDotMaterialAction; [Space(10f)] [Header("Audio")] [SerializeField] private AudioAction deathAudioAction; [SerializeField] private AudioAction hitBodyAudioAction; [Space(10f)] [Header("Particles")] [Space(10f)] [Header("Armature Attachments")] [SerializeField] private ArmatureAttachment[] genericAttachments = Array.Empty<ArmatureAttachment>(); [Header("Misc")] [Tooltip("Ensure renderers are set before skinning, this might be necessary for some enemies.")] [SerializeField] private bool ensureRenderersAreSet; public MaterialAction[] AllMaterialsAction => allMaterialsAction; public MaterialAction MapDotMaterialAction => mapDotMaterialAction; public AudioAction HitBodyAudioAction => hitBodyAudioAction; public AudioAction DeathAudioAction => deathAudioAction; public ArmatureAttachment[] GenericAttachments => genericAttachments; public bool EnsureRenderersAreSet => ensureRenderersAreSet; public override Skinner CreateSkinner() { return (Skinner)(object)new GenericSkinner(this); } } public class GenericSkinner : Skinner, GenericEventHandler, EnemyEventHandler { protected List<VanillaMaterial> allMaterials; protected VanillaMaterial vanillaMapDotMaterial; protected AudioClip vanillaDeathAudio; protected AudioClip vanillaHitBodyAudio; protected List<GameObject> activeAttachmentsForGeneric; protected GenericSkin SkinData { get; } public GenericSkinner(GenericSkin skinData) { SkinData = skinData; base..ctor(); } public void Apply(GameObject enemy) { EnemyAI component = enemy.GetComponent<EnemyAI>(); if (SkinData.EnsureRenderersAreSet) { component.skinnedMeshRenderers = ((Component)component).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(); } SkinnedMeshRenderer[] skinnedMeshRenderers = component.skinnedMeshRenderers; foreach (SkinnedMeshRenderer renderer in skinnedMeshRenderers) { activeAttachmentsForGeneric = activeAttachmentsForGeneric.Concat(ArmatureAttachment.ApplyAttachments(SkinData.GenericAttachments, renderer)).ToList(); } MaterialAction[] allMaterialsAction = SkinData.AllMaterialsAction; for (int j = 0; j < allMaterialsAction.Length; j++) { MaterialAction materialAction = allMaterialsAction[j]; allMaterials.Add(materialAction.Apply((Renderer)(object)component.skinnedMeshRenderers[materialAction.rendererIndex], materialAction.materialRendererIndex)); } MeshRenderer val = (from x in ((Component)((Component)component).gameObject.transform).GetComponentsInChildren<MeshRenderer>() where ((Component)x).CompareTag("DoNotSet") && ((Component)x).gameObject.layer == 14 select x).FirstOrDefault(); if ((Object)(object)val != (Object)null) { vanillaMapDotMaterial = SkinData.MapDotMaterialAction.Apply((Renderer)(object)val, 0); } vanillaHitBodyAudio = SkinData.HitBodyAudioAction.Apply(ref component.enemyType.hitBodySFX); vanillaDeathAudio = SkinData.DeathAudioAction.Apply(ref component.dieSFX); EnemySkinRegistry.RegisterEnemyEventHandler(component, (EnemyEventHandler)(object)this); } public void Remove(GameObject enemy) { EnemyAI component = enemy.GetComponent<EnemyAI>(); ArmatureAttachment.RemoveAttachments(activeAttachmentsForGeneric); for (int i = 0; i < allMaterials.Count; i++) { MaterialAction materialAction = SkinData.AllMaterialsAction[i]; materialAction.Remove((Renderer)(object)component.skinnedMeshRenderers[materialAction.rendererIndex], materialAction.materialRendererIndex, allMaterials[i]); } MeshRenderer val = (from x in ((Component)((Component)component).gameObject.transform).GetComponentsInChildren<MeshRenderer>() where ((Component)x).CompareTag("DoNotSet") && ((Component)x).gameObject.layer == 14 select x).FirstOrDefault(); if ((Object)(object)val != (Object)null) { SkinData.MapDotMaterialAction.Remove((Renderer)(object)val, 0, vanillaMapDotMaterial); } SkinData.HitBodyAudioAction.Remove(ref component.enemyType.hitBodySFX, vanillaHitBodyAudio); SkinData.DeathAudioAction.Remove(ref component.dieSFX, vanillaDeathAudio); EnemySkinRegistry.RemoveEnemyEventHandler(component, (EnemyEventHandler)(object)this); } } } namespace CodeRebirthESKR.Patches { public static class EnemyAIPatches { [CompilerGenerated] private static class <>O { public static hook_Start <0>__OnEnemyAI_Start; } public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__OnEnemyAI_Start; if (obj == null) { hook_Start val = OnEnemyAI_Start; <>O.<0>__OnEnemyAI_Start = val; obj = (object)val; } EnemyAI.Start += (hook_Start)obj; } private static void OnEnemyAI_Start(orig_Start orig, EnemyAI self) { orig.Invoke(self); } } } namespace CodeRebirthESKR.Misc { [CreateAssetMenu(fileName = "CodeRebirthSkinDefinition", menuName = "CodeRebirthESKR/CodeRebirthSkinDefinition", order = 0)] public class CRSkinDefinitions : ScriptableObject { public string authorName; public DefaultSkinConfigData config; public List<BaseSkin> BaseSkins = new List<BaseSkin>(); } [Serializable] public struct DefaultSkinConfigurationView { public string skinId; public DefaultMoonFrequencyView[] defaultEntries; public float defaultFrequency; public float vanillaFallbackFrequency; } [Serializable] public struct DefaultMoonFrequencyView { public string moonId; public float frequency; } public enum StaticMeshActionType { RETAIN, HIDE, REPLACE } [Serializable] public struct StaticMeshAction { public StaticMeshActionType actionType; public Mesh replacementMesh; public readonly Mesh? Apply(MeshFilter vanilla) { Mesh result = null; if ((Object)(object)vanilla != (Object)null) { switch (actionType) { case StaticMeshActionType.HIDE: ((Renderer)((Component)vanilla).gameObject.GetComponent<MeshRenderer>()).enabled = false; break; case StaticMeshActionType.REPLACE: result = vanilla.mesh; vanilla.mesh = replacementMesh; break; } } return result; } public readonly Mesh? ApplyToVisualEffect(VisualEffect vanillaVisualEffect, string meshId) { Mesh result = null; if ((Object)(object)vanillaVisualEffect != (Object)null) { switch (actionType) { case StaticMeshActionType.HIDE: ((Behaviour)vanillaVisualEffect).enabled = false; break; case StaticMeshActionType.REPLACE: result = vanillaVisualEffect.GetMesh(meshId); vanillaVisualEffect.SetMesh(meshId, replacementMesh); break; } } return result; } public readonly void Remove(MeshFilter vanilla, Mesh vanillaMesh) { if ((Object)(object)vanilla != (Object)null) { switch (actionType) { case StaticMeshActionType.HIDE: ((Renderer)((Component)vanilla).gameObject.GetComponent<MeshRenderer>()).enabled = true; break; case StaticMeshActionType.REPLACE: vanilla.mesh = vanillaMesh; break; case StaticMeshActionType.RETAIN: break; } } } public void RemoveFromVisualEffect(VisualEffect vanillaVisualEffect, Mesh vanillaMesh, string meshId) { if ((Object)(object)vanillaVisualEffect != (Object)null) { switch (actionType) { case StaticMeshActionType.HIDE: ((Behaviour)vanillaVisualEffect).enabled = true; break; case StaticMeshActionType.REPLACE: vanillaVisualEffect.SetMesh(meshId, vanillaMesh); break; case StaticMeshActionType.RETAIN: break; } } } } public enum ColorActionType { RETAIN, REPLACE } [Serializable] public struct ColorAction { public ColorActionType actionType; public Color replacementColor; public readonly Color Apply(Material vanillaMat, string property) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Color result = Color.black; if ((Object)(object)vanillaMat != (Object)null) { try { result = vanillaMat.GetColor(property); ColorActionType colorActionType = actionType; if (colorActionType != 0 && colorActionType == ColorActionType.REPLACE) { vanillaMat.SetColor(property, replacementColor); } } catch (Exception) { Plugin.Logger.LogError((object)("No such property \"" + property + "\" exists for vanilla material \"" + ((Object)vanillaMat).name + ".\" Skipping.")); } } return result; } public readonly void Remove(Material vanillaMat, string property, Color vanillaColor) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)vanillaMat != (Object)null) { try { ColorActionType colorActionType = actionType; if (colorActionType != 0 && colorActionType == ColorActionType.REPLACE) { vanillaMat.SetColor(property, vanillaColor); } return; } catch (Exception) { Plugin.Logger.LogError((object)("No such property \"" + property + "\" exists for vanilla material \"" + ((Object)vanillaMat).name + ".\" Skipping.")); return; } } Plugin.Logger.LogWarning((object)"Vanilla Material was null for Color Action. Skipping remove."); } public readonly Color Apply(Light vanillaLight) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0026: Unknown result type (might be due to invalid IL or missing references) Color result = Color.black; if ((Object)(object)vanillaLight != (Object)null) { result = vanillaLight.color; ColorActionType colorActionType = actionType; if (colorActionType != 0 && colorActionType == ColorActionType.REPLACE) { vanillaLight.color = replacementColor; } } else { Plugin.Logger.LogWarning((object)"Vanilla Light was null for Color Action. Skipping Apply."); } return result; } public readonly void Remove(Light vanillaLight, Color vanillaColor) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)vanillaLight != (Object)null) { ColorActionType colorActionType = actionType; if (colorActionType != 0 && colorActionType == ColorActionType.REPLACE) { vanillaLight.color = vanillaColor; } } else { Plugin.Logger.LogWarning((object)"Vanilla Light was null for Color Action. Skipping remove."); } } } public enum TextureActionType { RETAIN, REPLACE } [Serializable] public struct TextureAction { public TextureActionType actionType; public Texture replacementTexture; public readonly Texture? Apply(Material vanillaMat, string property) { Texture result = null; if ((Object)(object)vanillaMat != (Object)null) { try { result = vanillaMat.GetTexture(property); TextureActionType textureActionType = actionType; if (textureActionType != 0 && textureActionType == TextureActionType.REPLACE) { vanillaMat.SetTexture(property, replacementTexture); } } catch (Exception) { Plugin.Logger.LogError((object)("No such property \"" + property + "\" exists for vanilla material \"" + ((Object)vanillaMat).name + ".\" Skipping.")); } } else { Plugin.Logger.LogWarning((object)"Vanilla Material was null for Texture Action. Skipping Apply."); } return result; } public readonly void Remove(Material vanillaMat, string property, Texture vanillaTexture) { if ((Object)(object)vanillaMat != (Object)null) { try { TextureActionType textureActionType = actionType; if (textureActionType != 0 && textureActionType == TextureActionType.REPLACE) { vanillaMat.SetTexture(property, vanillaTexture); } return; } catch (Exception) { Plugin.Logger.LogError((object)("No such property \"" + property + "\" exists for vanilla material \"" + ((Object)vanillaMat).name + ".\" Skipping.")); return; } } Plugin.Logger.LogWarning((object)"Vanilla Material was null for Texture Action. Skipping remove."); } public readonly Texture? ApplyToVisualEffect(VisualEffect vanillaVisualEffect, string property) { Texture result = null; if ((Object)(object)vanillaVisualEffect != (Object)null) { try { result = vanillaVisualEffect.GetTexture(property); TextureActionType textureActionType = actionType; if (textureActionType != 0 && textureActionType == TextureActionType.REPLACE) { vanillaVisualEffect.SetTexture(property, replacementTexture); } } catch (Exception) { Plugin.Logger.LogError((object)("No such property \"" + property + "\" exists for vanilla visual effect \"" + ((Object)vanillaVisualEffect).name + ".\" Skipping.")); } } else { Plugin.Logger.LogWarning((object)"Vanilla visual effect was null for Texture Action. Skipping Apply."); } return result; } public readonly void RemoveFromVisualEffect(VisualEffect vanillaVisualEffect, string property, Texture vanillaTexture) { if ((Object)(object)vanillaVisualEffect != (Object)null) { try { TextureActionType textureActionType = actionType; if (textureActionType != 0 && textureActionType == TextureActionType.REPLACE) { vanillaVisualEffect.SetTexture(property, vanillaTexture); } return; } catch (Exception) { Plugin.Logger.LogError((object)("No such property \"" + property + "\" exists for vanilla visual effect \"" + ((Object)vanillaVisualEffect).name + ".\" Skipping.")); return; } } Plugin.Logger.LogWarning((object)"Vanilla visual effect was null for Texture Action. Skipping remove."); } } public enum MaterialActionType { RETAIN, REPLACE, REPLACE_TEXTURE } public struct VanillaMaterial { public Material material; public Texture texture; } [Serializable] public struct MaterialAction { public MaterialActionType actionType; [Header("Material Options")] public Material replacementMaterial; [Tooltip("The index of the renderer to apply the material to.")] public int rendererIndex; [Tooltip("The index of the material in the renderer to apply the material to.")] public int materialRendererIndex; [Header("Texture Options [Material Recommended Instead]")] public Texture2D replacementTexture; public readonly VanillaMaterial Apply(Renderer vanillaRenderer, int materialIndex) { VanillaMaterial result = default(VanillaMaterial); if ((Object)(object)vanillaRenderer != (Object)null) { switch (actionType) { case MaterialActionType.REPLACE: { result.material = vanillaRenderer.sharedMaterials[materialIndex]; Material[] sharedMaterials = vanillaRenderer.sharedMaterials; sharedMaterials[materialIndex] = replacementMaterial; vanillaRenderer.sharedMaterials = sharedMaterials; break; } case MaterialActionType.REPLACE_TEXTURE: result.texture = vanillaRenderer.sharedMaterials[materialIndex].mainTexture; vanillaRenderer.materials[materialIndex].mainTexture = (Texture)(object)replacementTexture; break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Renderer was null for Material Action. Skipping Apply."); } return result; } public readonly VanillaMaterial ApplyRef(ref Material vanillaRef) { VanillaMaterial result = default(VanillaMaterial); switch (actionType) { case MaterialActionType.REPLACE: result.material = vanillaRef; vanillaRef = replacementMaterial; break; case MaterialActionType.REPLACE_TEXTURE: result.texture = vanillaRef.mainTexture; vanillaRef.mainTexture = (Texture)(object)replacementTexture; break; } return result; } public readonly void Remove(Renderer vanillaRenderer, int materialIndex, VanillaMaterial vanillaMaterial) { if ((Object)(object)vanillaRenderer != (Object)null) { switch (actionType) { case MaterialActionType.REPLACE: { Material[] materials = vanillaRenderer.materials; materials[materialIndex] = vanillaMaterial.material; vanillaRenderer.materials = materials; break; } case MaterialActionType.REPLACE_TEXTURE: vanillaRenderer.materials[materialIndex].mainTexture = vanillaMaterial.texture; break; case MaterialActionType.RETAIN: break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Renderer was null for Material Action. Skipping remove."); } } public readonly void RemoveRef(ref Material dest, VanillaMaterial vanillaMaterial) { switch (actionType) { case MaterialActionType.REPLACE: dest = vanillaMaterial.material; break; case MaterialActionType.REPLACE_TEXTURE: dest.mainTexture = vanillaMaterial.texture; break; case MaterialActionType.RETAIN: break; } } } public enum ParticleSystemActionType { RETAIN, HIDE, REPLACE } [Serializable] public struct ParticleSystemAction { public ParticleSystemActionType actionType; public ParticleSystem replacementParticle; public readonly ParticleSystem? Apply(ParticleSystem vanillaParticle) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) ParticleSystem result = null; object obj; if (vanillaParticle == null) { obj = null; } else { GameObject gameObject = ((Component)vanillaParticle).gameObject; obj = ((gameObject != null) ? gameObject.GetComponent<ParticleSystemRenderer>() : null); } if ((Object)obj != (Object)null) { switch (actionType) { case ParticleSystemActionType.HIDE: ((Renderer)((Component)vanillaParticle).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; break; case ParticleSystemActionType.REPLACE: { ParticleSystem component = Object.Instantiate<GameObject>(((Component)replacementParticle).gameObject, ((Component)vanillaParticle).transform).GetComponent<ParticleSystem>(); ((Renderer)((Component)vanillaParticle).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; ((Component)component).transform.localScale = Vector3.one; ((Component)component).transform.localRotation = Quaternion.identity; ((Component)component).transform.localPosition = Vector3.zero; if (vanillaParticle.isPlaying != component.isPlaying) { if (vanillaParticle.isPlaying) { component.Play(); } else { component.Stop(); } } result = component; break; } } } else { Plugin.Logger.LogWarning((object)"Vanilla Renderer was null for Particle Action. Skipping Apply."); } return result; } public readonly ParticleSystem? ApplySubEmitter(ParticleSystem vanillaParticleRef, int subEmitterIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) SubEmittersModule subEmitters = vanillaParticleRef.subEmitters; ParticleSystem subEmitterSystem = ((SubEmittersModule)(ref subEmitters)).GetSubEmitterSystem(subEmitterIndex); if ((Object)(object)subEmitterSystem != (Object)null) { switch (actionType) { case ParticleSystemActionType.HIDE: subEmitters = vanillaParticleRef.subEmitters; ((Renderer)((Component)((SubEmittersModule)(ref subEmitters)).GetSubEmitterSystem(subEmitterIndex)).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; break; case ParticleSystemActionType.REPLACE: if ((Object)(object)replacementParticle != (Object)null) { ParticleSystem component = Object.Instantiate<GameObject>(((Component)replacementParticle).gameObject, ((Component)subEmitterSystem).transform).GetComponent<ParticleSystem>(); ((Component)component).transform.localScale = Vector3.one; ((Component)component).transform.localRotation = Quaternion.identity; ((Component)component).transform.localPosition = Vector3.zero; subEmitters = vanillaParticleRef.subEmitters; ((SubEmittersModule)(ref subEmitters)).SetSubEmitterSystem(subEmitterIndex, component); if (component.isPlaying != subEmitterSystem.isPlaying) { if (subEmitterSystem.isPlaying) { component.Play(); } else { component.Stop(); } } if (subEmitterSystem.isPlaying) { subEmitterSystem.Stop(); } } else { ((Renderer)((Component)vanillaParticleRef).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; Plugin.Logger.LogWarning((object)"Replacement particle was null. Vanilla particle will be hidden."); } break; } return subEmitterSystem; } Plugin.Logger.LogWarning((object)"Could not find particle sub-emitter at index specified. Skipping."); return null; } public ParticleSystem ApplyRef(ref ParticleSystem vanillaParticleRef) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = vanillaParticleRef; ParticleSystem obj = vanillaParticleRef; object obj2; if (obj == null) { obj2 = null; } else { GameObject gameObject = ((Component)obj).gameObject; obj2 = ((gameObject != null) ? gameObject.GetComponent<ParticleSystemRenderer>() : null); } if ((Object)obj2 != (Object)null) { switch (actionType) { case ParticleSystemActionType.HIDE: ((Renderer)((Component)vanillaParticleRef).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; break; case ParticleSystemActionType.REPLACE: if ((Object)(object)replacementParticle != (Object)null) { ParticleSystem component = Object.Instantiate<GameObject>(((Component)replacementParticle).gameObject, ((Component)val).transform).GetComponent<ParticleSystem>(); ((Component)component).transform.localPosition = Vector3.zero; ((Renderer)((Component)val).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; ((Renderer)((Component)component).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = true; if (val.isPlaying != component.isPlaying) { if (val.isPlaying) { component.Play(); } else { component.Stop(); } } vanillaParticleRef = component; } else { ((Renderer)((Component)vanillaParticleRef).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; Plugin.Logger.LogWarning((object)"Replacement particle was null. Vanilla particle will be hidden."); } break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Renderer was null for Particle Action. Skipping Apply."); } return val; } public readonly ParticleSystem? RemoveSubEmitter(ParticleSystem vanillaParticleRef, int subEmitterIndex, ParticleSystem vanillaSubEmitter) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) SubEmittersModule subEmitters = vanillaParticleRef.subEmitters; ParticleSystem subEmitterSystem = ((SubEmittersModule)(ref subEmitters)).GetSubEmitterSystem(subEmitterIndex); if ((Object)(object)vanillaSubEmitter != (Object)null) { switch (actionType) { case ParticleSystemActionType.HIDE: ((Renderer)((Component)vanillaSubEmitter).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; break; case ParticleSystemActionType.REPLACE: subEmitters = vanillaParticleRef.subEmitters; ((SubEmittersModule)(ref subEmitters)).SetSubEmitterSystem(subEmitterIndex, vanillaSubEmitter); if (!((Object)(object)subEmitterSystem != (Object)null)) { break; } if (subEmitterSystem.isPlaying != vanillaSubEmitter.isPlaying) { if (subEmitterSystem.isPlaying) { vanillaSubEmitter.Play(); } else { vanillaSubEmitter.Stop(); } } Object.Destroy((Object)(object)((Component)subEmitterSystem).gameObject); break; } return vanillaSubEmitter; } Plugin.Logger.LogWarning((object)"Could not find particle sub-emitter at index specified. Skipping."); return null; } public readonly void Remove(ParticleSystem vanillaParticle, ParticleSystem replacementSystem) { object obj; if (vanillaParticle == null) { obj = null; } else { GameObject gameObject = ((Component)vanillaParticle).gameObject; obj = ((gameObject != null) ? gameObject.GetComponent<ParticleSystemRenderer>() : null); } if ((Object)obj != (Object)null) { switch (actionType) { case ParticleSystemActionType.HIDE: ((Renderer)((Component)vanillaParticle).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = true; break; case ParticleSystemActionType.REPLACE: if ((Object)(object)replacementSystem != (Object)null) { if (replacementSystem.isPlaying != vanillaParticle.isPlaying) { if (replacementSystem.isPlaying) { vanillaParticle.Play(); } else { vanillaParticle.Stop(); } } Object.Destroy((Object)(object)replacementSystem); } ((Renderer)((Component)vanillaParticle).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = true; break; case ParticleSystemActionType.RETAIN: break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Renderer was null for Particle Action. Skipping Remove."); } } public readonly void RemoveRef(ref ParticleSystem vanillaParticleRef, ParticleSystem vanillaParticle) { ParticleSystem obj = vanillaParticleRef; object obj2; if (obj == null) { obj2 = null; } else { GameObject gameObject = ((Component)obj).gameObject; obj2 = ((gameObject != null) ? gameObject.GetComponent<ParticleSystemRenderer>() : null); } if ((Object)obj2 != (Object)null) { switch (actionType) { case ParticleSystemActionType.REPLACE: { ParticleSystem val = vanillaParticleRef; if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)vanillaParticle) { ((Renderer)((Component)val).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = false; ((Renderer)((Component)vanillaParticle).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = true; if (val.isPlaying && !vanillaParticle.isPlaying) { vanillaParticle.Play(); } vanillaParticleRef = vanillaParticle; Object.Destroy((Object)(object)((Component)val).gameObject); } else { ((Renderer)((Component)vanillaParticleRef).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = true; Plugin.Logger.LogWarning((object)"Replacement particle was null. The only action being taken is showing the vanilla particle."); } break; } case ParticleSystemActionType.HIDE: ((Renderer)((Component)vanillaParticle).gameObject.GetComponent<ParticleSystemRenderer>()).enabled = true; break; case ParticleSystemActionType.RETAIN: break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Renderer was null for Particle Action. Skipping remove."); } } } public enum AudioActionType { RETAIN, MUTE, REPLACE } [Serializable] public struct AudioAction { public AudioActionType actionType; public AudioClip replacementClip; public readonly AudioClip Silence => AudioClip.Create("empty", 1, 1, 1000, false); public readonly AudioClip Apply(ref AudioClip vanillaRef) { AudioClip result = vanillaRef; if ((Object)(object)vanillaRef != (Object)null) { switch (actionType) { case AudioActionType.MUTE: vanillaRef = Silence; break; case AudioActionType.REPLACE: vanillaRef = replacementClip; break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Audio Clip was null for Audio Action. Skipping Apply."); } return result; } public readonly AudioClip WorkingClip(AudioClip vanillaClip) { return (AudioClip)(actionType switch { AudioActionType.REPLACE => replacementClip, AudioActionType.MUTE => Silence, _ => vanillaClip, }); } public readonly AudioClip? ApplyToSource(AudioSource vanillaSource) { AudioClip result = null; if ((Object)(object)vanillaSource != (Object)null) { result = vanillaSource.clip; switch (actionType) { case AudioActionType.MUTE: vanillaSource.Stop(); vanillaSource.clip = Silence; break; case AudioActionType.REPLACE: vanillaSource.clip = replacementClip; if (vanillaSource.isPlaying) { vanillaSource.Stop(); vanillaSource.Play(); } break; } } else { Plugin.Logger.LogWarning((object)"Vanilla AudioSource was null for Audio Action. Skipping apply."); } return result; } public readonly void Remove(ref AudioClip vanillaRef, AudioClip vanillaClip) { if ((Object)(object)vanillaRef != (Object)null) { switch (actionType) { case AudioActionType.MUTE: vanillaRef = vanillaClip; break; case AudioActionType.REPLACE: vanillaRef = vanillaClip; break; case AudioActionType.RETAIN: break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Audio Clip was null for Audio Action. Skipping remove."); } } public readonly void RemoveFromSource(AudioSource vanillaSource, AudioClip vanillaClip) { if ((Object)(object)vanillaSource != (Object)null) { switch (actionType) { case AudioActionType.MUTE: vanillaSource.mute = false; break; case AudioActionType.REPLACE: vanillaSource.clip = vanillaClip; if (vanillaSource.isPlaying) { vanillaSource.Stop(); vanillaSource.Play(); } break; case AudioActionType.RETAIN: break; } } else { Plugin.Logger.LogWarning((object)"Vanilla AudioSource was null for Audio Action. Skipping remove."); } } } public enum AudioListActionType { RETAIN, MUTE, REPLACE } [Serializable] public struct AudioListAction { public AudioListActionType actionType; public AudioClip[] replacementClips; private readonly AudioClip Silence => AudioClip.Create("empty", 1, 1, 1000, false); public readonly AudioClip[] Apply(ref AudioClip[] vanillaSource) { AudioClip[] array = (AudioClip[])(object)new AudioClip[vanillaSource.Length]; Array.Copy(vanillaSource, array, vanillaSource.Length); if (vanillaSource != null) { switch (actionType) { case AudioListActionType.MUTE: { for (int i = 0; i < vanillaSource.Length; i++) { vanillaSource[i] = Silence; } break; } case AudioListActionType.REPLACE: if (replacementClips == null) { Plugin.Logger.LogWarning((object)"Audio list was null on a replace action. This probably means either you're running dev build or you've uninstalled fixplugintypesserialization for some reason."); } else { vanillaSource = replacementClips; } break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Audio Clip Array was null for Audio List Action. Skipping Apply."); } return array; } public readonly AudioClip[] WorkingClips(AudioClip[] vanillaClips) { switch (actionType) { case AudioListActionType.MUTE: { AudioClip[] array = (AudioClip[])(object)new AudioClip[vanillaClips.Length]; for (int i = 0; i < vanillaClips.Length; i++) { array[i] = Silence; } return array; } case AudioListActionType.REPLACE: return replacementClips; default: return vanillaClips; } } public readonly void Remove(ref AudioClip[] vanillaSource, AudioClip[] vanillaClips) { if (vanillaSource != null) { switch (actionType) { case AudioListActionType.MUTE: vanillaSource = vanillaClips; break; case AudioListActionType.REPLACE: vanillaSource = vanillaClips; break; case AudioListActionType.RETAIN: break; } } else { Plugin.Logger.LogWarning((object)"Vanilla Audio Clip Array was null for Audio List Action. Skipping remove."); } } } [Serializable] public struct ArmatureAttachment { public string boneId; public GameObject attachment; public Vector3 location; public Vector3 rotation; public Vector3 scale; public static List<GameObject> ApplyAttachments(ArmatureAttachment[] attachments, SkinnedMeshRenderer renderer) { //IL_006e: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)renderer != (Object)null && attachments != null) { List<GameObject> list = new List<GameObject>(); for (int i = 0; i < attachments.Length; i++) { ArmatureAttachment attachment = attachments[i]; try { Transform val = renderer.bones.First((Transform tf) => ((Object)tf).name.Equals(attachment.boneId)); GameObject val2 = Object.Instantiate<GameObject>(attachment.attachment, val); val2.transform.localPosition = attachment.location; val2.transform.localRotation = Quaternion.Euler(attachment.rotation); val2.transform.localScale = attachment.scale; list.Add(val2); } catch (Exception ex) { Plugin.Logger.LogError((object)ex.StackTrace); } } return list; } if (attachments == null) { Plugin.Logger.LogWarning((object)"Armature attachments array was null. This probably either means you're running dev build or uninstalled fixplugintypesserialization for some reason. If you're manually setting your armature attachments to null when extending an enemyskinner, consider passing in an empty array instead ans save yourself the log entry."); } return new List<GameObject>(); } public static void RemoveAttachments(List<GameObject> attachments) { foreach (GameObject attachment in attachments) { Object.Destroy((Object)(object)attachment); } } } public class SkinContentHandler { internal static SkinContentHandler Instance { get; private set; } internal SkinContentHandler() { Instance = this; } protected void LoadEnabledConfigs(string keyName) { } public void LoadAndRegisterSkin(BaseSkin baseSkin, string authorName, DefaultSkinConfigData defaultConfig) { } } }