using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CSync.Lib; using CodeRebirth.NetcodePatcher; using CodeRebirth.src.Content.DevTools; using CodeRebirth.src.Content.Enemies; using CodeRebirth.src.Content.Items; using CodeRebirth.src.Content.Maps; using CodeRebirth.src.Content.Moons; using CodeRebirth.src.Content.Unlockables; using CodeRebirth.src.Content.Weapons; using CodeRebirth.src.MiscScripts; using CodeRebirth.src.MiscScripts.CustomPasses; using CodeRebirth.src.ModCompats; using CodeRebirth.src.Patches; using CodeRebirth.src.Util; using CodeRebirth.src.Util.Timer; using CullFactory.Behaviours.API; using Dawn; using Dawn.Internal; using Dawn.Utils; using DigitalRuby.ThunderAndLightning; using DunGen; using Dusk; using GameNetcodeStuff; using HarmonyLib; using IL; using IL.GameNetcodeStuff; using Imperium; using LethalCompanyInputUtils.Api; using LethalMoonUnlocks; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MoreCompany.Cosmetics; using MoreCounterplay; using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Store; using MoreShipUpgrades.UpgradeComponents.TierUpgrades.AttributeUpgrades; using On; using On.GameNetcodeStuff; using On.Unity.AI.Navigation; using OpenBodyCams; using TMPro; using TooManyEmotes.Patches; using Unity.AI.Navigation; 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.ProBuilder; 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.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("BaronDrakula.MoreCounterplay")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.github.teamxiaolan.dawnlib")] [assembly: IgnoresAccessChecksTo("com.github.teamxiaolan.dawnlib.dusk")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("giosuel.Imperium")] [assembly: IgnoresAccessChecksTo("MoreShipUpgrades")] [assembly: IgnoresAccessChecksTo("TooManyEmotes")] [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.Components")] [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("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [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.6.4.0")] [assembly: AssemblyInformationalVersion("1.6.4+8cd5bb2abeaec35947e959d8204d2c2bd1df006c")] [assembly: AssemblyProduct("CodeRebirth")] [assembly: AssemblyTitle("CodeRebirth")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.6.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } 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 SeeThroughCustomPass : CustomPass { [CompilerGenerated] private sealed class d__11 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private Material <>2__current; private int <>l__initialThreadId; public SeeThroughCustomPass <>4__this; Material IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SeeThroughCustomPass seeThroughCustomPass = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = seeThroughCustomPass.seeThroughMaterial; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__11 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__11(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } [SerializeField] public Material seeThroughMaterial = new Material(CodeRebirthUtils.Instance.WireframeMaterial); public LayerMask seeThroughLayer; public float maxVisibilityDistance = 20f; [SerializeField] private readonly Shader stencilShader = CodeRebirthUtils.Instance.SeeThroughShader; private Material? stencilMaterial; private ShaderTagId[] shaderTags = Array.Empty(); public override bool executeInSceneView => true; public void ConfigureMaterial(Color edgeColor, Color fillColor, float thickness) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) seeThroughMaterial.SetColor("_EdgeColor", edgeColor); seeThroughMaterial.SetColor("_MainColor", fillColor); seeThroughMaterial.SetFloat("_WireframeVal", thickness); } public override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0057: Unknown result type (might be due to invalid IL or missing references) stencilMaterial = CoreUtils.CreateEngineMaterial(stencilShader); shaderTags = (ShaderTagId[])(object)new ShaderTagId[4] { new ShaderTagId("Forward"), new ShaderTagId("ForwardOnly"), new ShaderTagId("SRPDefaultUnlit"), new ShaderTagId("FirstPass") }; } public override void Execute(CustomPassContext ctx) { //IL_0052: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)stencilMaterial == (Object)null) { stencilMaterial = CoreUtils.CreateEngineMaterial(stencilShader); } stencilMaterial.SetInt("_StencilWriteMask", 64); seeThroughMaterial.SetFloat("_MaxVisibilityDistance", Mathf.Max(0f, maxVisibilityDistance)); RenderObjects(ctx.renderContext, ctx.cmd, stencilMaterial, 0, (CompareFunction)4, ctx.cullingResults, ctx.hdCamera); StencilState value = default(StencilState); ((StencilState)(ref value))..ctor(true, (byte)64, byte.MaxValue, (CompareFunction)3, (StencilOp)0, (StencilOp)0, (StencilOp)0); RenderObjects(ctx.renderContext, ctx.cmd, seeThroughMaterial, seeThroughMaterial.FindPass("ForwardOnly"), (CompareFunction)7, ctx.cullingResults, ctx.hdCamera, value); } [IteratorStateMachine(typeof(d__11))] public override IEnumerable RegisterMaterialForInspector() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(-2) { <>4__this = this }; } private void RenderObjects(ScriptableRenderContext renderContext, CommandBuffer cmd, Material overrideMaterial, int passIndex, CompareFunction depthCompare, CullingResults cullingResult, HDCamera hdCamera, StencilState? overrideStencil = null) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00c3: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a2: 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_00b8: Unknown result type (might be due to invalid IL or missing references) RendererListDesc val = default(RendererListDesc); ((RendererListDesc)(ref val))..ctor(shaderTags, cullingResult, hdCamera.camera); val.rendererConfiguration = (PerObjectData)0; val.renderQueueRange = RenderQueueRange.opaque; val.sortingCriteria = (SortingCriteria)4; val.excludeObjectMotionVectors = false; val.overrideMaterial = overrideMaterial; val.overrideMaterialPassIndex = passIndex; val.layerMask = LayerMask.op_Implicit(seeThroughLayer); RenderStateBlock value = default(RenderStateBlock); ((RenderStateBlock)(ref value))..ctor((RenderStateMask)4); ((RenderStateBlock)(ref value)).depthState = new DepthState(false, depthCompare); val.stateBlock = value; RendererListDesc val2 = val; if (overrideStencil.HasValue) { RenderStateBlock value2 = val2.stateBlock.Value; ((RenderStateBlock)(ref value2)).mask = (RenderStateMask)(((RenderStateBlock)(ref value2)).mask | 8); ((RenderStateBlock)(ref value2)).stencilState = overrideStencil.Value; val2.stateBlock = value2; } CoreUtils.DrawRendererList(renderContext, cmd, ((ScriptableRenderContext)(ref renderContext)).CreateRendererList(val2)); } public override void Cleanup() { } } internal class TIPS : CustomPass { public Mesh? mesh; public float size = 5f; public float rotationSpeed = 5f; public float edgeDetectThreshold = 1f; public int edgeRadius = 2; public Color glowColor = Color.white; public const float kMaxDistance = 1000f; public Material tipsMeshMaterial; public Material fullscreenMaterial; private RTHandle tipsBuffer; private int compositingPass; private int blurPass; private static readonly int _TipsBuffer = Shader.PropertyToID("_TIPSBuffer"); private static readonly int _BypassMeshDepth = Shader.PropertyToID("_BypassMeshDepth"); private static readonly int _EdgeDetectThreshold = Shader.PropertyToID("_EdgeDetectThreshold"); private static readonly int _GlowColor = Shader.PropertyToID("_GlowColor"); private static readonly int _EdgeRadius = Shader.PropertyToID("_EdgeRadius"); private static readonly int _Intensity = Shader.PropertyToID("_Intensity"); public override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) tipsMeshMaterial = Resources.Load("Shader Graphs_TIPS_Effect"); tipsBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, (DepthBits)0, (GraphicsFormat)48, (FilterMode)0, (TextureWrapMode)0, TextureXR.dimension, false, false, true, false, 1, 0f, (MSAASamples)1, false, true, (RenderTextureMemoryless)0, (VRTextureUsage)0, "TIPS Buffer"); if ((Object)(object)fullscreenMaterial != (Object)null) { compositingPass = fullscreenMaterial.FindPass("Compositing"); blurPass = fullscreenMaterial.FindPass("Blur"); } base.targetColorBuffer = (TargetBuffer)1; base.targetDepthBuffer = (TargetBuffer)1; base.clearFlags = (ClearFlag)7; } public override void Execute(CustomPassContext ctx) { //IL_00d1: 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_00f3: 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) //IL_0114: 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) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00a8: 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_013f: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)fullscreenMaterial == (Object)null)) { if ((Object)(object)mesh != (Object)null && (Object)(object)tipsMeshMaterial != (Object)null) { Transform transform = ((Component)ctx.hdCamera.camera).transform; Matrix4x4 val = Matrix4x4.TRS(transform.position, Quaternion.Euler(0f, Time.realtimeSinceStartup * rotationSpeed, Time.realtimeSinceStartup * rotationSpeed * 0.5f), Vector3.one * size); tipsMeshMaterial.SetFloat(_Intensity, 0.2f / size * 1000f); ctx.cmd.DrawMesh(mesh, val, tipsMeshMaterial, 0, tipsMeshMaterial.FindPass("ForwardOnly")); } ctx.propertyBlock.SetFloat(_EdgeDetectThreshold, edgeDetectThreshold); ctx.propertyBlock.SetColor(_GlowColor, glowColor); ctx.propertyBlock.SetFloat(_EdgeRadius, (float)edgeRadius); ctx.propertyBlock.SetFloat(_BypassMeshDepth, ((Object)(object)mesh != (Object)null) ? 0f : size); CoreUtils.SetRenderTarget(ctx.cmd, tipsBuffer, (ClearFlag)1, 0, (CubemapFace)(-1), -1); CommandBuffer cmd = ctx.cmd; Material obj = fullscreenMaterial; int num = compositingPass; CoreUtils.DrawFullScreen(cmd, obj, ctx.propertyBlock, num); ctx.propertyBlock.SetTexture(_TipsBuffer, RTHandle.op_Implicit(tipsBuffer)); CoreUtils.SetRenderTarget(ctx.cmd, ctx.cameraColorBuffer, (ClearFlag)0, 0, (CubemapFace)(-1), -1); CommandBuffer cmd2 = ctx.cmd; Material obj2 = fullscreenMaterial; num = blurPass; CoreUtils.DrawFullScreen(cmd2, obj2, ctx.propertyBlock, num); } } public override void Cleanup() { tipsBuffer.Release(); } } namespace CodeRebirth { public static class MyPluginInfo { public const string PLUGIN_GUID = "CodeRebirth"; public const string PLUGIN_NAME = "CodeRebirth"; public const string PLUGIN_VERSION = "1.6.4"; } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthEnemyKeys { public static NamespacedKey DebtCollector = NamespacedKey.From("code_rebirth", "debt_collector"); public static NamespacedKey Guardsman = NamespacedKey.From("code_rebirth", "guardsman"); public static NamespacedKey CactusBudling = NamespacedKey.From("code_rebirth", "cactus_budling"); public static NamespacedKey CarnivorousPlant = NamespacedKey.From("code_rebirth", "carnivorous_plant"); public static NamespacedKey DriftwoodMenace = NamespacedKey.From("code_rebirth", "driftwood_menace"); public static NamespacedKey Duck = NamespacedKey.From("code_rebirth", "duck"); public static NamespacedKey Janitor = NamespacedKey.From("code_rebirth", "janitor"); public static NamespacedKey RabbitMagician = NamespacedKey.From("code_rebirth", "rabbit_magician"); public static NamespacedKey LordOfTheManor = NamespacedKey.From("code_rebirth", "lord_of_the_manor"); public static NamespacedKey Mistress = NamespacedKey.From("code_rebirth", "mistress"); public static NamespacedKey CutieFly = NamespacedKey.From("code_rebirth", "cutiefly"); public static NamespacedKey Monarch = NamespacedKey.From("code_rebirth", "monarch"); public static NamespacedKey Nancy = NamespacedKey.From("code_rebirth", "nancy"); public static NamespacedKey PeaceKeeper = NamespacedKey.From("code_rebirth", "peace_keeper"); public static NamespacedKey RedwoodTitan = NamespacedKey.From("code_rebirth", "redwood_titan"); public static NamespacedKey RealEnemySnailCat = NamespacedKey.From("code_rebirth", "real_enemy_snailcat"); public static NamespacedKey Transporter = NamespacedKey.From("code_rebirth", "transporter"); public static NamespacedKey Tornado = NamespacedKey.From("code_rebirth", "tornado"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthEnemyKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthWeatherKeys { public static NamespacedKey MeteorShower = NamespacedKey.From("code_rebirth", "meteor_shower"); public static NamespacedKey NightShift = NamespacedKey.From("code_rebirth", "night_shift"); public static NamespacedKey Tornado = NamespacedKey.From("code_rebirth", "tornado"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthWeatherKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthUnlockableItemKeys { public static NamespacedKey ToastyToaster = NamespacedKey.From("code_rebirth", "toasty_toaster"); public static NamespacedKey DenominationAnalyzer = NamespacedKey.From("code_rebirth", "denomination_analyzer"); public static NamespacedKey TrashHoop = NamespacedKey.From("code_rebirth", "trash_hoop"); public static NamespacedKey FancyCoatHanger = NamespacedKey.From("code_rebirth", "fancy_coat_hanger"); public static NamespacedKey TeddyBear = NamespacedKey.From("code_rebirth", "teddy_bear"); public static NamespacedKey CutieflyCase = NamespacedKey.From("code_rebirth", "cutiefly_case"); public static NamespacedKey JimPlaque = NamespacedKey.From("code_rebirth", "jim_plaque"); public static NamespacedKey AIRCONTROL = NamespacedKey.From("code_rebirth", "aircontrol"); public static NamespacedKey BEARTRAP = NamespacedKey.From("code_rebirth", "beartrap"); public static NamespacedKey HERMIT = NamespacedKey.From("code_rebirth", "hermit"); public static NamespacedKey CLEANER = NamespacedKey.From("code_rebirth", "cleaner"); public static NamespacedKey MISSCRUISER = NamespacedKey.From("code_rebirth", "miss_cruiser"); public static NamespacedKey BALD = NamespacedKey.From("code_rebirth", "bald"); public static NamespacedKey PlantPot = NamespacedKey.From("code_rebirth", "plantpot"); public static NamespacedKey LIZZIE = NamespacedKey.From("code_rebirth", "lizzie"); public static NamespacedKey SEAMOne = NamespacedKey.From("code_rebirth", "seamone"); public static NamespacedKey SWRDOne = NamespacedKey.From("code_rebirth", "swrdone"); public static NamespacedKey SHRIMP = NamespacedKey.From("code_rebirth", "shrimp"); public static NamespacedKey DAISY = NamespacedKey.From("code_rebirth", "daisy"); public static NamespacedKey TimmyBass = NamespacedKey.From("code_rebirth", "timmy_bass"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthUnlockableItemKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthItemKeys { public static NamespacedKey CharredBaby = NamespacedKey.From("code_rebirth", "charred_baby"); public static NamespacedKey CharredFork = NamespacedKey.From("code_rebirth", "charred_fork"); public static NamespacedKey SapsuckerOmelette = NamespacedKey.From("code_rebirth", "sapsucker_omelette"); public static NamespacedKey CharredSpork = NamespacedKey.From("code_rebirth", "charred_spork"); public static NamespacedKey FlattenedBody = NamespacedKey.From("code_rebirth", "flattened_body"); public static NamespacedKey SallyCube = NamespacedKey.From("code_rebirth", "sally_cube"); public static NamespacedKey BurntFleshArm = NamespacedKey.From("code_rebirth", "burnt_flesh_arm"); public static NamespacedKey BurntFleshEye = NamespacedKey.From("code_rebirth", "burnt_flesh_eye"); public static NamespacedKey BurntRubble = NamespacedKey.From("code_rebirth", "burnt_rubble"); public static NamespacedKey BurntFleshTeeth = NamespacedKey.From("code_rebirth", "burnt_flesh_teeth"); public static NamespacedKey BurntFleshTongue = NamespacedKey.From("code_rebirth", "burnt_flesh_tongue"); public static NamespacedKey Coin = NamespacedKey.From("code_rebirth", "coin"); public static NamespacedKey CrispDollarBill = NamespacedKey.From("code_rebirth", "crisp_dollar_bill"); public static NamespacedKey WayfarersWallet = NamespacedKey.From("code_rebirth", "wayfarers_wallet"); public static NamespacedKey AlarmClock = NamespacedKey.From("code_rebirth", "alarm_clock"); public static NamespacedKey Amber = NamespacedKey.From("code_rebirth", "amber"); public static NamespacedKey MusicBox = NamespacedKey.From("code_rebirth", "music_box"); public static NamespacedKey BirthdayCard = NamespacedKey.From("code_rebirth", "birthday_card"); public static NamespacedKey CreditPadOneZeroZerocc = NamespacedKey.From("code_rebirth", "credit_pad_onezerozerocc"); public static NamespacedKey CreditPadFiveZeroZerocc = NamespacedKey.From("code_rebirth", "credit_pad_fivezerozerocc"); public static NamespacedKey CreditPadOneZeroZeroZerocc = NamespacedKey.From("code_rebirth", "credit_pad_onezerozerozerocc"); public static NamespacedKey RemoteDetonator = NamespacedKey.From("code_rebirth", "remote_detonator"); public static NamespacedKey DisposableCamera = NamespacedKey.From("code_rebirth", "disposable_camera"); public static NamespacedKey DuckyTube = NamespacedKey.From("code_rebirth", "ducky_tube"); public static NamespacedKey EZBakeOven = NamespacedKey.From("code_rebirth", "ez_bake_oven"); public static NamespacedKey FogHorn = NamespacedKey.From("code_rebirth", "foghorn"); public static NamespacedKey GuardsmanPhone = NamespacedKey.From("code_rebirth", "guardsman_phone"); public static NamespacedKey HandDrill = NamespacedKey.From("code_rebirth", "hand_drill"); public static NamespacedKey HardHat = NamespacedKey.From("code_rebirth", "hard_hat"); public static NamespacedKey InfiniKey = NamespacedKey.From("code_rebirth", "infinikey"); public static NamespacedKey LifeformAnalyser = NamespacedKey.From("code_rebirth", "lifeform_analyser"); public static NamespacedKey MagicEightBall = NamespacedKey.From("code_rebirth", "magic_eight_ball"); public static NamespacedKey Mirror = NamespacedKey.From("code_rebirth", "mirror"); public static NamespacedKey MoleDigger = NamespacedKey.From("code_rebirth", "mole_digger"); public static NamespacedKey MouseTrap = NamespacedKey.From("code_rebirth", "mouse_trap"); public static NamespacedKey NitroglycerinCrate = NamespacedKey.From("code_rebirth", "nitroglycerin_crate"); public static NamespacedKey OldBooze = NamespacedKey.From("code_rebirth", "old_booze"); public static NamespacedKey OrbitalStrikeCaller = NamespacedKey.From("code_rebirth", "orbital_strike_caller"); public static NamespacedKey Oxidizer = NamespacedKey.From("code_rebirth", "oxidizer"); public static NamespacedKey PlasticCake = NamespacedKey.From("code_rebirth", "plastic_cake"); public static NamespacedKey RailSlugger = NamespacedKey.From("code_rebirth", "rail_slugger"); public static NamespacedKey Rocky = NamespacedKey.From("code_rebirth", "rocky"); public static NamespacedKey RollingDuck = NamespacedKey.From("code_rebirth", "rolling_duck"); public static NamespacedKey Rubberband = NamespacedKey.From("code_rebirth", "rubber_band"); public static NamespacedKey RustedPickHead = NamespacedKey.From("code_rebirth", "rusted_pick_head"); public static NamespacedKey SawBlade = NamespacedKey.From("code_rebirth", "saw_blade"); public static NamespacedKey Scrapapult = NamespacedKey.From("code_rebirth", "scrapapult"); public static NamespacedKey ShipUpgradeUnlocker = NamespacedKey.From("code_rebirth", "ship_upgrade_unlocker"); public static NamespacedKey Skull = NamespacedKey.From("code_rebirth", "skull"); public static NamespacedKey SpudTater = NamespacedKey.From("code_rebirth", "spud_tater"); public static NamespacedKey StoptimeWatch = NamespacedKey.From("code_rebirth", "stoptime_watch"); public static NamespacedKey TeddyBear = NamespacedKey.From("code_rebirth", "teddy_bear"); public static NamespacedKey WalkieYellie = NamespacedKey.From("code_rebirth", "walkieyellie"); public static NamespacedKey WalkingCane = NamespacedKey.From("code_rebirth", "walking_cane"); public static NamespacedKey WiltedRose = NamespacedKey.From("code_rebirth", "wilted_rose"); public static NamespacedKey MelanieDrawing = NamespacedKey.From("code_rebirth", "melanie_drawing"); public static NamespacedKey XrayGlasses = NamespacedKey.From("code_rebirth", "xray_glasses"); public static NamespacedKey Yoyo = NamespacedKey.From("code_rebirth", "yoyo"); public static NamespacedKey BloodyShreddedScraps = NamespacedKey.From("code_rebirth", "bloody_shredded_scraps"); public static NamespacedKey JimothyCore = NamespacedKey.From("code_rebirth", "jimothy_core"); public static NamespacedKey NormalShreddedScraps = NamespacedKey.From("code_rebirth", "normal_shredded_scraps"); public static NamespacedKey DebugStick = NamespacedKey.From("code_rebirth", "debug_stick"); public static NamespacedKey StoatGun = NamespacedKey.From("code_rebirth", "stoat_gun"); public static NamespacedKey CrispXuBuck = NamespacedKey.From("code_rebirth", "crisp_xubuck"); public static NamespacedKey Grape = NamespacedKey.From("code_rebirth", "grape"); public static NamespacedKey LemonadePitcher = NamespacedKey.From("code_rebirth", "lemonade_pitcher"); public static NamespacedKey PuppeteersNeedle = NamespacedKey.From("code_rebirth", "puppeteers_needle"); public static NamespacedKey PuppeteersVoodoo = NamespacedKey.From("code_rebirth", "puppeteers_voodoo"); public static NamespacedKey TalkingHead = NamespacedKey.From("code_rebirth", "talking_head"); public static NamespacedKey Ceasefire = NamespacedKey.From("code_rebirth", "ceasefire"); public static NamespacedKey GiantCallerHorn = NamespacedKey.From("code_rebirth", "giant_caller_horn"); public static NamespacedKey FakeSnailCat = NamespacedKey.From("code_rebirth", "fake_snailcat"); public static NamespacedKey SnailCat = NamespacedKey.From("code_rebirth", "snailcat"); public static NamespacedKey Hoverboard = NamespacedKey.From("code_rebirth", "hoverboard"); public static NamespacedKey ByrneJournalOne = NamespacedKey.From("code_rebirth", "byrne_journal_one"); public static NamespacedKey ByrneJournalTwo = NamespacedKey.From("code_rebirth", "byrne_journal_two"); public static NamespacedKey ByrneJournalThree = NamespacedKey.From("code_rebirth", "byrne_journal_three"); public static NamespacedKey ByrneJournalFour = NamespacedKey.From("code_rebirth", "byrne_journal_four"); public static NamespacedKey ByrneJournalFive = NamespacedKey.From("code_rebirth", "byrne_journal_five"); public static NamespacedKey ByrneJournalSix = NamespacedKey.From("code_rebirth", "byrne_journal_six"); public static NamespacedKey DirectorDiaryOne = NamespacedKey.From("code_rebirth", "director_diary_one"); public static NamespacedKey DirectorDiaryTwo = NamespacedKey.From("code_rebirth", "director_diary_two"); public static NamespacedKey DirectorDiaryThree = NamespacedKey.From("code_rebirth", "director_diary_three"); public static NamespacedKey DirectorDiaryFour = NamespacedKey.From("code_rebirth", "director_diary_four"); public static NamespacedKey DirectorDiaryFive = NamespacedKey.From("code_rebirth", "director_diary_five"); public static NamespacedKey DirectorDiarySix = NamespacedKey.From("code_rebirth", "director_diary_six"); public static NamespacedKey DirectorDiarySeven = NamespacedKey.From("code_rebirth", "director_diary_seven"); public static NamespacedKey DirectorDiaryEight = NamespacedKey.From("code_rebirth", "director_diary_eight"); public static NamespacedKey DirectorDiaryNine = NamespacedKey.From("code_rebirth", "director_diary_nine"); public static NamespacedKey DirectorDiaryOneZero = NamespacedKey.From("code_rebirth", "director_diary_onezero"); public static NamespacedKey ToDoList = NamespacedKey.From("code_rebirth", "todo_list"); public static NamespacedKey CactusBudlingDocument = NamespacedKey.From("code_rebirth", "cactusbudlingdocument"); public static NamespacedKey CutieMonarchDocument = NamespacedKey.From("code_rebirth", "cutiemonarchdocument"); public static NamespacedKey DriftwoodMenaceDocument = NamespacedKey.From("code_rebirth", "driftwoodmenacedocument"); public static NamespacedKey DuckDocument = NamespacedKey.From("code_rebirth", "duckdocument"); public static NamespacedKey GuardsmanDocument = NamespacedKey.From("code_rebirth", "guardsmandocument"); public static NamespacedKey IntroDocument = NamespacedKey.From("code_rebirth", "introdocument"); public static NamespacedKey JanitorDocument = NamespacedKey.From("code_rebirth", "janitordocument"); public static NamespacedKey MagicianDocument = NamespacedKey.From("code_rebirth", "magiciandocument"); public static NamespacedKey ManorLordDocument = NamespacedKey.From("code_rebirth", "manorlorddocument"); public static NamespacedKey MistressDocument = NamespacedKey.From("code_rebirth", "mistressdocument"); public static NamespacedKey NancyDocument = NamespacedKey.From("code_rebirth", "nancydocument"); public static NamespacedKey PeaceKeeperDocument = NamespacedKey.From("code_rebirth", "peacekeeperdocument"); public static NamespacedKey RedwoodDocument = NamespacedKey.From("code_rebirth", "redwooddocument"); public static NamespacedKey SnailCatDocument = NamespacedKey.From("code_rebirth", "snailcatdocument"); public static NamespacedKey TransporterDocument = NamespacedKey.From("code_rebirth", "transporterdocument"); public static NamespacedKey ComfortTape = NamespacedKey.From("code_rebirth", "comfort_tape"); public static NamespacedKey OxydeTrainingTape = NamespacedKey.From("code_rebirth", "oxyde_training_tape"); public static NamespacedKey HaemoglobinTablet = NamespacedKey.From("code_rebirth", "haemoglobin_tablet"); public static NamespacedKey OxydeTablet = NamespacedKey.From("code_rebirth", "oxyde_tablet"); public static NamespacedKey Plushie = NamespacedKey.From("code_rebirth", "plushie"); public static NamespacedKey ACUnitGalPlushie = NamespacedKey.From("code_rebirth", "acunit_gal_plushie"); public static NamespacedKey CactusBudlingPlushie = NamespacedKey.From("code_rebirth", "cactus_budling_plushie"); public static NamespacedKey CruiserGalPlushie = NamespacedKey.From("code_rebirth", "cruiser_gal_plushie"); public static NamespacedKey DriftwoodMenacePlushie = NamespacedKey.From("code_rebirth", "driftwood_menace_plushie"); public static NamespacedKey DuckPlushie = NamespacedKey.From("code_rebirth", "duck_plushie"); public static NamespacedKey GuardsmanPlushie = NamespacedKey.From("code_rebirth", "guardsman_plushie"); public static NamespacedKey JanitorPlushie = NamespacedKey.From("code_rebirth", "janitor_plushie"); public static NamespacedKey ManorLordPlushie = NamespacedKey.From("code_rebirth", "manorlord_plushie"); public static NamespacedKey MistressPlushie = NamespacedKey.From("code_rebirth", "mistress_plushie"); public static NamespacedKey MonarchPlushie = NamespacedKey.From("code_rebirth", "monarch_plushie"); public static NamespacedKey NancyPlushie = NamespacedKey.From("code_rebirth", "nancy_plushie"); public static NamespacedKey PeaceKeeperPlushie = NamespacedKey.From("code_rebirth", "peacekeeper_plushie"); public static NamespacedKey RabbitMagicianPlushie = NamespacedKey.From("code_rebirth", "rabbit_magician_plushie"); public static NamespacedKey RedwoodTitanPlushie = NamespacedKey.From("code_rebirth", "redwood_titan_plushie"); public static NamespacedKey SeamineTinkPlushie = NamespacedKey.From("code_rebirth", "seamine_tink_plushie"); public static NamespacedKey ShockwaveBotPlushie = NamespacedKey.From("code_rebirth", "shockwave_bot_plushie"); public static NamespacedKey SnailCatPlushie = NamespacedKey.From("code_rebirth", "snail_cat_plushie"); public static NamespacedKey TerminalBotPlushie = NamespacedKey.From("code_rebirth", "terminal_bot_plushie"); public static NamespacedKey TransporterPlushie = NamespacedKey.From("code_rebirth", "transporter_plushie"); public static NamespacedKey SnowGlobe = NamespacedKey.From("code_rebirth", "snow_globe"); public static NamespacedKey Brrreaker = NamespacedKey.From("code_rebirth", "brrreaker"); public static NamespacedKey MarrowSplitter = NamespacedKey.From("code_rebirth", "marrow_splitter"); public static NamespacedKey SWATTer = NamespacedKey.From("code_rebirth", "swatter"); public static NamespacedKey TomaHop = NamespacedKey.From("code_rebirth", "toma_hop"); public static NamespacedKey Turbulence = NamespacedKey.From("code_rebirth", "turbulence"); public static NamespacedKey SaltedBeef = NamespacedKey.From("code_rebirth", "salted_beef"); public static NamespacedKey KingRigo = NamespacedKey.From("code_rebirth", "kingrigo"); public static NamespacedKey MeliciousMel = NamespacedKey.From("code_rebirth", "melicious_mel"); public static NamespacedKey Xui = NamespacedKey.From("code_rebirth", "xui"); public static NamespacedKey Accordion = NamespacedKey.From("code_rebirth", "accordion"); public static NamespacedKey Guitar = NamespacedKey.From("code_rebirth", "guitar"); public static NamespacedKey Recorder = NamespacedKey.From("code_rebirth", "recorder"); public static NamespacedKey Violin = NamespacedKey.From("code_rebirth", "violin"); public static NamespacedKey CruiserGalAssemblyParts = NamespacedKey.From("code_rebirth", "cruisergal_assembly_parts"); public static NamespacedKey GoldenTomato = NamespacedKey.From("code_rebirth", "golden_tomato"); public static NamespacedKey NormalTomato = NamespacedKey.From("code_rebirth", "normal_tomato"); public static NamespacedKey WoodenSeed = NamespacedKey.From("code_rebirth", "wooden_seed"); public static NamespacedKey JarofNineNineNine = NamespacedKey.From("code_rebirth", "jar_of_nineninenine"); public static NamespacedKey SeamineGalAssemblyParts = NamespacedKey.From("code_rebirth", "seaminegal_assembly_parts"); public static NamespacedKey ShockwaveGalAssemblyParts = NamespacedKey.From("code_rebirth", "shockwavegal_assembly_parts"); public static NamespacedKey BlueShrimp = NamespacedKey.From("code_rebirth", "blue_shrimp"); public static NamespacedKey TerminalGalAssemblyParts = NamespacedKey.From("code_rebirth", "terminalgal_assembly_parts"); public static NamespacedKey AmethystCrystal = NamespacedKey.From("code_rebirth", "amethyst_crystal"); public static NamespacedKey EmeraldCrystal = NamespacedKey.From("code_rebirth", "emerald_crystal"); public static NamespacedKey QuartzCrystal = NamespacedKey.From("code_rebirth", "quartz_crystal"); public static NamespacedKey RubyCrystal = NamespacedKey.From("code_rebirth", "ruby_crystal"); public static NamespacedKey SapphireCrystal = NamespacedKey.From("code_rebirth", "sapphire_crystal"); public static NamespacedKey TopazCrystal = NamespacedKey.From("code_rebirth", "topaz_crystal"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthItemKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthMapObjectKeys { public static NamespacedKey MilitaryPlane = NamespacedKey.From("code_rebirth", "military_plane"); public static NamespacedKey FlashTurret = NamespacedKey.From("code_rebirth", "flash_turret"); public static NamespacedKey FunctionalMicrowave = NamespacedKey.From("code_rebirth", "functional_microwave"); public static NamespacedKey LaserTurret = NamespacedKey.From("code_rebirth", "laser_turret"); public static NamespacedKey IndustrialFan = NamespacedKey.From("code_rebirth", "industrial_fan"); public static NamespacedKey BugZapper = NamespacedKey.From("code_rebirth", "bug_zapper"); public static NamespacedKey AirControlUnit = NamespacedKey.From("code_rebirth", "air_control_unit"); public static NamespacedKey AutonomousCrane = NamespacedKey.From("code_rebirth", "autonomous_crane"); public static NamespacedKey BoomTrap = NamespacedKey.From("code_rebirth", "boom_trap"); public static NamespacedKey GrassBearTrap = NamespacedKey.From("code_rebirth", "grass_bear_trap"); public static NamespacedKey GravelBearTrap = NamespacedKey.From("code_rebirth", "gravel_bear_trap"); public static NamespacedKey SnowBearTrap = NamespacedKey.From("code_rebirth", "snow_bear_trap"); public static NamespacedKey Biome = NamespacedKey.From("code_rebirth", "biome"); public static NamespacedKey CompactorToby = NamespacedKey.From("code_rebirth", "compactor_toby"); public static NamespacedKey OxydeCrashedShip = NamespacedKey.From("code_rebirth", "oxyde_crashed_ship"); public static NamespacedKey GunslingerGreg = NamespacedKey.From("code_rebirth", "gunslinger_greg"); public static NamespacedKey NormalMetalCrate = NamespacedKey.From("code_rebirth", "normal_metal_crate"); public static NamespacedKey MimicMetalCrate = NamespacedKey.From("code_rebirth", "mimic_metal_crate"); public static NamespacedKey MimicWoodenCrate = NamespacedKey.From("code_rebirth", "mimic_wooden_crate"); public static NamespacedKey NormalWoodenCrate = NamespacedKey.From("code_rebirth", "normal_wooden_crate"); public static NamespacedKey Coin = NamespacedKey.From("code_rebirth", "coin"); public static NamespacedKey CrispDollarBill = NamespacedKey.From("code_rebirth", "crisp_dollar_bill"); public static NamespacedKey Wallet = NamespacedKey.From("code_rebirth", "wallet"); public static NamespacedKey CommonVendingMachine = NamespacedKey.From("code_rebirth", "common_vending_machine"); public static NamespacedKey LegendaryVendingMachine = NamespacedKey.From("code_rebirth", "legendary_vending_machine"); public static NamespacedKey RareVendingMachine = NamespacedKey.From("code_rebirth", "rare_vending_machine"); public static NamespacedKey UncommonVendingMachine = NamespacedKey.From("code_rebirth", "uncommon_vending_machine"); public static NamespacedKey Merchant = NamespacedKey.From("code_rebirth", "merchant"); public static NamespacedKey KamikazeJimothy = NamespacedKey.From("code_rebirth", "kamikaze_jimothy"); public static NamespacedKey ShredderSarah = NamespacedKey.From("code_rebirth", "shredder_sarah"); public static NamespacedKey EmergingCactusOne = NamespacedKey.From("code_rebirth", "emerging_cactus_one"); public static NamespacedKey EmergingCactusTwo = NamespacedKey.From("code_rebirth", "emerging_cactus_two"); public static NamespacedKey EmergingCactusThree = NamespacedKey.From("code_rebirth", "emerging_cactus_three"); public static NamespacedKey TrashCan = NamespacedKey.From("code_rebirth", "trash_can"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthMapObjectKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthAchievementKeys { public static NamespacedKey LunchisServed = NamespacedKey.From("code_rebirth", "lunch_is_served"); public static NamespacedKey ShortFuse = NamespacedKey.From("code_rebirth", "short_fuse"); public static NamespacedKey Banzai = NamespacedKey.From("code_rebirth", "banzai"); public static NamespacedKey GraveyardShift = NamespacedKey.From("code_rebirth", "graveyard_shift"); public static NamespacedKey GreatestAsset = NamespacedKey.From("code_rebirth", "greatest_asset"); public static NamespacedKey Internship = NamespacedKey.From("code_rebirth", "internship"); public static NamespacedKey Crateapult = NamespacedKey.From("code_rebirth", "crateapult"); public static NamespacedKey SafeAndSound = NamespacedKey.From("code_rebirth", "safe_and_sound"); public static NamespacedKey Capitalism = NamespacedKey.From("code_rebirth", "capitalism"); public static NamespacedKey FatWallet = NamespacedKey.From("code_rebirth", "fat_wallet"); public static NamespacedKey MaydayMayday = NamespacedKey.From("code_rebirth", "mayday_mayday"); public static NamespacedKey OhAPenny = NamespacedKey.From("code_rebirth", "oh_a_penny"); public static NamespacedKey OutOfStock = NamespacedKey.From("code_rebirth", "out_of_stock"); public static NamespacedKey YouMonster = NamespacedKey.From("code_rebirth", "you_monster"); public static NamespacedKey WildWest = NamespacedKey.From("code_rebirth", "wild_west"); public static NamespacedKey Bushwacked = NamespacedKey.From("code_rebirth", "bushwacked"); public static NamespacedKey TrashTrashTrash = NamespacedKey.From("code_rebirth", "trash_trash_trash"); public static NamespacedKey NightofBetrayal = NamespacedKey.From("code_rebirth", "night_of_betrayal"); public static NamespacedKey Igotaheadache = NamespacedKey.From("code_rebirth", "i_got_a_headache"); public static NamespacedKey PestControl = NamespacedKey.From("code_rebirth", "pest_control"); public static NamespacedKey PeaceKept = NamespacedKey.From("code_rebirth", "peace_kept"); public static NamespacedKey Timber = NamespacedKey.From("code_rebirth", "timber"); public static NamespacedKey CodeRebirthPlatinum = NamespacedKey.From("code_rebirth", "code_rebirth_platinum"); public static NamespacedKey MuMiaolan = NamespacedKey.From("code_rebirth", "mu_miaolan"); public static NamespacedKey CompanyCertified = NamespacedKey.From("code_rebirth", "company_certified"); public static NamespacedKey HappyFamily = NamespacedKey.From("code_rebirth", "happy_family"); public static NamespacedKey HoardingBug = NamespacedKey.From("code_rebirth", "hoarding_bug"); public static NamespacedKey Scalper = NamespacedKey.From("code_rebirth", "scalper"); public static NamespacedKey SomeAssemblyRequired = NamespacedKey.From("code_rebirth", "some_assembly_required"); public static NamespacedKey TheUprooted = NamespacedKey.From("code_rebirth", "the_uprooted"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthAchievementKeys).GetField(name)?.GetValue(null)); } } [GeneratedCode("DawnLib", "0.2.2")] public static class CodeRebirthMoonKeys { public static NamespacedKey Haemoglobin = NamespacedKey.From("code_rebirth", "haemoglobin"); public static NamespacedKey Oxyde = NamespacedKey.From("code_rebirth", "oxyde"); public static NamespacedKey? GetByReflection(string name) { return (NamespacedKey)(typeof(CodeRebirthMoonKeys).GetField(name)?.GetValue(null)); } } } namespace CodeRebirth.src { public class CodeRebirthConfig { public ConfigEntry ConfigOxydeEnabledFromStart { get; private set; } public ConfigEntry ConfigDisableTrashCans { get; private set; } public ConfigEntry ConfigRemoveInteriorFog { get; private set; } public ConfigEntry ConfigDontTargetFarEnemies { get; private set; } public ConfigEntry ConfigHazardsDeleteBodies { get; private set; } public ConfigEntry ConfigOnlyOwnerDisablesGal { get; private set; } public ConfigEntry ConfigFloraEnabled { get; set; } public ConfigEntry ConfigRedwoodHeartEnabled { get; private set; } public ConfigEntry ConfigSnowGlobeMusic { get; private set; } public ConfigEntry ConfigRedwoodNormalVolume { get; private set; } public ConfigEntry ConfigRedwoodInShipVolume { get; private set; } public ConfigEntry ConfigRedwoodSpeed { get; private set; } public ConfigEntry ConfigRedwoodShipPadding { get; private set; } public ConfigEntry ConfigRedwoodEyesight { get; private set; } public ConfigEntry ConfigRedwoodCanEatOldBirds { get; private set; } public ConfigEntry ConfigMeteorShowerTimeToLeave { get; private set; } public ConfigEntry ConfigTornadoInsideBeforeThrow { get; private set; } public ConfigEntry ConfigTornadoPullStrength { get; private set; } public ConfigEntry ConfigTornadoSpeed { get; private set; } public ConfigEntry ConfigMeteorSpeed { get; private set; } public ConfigEntry ConfigMinMeteorSpawnCount { get; private set; } public ConfigEntry ConfigMaxMeteorSpawnCount { get; private set; } public ConfigEntry ConfigTornadoInShipVolume { get; private set; } public ConfigEntry ConfigTornadoDefaultVolume { get; private set; } public ConfigEntry ConfigMeteorShowerMeteoriteSpawnChance { get; private set; } public ConfigEntry ConfigMeteorShowerInShipVolume { get; private set; } public ConfigEntry ConfigMeteorHitShip { get; private set; } public ConfigEntry ConfigMeteorsDefaultVolume { get; private set; } public ConfigEntry ConfigTerminalScanFrequency { get; private set; } public ConfigEntry ConfigTerminalScanRange { get; private set; } public ConfigEntry ConfigSeamineScanFrequency { get; private set; } public ConfigEntry ConfigSeamineScanRange { get; private set; } public ConfigEntry ConfigBearTrapsPopTires { get; private set; } public ConfigEntry ConfigOnlyOwnerSeesScanEffects { get; private set; } public ConfigEntry ConfigSeamineTinkCharges { get; private set; } public ConfigEntry ConfigOnlyOwnerSeesScanEffectsTerminalGal { get; private set; } public ConfigEntry ConfigTerminalBotFlyingVolume { get; private set; } public ConfigEntry ConfigCruiserGalAutomatic { get; private set; } public ConfigEntry ConfigTerminalBotAutomatic { get; private set; } public ConfigEntry ConfigWoodenSeedTreeSpawnChance { get; private set; } public ConfigEntry ConfigShockwaveBotAutomatic { get; private set; } public ConfigEntry ConfigShockwaveBotPropellerVolume { get; private set; } public ConfigEntry ConfigShockwaveHoldsFourItems { get; private set; } public ConfigEntry ConfigShockwaveCharges { get; private set; } public ConfigEntry ConfigAllowPowerLevelChangesFromWeather { get; private set; } public ConfigEntry ConfigExtendedLogging { get; set; } public ConfigEntry ConfigFloraGrassCurveSpawnWeight { get; set; } public ConfigEntry ConfigFloraDesertCurveSpawnWeight { get; set; } public ConfigEntry ConfigFloraSnowCurveSpawnWeight { get; set; } public ConfigEntry ConfigSeamineTinkRidingBruceVolume { get; private set; } public ConfigEntry ConfigSeamineTinkAutomatic { get; private set; } public ConfigEntry ConfigMicrowaveVolume { get; private set; } public ConfigEntry ConfigBearTrapVolume { get; private set; } public ConfigEntry ConfigLaserTurretVolume { get; private set; } public ConfigEntry ConfigFlashTurretVolume { get; private set; } public ConfigEntry ConfigBugZapperVolume { get; private set; } public ConfigEntry ConfigACUVolume { get; private set; } public ConfigEntry Config999GalHealCooldown { get; private set; } public ConfigEntry Config999GalHealAmount { get; private set; } public ConfigEntry Config999GalHealSpeed { get; private set; } public ConfigEntry Config999GalHealOnlyInteractedPlayer { get; private set; } public ConfigEntry Config999GalReviveNearbyDeadPlayers { get; private set; } public ConfigEntry Config999GalHealTotalAmount { get; private set; } public ConfigEntry Config999GalReviveCharges { get; private set; } public ConfigEntry Config999GalCompanyMoonRecharge { get; private set; } public ConfigEntry Config999GalFailureChance { get; private set; } public ConfigEntry Config999GalScaleHealAndReviveWithPlayerCount { get; private set; } public ConfigEntry ConfigAirControlUnitKnockbackPower { get; private set; } public ConfigEntry ConfigAirControlUnitDamage { get; private set; } public ConfigEntry ConfigCleanUnusedConfigs { get; private set; } public ConfigEntry ConfigDebugMode { get; private set; } public void InitMainCodeRebirthConfig(ConfigFile configFile) { ConfigExtendedLogging = configFile.Bind("Debug Options", "Debug Mode | Extended Logging", false, "Whether ExtendedLogging is enabled."); ConfigDebugMode = configFile.Bind("Debug Options", "Debug Mode | Hazard Spawning Enabled", false, "Whether debug mode is enabled (for hazard spawning stuff)."); ConfigRemoveInteriorFog = configFile.Bind("Debug Options", "Debug Mode | Remove Interior Fog", false, "Whether zeekerss' horrible interior fog is removed."); ConfigAllowPowerLevelChangesFromWeather = configFile.Bind("General", "Allow Power Level Changes From Weather", true, "Whether power level changes from CodeRebirth weathers are allowed."); ConfigOnlyOwnerDisablesGal = configFile.Bind("General", "Gal AI | Owner Power", false, "Whether only the current owner of the gal can disable her."); ConfigDontTargetFarEnemies = configFile.Bind("General", "Gal AI | Dont Stray Too Far", false, "Whether the Gal AI should stop targetting enemies when she is far from her owner's position."); ConfigHazardsDeleteBodies = configFile.Bind("General", "Hazards | Delete Bodies", true, "Whether hazards like IndustrialFan and LaserTurret should delete player bodies."); ConfigCleanUnusedConfigs = configFile.Bind("General", "Clean Unusued Configs", true, "Whether CodeRebirth should delete old confing information that are unused."); ConfigFloraGrassCurveSpawnWeight = configFile.Bind("Flora Options", "Flora | Grass CurveSpawnWeight", "Vanilla - 0.00,30.00 ; 1.00,60.00 | Custom - 0.00,30.00 ; 1.00,60.00 | Oxyde - 0.00,0.00 ; 1.00,0.00", "MoonName - CurveSpawnWeight for Grass flora (moon tags also work)."); ConfigFloraDesertCurveSpawnWeight = configFile.Bind("Flora Options", "Flora | Desert CurveSpawnWeight", "Vanilla - 0.00,30.00 ; 1.00,60.00 | Custom - 0.00,30.00 ; 1.00,60.00 | Oxyde - 0.00,0.00 ; 1.00,0.00", "MoonName - CurveSpawnWeight for Desert flora (moon tags also work)."); ConfigFloraSnowCurveSpawnWeight = configFile.Bind("Flora Options", "Flora | Snow CurveSpawnWeight", "Vanilla - 0.00,30.00 ; 1.00,60.00 | Custom - 0.00,30.00 ; 1.00,60.00 | Oxyde - 0.00,0.00 ; 1.00,0.00", "MoonName - CurveSpawnWeight for Snowy flora (moon tags also work)."); } public void InitCodeRebirthConfig(ConfigFile configFile) { //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Expected O, but got Unknown //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Expected O, but got Unknown //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Expected O, but got Unknown //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Expected O, but got Unknown //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Expected O, but got Unknown //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Expected O, but got Unknown //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Expected O, but got Unknown //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Expected O, but got Unknown //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Expected O, but got Unknown //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Expected O, but got Unknown //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Expected O, but got Unknown //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Expected O, but got Unknown //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Expected O, but got Unknown //IL_076b: Unknown result type (might be due to invalid IL or missing references) //IL_0775: Expected O, but got Unknown //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Expected O, but got Unknown //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Expected O, but got Unknown //IL_0832: Unknown result type (might be due to invalid IL or missing references) //IL_083c: Expected O, but got Unknown //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Expected O, but got Unknown ConfigDisableTrashCans = configFile.Bind("Janitor Options", "Janitor | Disable Trash Cans", false, "Whether trash cans are disabled (this is only visually, trash cans still exist)."); ConfigMicrowaveVolume = configFile.Bind("FunctionalMicrowave Options", "Functional Microwave | Volume", 1f, "The volume of the Functional Microwave."); ConfigBearTrapsPopTires = configFile.Bind("BearTrap Options", "Bear Trap | Pop Tires", true, "Whether the bear trap can pop tires."); ConfigBearTrapVolume = configFile.Bind("BearTrap Options", "Bear Trap | Volume", 1f, "The volume of the Bear Trap."); ConfigLaserTurretVolume = configFile.Bind("LaserTurret Options", "Laser Turret | Volume", 1f, "The volume of the Laser Turret."); ConfigFlashTurretVolume = configFile.Bind("FlashTurret Options", "Flash Turret | Volume", 1f, "The volume of the Flash Turret."); ConfigBugZapperVolume = configFile.Bind("BugZapper Options", "Bug Zapper | Volume", 1f, "The volume of the Bug Zapper."); ConfigAirControlUnitDamage = configFile.Bind("AirControlUnit Options", "Air Control Unit | Damage", 15, "Damage that the ACUnit deals to a player on hit"); ConfigAirControlUnitKnockbackPower = configFile.Bind("AirControlUnit Options", "Air Control Unit | Knockback Power", 250f, "The knockback power of the ACUnit."); ConfigACUVolume = configFile.Bind("AirControlUnit Options", "Air Control Unit | Volume", 1f, "The volume of the Air Control Unit."); ConfigCruiserGalAutomatic = configFile.Bind("Cruiser Gal Options", "Cruiser Gal | Automatic Behaviour", false, "Whether the Cruiser Gal will automatically wake up and choose the nearest player as the owner."); ConfigShockwaveCharges = configFile.Bind("Shockwave Bot Options", "Shockwave Gal | Charges", 10, "How many charges the Shockwave Gal has."); ConfigShockwaveHoldsFourItems = configFile.Bind("Shockwave Bot Options", "Shockwave Gal | Holds Four Items", false, "Whether the Shockwave Gal holds four items regardless of singleplayer or multiplayer."); ConfigShockwaveBotPropellerVolume = configFile.Bind("Shockwave Bot Options", "Shockwave Gal | Propeller Volume", 0.75f, new ConfigDescription("Volume of the Shockwave Gal's propeller.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigShockwaveBotAutomatic = configFile.Bind("Shockwave Bot Options", "Shockwave Gal | Automatic Behaviour", false, "Whether the Shockwave Gal will automatically wake up and choose the nearest player as the owner."); ConfigSeamineTinkCharges = configFile.Bind("Seamine Tink Options", "Seamine Gal | Charges", 3, "How many charges the Seamine Gal has."); ConfigSeamineTinkRidingBruceVolume = configFile.Bind("Seamine Tink Options", "Seamine Gal | Riding Bruce Volume", 0.75f, new ConfigDescription("Volume of the Seamine Gal's Riding Bruce.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigSeamineTinkAutomatic = configFile.Bind("Seamine Tink Options", "Seamine Gal | Automatic Behaviour", false, "Whether the Seamine Gal will automatically wake up and choose the nearest player as the owner."); ConfigOnlyOwnerSeesScanEffects = configFile.Bind("Seamine Tink Options", "Seamine Gal | Only Owner Sees Scan Effects", false, "Whether only the owner of the Seamine Gal can see the scan effects."); ConfigSeamineScanRange = configFile.Bind("Seamine Tink Options", "Seamine Gal | Scan Range", 50f, "Range of the Seamine Gal's scan."); ConfigSeamineScanFrequency = configFile.Bind("Seamine Tink Options", "Seamine Gal | Scan Frequency", 17.5f, "The average Frequency time of the Seamine Gal's scan in seconds."); ConfigTerminalBotAutomatic = configFile.Bind("Terminal Bot Options", "Terminal Gal | Automatic Behaviour", false, "Whether the Terminal Gal will automatically wake up and choose the nearest player as the owner."); ConfigOnlyOwnerSeesScanEffectsTerminalGal = configFile.Bind("Terminal Bot Options", "Terminal Gal | Only Owner Sees Scan Effects", false, "Whether only the owner of the Terminal Gal can see the scan effects."); ConfigTerminalScanRange = configFile.Bind("Terminal Bot Options", "Terminal Gal | Scan Range", 50f, "Range of the Terminal Gal's scan."); ConfigTerminalScanFrequency = configFile.Bind("Terminal Bot Options", "Terminal Gal | Scan Frequency", 17.5f, "The average Frequency time of the Terminal Gal's scan in seconds."); ConfigTerminalBotFlyingVolume = configFile.Bind("Terminal Bot Options", "Terminal Gal | Flying Volume", 0.75f, "Volume of the Terminal Gal's Flying animation."); Config999GalHealCooldown = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Heal Cooldown", 10f, "Cooldown between heals by interacting on the gal."); Config999GalHealAmount = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Heal Amount", 100, "Amount healed by interacting on the gal."); Config999GalHealSpeed = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Heal Speed", 10f, "Speed of healing by interacting on the gal (amount of time in seconds it for the gal to finish healing)."); Config999GalHealTotalAmount = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Healing Capacity", 200, "How much healing the SCP 999 Gal has per orbit."); Config999GalReviveCharges = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Revive Charges", 2, "How many revive charges the SCP 999 Gal has per orbit."); Config999GalCompanyMoonRecharge = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Company Moon Recharge", true, "Whether the SCP 999 Gal recharges once per visiting company moon on last day."); Config999GalFailureChance = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Failure Chance", 15f, "Failure chance of the SCP 999 Gal."); Config999GalHealOnlyInteractedPlayer = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Heal Only Interacted Player", false, "Whether the gal can heal only the player that interacts with her."); Config999GalReviveNearbyDeadPlayers = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Revive Nearby Dead Players", true, "Whether the gal can revive nearby dead bodies."); Config999GalScaleHealAndReviveWithPlayerCount = configFile.Bind("SCP 999 Gal Options", "SCP 999 Gal | Scale Heal and Revive with Player Count", true, "Whether the gal scales the heals and revives with player count."); ConfigTornadoSpeed = configFile.Bind("Tornado Options", "Tornados | Speed", 7f, new ConfigDescription("Speed of tornados.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); ConfigTornadoPullStrength = configFile.Bind("Tornado Options", "Tornados | Pull Strength", 20f, new ConfigDescription("Pull strength of tornados.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); ConfigTornadoInsideBeforeThrow = configFile.Bind("Tornado Options", "Tornados | Inside Before Throw", 10f, new ConfigDescription("Timer of being inside tornado before you get flung the hell out (50 if you never wanna be thrown).", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 50f), Array.Empty())); ConfigTornadoDefaultVolume = configFile.Bind("Tornado Options", "Tornados | Default Volume", 1f, new ConfigDescription("Default volume of tornados.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigTornadoInShipVolume = configFile.Bind("Tornado Options", "Tornados | Volume in Ship", 1f, new ConfigDescription("Volume of tornados in the ship.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigRedwoodCanEatOldBirds = configFile.Bind("Redwood Options", "Redwood | Can Eat Old Birds", true, "Whether redwood can eat old birds."); ConfigRedwoodShipPadding = configFile.Bind("Redwood Options", "Redwood | Ship Padding", 10f, new ConfigDescription("How far away the redwood usually stays from the ship.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 999f), Array.Empty())); ConfigRedwoodSpeed = configFile.Bind("Redwood Options", "Redwood | Speed", 5f, new ConfigDescription("Redwood speed.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 999f), Array.Empty())); ConfigRedwoodEyesight = configFile.Bind("Redwood Options", "Redwood | Eyesight", 40f, new ConfigDescription("Redwood eyesight.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 999f), Array.Empty())); ConfigRedwoodNormalVolume = configFile.Bind("Redwood Options", "Redwood | Normal Volume", 1f, new ConfigDescription("Redwood Normal volume.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigRedwoodHeartEnabled = configFile.Bind("Redwood Options", "Redwood | Heart Enabled", true, "Whether redwood heart is enabled."); ConfigRedwoodInShipVolume = configFile.Bind("Redwood Options", "Redwood | In Ship Volume", 0.75f, new ConfigDescription("Redwood in ship volume.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigMaxMeteorSpawnCount = configFile.Bind("MeteorShower Options", "Meteors | Max Spawn Count", 3, new ConfigDescription("Maximum number of meteors to spawn at once every spawn cycle.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 999), Array.Empty())); ConfigMinMeteorSpawnCount = configFile.Bind("MeteorShower Options", "Meteors | Min Spawn Count", 1, new ConfigDescription("Minimum number of meteors to spawn at once every spawn cycle.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 999), Array.Empty())); ConfigMeteorSpeed = configFile.Bind("MeteorShower Options", "Meteors | Speed", 50f, new ConfigDescription("Speed of meteors.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1000f), Array.Empty())); ConfigMeteorShowerTimeToLeave = configFile.Bind("MeteorShower Options", "MeteorShower | Time To Leave", 0.85f, new ConfigDescription("Normalised time it takes for the meteor shower to leave the moon, 1 being at 12PM~.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigMeteorHitShip = configFile.Bind("MeteorShower Options", "MeteorShower | Meteor Strikes Ship", false, "Allows striking the ship with a meteor."); ConfigMeteorShowerMeteoriteSpawnChance = configFile.Bind("MeteorShower Options", "MeteorShower | Meteorite Spawn Chance", 2.5f, new ConfigDescription("Chance of spawning a meteorite when a meteor is spawned (0 to 100 decimals included).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); ConfigMeteorsDefaultVolume = configFile.Bind("MeteorShower Options", "Meteors | Default Volume", 0.4f, new ConfigDescription("Default Volume of Meteors (between 0 and 1).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigMeteorShowerInShipVolume = configFile.Bind("MeteorShower Options", "MeteorShower | Meteor Volume", 0.3f, new ConfigDescription("Multiplier of the meteors volume for when the player is in the ship and the ship door is closed.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ConfigSnowGlobeMusic = configFile.Bind("SnowGlobe Options", "Snow Globe | Music", true, "Enables/Disables the music in the snow globe."); } } public class IngameKeybinds : LcInputActions { [InputAction("/r", Name = "PullChain")] public InputAction PullChain { get; set; } [InputAction("/r", Name = "JumpBoost")] public InputAction JumpBoost { get; set; } [InputAction("/r", Name = "PumpSlugger")] public InputAction PumpSlugger { get; set; } [InputAction("/r", Name = "ExhaustFuel")] public InputAction ExhaustFuel { get; set; } [InputAction("/w", Name = "HoverForward")] public InputAction HoverForward { get; set; } [InputAction("/shift", Name = "SprintForward")] public InputAction SprintForward { get; set; } [InputAction("/a", Name = "HoverLeft")] public InputAction HoverLeft { get; set; } [InputAction("/s", Name = "HoverBackward")] public InputAction HoverBackward { get; set; } [InputAction("/d", Name = "HoverRight")] public InputAction HoverRight { get; set; } [InputAction("/space", Name = "HoverUp")] public InputAction HoverUp { get; set; } [InputAction("/c", Name = "DropHoverboard")] public InputAction DropHoverboard { get; set; } [InputAction("/f", Name = "SwitchMode")] public InputAction SwitchMode { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction MouseDelta { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction MarrowHealPlayer { get; set; } } [BepInPlugin("CodeRebirth", "CodeRebirth", "1.6.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal class MainAssets : AssetBundleLoader { [LoadFromBundle("CodeRebirthUtils.prefab")] public GameObject UtilsPrefab { get; private set; } [LoadFromBundle("EmptyNetworkObject.prefab")] public GameObject EmptyNetworkObject { get; private set; } public MainAssets(AssetBundle bundle) : base(bundle) { } } internal static ManualLogSource Logger = null; internal static readonly Harmony _harmony = new Harmony("CodeRebirth"); internal static IngameKeybinds InputActionsInstance = null; internal const ulong GLITCH_STEAM_ID = 9uL; internal const int BURN_HIT_ID = 745737; public static ConfigFile configFile { get; private set; } = null; public static CodeRebirthConfig ModConfig { get; private set; } = null; public static DuskMod Mod { get; private set; } = null; public static PersistentDataContainer PersistentDataContainer { get; private set; } = null; internal static MainAssets Assets { get; private set; } = null; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; PersistentDataContainer = BepInPluginExtensions.GetPersistentDataContainer((BaseUnityPlugin)(object)this); ((DataContainer)PersistentDataContainer).Set(NamespacedKey.From("code_rebirth", "last_version"), "1.6.4"); configFile = ((BaseUnityPlugin)this).Config; ModConfig = new CodeRebirthConfig { ConfigExtendedLogging = configFile.Bind("Debug Options", "Debug Mode | Extended Logging", false, "Whether ExtendedLogging is enabled.") }; _harmony.PatchAll(typeof(PlayerControllerBPatch)); _harmony.PatchAll(typeof(EnemyAIPatch)); _harmony.PatchAll(typeof(ShovelPatch)); _harmony.PatchAll(typeof(DoorLockPatch)); _harmony.PatchAll(typeof(KeyItemPatch)); _harmony.PatchAll(typeof(RoundManagerPatch)); _harmony.PatchAll(typeof(StartOfRoundPatch)); _harmony.PatchAll(typeof(NetworkBehaviourPatch)); _harmony.PatchAll(typeof(HDAdditionalLightDataPatch)); ItemDropshipPatch.Init(); KnifeItemPatch.Init(); PlayerControllerBPatch.Init(); EnemyAIPatch.Init(); ShovelPatch.Init(); DoorLockPatch.Init(); SpikeTrapPatch.Init(); EnemyAICollisionDetectPatch.Init(); LandminePatch.Init(); ShotgunItemPatch.Init(); TurretPatch.Init(); SoccerBallPropPatch.Init(); VehicleControllerPatch.Init(); MerchantTipPad.Init(); StoatGun.Init(); CommitKeyToSave.Init(); HauntedTeddyBear.Init(); BearTrapWheelProxy.Init(); InputActionsInstance = new IngameKeybinds(); ModConfig.InitMainCodeRebirthConfig(configFile); AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "coderebirthasset"); Assets = new MainAssets(val); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); ModConfig.InitCodeRebirthConfig(configFile); Logger.LogInfo((object)"Registering CodeRebirth content."); if (OpenBodyCamCompatibilityChecker.Enabled) { OpenBodyCamCompatibilityChecker.Init(); } if (ModConfig.ConfigCleanUnusedConfigs.Value) { Logger.LogInfo((object)"Cleaning config"); ConfigFileExtensions.ClearUnusedEntries(((BaseUnityPlugin)this).Config); } ((BaseUnityPlugin)this).Config.Save(); Logger.LogInfo((object)"Plugin CodeRebirth is loaded!"); } internal static void ExtendedLogging(object text) { if (ModConfig.ConfigExtendedLogging.Value) { Logger.LogInfo(text); } } } } namespace CodeRebirth.src.Util { public enum CodeRebirthStatusEffects { None, Water, Fire, Smoke } public class CodeRebirthPlayerManager : NetworkSingleton { private bool previousDoorClosed; public static List triggersTampered = new List(); internal static Dictionary dataForPlayer = new Dictionary(); public static event EventHandler? OnDoorStateChange; public void Awake() { if ((Object)(object)StartOfRound.Instance != (Object)null) { previousDoorClosed = StartOfRound.Instance.hangarDoorsClosed; } } public void Update() { if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } if (previousDoorClosed != StartOfRound.Instance.hangarDoorsClosed) { Plugin.ExtendedLogging("Door opened/closed!!"); CodeRebirthPlayerManager.OnDoorStateChange?.Invoke(null, StartOfRound.Instance.hangarDoorsClosed); } previousDoorClosed = StartOfRound.Instance.hangarDoorsClosed; if (SlowDownEffect.isSlowDownEffectActive) { if (Object.op_Implicit((Object)(object)GameNetworkManager.Instance.localPlayerController.hoveringOverTrigger) && (Object)(object)GameNetworkManager.Instance.localPlayerController.currentTriggerInAnimationWith != (Object)null && !triggersTampered.Contains(GameNetworkManager.Instance.localPlayerController.currentTriggerInAnimationWith)) { InteractTrigger currentTriggerInAnimationWith = GameNetworkManager.Instance.localPlayerController.currentTriggerInAnimationWith; currentTriggerInAnimationWith.timeToHold /= 5f; triggersTampered.Add(GameNetworkManager.Instance.localPlayerController.currentTriggerInAnimationWith); } } else { if (triggersTampered.Count <= 0) { return; } foreach (InteractTrigger item in triggersTampered) { item.timeToHold *= 5f; } triggersTampered.Clear(); } } public static void RevivePlayer(PlayerControllerB player, Vector3 position) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (player.isPlayerDead) { if (((NetworkBehaviour)NetworkSingleton.Instance).IsHost) { NetworkSingleton.Instance.RevivePlayerClientRPC(PlayerControllerReference.op_Implicit(player), position); } else { NetworkSingleton.Instance.RevivePlayerServerRPC(PlayerControllerReference.op_Implicit(player), position); } } } [ServerRpc(RequireOwnership = false)] private void RevivePlayerServerRPC(PlayerControllerReference playerRef, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0119: 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_00d4: 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(479954577u, val, (RpcDelivery)0); bool flag = playerRef != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerRef, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 479954577u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RevivePlayerClientRPC(playerRef, position); } } [ClientRpc] private void RevivePlayerClientRPC(PlayerControllerReference playerRef, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3421960823u, val, (RpcDelivery)0); bool flag = playerRef != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerRef, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3421960823u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = PlayerControllerReference.op_Implicit(playerRef); val3.isInsideFactory = false; val3.isInElevator = true; val3.isInHangarShipRoom = true; val3.ResetPlayerBloodObjects(val3.isPlayerDead); val3.health = 5; val3.isClimbingLadder = false; val3.clampLooking = false; val3.inVehicleAnimation = false; val3.disableMoveInput = false; val3.disableLookInput = false; val3.disableInteract = false; val3.ResetZAndXRotation(); ((Collider)val3.thisController).enabled = true; if (val3.isPlayerDead) { ((Collider)val3.thisController).enabled = true; val3.isPlayerDead = false; val3.isPlayerControlled = true; val3.health = 5; val3.hasBeenCriticallyInjured = false; val3.criticallyInjured = false; val3.playerBodyAnimator.SetBool("Limp", false); val3.TeleportPlayer(position, false, 0f, false, true); val3.parentedToElevatorLastFrame = false; val3.overrideGameOverSpectatePivot = null; StartOfRound.Instance.SetPlayerObjectExtrapolate(false); val3.setPositionOfDeadPlayer = false; val3.DisablePlayerModel(((Component)val3).gameObject, true, true); ((Behaviour)val3.helmetLight).enabled = false; val3.Crouch(false); Animator playerBodyAnimator = val3.playerBodyAnimator; if (playerBodyAnimator != null) { playerBodyAnimator.SetBool("Limp", false); } val3.bleedingHeavily = false; if ((Object)(object)val3.deadBody != (Object)null) { ((Behaviour)val3.deadBody).enabled = false; ((Component)val3.deadBody).gameObject.SetActive(false); } val3.bleedingHeavily = true; val3.deadBody = null; val3.activatingItem = false; val3.twoHanded = false; val3.inShockingMinigame = false; val3.inSpecialInteractAnimation = false; val3.freeRotationInInteractAnimation = false; val3.disableSyncInAnimation = false; val3.inAnimationWithEnemy = null; val3.holdingWalkieTalkie = false; val3.speakingToWalkieTalkie = false; val3.isSinking = false; val3.isUnderwater = false; val3.sinkingValue = 0f; val3.statusEffectAudio.Stop(); val3.DisableJetpackControlsLocally(); val3.mapRadarDotAnimator.SetBool("dead", false); val3.hasBegunSpectating = false; val3.externalForceAutoFade = Vector3.zero; val3.hinderedMultiplier = 1f; val3.isMovementHindered = 0; val3.sourcesCausingSinking = 0; val3.reverbPreset = StartOfRound.Instance.shipReverb; SoundManager.Instance.earsRingingTimer = 0f; val3.voiceMuffledByEnemy = false; SoundManager.Instance.playerVoicePitchTargets[Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val3)] = 1f; SoundManager.Instance.SetPlayerPitch(1f, Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val3)); if ((Object)(object)val3.currentVoiceChatIngameSettings == (Object)null) { StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects(); } if ((Object)(object)val3.currentVoiceChatIngameSettings != (Object)null) { if ((Object)(object)val3.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { val3.currentVoiceChatIngameSettings.InitializeComponents(); } if ((Object)(object)val3.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { return; } ((Component)val3.currentVoiceChatIngameSettings.voiceAudio).GetComponent().overridingLowPass = false; } HUDManager.Instance.UpdateBoxesSpectateUI(); HUDManager.Instance.UpdateSpectateBoxSpeakerIcons(); } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val3) { val3.bleedingHeavily = false; val3.criticallyInjured = false; val3.health = 5; HUDManager.Instance.UpdateHealthUI(5, true); Animator playerBodyAnimator2 = val3.playerBodyAnimator; if (playerBodyAnimator2 != null) { playerBodyAnimator2.SetBool("Limp", false); } val3.spectatedPlayerScript = null; StartOfRound.Instance.SetSpectateCameraToGameOverMode(false, val3); StartOfRound.Instance.SetPlayerObjectExtrapolate(false); ((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false; HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); HUDManager.Instance.RemoveSpectateUI(); HUDManager.Instance.gameOverAnimator.SetTrigger("revive"); } StartOfRound.Instance.allPlayersDead = false; StartOfRound instance = StartOfRound.Instance; instance.livingPlayers++; StartOfRound.Instance.UpdatePlayerVoiceEffects(); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(479954577u, new RpcReceiveHandler(__rpc_handler_479954577), "RevivePlayerServerRPC"); ((NetworkBehaviour)this).__registerRpc(3421960823u, new RpcReceiveHandler(__rpc_handler_3421960823), "RevivePlayerClientRPC"); base.__initializeRpcs(); } private static void __rpc_handler_479954577(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_007b: 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_0099: 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(ref flag, default(ForPrimitives)); PlayerControllerReference playerRef = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); } Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthPlayerManager)(object)target).RevivePlayerServerRPC(playerRef, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3421960823(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_007b: 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_0099: 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(ref flag, default(ForPrimitives)); PlayerControllerReference playerRef = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); } Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthPlayerManager)(object)target).RevivePlayerClientRPC(playerRef, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CodeRebirthPlayerManager"; } } public class CRPlayerData { public bool Water; public bool Fire; public bool Smoke; public bool ridingHoverboard; public bool flingingAway; public bool flung; public bool pseudoDead; public bool isJumping; public Hoverboard? hoverboardRiding; public List playerColliders = new List(); } internal static class PlayerControllerBExtensions { internal enum ApplyEffectResults : sbyte { Applied, Removed, None } internal static ApplyEffectResults ApplyStatusEffect(this PlayerControllerB player, CodeRebirthStatusEffects effect, float range, float distance) { if (distance < range && !player.HasEffectActive(effect)) { player.ApplyStatusEffect(effect, isActive: true); return ApplyEffectResults.Applied; } if (distance >= range && player.HasEffectActive(effect)) { player.ApplyStatusEffect(effect, isActive: false); return ApplyEffectResults.Removed; } if (player.HasEffectActive(effect) && effect == CodeRebirthStatusEffects.Fire) { CodeRebirthUtils.Instance.FireyVolume.weight = Mathf.Clamp01(range / distance); } else if (player.HasEffectActive(effect) && effect == CodeRebirthStatusEffects.Smoke) { CodeRebirthUtils.Instance.SmokyVolume.weight = Mathf.Clamp01(range / distance); } return ApplyEffectResults.None; } internal static void ApplyStatusEffect(this PlayerControllerB player, CodeRebirthStatusEffects effect, bool isActive) { if (player.ContainsCRPlayerData()) { CRPlayerData cRPlayerData = player.GetCRPlayerData(); switch (effect) { case CodeRebirthStatusEffects.Water: cRPlayerData.Water = isActive; break; case CodeRebirthStatusEffects.Fire: CodeRebirthUtils.Instance.FireyVolume.weight = 0f; cRPlayerData.Fire = isActive; break; case CodeRebirthStatusEffects.Smoke: CodeRebirthUtils.Instance.SmokyVolume.weight = 0f; cRPlayerData.Smoke = isActive; break; } } } internal static bool HasEffectActive(this PlayerControllerB player, CodeRebirthStatusEffects effect) { if (!player.ContainsCRPlayerData()) { return false; } CRPlayerData cRPlayerData = player.GetCRPlayerData(); return effect switch { CodeRebirthStatusEffects.Water => cRPlayerData.Water, CodeRebirthStatusEffects.Fire => cRPlayerData.Fire, CodeRebirthStatusEffects.Smoke => cRPlayerData.Smoke, _ => false, }; } internal static CRPlayerData GetCRPlayerData(this PlayerControllerB player) { return CodeRebirthPlayerManager.dataForPlayer[player]; } internal static bool ContainsCRPlayerData(this PlayerControllerB player) { return CodeRebirthPlayerManager.dataForPlayer.ContainsKey(player); } internal static void AddCRPlayerData(this PlayerControllerB player) { CodeRebirthPlayerManager.dataForPlayer.Add(player, new CRPlayerData()); player.GetCRPlayerData().playerColliders = new List(((Component)player).GetComponentsInChildren()); } internal static bool IsJumping(this PlayerControllerB player) { return player.GetCRPlayerData().isJumping; } internal static void SetIsJumping(this PlayerControllerB player, bool isJumping) { player.GetCRPlayerData().isJumping = isJumping; } internal static bool IsPseudoDead(this PlayerControllerB player) { return player.GetCRPlayerData().pseudoDead; } internal static bool SetPseudoDead(this PlayerControllerB player, bool pseudoDead) { return player.GetCRPlayerData().pseudoDead = pseudoDead; } internal static Hoverboard? TryGetHoverboardRiding(this PlayerControllerB player) { return player.GetCRPlayerData().hoverboardRiding; } internal static void SetHoverboardRiding(this PlayerControllerB player, Hoverboard? hoverboard) { player.GetCRPlayerData().ridingHoverboard = Object.op_Implicit((Object)(object)hoverboard); } internal static bool IsRidingHoverboard(this PlayerControllerB player) { return player.GetCRPlayerData().ridingHoverboard; } internal static void SetRidingHoverboard(this PlayerControllerB player, bool ridingHoverboard) { player.GetCRPlayerData().ridingHoverboard = ridingHoverboard; } internal static bool HasFlung(this PlayerControllerB player) { return player.GetCRPlayerData().flung; } internal static void SetFlung(this PlayerControllerB player, bool flung) { player.GetCRPlayerData().flung = flung; } internal static bool IsFlingingAway(this PlayerControllerB player) { return player.GetCRPlayerData().flingingAway; } internal static void SetFlingingAway(this PlayerControllerB player, bool flingingAway) { player.GetCRPlayerData().flingingAway = flingingAway; } internal static IEnumerable GetPlayerColliders(this PlayerControllerB player) { return player.GetCRPlayerData().playerColliders; } } internal class CodeRebirthUtils : NetworkBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass36_0 { public NetworkObject netObj; internal bool b__0() { return netObj.IsSpawned; } } [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject go; public Quaternion rotation; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = 0.25f; break; case 2: <>1__state = -1; break; } if (5__2 > 0f) { 5__2 -= Time.deltaTime; go.transform.rotation = rotation; <>2__current = null; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkObjectReference netObjRefXuBucket; public NetworkObjectReference netObjRefDebugStick; public NetworkObjectReference netObjRefStoatGun; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 1; return true; case 1: <>1__state = -1; CRUtilities.MakePlayerGrabObject(GameNetworkManager.Instance.localPlayerController, NetworkObjectReference.op_Implicit(netObjRefXuBucket).GetComponent()); <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 2; return true; case 2: <>1__state = -1; CRUtilities.MakePlayerGrabObject(GameNetworkManager.Instance.localPlayerController, NetworkObjectReference.op_Implicit(netObjRefDebugStick).GetComponent()); <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 3; return true; case 3: <>1__state = -1; CRUtilities.MakePlayerGrabObject(GameNetworkManager.Instance.localPlayerController, NetworkObjectReference.op_Implicit(netObjRefStoatGun).GetComponent()); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabbableObject grabbableObject; public int value; private <>c__DisplayClass36_0 <>8__1; public CodeRebirthUtils <>4__this; public Quaternion rotation; public Vector3 spawnPosition; public Vector3 targetPosition; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown int num = <>1__state; CodeRebirthUtils codeRebirthUtils = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass36_0(); <>8__1.netObj = ((NetworkBehaviour)grabbableObject).NetworkObject; <>2__current = (object)new WaitUntil((Func)(() => <>8__1.netObj.IsSpawned)); <>1__state = 1; return true; case 1: { <>1__state = -1; grabbableObject.SetScrapValue(value); if (<>8__1.netObj.AutoObjectParentSync && ((NetworkBehaviour)codeRebirthUtils).IsServer) { ((Component)<>8__1.netObj).transform.SetParent(StartOfRound.Instance.propsContainer, true); } else if (!<>8__1.netObj.AutoObjectParentSync) { ((Component)<>8__1.netObj).transform.SetParent(StartOfRound.Instance.propsContainer, true); } Plugin.ExtendedLogging("This object just spawned: " + ((Object)((Component)<>8__1.netObj).gameObject).name); ((MonoBehaviour)codeRebirthUtils).StartCoroutine(codeRebirthUtils.ForceRotationForABit(((Component)<>8__1.netObj).gameObject, rotation)); ScanNodeProperties componentInChildren = ((Component)grabbableObject).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.scrapValue = value; componentInChildren.subText = $"Value: ${value}"; grabbableObject.scrapValue = value; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; } case 2: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 3; return true; case 3: { <>1__state = -1; RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)grabbableObject.scrapValue; grabbableObject.startFallingPosition = StartOfRound.Instance.propsContainer.InverseTransformPoint(spawnPosition); grabbableObject.targetFloorPosition = StartOfRound.Instance.propsContainer.InverseTransformPoint(targetPosition); grabbableObject.InitializeAfterPositioning(); grabbableObject.EnableItemMeshes(true); grabbableObject.EnablePhysics(true); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Material WireframeMaterial; public Shader SeeThroughShader; public Volume FireyVolume; public Volume SmokyVolume; public Volume CloseEyeVolume; public AnimationClip ModifiedDangerousShipLeaveAnimation; internal ShipAnimator shipAnimator; internal static HashSet<(Light light, HDAdditionalLightData hDAdditionalLightData)> currentRoundLightData = new HashSet<(Light, HDAdditionalLightData)>(); internal Dictionary enemyCoinDropRate = new Dictionary(); internal Random CRRandom = new Random(); private int _indexToSpawn; internal static CodeRebirthUtils Instance { get; private set; } = null; public override void OnNetworkSpawn() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00c7: 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) ((NetworkBehaviour)this).OnNetworkSpawn(); ((Component)this).gameObject.AddComponent(); if (ContentHandler.Instance.DevTools != null && Plugin.ModConfig.ConfigDebugMode.Value && ((NetworkBehaviour)this).IsHost) { NetworkObjectReference netObjRefXuBucket = SpawnScrap(((Registry)(object)LethalContent.Items)[CodeRebirthItemKeys.CrispXuBuck].Item, Vector3.zero); NetworkObjectReference netObjRefDebugStick = SpawnScrap(((Registry)(object)LethalContent.Items)[CodeRebirthItemKeys.DebugStick].Item, Vector3.zero); NetworkObjectReference netObjRefStoatGun = SpawnScrap(((Registry)(object)LethalContent.Items)[CodeRebirthItemKeys.StoatGun].Item, Vector3.zero); ((MonoBehaviour)this).StartCoroutine(GiveItemsToPlayer(netObjRefDebugStick, netObjRefXuBucket, netObjRefStoatGun)); } Instance = this; HandleEnemyDropRates(); CRRandom = new Random(StartOfRound.Instance.randomMapSeed + 69); shipAnimator = ((Component)StartOfRound.Instance.shipAnimatorObject).gameObject.AddComponent(); } [IteratorStateMachine(typeof(d__15))] private IEnumerator GiveItemsToPlayer(NetworkObjectReference netObjRefDebugStick, NetworkObjectReference netObjRefXuBucket, NetworkObjectReference netObjRefStoatGun) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { netObjRefDebugStick = netObjRefDebugStick, netObjRefXuBucket = netObjRefXuBucket, netObjRefStoatGun = netObjRefStoatGun }; } private void HandleEnemyDropRates() { if (ContentHandler.Instance.Merchant == null) { return; } IEnumerable enumerable = from s in ((AssetBundleLoader)(object)ContentHandler.Instance.Merchant).GetConfig("Money | Enemy Drop Rates").Value.Split(',') select s.Trim(); foreach (string item in enumerable) { string[] split = item.Split(':'); DawnEnemyInfo? obj = ((Registry)(object)LethalContent.Enemies).Values.FirstOrDefault((Func)((DawnEnemyInfo et) => (Object)(object)et.EnemyType != (Object)null && !string.IsNullOrEmpty(et.EnemyType.enemyName) && et.EnemyType.enemyName.Equals(split[0], StringComparison.OrdinalIgnoreCase))); EnemyType val = ((obj != null) ? obj.EnemyType : null); if ((Object)(object)val == (Object)null) { Plugin.Logger.LogWarning((object)("Couldn't find enemy of name '" + split[0] + "' for the money drop rate config!")); continue; } float num = float.Parse(split[1], NumberStyles.Float, CultureInfo.InvariantCulture); Plugin.ExtendedLogging($"{val.enemyName} has a drop rate of {num}"); enemyCoinDropRate.Add(val, num); } } public void PlayerPressedJump(PlayerControllerB player) { player.SetIsJumping(isJumping: true); foreach (Mountaineer instance in Mountaineer.Instances) { instance.JumpActionTriggered(player); } } public void PlayerPressedInteract(PlayerControllerB player) { foreach (Mountaineer instance in Mountaineer.Instances) { instance.InteractActionTriggered(player); } } [ServerRpc(RequireOwnership = false)] public void DamagePlayerOnOwnerServerRpc(PlayerControllerReference playerControllerB, int damageAmount, bool hasDamageSFX, int causeOfDeathInt, int deathAnimationInt, bool fallDamage, Vector3 force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1688454542u, val, (RpcDelivery)0); bool flag = playerControllerB != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } BytePacker.WriteValueBitPacked(val2, damageAmount); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref hasDamageSFX, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, causeOfDeathInt); BytePacker.WriteValueBitPacked(val2, deathAnimationInt); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fallDamage, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1688454542u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DamagePlayerOnOwnerClientRpc(playerControllerB, damageAmount, hasDamageSFX, causeOfDeathInt, deathAnimationInt, fallDamage, force); } } [ClientRpc] public void DamagePlayerOnOwnerClientRpc(PlayerControllerReference playerControllerB, int damageAmount, bool hasDamageSFX, int causeOfDeathInt, int deathAnimationInt, bool fallDamage, Vector3 force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1857569153u, val, (RpcDelivery)0); bool flag = playerControllerB != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } BytePacker.WriteValueBitPacked(val2, damageAmount); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref hasDamageSFX, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, causeOfDeathInt); BytePacker.WriteValueBitPacked(val2, deathAnimationInt); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fallDamage, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1857569153u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerBeingDamaged = PlayerControllerReference.op_Implicit(playerControllerB); DamagePlayerOnOwner(playerBeingDamaged, damageAmount, hasDamageSFX, causeOfDeathInt, deathAnimationInt, fallDamage, force); } } private void DamagePlayerOnOwner(PlayerControllerB playerBeingDamaged, int damageNumber, bool hasDamageSFX, int causeOfDeathInt, int deathAnimationInt, bool fallDamage, Vector3 force) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) playerBeingDamaged.DamagePlayer(damageNumber, hasDamageSFX, true, (CauseOfDeath)causeOfDeathInt, deathAnimationInt, fallDamage, force); } [ServerRpc(RequireOwnership = false)] public void KillPlayerOnOwnerServerRpc(PlayerControllerReference playerControllerB, bool spawnBody, int causeOfDeathInt, int deathAnimationInt, Vector3 positionOffset) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_014e: 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_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(211212839u, val, (RpcDelivery)0); bool flag = playerControllerB != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnBody, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, causeOfDeathInt); BytePacker.WriteValueBitPacked(val2, deathAnimationInt); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref positionOffset); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 211212839u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; KillPlayerOnOwnerClientRpc(playerControllerB, spawnBody, causeOfDeathInt, deathAnimationInt, positionOffset); } } [ClientRpc] public void KillPlayerOnOwnerClientRpc(PlayerControllerReference playerControllerB, bool spawnBody, int causeOfDeathInt, int deathAnimationInt, Vector3 positionOffset) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2817038314u, val, (RpcDelivery)0); bool flag = playerControllerB != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnBody, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, causeOfDeathInt); BytePacker.WriteValueBitPacked(val2, deathAnimationInt); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref positionOffset); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2817038314u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerBeingDamaged = PlayerControllerReference.op_Implicit(playerControllerB); KillPlayerOnOwner(playerBeingDamaged, spawnBody, causeOfDeathInt, deathAnimationInt, positionOffset); } } private void KillPlayerOnOwner(PlayerControllerB playerBeingDamaged, bool spawnBody, int causeOfDeathInt, int deathAnimationInt, Vector3 positionOffset) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) playerBeingDamaged.KillPlayer(playerBeingDamaged.velocityLastFrame, spawnBody, (CauseOfDeath)causeOfDeathInt, deathAnimationInt, positionOffset, false); } [ServerRpc(RequireOwnership = false)] public void KillEnemyOnOwnerServerRpc(NetworkBehaviourReference networkBehaviourReference, bool overrideDestroy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1711953430u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref networkBehaviourReference, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref overrideDestroy, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1711953430u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; KillEnemyOnOwnerClientRpc(networkBehaviourReference, overrideDestroy); } } } [ClientRpc] public void KillEnemyOnOwnerClientRpc(NetworkBehaviourReference networkBehaviourReference, bool overrideDestroy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(888264829u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref networkBehaviourReference, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref overrideDestroy, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 888264829u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; EnemyAI enemyAI = (EnemyAI)NetworkBehaviourReference.op_Implicit(networkBehaviourReference); KillEnemyOnOwner(enemyAI, overrideDestroy); } } } private void KillEnemyOnOwner(EnemyAI enemyAI, bool overrideDestroy) { if (((NetworkBehaviour)enemyAI).IsOwner) { enemyAI.KillEnemyOnOwnerClient(overrideDestroy); } } public void SpawnFakeSnailCat(PlayerControllerB lastOwner, Vector3 originalScale, string currentName, float shiftHash) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) NetworkObjectReference val = Instance.SpawnScrap(((Registry)(object)LethalContent.Items)[CodeRebirthItemKeys.FakeSnailCat].Item, ((Component)this).transform.position); FakeSnailCat component = ((Component)NetworkObjectReference.op_Implicit(val)).GetComponent(); component.lastOwner = lastOwner; component.localScale = originalScale; component.snailCatName = currentName; component.shiftHash = shiftHash; } [ServerRpc(RequireOwnership = false)] public void ReactToVehicleCollisionServerRpc(int obstacleId) { //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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3828865599u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, obstacleId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3828865599u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ReactToVehicleCollisionClientRpc(obstacleId); } } } [ClientRpc] public void ReactToVehicleCollisionClientRpc(int obstacleId) { //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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(887194317u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, obstacleId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 887194317u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (ReactToVehicleCollision.TryGetById(obstacleId, out ReactToVehicleCollision result) && (Object)(object)result != (Object)null) { result.InvokeCollisionEvent(); } else { Plugin.Logger.LogError((object)$"ReactToVehicleCollision with ID {obstacleId} not found!"); } } } [ServerRpc(RequireOwnership = false)] public void SpawnRandomCRHazardServerRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1740053690u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1740053690u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; Plugin.ExtendedLogging("Spawning CR Hazard with index: " + _indexToSpawn); if (position == Vector3.zero) { Plugin.Logger.LogError((object)"Trying to spawn a hazard at Vector3.zero!"); return; } List list = ((Registry)(object)LethalContent.MapObjects).Values.ToList(); GameObject mapObjectPrefab = list[_indexToSpawn].GetMapObjectPrefab(); if ((Object)(object)mapObjectPrefab != (Object)null) { GameObject val3 = Object.Instantiate(mapObjectPrefab, position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); NetworkObject val4 = default(NetworkObject); if (val3.TryGetComponent(ref val4)) { val4.Spawn(true); } } _indexToSpawn++; if (_indexToSpawn >= list.Count - 1) { _indexToSpawn = 0; } } [ServerRpc(RequireOwnership = false)] public void SpawnScrapServerRpc(NamespacedKey itemKey, Vector3 position, bool isQuest = false, bool defaultRotation = true, int valueIncrease = 0) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2374463835u, val, (RpcDelivery)0); bool flag = itemKey != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe>(ref itemKey, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isQuest, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref defaultRotation, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, valueIncrease); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2374463835u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DawnItemInfo val3 = default(DawnItemInfo); if (!((Registry)(object)LethalContent.Items).TryGetValue(itemKey, ref val3)) { Plugin.Logger.LogError((object)$"'{itemKey}' is not registered through DawnLib!"); } else { SpawnScrap(val3.Item, position, isQuest, defaultRotation, valueIncrease); } } } public NetworkObjectReference SpawnScrap(Item? item, Vector3 position, bool isQuest = false, bool defaultRotation = true, int valueIncrease = 0, Quaternion rotation = default(Quaternion)) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00c2: 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_00c8: 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_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_006d: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)item == (Object)null) { return default(NetworkObjectReference); } Vector3 val = position; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(position + Vector3.up * 1f, Vector3.down, ref val2, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val2)).point + Vector3.up * item.verticalOffset; } GameObject val3 = Object.Instantiate(item.spawnPrefab, val, Quaternion.identity, (Transform)null); GrabbableObject component = val3.GetComponent(); NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject; networkObject.Spawn(false); int value = (int)((float)Random.Range(item.minValue, item.maxValue) * RoundManager.Instance.scrapValueMultiplier) + valueIncrease; SyncScanNodeParentRotationsAndFallRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)component), position, val, defaultRotation ? Quaternion.Euler(item.restingRotation) : rotation, value); if (isQuest) { StartUIForItemServerRpc(NetworkObjectReference.op_Implicit(val3)); } return new NetworkObjectReference(val3); } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncScanNodeParentRotationsAndFallRpc(NetworkBehaviourReference grabbableObjectReference, Vector3 spawnPosition, Vector3 targetPosition, Quaternion rotation, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { DeferLocal = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3739297622u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref grabbableObjectReference, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref spawnPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref targetPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); BytePacker.WriteValueBitPacked(val3, value); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3739297622u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(SyncScanNodeParentRotationsAndFall((GrabbableObject)NetworkBehaviourReference.op_Implicit(grabbableObjectReference), spawnPosition, targetPosition, rotation, value)); } } } [IteratorStateMachine(typeof(d__36))] private IEnumerator SyncScanNodeParentRotationsAndFall(GrabbableObject grabbableObject, Vector3 spawnPosition, Vector3 targetPosition, Quaternion rotation, int value) { //IL_0015: 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_001c: 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_0023: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this, grabbableObject = grabbableObject, spawnPosition = spawnPosition, targetPosition = targetPosition, rotation = rotation, value = value }; } [IteratorStateMachine(typeof(d__37))] private IEnumerator ForceRotationForABit(GameObject go, Quaternion rotation) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { go = go, rotation = rotation }; } [ServerRpc(RequireOwnership = false)] public void StartUIForItemServerRpc(NetworkObjectReference go) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(691221269u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref go, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 691221269u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartUIForItemClientRpc(go); } } } [ClientRpc] public void StartUIForItemClientRpc(NetworkObjectReference go) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2626002385u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref go, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2626002385u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DuckUI.Instance.itemUI.StartUIforItem(NetworkObjectReference.op_Implicit(go).GetComponent()); NetworkObjectReference.op_Implicit(go).AddComponent(); } } } public T? CreateFallingObject(GameObject prefab, Vector3 origin, Vector3 target, float speed) where T : FallingObjectBehaviour { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Plugin.ExtendedLogging($"creating falling object: {((Object)prefab).name} going from {origin} to {target}"); GameObject val = Object.Instantiate(prefab, origin, Quaternion.identity); T fallingObjectBehaviour = val.GetComponent(); if ((Object)(object)fallingObjectBehaviour == (Object)null) { Plugin.Logger.LogError((object)$"FallingObjectBehaviour Component on GameObject: {prefab} does not exist."); return null; } NetworkObjectExtensions.OnSpawn(((NetworkBehaviour)fallingObjectBehaviour).NetworkObject, (Action)delegate { //IL_000c: 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) fallingObjectBehaviour.SetupFallingObjectServerRpc(origin, target, speed); }); ((NetworkBehaviour)fallingObjectBehaviour).NetworkObject.Spawn(false); return fallingObjectBehaviour; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1688454542u, new RpcReceiveHandler(__rpc_handler_1688454542), "DamagePlayerOnOwnerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1857569153u, new RpcReceiveHandler(__rpc_handler_1857569153), "DamagePlayerOnOwnerClientRpc"); ((NetworkBehaviour)this).__registerRpc(211212839u, new RpcReceiveHandler(__rpc_handler_211212839), "KillPlayerOnOwnerServerRpc"); ((NetworkBehaviour)this).__registerRpc(2817038314u, new RpcReceiveHandler(__rpc_handler_2817038314), "KillPlayerOnOwnerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1711953430u, new RpcReceiveHandler(__rpc_handler_1711953430), "KillEnemyOnOwnerServerRpc"); ((NetworkBehaviour)this).__registerRpc(888264829u, new RpcReceiveHandler(__rpc_handler_888264829), "KillEnemyOnOwnerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3828865599u, new RpcReceiveHandler(__rpc_handler_3828865599), "ReactToVehicleCollisionServerRpc"); ((NetworkBehaviour)this).__registerRpc(887194317u, new RpcReceiveHandler(__rpc_handler_887194317), "ReactToVehicleCollisionClientRpc"); ((NetworkBehaviour)this).__registerRpc(1740053690u, new RpcReceiveHandler(__rpc_handler_1740053690), "SpawnRandomCRHazardServerRpc"); ((NetworkBehaviour)this).__registerRpc(2374463835u, new RpcReceiveHandler(__rpc_handler_2374463835), "SpawnScrapServerRpc"); ((NetworkBehaviour)this).__registerRpc(3739297622u, new RpcReceiveHandler(__rpc_handler_3739297622), "SyncScanNodeParentRotationsAndFallRpc"); ((NetworkBehaviour)this).__registerRpc(691221269u, new RpcReceiveHandler(__rpc_handler_691221269), "StartUIForItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2626002385u, new RpcReceiveHandler(__rpc_handler_2626002385), "StartUIForItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1688454542(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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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(ref flag, default(ForPrimitives)); PlayerControllerReference playerControllerB = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } int damageAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damageAmount); bool hasDamageSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hasDamageSFX, default(ForPrimitives)); int causeOfDeathInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeathInt); int deathAnimationInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref deathAnimationInt); bool fallDamage = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fallDamage, default(ForPrimitives)); Vector3 force = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).DamagePlayerOnOwnerServerRpc(playerControllerB, damageAmount, hasDamageSFX, causeOfDeathInt, deathAnimationInt, fallDamage, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1857569153(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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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(ref flag, default(ForPrimitives)); PlayerControllerReference playerControllerB = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } int damageAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damageAmount); bool hasDamageSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hasDamageSFX, default(ForPrimitives)); int causeOfDeathInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeathInt); int deathAnimationInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref deathAnimationInt); bool fallDamage = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fallDamage, default(ForPrimitives)); Vector3 force = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).DamagePlayerOnOwnerClientRpc(playerControllerB, damageAmount, hasDamageSFX, causeOfDeathInt, deathAnimationInt, fallDamage, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_211212839(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_0083: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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(ref flag, default(ForPrimitives)); PlayerControllerReference playerControllerB = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } bool spawnBody = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnBody, default(ForPrimitives)); int causeOfDeathInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeathInt); int deathAnimationInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref deathAnimationInt); Vector3 positionOffset = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref positionOffset); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).KillPlayerOnOwnerServerRpc(playerControllerB, spawnBody, causeOfDeathInt, deathAnimationInt, positionOffset); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2817038314(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_0083: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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(ref flag, default(ForPrimitives)); PlayerControllerReference playerControllerB = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerControllerB, default(ForNetworkSerializable)); } bool spawnBody = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnBody, default(ForPrimitives)); int causeOfDeathInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeathInt); int deathAnimationInt = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref deathAnimationInt); Vector3 positionOffset = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref positionOffset); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).KillPlayerOnOwnerClientRpc(playerControllerB, spawnBody, causeOfDeathInt, deathAnimationInt, positionOffset); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1711953430(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference networkBehaviourReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref networkBehaviourReference, default(ForNetworkSerializable)); bool overrideDestroy = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overrideDestroy, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).KillEnemyOnOwnerServerRpc(networkBehaviourReference, overrideDestroy); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_888264829(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference networkBehaviourReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref networkBehaviourReference, default(ForNetworkSerializable)); bool overrideDestroy = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overrideDestroy, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).KillEnemyOnOwnerClientRpc(networkBehaviourReference, overrideDestroy); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3828865599(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 obstacleId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref obstacleId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).ReactToVehicleCollisionServerRpc(obstacleId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_887194317(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 obstacleId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref obstacleId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).ReactToVehicleCollisionClientRpc(obstacleId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1740053690(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).SpawnRandomCRHazardServerRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2374463835(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_0081: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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(ref flag, default(ForPrimitives)); NamespacedKey itemKey = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe>(ref itemKey, default(ForNetworkSerializable)); } Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool isQuest = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isQuest, default(ForPrimitives)); bool defaultRotation = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref defaultRotation, default(ForPrimitives)); int valueIncrease = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref valueIncrease); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).SpawnScrapServerRpc(itemKey, position, isQuest, defaultRotation, valueIncrease); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3739297622(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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference grabbableObjectReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref grabbableObjectReference, default(ForNetworkSerializable)); Vector3 spawnPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPosition); Vector3 targetPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).SyncScanNodeParentRotationsAndFallRpc(grabbableObjectReference, spawnPosition, targetPosition, rotation, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_691221269(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_004f: 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) { NetworkObjectReference go = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref go, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).StartUIForItemServerRpc(go); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2626002385(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_004f: 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) { NetworkObjectReference go = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref go, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CodeRebirthUtils)(object)target).StartUIForItemClientRpc(go); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CodeRebirthUtils"; } } } namespace CodeRebirth.src.Util.Timer { public enum TimerExecutionTime { Update, FixedUpdate, LateUpdate } public class TimerCreateParams { public float duration; public TimerExecutionTime executionTime; public bool loop; public TimerCreateParams(float duration, TimerExecutionTime executionTime, bool loop) { this.duration = duration; this.executionTime = executionTime; this.loop = loop; base..ctor(); } } public class Timer { public TimerExecutionTime executionTime; private Func _conditionalUpdate = () => true; public float Elapsed { get; private set; } public float Duration { get; private set; } public bool IsPaused { get; private set; } = true; public bool IsFinished { get; private set; } public bool IsLooping { get; private set; } public bool IsRunning { get { if (!IsPaused) { return !IsFinished; } return false; } } public float NormalizedProgress => Mathf.Clamp01(Elapsed / Duration); public Func ConditionalUpdate { get { return _conditionalUpdate; } set { _conditionalUpdate = value ?? _conditionalUpdate; } } public event Action OnStart; public event Action OnUpdate; public event Action OnFinish; public Timer(TimerCreateParams createParams) : this(createParams.duration, createParams.executionTime, createParams.loop) { } public Timer(float duration, TimerExecutionTime executionTime, bool loop = false, bool autostart = false) { Duration = duration; this.executionTime = executionTime; IsLooping = loop; Elapsed = 0f; IsPaused = true; if (autostart) { Start(); } } public static Timer CreateTimer(TimerCreateParams createParams, Action onStart, Action onUpdate, Action onFinish) { Timer timer = new Timer(createParams); timer.OnStart += onStart; timer.OnUpdate += onUpdate; timer.OnFinish += onFinish; return timer; } public static Timer CreateAutoTimer(TimerCreateParams createParams, Action onStart, Action onUpdate, Action onFinish) { Timer timer = CreateTimer(createParams, onStart, onUpdate, onFinish); timer.Start(); return timer; } public void Start() { if (IsPaused) { IsPaused = false; IsFinished = false; this.OnStart?.Invoke(this); Singleton.Instance?.RegisterTimer(this); } } public void Pause() { if (!IsPaused) { IsPaused = true; } } public void Stop() { IsPaused = true; Elapsed = 0f; Singleton.Instance?.UnRegisterTimer(this); } public void Reset() { Elapsed = 0f; } public void Restart() { Elapsed = 0f; Start(); } public void SetDuration(float duration) { Duration = duration; } public void Update(float deltaTime) { if (!_conditionalUpdate() || IsPaused || IsFinished) { return; } Elapsed += deltaTime; if (Elapsed > Duration) { Elapsed = Duration; } this.OnUpdate?.Invoke(this); if (Elapsed >= Duration) { this.OnFinish?.Invoke(this); if (IsLooping) { Elapsed -= Duration; IsFinished = false; this.OnStart?.Invoke(this); } else { Elapsed = Duration; IsFinished = true; Singleton.Instance?.UnRegisterTimer(this); } } } } public class TimerExecutor : Singleton { public readonly HashSet ActiveTimers = new HashSet(); public readonly List UpdateTimers = new List(); public readonly List FixedUpdateTimers = new List(); public readonly List LateUpdateTimers = new List(); public void RegisterTimer(Timer timer) { if (ActiveTimers.Add(timer)) { switch (timer.executionTime) { case TimerExecutionTime.Update: UpdateTimers.Add(timer); break; case TimerExecutionTime.FixedUpdate: FixedUpdateTimers.Add(timer); break; case TimerExecutionTime.LateUpdate: LateUpdateTimers.Add(timer); break; } } } public void UnRegisterTimer(Timer timer) { ActiveTimers.Remove(timer); UpdateTimers.Remove(timer); FixedUpdateTimers.Remove(timer); LateUpdateTimers.Remove(timer); } private void Update() { RunTimers(UpdateTimers, Time.deltaTime); } private void FixedUpdate() { RunTimers(FixedUpdateTimers, Time.fixedDeltaTime); } private void LateUpdate() { RunTimers(LateUpdateTimers, Time.deltaTime); } private void RunTimers(List timerList, float delta) { for (int num = timerList.Count - 1; num >= 0; num--) { Timer timer = timerList[num]; try { timer.Update(delta); if (timer.IsFinished) { UnRegisterTimer(timer); } } catch (Exception ex) { Plugin.Logger.LogError((object)$"[TimerSystem]: {timer} failed during update: {ex.Message}\n{ex.StackTrace}"); UnRegisterTimer(timer); } } } } } namespace CodeRebirth.src.Util.Extensions { public static class GameObjectUtils { public static bool RequiresComponent(this GameObject gameObject, Type componentType) { Component[] components = gameObject.GetComponents(); foreach (Component val in components) { object[] customAttributes = ((object)val).GetType().GetCustomAttributes(inherit: true); foreach (object obj in customAttributes) { RequireComponent val2 = (RequireComponent)((obj is RequireComponent) ? obj : null); if (val2 == null) { continue; } Type type = val2.m_Type0; if ((object)type == null || !type.IsAssignableFrom(componentType)) { Type type2 = val2.m_Type1; if ((object)type2 == null || !type2.IsAssignableFrom(componentType)) { Type type3 = val2.m_Type2; if ((object)type3 == null || !type3.IsAssignableFrom(componentType)) { continue; } } } return true; } } return false; } } public static class NetworkAnimatorExtensions { public static void SetTriggerOnServer(this NetworkAnimator animator, string triggerName) { if (NetworkManager.Singleton.IsServer) { animator.SetTrigger(triggerName); } } public static void SetTriggerOnServer(this NetworkAnimator animator, int triggerHash) { if (NetworkManager.Singleton.IsServer) { animator.SetTrigger(triggerHash, true); } } } } namespace CodeRebirth.src.Patches { public static class DoorLockPatch { [CompilerGenerated] private static class <>O { public static hook_OnTriggerStay <0>__DoorLock_OnTriggerStay; } 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>__DoorLock_OnTriggerStay; if (obj == null) { hook_OnTriggerStay val = DoorLock_OnTriggerStay; <>O.<0>__DoorLock_OnTriggerStay = val; obj = (object)val; } DoorLock.OnTriggerStay += (hook_OnTriggerStay)obj; } private static void DoorLock_OnTriggerStay(orig_OnTriggerStay orig, DoorLock self, Collider other) { if (!((Object)(object)NetworkManager.Singleton == (Object)null) && ((NetworkBehaviour)self).IsServer && !self.isLocked && !self.isDoorOpened) { if (((Component)other).gameObject.layer == 19 && ((Object)((Component)other).gameObject).name == "DoorCollider") { self.enemyDoorMeter += Time.deltaTime * 0.5f; if (self.enemyDoorMeter > 1f) { self.enemyDoorMeter = 0f; ((Component)self).gameObject.GetComponent().TriggerAnimationNonPlayer(false, true, false); self.OpenDoorAsEnemyServerRpc(); } } else if (((Component)other).gameObject.layer == 19 && ((Object)((Component)other).gameObject).name == "ShockwaveGalDoorCollider") { float num = 0f; GalAI component = ((Component)((Component)other).gameObject.transform.parent).GetComponent(); if ((Object)(object)component != (Object)null) { num = component.DoorOpeningSpeed; } self.enemyDoorMeter += Time.deltaTime * num; if (self.enemyDoorMeter > 1f) { self.enemyDoorMeter = 0f; ((Component)self).gameObject.GetComponent().TriggerAnimationNonPlayer(false, true, false); self.OpenDoorAsEnemyServerRpc(); } } else if (((Component)other).gameObject.layer == 19 && ((Object)((Component)other).gameObject).name == "MicrowaveCollider") { self.enemyDoorMeter += Time.deltaTime * 0.5f; if (self.enemyDoorMeter > 1f) { self.enemyDoorMeter = 0f; ((Component)self).gameObject.GetComponent().TriggerAnimationNonPlayer(false, true, false); self.OpenDoorAsEnemyServerRpc(); } } } orig.Invoke(self, other); } } public static class EnemyAICollisionDetectPatch { [CompilerGenerated] private static class <>O { public static hook_IHittable_Hit <0>__EnemyAICollisionDetect_IHittable_Hit; } 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>__EnemyAICollisionDetect_IHittable_Hit; if (obj == null) { hook_IHittable_Hit val = EnemyAICollisionDetect_IHittable_Hit; <>O.<0>__EnemyAICollisionDetect_IHittable_Hit = val; obj = (object)val; } EnemyAICollisionDetect.IHittable_Hit += (hook_IHittable_Hit)obj; } private static bool EnemyAICollisionDetect_IHittable_Hit(orig_IHittable_Hit orig, EnemyAICollisionDetect self, int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit.currentlyHeldObjectServer != (Object)null && playerWhoHit.currentlyHeldObjectServer is ScaryShrimp scaryShrimp) { if (scaryShrimp.hitEnemy.Value == 1) { return false; } scaryShrimp.hitEnemy.Value = 1; scaryShrimp.PastHitEnemyServerRpc(self.mainScript.enemyHP); self.mainScript.HitEnemyOnLocalClient(3, hitDirection, playerWhoHit, playHitSFX, hitID); return false; } if ((Object)(object)playerWhoHit != (Object)null) { foreach (PeaceKeeper instance in PeaceKeeper.Instances) { instance.AlertPeaceKeeperToLocalPlayer(playerWhoHit); } } return orig.Invoke(self, force, hitDirection, playerWhoHit, playHitSFX, hitID); } } internal static class EnemyAIPatch { [CompilerGenerated] private static class <>O { public static hook_Start <0>__EnemyAI_Start; public static hook_HitEnemy <1>__EnemyAI_HitEnemy; public static hook_KillEnemy <2>__EnemyAI_KillEnemy; public static hook_Update <3>__EnemyAI_Update; public static hook_OnCollideWithPlayer <4>__EnemyAI_OnCollideWithPlayer; } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI self; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(4f); <>1__state = 1; return true; case 1: <>1__state = -1; _slowedEnemies.Remove(self); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Dictionary _slowedEnemies = new Dictionary(); 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0050: 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_005b: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //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_009b: Expected O, but got Unknown object obj = <>O.<0>__EnemyAI_Start; if (obj == null) { hook_Start val = EnemyAI_Start; <>O.<0>__EnemyAI_Start = val; obj = (object)val; } EnemyAI.Start += (hook_Start)obj; object obj2 = <>O.<1>__EnemyAI_HitEnemy; if (obj2 == null) { hook_HitEnemy val2 = EnemyAI_HitEnemy; <>O.<1>__EnemyAI_HitEnemy = val2; obj2 = (object)val2; } EnemyAI.HitEnemy += (hook_HitEnemy)obj2; object obj3 = <>O.<2>__EnemyAI_KillEnemy; if (obj3 == null) { hook_KillEnemy val3 = EnemyAI_KillEnemy; <>O.<2>__EnemyAI_KillEnemy = val3; obj3 = (object)val3; } EnemyAI.KillEnemy += (hook_KillEnemy)obj3; object obj4 = <>O.<3>__EnemyAI_Update; if (obj4 == null) { hook_Update val4 = EnemyAI_Update; <>O.<3>__EnemyAI_Update = val4; obj4 = (object)val4; } EnemyAI.Update += (hook_Update)obj4; object obj5 = <>O.<4>__EnemyAI_OnCollideWithPlayer; if (obj5 == null) { hook_OnCollideWithPlayer val5 = EnemyAI_OnCollideWithPlayer; <>O.<4>__EnemyAI_OnCollideWithPlayer = val5; obj5 = (object)val5; } EnemyAI.OnCollideWithPlayer += (hook_OnCollideWithPlayer)obj5; } private static void EnemyAI_KillEnemy(orig_KillEnemy orig, EnemyAI self, bool destroy) { //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) orig.Invoke(self, destroy); DawnEnemyAdditionalData val = DawnEnemyAdditionalData.CreateOrGet(self); if (self.isEnemyDead && val.KilledByPlayer && CodeRebirthUtils.Instance.enemyCoinDropRate.TryGetValue(self.enemyType, out var value)) { float num = value; Plugin.ExtendedLogging($"Rolling to drop coin {num}"); DawnMapObjectInfo val2 = default(DawnMapObjectInfo); if (NetworkManager.Singleton.IsServer && !(Random.Range(0f, 100f) >= num) && ((Registry)(object)LethalContent.MapObjects).TryGetValue(CodeRebirthMapObjectKeys.Coin, ref val2)) { GameObject val3 = Object.Instantiate(val2.GetMapObjectPrefab(), ((Component)self).transform.position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); val3.GetComponent().Spawn(true); } } } private static void EnemyAI_OnCollideWithPlayer(orig_OnCollideWithPlayer orig, EnemyAI self, Collider other) { //IL_00c7: 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) PuppeteersVoodoo puppeteersVoodoo = default(PuppeteersVoodoo); if (((Component)other).gameObject.layer != 19 || self.isEnemyDead || !((NetworkBehaviour)self).IsServer || self is Puppeteer || !((Component)self).TryGetComponent(ref puppeteersVoodoo)) { orig.Invoke(self, other); } else { if (puppeteersVoodoo.lastTimeTakenDamageFromEnemy <= 1f) { return; } foreach (string blacklistedEnemy in puppeteersVoodoo.blacklistedEnemies) { if (self.enemyType.enemyName.ToLowerInvariant().Equals(blacklistedEnemy)) { return; } } if (self.enemyType.enemyName.Contains("SCP-999")) { puppeteersVoodoo.Hit(-1, ((Component)self).transform.position); } else { puppeteersVoodoo.Hit(1, ((Component)self).transform.position); } } } private static void EnemyAI_Start(orig_Start orig, EnemyAI self) { EnemyAI self2 = self; orig.Invoke(self2); if (self2 is CaveDwellerAI) { ((Component)((Component)self2).gameObject.transform.Find("BabyMeshContainer").Find("BabyManeaterMesh")).gameObject.layer = 19; } if (!StartOfRound.Instance.inShipPhase && RoundManager.Instance.currentLevel.sceneName.Equals("Oxyde")) { self2.SetEnemyOutside(true); GameObject val = RoundManager.Instance.outsideAINodes.OrderBy((GameObject x) => Vector3.Distance(x.transform.position, ((Component)self2).transform.position)).FirstOrDefault(); if (!((Object)(object)val == (Object)null)) { self2.favoriteSpot = val.transform; } } } private static void EnemyAI_Update(orig_Update orig, EnemyAI self) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (_slowedEnemies.TryGetValue(self, out Coroutine _)) { self.agent.velocity = Vector3.zero; } } private static void EnemyAI_HitEnemy(orig_HitEnemy orig, EnemyAI self, int force, PlayerControllerB? playerWhoHit, bool playHitSFX, int hitID) { if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit.currentlyHeldObjectServer != (Object)null && (Object)(object)playerWhoHit.currentlyHeldObjectServer.itemProperties != (Object)null && playerWhoHit.currentlyHeldObjectServer.itemProperties.isDefensiveWeapon && playerWhoHit.currentlyHeldObjectServer is Mountaineer mountaineer && RandomExtensions.NextFloat(CodeRebirthUtils.Instance.CRRandom, 0f, 100f) <= mountaineer.FreezePercentile) { Plugin.ExtendedLogging("Slowed enemy"); if (_slowedEnemies.ContainsKey(self) && _slowedEnemies[self] != null) { ((MonoBehaviour)self).StopCoroutine(_slowedEnemies[self]); } _slowedEnemies[self] = ((MonoBehaviour)self).StartCoroutine(DelayResetSpeed(self)); } orig.Invoke(self, force, playerWhoHit, playHitSFX, hitID); } [IteratorStateMachine(typeof(d__7))] private static IEnumerator DelayResetSpeed(EnemyAI self) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { self = self }; } } public static class GiantKiwiPatch { public static void Init() { } } [HarmonyPatch(typeof(HDAdditionalLightData))] internal static class HDAdditionalLightDataPatch { [HarmonyPatch("OnEnable")] [HarmonyPostfix] private static void OnEnablePatch(HDAdditionalLightData __instance) { Light item = default(Light); if (((Component)__instance).gameObject.TryGetComponent(ref item)) { CodeRebirthUtils.currentRoundLightData.Add((item, __instance)); } } [HarmonyPatch("OnDisable")] [HarmonyPostfix] private static void OnDisablePatch(HDAdditionalLightData __instance) { Light item = default(Light); if (((Component)__instance).gameObject.TryGetComponent(ref item)) { CodeRebirthUtils.currentRoundLightData.Remove((item, __instance)); } } } public static class ItemDropshipPatch { [CompilerGenerated] private static class <>O { public static hook_Update <0>__ItemDropship_Update; public static hook_ShipLeave <1>__ItemDropship_ShipLeave; public static hook_DeliverVehicleOnServer <2>__ItemDropship_DeliverVehicleOnServer; public static hook_ShipLandedAnimationEvent <3>__ItemDropship_ShipLandedAnimationEvent; public static hook_OpenShipDoorsOnServer <4>__ItemDropship_OpenShipDoorsOnServer; } 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0050: 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_005b: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //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_009b: Expected O, but got Unknown object obj = <>O.<0>__ItemDropship_Update; if (obj == null) { hook_Update val = ItemDropship_Update; <>O.<0>__ItemDropship_Update = val; obj = (object)val; } ItemDropship.Update += (hook_Update)obj; object obj2 = <>O.<1>__ItemDropship_ShipLeave; if (obj2 == null) { hook_ShipLeave val2 = ItemDropship_ShipLeave; <>O.<1>__ItemDropship_ShipLeave = val2; obj2 = (object)val2; } ItemDropship.ShipLeave += (hook_ShipLeave)obj2; object obj3 = <>O.<2>__ItemDropship_DeliverVehicleOnServer; if (obj3 == null) { hook_DeliverVehicleOnServer val3 = ItemDropship_DeliverVehicleOnServer; <>O.<2>__ItemDropship_DeliverVehicleOnServer = val3; obj3 = (object)val3; } ItemDropship.DeliverVehicleOnServer += (hook_DeliverVehicleOnServer)obj3; object obj4 = <>O.<3>__ItemDropship_ShipLandedAnimationEvent; if (obj4 == null) { hook_ShipLandedAnimationEvent val4 = ItemDropship_ShipLandedAnimationEvent; <>O.<3>__ItemDropship_ShipLandedAnimationEvent = val4; obj4 = (object)val4; } ItemDropship.ShipLandedAnimationEvent += (hook_ShipLandedAnimationEvent)obj4; object obj5 = <>O.<4>__ItemDropship_OpenShipDoorsOnServer; if (obj5 == null) { hook_OpenShipDoorsOnServer val5 = ItemDropship_OpenShipDoorsOnServer; <>O.<4>__ItemDropship_OpenShipDoorsOnServer = val5; obj5 = (object)val5; } ItemDropship.OpenShipDoorsOnServer += (hook_OpenShipDoorsOnServer)obj5; } private static void ItemDropship_OpenShipDoorsOnServer(orig_OpenShipDoorsOnServer orig, ItemDropship self) { orig.Invoke(self); if ((Object)(object)((Registry)(object)LethalContent.Moons)[NamespacedKey.From("code_rebirth", "oxyde")].Level == (Object)(object)RoundManager.Instance.currentLevel) { Plugin.ExtendedLogging("OpenShipDoorsOnServer"); self.shipTimer = 0f; } } private static void ItemDropship_ShipLandedAnimationEvent(orig_ShipLandedAnimationEvent orig, ItemDropship self) { orig.Invoke(self); if (self is CRDropShip cRDropShip) { cRDropShip.audioSource.Stop(); cRDropShip.audioSource.clip = cRDropShip.musicSound; cRDropShip.audioSource.Play(); } } private static void ItemDropship_ShipLeave(orig_ShipLeave orig, ItemDropship self) { if (self is CRDropShip cRDropShip) { cRDropShip.audioSource.Stop(); cRDropShip.audioSource.clip = cRDropShip.leaveSound; cRDropShip.audioSource.Play(); cRDropShip.rumbleSource.Play(); ((ItemDropship)cRDropShip).shipTimer = 0f; } orig.Invoke(self); } private static void ItemDropship_Update(orig_Update orig, ItemDropship self) { orig.Invoke(self); if (self is CRDropShip cRDropShip) { if (!((ItemDropship)cRDropShip).deliveringOrder && ((NetworkBehaviour)cRDropShip).IsServer && ((ItemDropship)cRDropShip).shipTimer < 34f && ((ItemDropship)cRDropShip).shipTimer + cRDropShip.rumbleSource.clip.length >= 40f && !cRDropShip.rumbleSource.isPlaying) { Plugin.ExtendedLogging("PlayRumbleClientRpc"); cRDropShip.PlayRumbleClientRpc(); } if (cRDropShip.rumbleSource.isPlaying) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } } } private static void ItemDropship_DeliverVehicleOnServer(orig_DeliverVehicleOnServer orig, ItemDropship self) { if (self is CRDropShip cRDropShip) { ((ItemDropship)cRDropShip).shipTimer = 0f; Plugin.ExtendedLogging("ItemDropship_DeliverVehicleOnServer"); ((ItemDropship)cRDropShip).shipAnimator.SetTrigger("landingVehicle"); } else { orig.Invoke(self); } } } [HarmonyPatch(typeof(KeyItem))] internal static class KeyItemPatch { [HarmonyPatch("ItemActivate")] [HarmonyPostfix] public static void CustomPickableObjects(KeyItem __instance) { //IL_0029: 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_0048: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null || !((NetworkBehaviour)__instance).IsOwner) { return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)((GrabbableObject)__instance).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)__instance).playerHeldBy.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); Pickable pickable = default(Pickable); if (Physics.Raycast(val, ref val2, 3f, 2816) && ((Component)((RaycastHit)(ref val2)).transform).TryGetComponent(ref pickable) && ((Behaviour)pickable).enabled && pickable.IsLocked) { pickable.UnlockStuffServerRpc(); if (((NetworkBehaviour)__instance).IsSpawned) { ((GrabbableObject)__instance).playerHeldBy.carryWeight = Mathf.Clamp(((GrabbableObject)__instance).playerHeldBy.carryWeight - (((GrabbableObject)__instance).itemProperties.weight - 1f), 1f, 10f); ((GrabbableObject)__instance).playerHeldBy.DestroyItemInSlotAndSync(Array.IndexOf(((GrabbableObject)__instance).playerHeldBy.ItemSlots, (GrabbableObject)(object)__instance)); } } } } public static class KnifeItemPatch { [CompilerGenerated] private static class <>O { public static hook_HitKnife <0>__KnifeItem_HitKnife; } 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>__KnifeItem_HitKnife; if (obj == null) { hook_HitKnife val = KnifeItem_HitKnife; <>O.<0>__KnifeItem_HitKnife = val; obj = (object)val; } KnifeItem.HitKnife += (hook_HitKnife)obj; } private static void KnifeItem_HitKnife(orig_HitKnife orig, KnifeItem self, bool cancel) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, cancel); if (Plugin.ModConfig.ConfigDebugMode.Value) { ((GrabbableObject)self).playerHeldBy.DamagePlayer(10, true, true, (CauseOfDeath)1, 0, false, default(Vector3)); } } } public static class LandminePatch { [CompilerGenerated] private static class <>O { public static hook_SpawnExplosion <0>__Landmine_SpawnExplosion; public static hook_OnTriggerExit <1>__Landmine_OnTriggerExit; public static Manipulator <2>__AffectIExplodeable; } 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0050: 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_005b: Expected O, but got Unknown object obj = <>O.<0>__Landmine_SpawnExplosion; if (obj == null) { hook_SpawnExplosion val = Landmine_SpawnExplosion; <>O.<0>__Landmine_SpawnExplosion = val; obj = (object)val; } Landmine.SpawnExplosion += (hook_SpawnExplosion)obj; object obj2 = <>O.<1>__Landmine_OnTriggerExit; if (obj2 == null) { hook_OnTriggerExit val2 = Landmine_OnTriggerExit; <>O.<1>__Landmine_OnTriggerExit = val2; obj2 = (object)val2; } Landmine.OnTriggerExit += (hook_OnTriggerExit)obj2; object obj3 = <>O.<2>__AffectIExplodeable; if (obj3 == null) { Manipulator val3 = AffectIExplodeable; <>O.<2>__AffectIExplodeable = val3; obj3 = (object)val3; } Landmine.SpawnExplosion += (Manipulator)obj3; } private static void AffectIExplodeable(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0137: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)0, new Func[8] { (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 3), (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 10), (Instruction i) => ILPatternMatchingExt.MatchLdelemRef(i), (Instruction i) => ILPatternMatchingExt.MatchCallvirt(i, "get_gameObject"), (Instruction i) => ILPatternMatchingExt.MatchCallvirt(i, "GetComponentInChildren"), (Instruction i) => ILPatternMatchingExt.MatchStloc(i, 13), (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 13), (Instruction i) => ILPatternMatchingExt.MatchLdnull(i) })) { Plugin.Logger.LogError((object)"Failed to find GetComponentsInChildren etc in Landmine.SpawnExplosion 1"); return; } val.Emit(OpCodes.Ldloc_3); val.Emit(OpCodes.Ldloc_S, (byte)10); val.Emit(OpCodes.Ldelem_Ref); val.Emit(OpCodes.Castclass, typeof(Collider)); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_S, (byte)11); val.Emit(OpCodes.Call, (MethodBase)AccessTools.Method(typeof(LandminePatch), "AffectIExplodeableFromLandmine", (Type[])null, (Type[])null)); if (!val.TryGotoNext((MoveType)0, new Func[8] { (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 3), (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 10), (Instruction i) => ILPatternMatchingExt.MatchLdelemRef(i), (Instruction i) => ILPatternMatchingExt.MatchCallvirt(i, "get_gameObject"), (Instruction i) => ILPatternMatchingExt.MatchCallvirt(i, "GetComponentInChildren"), (Instruction i) => ILPatternMatchingExt.MatchStloc(i, 14), (Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 14), (Instruction i) => ILPatternMatchingExt.MatchLdnull(i) })) { Plugin.Logger.LogError((object)"Failed to find GetComponentsInChildren etc in Landmine.SpawnExplosion 2"); return; } val.Emit(OpCodes.Ldloc_3); val.Emit(OpCodes.Ldloc_S, (byte)10); val.Emit(OpCodes.Ldelem_Ref); val.Emit(OpCodes.Castclass, typeof(Collider)); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_S, (byte)11); val.Emit(OpCodes.Call, (MethodBase)AccessTools.Method(typeof(LandminePatch), "AffectIExplodeableFromLandmine", (Type[])null, (Type[])null)); } private static void AffectIExplodeableFromLandmine(Collider collider, Vector3 explosionPosition, float distanceToExplosion) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) IExplodeable explodeable = default(IExplodeable); if (NetworkManager.Singleton.IsServer && ((Component)collider).TryGetComponent(ref explodeable)) { explodeable.OnExplosion(6, explosionPosition, distanceToExplosion); } } private static void Landmine_OnTriggerExit(orig_OnTriggerExit orig, Landmine self, Collider other) { orig.Invoke(self, other); if (((NetworkBehaviour)self).IsServer && PuppeteersVoodoo.puppeteerList.Count > 0 && ((Component)other).gameObject.layer == 19 && ((Object)((Component)other).gameObject).name.Contains("PuppeteerPuppet")) { self.TriggerMineOnLocalClientByExiting(); } } private static void Landmine_SpawnExplosion(orig_SpawnExplosion orig, Vector3 explosionPosition, bool spawnExplosionEffect, float killRange, float damageRange, int nonLethalDamage, float physicsForce, GameObject overridePrefab, bool goThroughCar) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a6: 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_00b1: 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_00ce: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(explosionPosition, spawnExplosionEffect, killRange, damageRange, nonLethalDamage, physicsForce, overridePrefab, goThroughCar); RaycastHit val = default(RaycastHit); for (int num = PuppeteersVoodoo.puppeteerList.Count - 1; num >= 0; num--) { PuppeteersVoodoo puppeteersVoodoo = PuppeteersVoodoo.puppeteerList[num]; float num2 = Vector3.Distance(((Component)puppeteersVoodoo).transform.position, explosionPosition); if (num2 > 5f) { break; } Plugin.ExtendedLogging($"Hit voodoo doll with landmine: {puppeteersVoodoo}"); if (!Physics.Linecast(explosionPosition, ((Component)puppeteersVoodoo).transform.position + Vector3.up * 0.3f, ref val, 1073742080, (QueryTriggerInteraction)1)) { Vector3 hitDirection = Vector3.Normalize(((Component)puppeteersVoodoo).transform.position - explosionPosition) * 80f / num2; if (num2 < killRange) { puppeteersVoodoo.Hit(10, hitDirection, null, playHitSFX: true); } else if (num2 < damageRange) { puppeteersVoodoo.Hit(2, hitDirection, null, playHitSFX: true); } } } } } [HarmonyPatch(typeof(NetworkBehaviour))] internal static class NetworkBehaviourPatch { [HarmonyPatch("OnNetworkSpawn")] [HarmonyPostfix] private static void OnNetworkSpawnPatch(NetworkBehaviour __instance) { if (__instance.NetworkObject.IsSpawned && ((Component)__instance.NetworkObject).gameObject.layer == 21 && !((Component)__instance.NetworkObject).CompareTag("DoNotSet")) { int priority = 5; if (((Object)((Component)__instance.NetworkObject).gameObject).name.EndsWith("BearTrap")) { priority = 1; } Transporter.objectsWithPriorityToTransport.Add(new GameObjectWithPriority(((Component)__instance.NetworkObject).gameObject, priority)); } } [HarmonyPatch("OnNetworkDespawn")] [HarmonyPostfix] private static void OnNetworkDespawnPatch(NetworkBehaviour __instance) { NetworkBehaviour __instance2 = __instance; if (((Component)__instance2.NetworkObject).gameObject.layer == 21 && !((Component)__instance2.NetworkObject).CompareTag("DoNotSet")) { GameObjectWithPriority item = Transporter.objectsWithPriorityToTransport.FirstOrDefault((GameObjectWithPriority kv) => (Object)(object)kv.gameObject == (Object)(object)((Component)__instance2.NetworkObject).gameObject); Transporter.objectsWithPriorityToTransport.Remove(item); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal static class PlayerControllerBPatch { [CompilerGenerated] private static class <>O { public static hook_Awake <0>__PlayerControllerB_Awake; public static hook_ConnectClientToPlayerObject <1>__PlayerControllerB_ConnectClientToPlayerObject; public static Manipulator <2>__PlayerControllerB_CheckConditionsForSinkingInQuicksand; public static hook_SetItemInElevator <3>__PlayerControllerB_SetItemInElevator; public static hook_Update <4>__PlayerControllerB_Update; public static hook_LateUpdate <5>__PlayerControllerB_LateUpdate; public static hook_IHittable_Hit <6>__PlayerControllerB_IHittable_Hit; public static hook_DiscardHeldObject <7>__PlayerControllerB_DiscardHeldObject; public static hook_Jump_performed <8>__PlayerControllerB_Jump_performed; public static hook_Interact_performed <9>__PlayerControllerB_Interact_performed; public static hook_StopHoldInteractionOnTrigger <10>__PlayerControllerB_StopHoldInteractionOnTrigger; public static hook_PlayerHitGroundEffects <11>__PlayerControllerB_PlayerHitGroundEffects; } [HarmonyPatch("PlayerHitGroundEffects")] [HarmonyPrefix] public static void PlayerHitGroundEffects(PlayerControllerB __instance) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (!__instance.ContainsCRPlayerData()) { return; } if (__instance.HasFlung()) { Plugin.ExtendedLogging($"{__instance.playerUsername} is flinging away with fallvalue: {__instance.fallValue} and fallvalueuncapped: {__instance.fallValueUncapped}!"); if (__instance.fallValueUncapped <= -50f) { __instance.DamagePlayer(10, true, true, (CauseOfDeath)2, 0, false, default(Vector3)); } __instance.fallValue = 0f; __instance.fallValueUncapped = 0f; } if (!__instance.IsFlingingAway() && __instance.HasFlung()) { __instance.SetFlung(flung: false); } } [HarmonyPatch("PlayFootstepSound")] [HarmonyPrefix] public static bool PlayFootstepSound(PlayerControllerB __instance) { if (__instance.ContainsCRPlayerData()) { return !__instance.IsRidingHoverboard(); } return true; } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] public static IEnumerable RemoveJumpDelay(IEnumerable instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); while (val.IsValid) { val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Newobj, (object)typeof(WaitForSeconds).GetConstructor(new Type[1] { typeof(float) }), (string)null) }); if (val.IsInvalid) { break; } val.Advance(1); val.Set(OpCodes.Nop, (object)null); val.Insert((CodeInstruction[])(object)new CodeInstruction[1] { new CodeInstruction(OpCodes.Call, (object)typeof(PlayerControllerBPatch).GetMethod("JumpDelay", BindingFlags.Static | BindingFlags.NonPublic)) }); } return val.InstructionEnumeration(); } private static float JumpDelay() { if (SlowDownEffect.isSlowDownEffectActive) { return 0f; } return 0.15f; } 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0050: 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_005b: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //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_009b: Expected O, but got Unknown //IL_00b0: 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_00bb: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00f0: 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_00fb: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0170: 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) //IL_017b: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_Awake; if (obj == null) { hook_Awake val = PlayerControllerB_Awake; <>O.<0>__PlayerControllerB_Awake = val; obj = (object)val; } PlayerControllerB.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__PlayerControllerB_ConnectClientToPlayerObject; if (obj2 == null) { hook_ConnectClientToPlayerObject val2 = PlayerControllerB_ConnectClientToPlayerObject; <>O.<1>__PlayerControllerB_ConnectClientToPlayerObject = val2; obj2 = (object)val2; } PlayerControllerB.ConnectClientToPlayerObject += (hook_ConnectClientToPlayerObject)obj2; object obj3 = <>O.<2>__PlayerControllerB_CheckConditionsForSinkingInQuicksand; if (obj3 == null) { Manipulator val3 = PlayerControllerB_CheckConditionsForSinkingInQuicksand; <>O.<2>__PlayerControllerB_CheckConditionsForSinkingInQuicksand = val3; obj3 = (object)val3; } PlayerControllerB.CheckConditionsForSinkingInQuicksand += (Manipulator)obj3; object obj4 = <>O.<3>__PlayerControllerB_SetItemInElevator; if (obj4 == null) { hook_SetItemInElevator val4 = PlayerControllerB_SetItemInElevator; <>O.<3>__PlayerControllerB_SetItemInElevator = val4; obj4 = (object)val4; } PlayerControllerB.SetItemInElevator += (hook_SetItemInElevator)obj4; object obj5 = <>O.<4>__PlayerControllerB_Update; if (obj5 == null) { hook_Update val5 = PlayerControllerB_Update; <>O.<4>__PlayerControllerB_Update = val5; obj5 = (object)val5; } PlayerControllerB.Update += (hook_Update)obj5; object obj6 = <>O.<5>__PlayerControllerB_LateUpdate; if (obj6 == null) { hook_LateUpdate val6 = PlayerControllerB_LateUpdate; <>O.<5>__PlayerControllerB_LateUpdate = val6; obj6 = (object)val6; } PlayerControllerB.LateUpdate += (hook_LateUpdate)obj6; object obj7 = <>O.<6>__PlayerControllerB_IHittable_Hit; if (obj7 == null) { hook_IHittable_Hit val7 = PlayerControllerB_IHittable_Hit; <>O.<6>__PlayerControllerB_IHittable_Hit = val7; obj7 = (object)val7; } PlayerControllerB.IHittable_Hit += (hook_IHittable_Hit)obj7; object obj8 = <>O.<7>__PlayerControllerB_DiscardHeldObject; if (obj8 == null) { hook_DiscardHeldObject val8 = PlayerControllerB_DiscardHeldObject; <>O.<7>__PlayerControllerB_DiscardHeldObject = val8; obj8 = (object)val8; } PlayerControllerB.DiscardHeldObject += (hook_DiscardHeldObject)obj8; object obj9 = <>O.<8>__PlayerControllerB_Jump_performed; if (obj9 == null) { hook_Jump_performed val9 = PlayerControllerB_Jump_performed; <>O.<8>__PlayerControllerB_Jump_performed = val9; obj9 = (object)val9; } PlayerControllerB.Jump_performed += (hook_Jump_performed)obj9; object obj10 = <>O.<9>__PlayerControllerB_Interact_performed; if (obj10 == null) { hook_Interact_performed val10 = PlayerControllerB_Interact_performed; <>O.<9>__PlayerControllerB_Interact_performed = val10; obj10 = (object)val10; } PlayerControllerB.Interact_performed += (hook_Interact_performed)obj10; object obj11 = <>O.<10>__PlayerControllerB_StopHoldInteractionOnTrigger; if (obj11 == null) { hook_StopHoldInteractionOnTrigger val11 = PlayerControllerB_StopHoldInteractionOnTrigger; <>O.<10>__PlayerControllerB_StopHoldInteractionOnTrigger = val11; obj11 = (object)val11; } PlayerControllerB.StopHoldInteractionOnTrigger += (hook_StopHoldInteractionOnTrigger)obj11; object obj12 = <>O.<11>__PlayerControllerB_PlayerHitGroundEffects; if (obj12 == null) { hook_PlayerHitGroundEffects val12 = PlayerControllerB_PlayerHitGroundEffects; <>O.<11>__PlayerControllerB_PlayerHitGroundEffects = val12; obj12 = (object)val12; } PlayerControllerB.PlayerHitGroundEffects += (hook_PlayerHitGroundEffects)obj12; } private static void PlayerControllerB_ConnectClientToPlayerObject(orig_ConnectClientToPlayerObject orig, PlayerControllerB self) { orig.Invoke(self); if (ContentHandler.Instance.Merchant != null) { GameObject val = Object.Instantiate(ContentHandler.Instance.Merchant.CoinUIPrefab); ((Object)val).name = "CoinUI_" + self.playerUsername; } } private static void PlayerControllerB_Awake(orig_Awake orig, PlayerControllerB self) { orig.Invoke(self); if (!self.ContainsCRPlayerData()) { self.AddCRPlayerData(); } } private static void PlayerControllerB_PlayerHitGroundEffects(orig_PlayerHitGroundEffects orig, PlayerControllerB self) { if (self.fallValue < -9f) { self.SetIsJumping(isJumping: false); } orig.Invoke(self); } private static void PlayerControllerB_SetItemInElevator(orig_SetItemInElevator orig, PlayerControllerB self, bool droppedInShipRoom, bool droppedInElevator, GrabbableObject gObject) { orig.Invoke(self, droppedInShipRoom, droppedInElevator, gObject); if (gObject is WrittenDocument) { DuskAchievementExtensions.TryDiscoverMoreProgressAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.MuMiaolan, gObject.itemProperties.itemName); } else { if ((!(gObject is PlushieItem) && !(gObject is Xui) && !(gObject is GoldRigo)) || 1 == 0) { return; } DuskAchievementExtensions.TryDiscoverMoreProgressAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.CompanyCertified, gObject.itemProperties.itemName); DuskAchievementExtensions.TryDiscoverMoreProgressAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.SomeAssemblyRequired, gObject.itemProperties.itemName); DuskAchievementExtensions.TryDiscoverMoreProgressAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.HappyFamily, gObject.itemProperties.itemName); DuskAchievementExtensions.TryDiscoverMoreProgressAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.TheUprooted, gObject.itemProperties.itemName); DuskAchievementExtensions.TryDiscoverMoreProgressAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.HoardingBug, gObject.itemProperties.itemName); if (!DuskModContent.Achievements[CodeRebirthAchievementKeys.Scalper].Completed && !RoundManagerPatch.plushiesCollectedToday.Contains(gObject)) { RoundManagerPatch.plushiesCollectedToday.Add(gObject); if (RoundManagerPatch.plushiesCollectedToday.Count >= 3) { RoundManagerPatch.plushiesCollectedToday.Clear(); DuskAchievementExtensions.TryTriggerAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.Scalper); } } } } private static void PlayerControllerB_Interact_performed(orig_Interact_performed orig, PlayerControllerB self, CallbackContext context) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, context); if (PlayerControllerBExtensions.IsLocalPlayer(self)) { Plugin.ExtendedLogging(self.playerUsername + " pressed interact."); CodeRebirthUtils.Instance.PlayerPressedInteract(self); } } private static void PlayerControllerB_Jump_performed(orig_Jump_performed orig, PlayerControllerB self, CallbackContext context) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, context); if (PlayerControllerBExtensions.IsLocalPlayer(self)) { Plugin.ExtendedLogging(self.playerUsername + " pressed jump."); CodeRebirthUtils.Instance.PlayerPressedJump(self); } } private static void PlayerControllerB_Update(orig_Update orig, PlayerControllerB self) { if (!PlayerControllerBExtensions.IsLocalPlayer(self) && self.IsPseudoDead()) { ((Component)self).gameObject.layer = 0; } orig.Invoke(self); SlowDownEffect.SlowTrigger(self.hoveringOverTrigger); } private static void PlayerControllerB_StopHoldInteractionOnTrigger(orig_StopHoldInteractionOnTrigger orig, PlayerControllerB self) { if (SlowDownEffect.isSlowDownEffectActive) { if ((Object)(object)self.previousHoveringOverTrigger != (Object)null) { SlowDownEffect.ResetSlowTrigger(self.previousHoveringOverTrigger); } if ((Object)(object)self.hoveringOverTrigger != (Object)null) { SlowDownEffect.ResetSlowTrigger(self.hoveringOverTrigger); } } orig.Invoke(self); } private static void PlayerControllerB_DiscardHeldObject(orig_DiscardHeldObject orig, PlayerControllerB self, bool placeObject, NetworkObject parentObjectTo, Vector3 placePosition, bool matchRotationOfParent) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, placeObject, parentObjectTo, placePosition, matchRotationOfParent); foreach (Janitor janitor in Janitor.janitors) { if (!((Object)(object)janitor == (Object)null) && !((EnemyAI)janitor).isEnemyDead && (Object)(object)self != (Object)null && NetworkManager.Singleton.IsServer && ((EnemyAI)janitor).currentBehaviourStateIndex != 2 && ((EnemyAI)janitor).currentBehaviourStateIndex != 3) { if (!janitor.currentlyGrabbingPlayer && !janitor.currentlyGrabbingScrap && !janitor.currentlyThrowingPlayer) { janitor.DetectDroppedScrapServerRpc(((Component)self).transform.position, PlayerControllerReference.op_Implicit(self)); } else { ((MonoBehaviour)janitor).StartCoroutine(janitor.WaitUntilNotDoingAnythingCurrently(self)); } } } } private static bool PlayerControllerB_IHittable_Hit(orig_IHittable_Hit orig, PlayerControllerB self, int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { //IL_0095: 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) if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit.currentlyHeldObjectServer != (Object)null && playerWhoHit.currentlyHeldObjectServer is ScaryShrimp scaryShrimp) { scaryShrimp.PastHitPlayerServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, self)); self.DamagePlayerFromOtherClientServerRpc(60, hitDirection, (int)playerWhoHit.playerClientId); return false; } if ((Object)(object)playerWhoHit != (Object)null) { foreach (PeaceKeeper instance in PeaceKeeper.Instances) { instance.AlertPeaceKeeperToLocalPlayer(playerWhoHit); } } return orig.Invoke(self, force, hitDirection, playerWhoHit, playHitSFX, hitID); } private static void PlayerControllerB_LateUpdate(orig_LateUpdate orig, PlayerControllerB self) { orig.Invoke(self); if (!PlayerControllerBExtensions.IsLocalPlayer(self) && self.IsPseudoDead()) { ((Component)self).gameObject.layer = 0; } if (ContentHandler.Instance.Hoverboard != null && self.ContainsCRPlayerData() && (((Object)(object)self.currentlyHeldObjectServer != (Object)null && (Object)(object)self.currentlyHeldObjectServer.itemProperties != (Object)null && !self.currentlyHeldObjectServer.itemProperties.requiresBattery) || (Object)(object)self.currentlyHeldObjectServer == (Object)null)) { Hoverboard hoverboard = self.TryGetHoverboardRiding(); if ((Object)(object)hoverboard != (Object)null && (Object)(object)hoverboard.playerControlling != (Object)null && (Object)(object)hoverboard.playerControlling == (Object)(object)self && PlayerControllerBExtensions.IsLocalPlayer(self)) { HUDManager.Instance.batteryMeter.fillAmount = ((GrabbableObject)hoverboard).insertedBattery.charge / 1.3f; ((Component)HUDManager.Instance.batteryMeter).gameObject.SetActive(true); ((Behaviour)HUDManager.Instance.batteryIcon).enabled = true; float fillAmount = HUDManager.Instance.batteryMeter.fillAmount; HUDManager.Instance.batteryBlinkUI.SetBool("blink", fillAmount < 0.2f && fillAmount > 0f); } } } private static void PlayerControllerB_CheckConditionsForSinkingInQuicksand(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = default(ILLabel); if (!val.TryGotoNext((MoveType)2, new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "thisController"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_isGrounded"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2) })) { Plugin.Logger.LogError((object)"[ILHook:PlayerControllerB.CheckConditionsForSinkingInQuicksand] Couldn't find thisController.isGrounded check!"); return; } val.Index -= 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool isGrounded, PlayerControllerB self) => isGrounded || self.HasEffectActive(CodeRebirthStatusEffects.Water))); } } [HarmonyPatch(typeof(RoundManager))] internal static class RoundManagerPatch { internal static List spawnableFlora = new List(); internal static List plushiesCollectedToday = new List(); internal static readonly NamespacedKey MilitaryAmountKey = NamespacedKey.From("code_rebirth", "military_plane_coverage"); [HarmonyPatch("SpawnOutsideHazards")] [HarmonyPrefix] private static void SpawnOutsideMapObjects() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (Plugin.ModConfig.ConfigFloraEnabled.Value) { SpawnFlora(); } if (NetworkManager.Singleton.IsServer && MoneyCounter.ExpensiveMoneyStored() < 0) { PersistentDataContainer currentContract = DawnLib.GetCurrentContract(); for (int i = 0; i < ((DataContainer)currentContract).GetOrSetDefault(MilitaryAmountKey, 1); i++) { GameObject val = Object.Instantiate(((Registry)(object)LethalContent.MapObjects)[CodeRebirthMapObjectKeys.MilitaryPlane].GetMapObjectPrefab(), Vector3.zero, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); val.GetComponent().Spawn(true); } } } private static void SpawnFlora() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Plugin.ExtendedLogging("Spawning flora!!!"); Random random = new Random(StartOfRound.Instance.randomMapSeed + 2358); int spawnCount = 0; GameObject val = new GameObject("Flora Parent"); if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) { val.transform.SetParent(RoundManager.Instance.mapPropsContainer.transform); } foreach (SpawnableFlora item in spawnableFlora) { SpawnFlora(val, random, item, ref spawnCount); } } private static bool TryGetValidFloraSpawnPoint(Random random, out RaycastHit hit) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Vector3 randomPointNearPointsOfInterest = GetRandomPointNearPointsOfInterest(random); hit = default(RaycastHit); NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(randomPointNearPointsOfInterest, ref val, 20f, -1)) { return false; } if (!Physics.Raycast(((NavMeshHit)(ref val)).position, Vector3.down, ref hit, 5f, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { return false; } return true; } private static void SpawnFlora(GameObject staticBatchedParent, Random random, SpawnableFlora flora, ref int spawnCount) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) AnimationCurve val = flora.spawnCurveFunction(SelectableLevelExtensions.GetDawnInfo(RoundManager.Instance.currentLevel)); int num = Mathf.FloorToInt(val.Evaluate(RandomExtensions.NextFloat(random, 0f, 1f)) + 0.5f); for (int i = 0; i < num; i++) { if (!TryGetValidFloraSpawnPoint(random, out var hit)) { continue; } switch (flora.floraTag) { case FloraTag.Grass: if (!((Component)((RaycastHit)(ref hit)).transform).gameObject.CompareTag("Grass")) { continue; } break; case FloraTag.Desert: if (!((Component)((RaycastHit)(ref hit)).transform).gameObject.CompareTag("Gravel")) { continue; } break; case FloraTag.Snow: if (!((Component)((RaycastHit)(ref hit)).transform).gameObject.CompareTag("Snow")) { continue; } break; } Vector3 point = ((RaycastHit)(ref hit)).point; GameObject val2 = Object.Instantiate(flora.prefab, point, Quaternion.identity, staticBatchedParent.transform); val2.transform.up = ((RaycastHit)(ref hit)).normal; spawnCount++; } } public static Vector3 GetRandomPointNearPointsOfInterest(Random random, float offsetRange = 20f) { //IL_0034: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) GameObject[] outsideAINodes = RoundManager.Instance.outsideAINodes; if (outsideAINodes.Length == 0) { Plugin.Logger.LogWarning((object)"No points of interest found."); return Vector3.zero; } Vector3 position = outsideAINodes[random.Next(outsideAINodes.Length)].transform.position; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(RandomExtensions.NextFloat(random, 0f - offsetRange, offsetRange), RandomExtensions.NextFloat(random, 0f, offsetRange), RandomExtensions.NextFloat(random, 0f - offsetRange, offsetRange)); return position + val; } [HarmonyPatch("UnloadSceneObjectsEarly")] [HarmonyPostfix] private static void ReturnToOrbitMiscPatch() { plushiesCollectedToday.Clear(); foreach (GalAI instance in GalAI.Instances) { instance.RefillChargesServerRpc(); } foreach (SCP999GalAI instance2 in SCP999GalAI.Instances) { instance2.MakeTriggerInteractableServerRpc(interactable: false); } } [HarmonyPatch("LoadNewLevelWait")] [HarmonyPrefix] public static void LoadNewLevelWaitPatch(RoundManager __instance) { if (!__instance.currentLevel.planetHasTime && TimeOfDay.Instance.daysUntilDeadline == 0 && Plugin.ModConfig.Config999GalCompanyMoonRecharge.Value) { foreach (SCP999GalAI instance in SCP999GalAI.Instances) { instance.RechargeGalHealsAndRevivesServerRpc(heal: true, revive: true); } } if (Plugin.ModConfig.Config999GalCompanyMoonRecharge.Value) { return; } foreach (SCP999GalAI instance2 in SCP999GalAI.Instances) { instance2.RechargeGalHealsAndRevivesServerRpc(heal: true, revive: true); } } } public static class ShotgunItemPatch { [CompilerGenerated] private static class <>O { public static hook_ShootGun <0>__ShotgunItem_ShootGun; } 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>__ShotgunItem_ShootGun; if (obj == null) { hook_ShootGun val = ShotgunItem_ShootGun; <>O.<0>__ShotgunItem_ShootGun = val; obj = (object)val; } ShotgunItem.ShootGun += (hook_ShootGun)obj; } private static void ShotgunItem_ShootGun(orig_ShootGun orig, ShotgunItem self, Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0080: 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) orig.Invoke(self, shotgunPosition, shotgunForward); if (ContentHandler.Instance.ManorLord == null || self.enemyColliders == null || self.enemyColliders.Length == 0) { return; } RaycastHit[] array = self.enemyColliders.ToArray(); PuppeteersVoodoo puppeteersVoodoo = default(PuppeteersVoodoo); RaycastHit val2 = default(RaycastHit); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (!((Object)(object)((RaycastHit)(ref val)).transform == (Object)null) && ((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref puppeteersVoodoo) && !Physics.Linecast(shotgunPosition, ((RaycastHit)(ref val)).point, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { float num = Vector3.Distance(shotgunPosition, ((RaycastHit)(ref val)).point); int force = 2; if (num < 3.7f) { force = 5; } else if (num < 6f) { force = 3; } puppeteersVoodoo.Hit(force, shotgunForward, ((GrabbableObject)self).playerHeldBy, playHitSFX: true); } } } } public static class ShovelPatch { [CompilerGenerated] private static class <>O { public static hook_HitShovel <0>__Shovel_HitShovel; } 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>__Shovel_HitShovel; if (obj == null) { hook_HitShovel val = Shovel_HitShovel; <>O.<0>__Shovel_HitShovel = val; obj = (object)val; } Shovel.HitShovel += (hook_HitShovel)obj; } private static void Shovel_HitShovel(orig_HitShovel orig, Shovel self, bool cancel) { orig.Invoke(self, cancel); PostHitShovel(ref self); } private static void PostHitShovel(ref Shovel self) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (self is ScaryShrimp scaryShrimp) { ((GrabbableObject)scaryShrimp).playerHeldBy.twoHanded = true; if (DetermineIfShovelHitSomething(self)) { ((GrabbableObject)scaryShrimp).playerHeldBy.externalForceAutoFade = -((Component)((GrabbableObject)scaryShrimp).playerHeldBy.gameplayCamera).transform.forward * 10f; } } } private static bool DetermineIfShovelHitSomething(Shovel self) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) IHittable val2 = default(IHittable); for (int i = 0; i < self.objectsHitByShovelList.Count; i++) { RaycastHit val = self.objectsHitByShovelList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = self.objectsHitByShovelList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = self.objectsHitByShovelList[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = self.objectsHitByShovelList[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)self.previousPlayerHeldBy).transform) { continue; } val = self.objectsHitByShovelList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)self.previousPlayerHeldBy.gameplayCamera).transform.position; RaycastHit val3 = self.objectsHitByShovelList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val3)).point, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } return true; } } val = self.objectsHitByShovelList[i]; if (!((RaycastHit)(ref val)).collider.isTrigger) { return true; } } return false; } } public static class SoccerBallPropPatch { [CompilerGenerated] private static class <>O { public static hook_KickBallLocalClient <0>__SoccerBallProp_KickBallLocalClient; } 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>__SoccerBallProp_KickBallLocalClient; if (obj == null) { hook_KickBallLocalClient val = SoccerBallProp_KickBallLocalClient; <>O.<0>__SoccerBallProp_KickBallLocalClient = val; obj = (object)val; } SoccerBallProp.KickBallLocalClient += (hook_KickBallLocalClient)obj; } private static void SoccerBallProp_KickBallLocalClient(orig_KickBallLocalClient orig, SoccerBallProp self, Vector3 destinationPos, bool setInElevator, bool setInShipRoom) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, destinationPos, setInElevator, setInShipRoom); if (self is JimBall jimBall && ((NetworkBehaviour)self).IsOwner) { jimBall._animator.SetBool(JimBall.KickingAnimation, true); } } } public static class SpikeTrapPatch { [CompilerGenerated] private static class <>O { public static hook_Start <0>__SpikeRoofTrap_Start; public static hook_OnTriggerStay <1>__SpikeRoofTrap_OnTrigger; } 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown object obj = <>O.<0>__SpikeRoofTrap_Start; if (obj == null) { hook_Start val = SpikeRoofTrap_Start; <>O.<0>__SpikeRoofTrap_Start = val; obj = (object)val; } SpikeRoofTrap.Start += (hook_Start)obj; object obj2 = <>O.<1>__SpikeRoofTrap_OnTrigger; if (obj2 == null) { hook_OnTriggerStay val2 = SpikeRoofTrap_OnTrigger; <>O.<1>__SpikeRoofTrap_OnTrigger = val2; obj2 = (object)val2; } SpikeRoofTrap.OnTriggerStay += (hook_OnTriggerStay)obj2; } private static void SpikeRoofTrap_OnTrigger(orig_OnTriggerStay orig, SpikeRoofTrap self, Collider other) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, other); PuppeteersVoodoo puppeteersVoodoo = default(PuppeteersVoodoo); if (ContentHandler.Instance.ManorLord != null && ((NetworkBehaviour)self).IsServer && ((Component)other).TryGetComponent(ref puppeteersVoodoo) && !(puppeteersVoodoo.lastTimeTakenDamageFromEnemy <= 0.5f)) { puppeteersVoodoo.Hit(2, ((Component)self).transform.position); } } private static void SpikeRoofTrap_Start(orig_Start orig, SpikeRoofTrap self) { orig.Invoke(self); Transform parent = ((Component)self).gameObject.transform.parent; ((Component)((NetworkBehaviour)self).NetworkObject).gameObject.layer = 21; ((Component)((Component)parent).transform.Find("BaseSupport")).gameObject.layer = 21; ((Component)((Component)parent).transform.Find("SpikeRoof")).gameObject.layer = 21; ((Component)((Component)parent).transform.Find("SpikeRoof").Find("MovingBar")).gameObject.layer = 21; } } [HarmonyPatch(typeof(StartOfRound))] internal static class StartOfRoundPatch { private static bool _patched; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void StartOfRound_Awake(ref StartOfRound __instance) { Plugin.ExtendedLogging("StartOfRound.Awake"); NetworkObjectExtensions.OnSpawn(((NetworkBehaviour)__instance).NetworkObject, (Action)CreateNetworkManager); if (!_patched) { _patched = true; if (LateGameUpgradesCompat.LateGameUpgradesExists) { LateGameUpgradesCompat.PatchDropshipUpgrades(); } } } private static void CreateNetworkManager() { //IL_0040: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)StartOfRound.Instance).IsServer || ((NetworkBehaviour)StartOfRound.Instance).IsHost) { if ((Object)(object)CodeRebirthUtils.Instance == (Object)null) { GameObject val = Object.Instantiate(Plugin.Assets.UtilsPrefab); SceneManager.MoveGameObjectToScene(val, ((Component)StartOfRound.Instance).gameObject.scene); val.GetComponent().Spawn(false); Scene scene = val.scene; Plugin.ExtendedLogging("Created CodeRebirthUtils. Scene is: '" + ((Scene)(ref scene)).name + "'"); } else { Plugin.Logger.LogWarning((object)"CodeRebirthUtils already exists?"); } } if (ContentHandler.Instance.DuckSong != null) { Plugin.ExtendedLogging("Creating duck UI"); GameObject val2 = GameObject.Find("Systems/UI/Canvas"); GameObject val3 = Object.Instantiate(ContentHandler.Instance.DuckSong.DuckUIPrefab, Vector3.zero, Quaternion.identity, val2.transform); } } [HarmonyPatch("OnShipLandedMiscEvents")] [HarmonyPostfix] public static void OnShipLandedMiscEventsPatch(StartOfRound __instance) { foreach (SCP999GalAI instance in SCP999GalAI.Instances) { instance.MakeTriggerInteractable(interactable: true); } if (Plugin.ModConfig.ConfigRemoveInteriorFog.Value) { Plugin.ExtendedLogging("Disabling halloween fog"); if (((Component)RoundManager.Instance.indoorFog).gameObject.activeSelf) { ((Component)RoundManager.Instance.indoorFog).gameObject.SetActive(false); } } foreach (GalAI instance2 in GalAI.Instances) { if (instance2.IdleSounds.Length != 0) { instance2.GalVoice.PlayOneShot(instance2.IdleSounds[instance2.galRandom.Next(instance2.IdleSounds.Length)]); } } } } public static class TurretPatch { [CompilerGenerated] private static class <>O { public static hook_CheckForPlayersInLineOfSight <0>__Turret_CheckForPlayersInLineOfSight; } 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>__Turret_CheckForPlayersInLineOfSight; if (obj == null) { hook_CheckForPlayersInLineOfSight val = Turret_CheckForPlayersInLineOfSight; <>O.<0>__Turret_CheckForPlayersInLineOfSight = val; obj = (object)val; } Turret.CheckForPlayersInLineOfSight += (hook_CheckForPlayersInLineOfSight)obj; } private static PlayerControllerB Turret_CheckForPlayersInLineOfSight(orig_CheckForPlayersInLineOfSight orig, Turret self, float radius, bool angleRangeCheck) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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_004b: 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) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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) if ((int)self.turretMode == 2 || (int)self.turretMode == 3) { Ray val = default(Ray); ((Ray)(ref val))..ctor(self.centerPoint.position - Vector3.up * 0.3f, self.aimPoint.forward - Vector3.up * 0.3f); Plugin.ExtendedLogging($"Raycast from {self.centerPoint.position} to {self.aimPoint.forward}"); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 30f, MoreLayerMasks.EnemiesMask, (QueryTriggerInteraction)2)) { Plugin.ExtendedLogging("Raycast hit " + ((Object)((RaycastHit)(ref val2)).transform).name); PuppeteersVoodoo puppeteersVoodoo = default(PuppeteersVoodoo); if (((Component)((RaycastHit)(ref val2)).transform).CompareTag("Player") && ((Component)((RaycastHit)(ref val2)).transform).TryGetComponent(ref puppeteersVoodoo) && (Object)(object)puppeteersVoodoo.playerControlled != (Object)null) { Plugin.ExtendedLogging("Hit player " + ((Object)puppeteersVoodoo.playerControlled).name); if (!angleRangeCheck || !(Vector3.Angle(((Component)puppeteersVoodoo).transform.position + Vector3.up * 1.75f - self.centerPoint.position, self.forwardFacingPos.forward) > self.rotationRange)) { return puppeteersVoodoo.playerControlled; } Plugin.ExtendedLogging("Angle too far"); } } } return orig.Invoke(self, radius, angleRangeCheck); } } public static class VehicleControllerPatch { [CompilerGenerated] private static class <>O { public static hook_Awake <0>__VehicleController_Awake; } 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>__VehicleController_Awake; if (obj == null) { hook_Awake val = VehicleController_Awake; <>O.<0>__VehicleController_Awake = val; obj = (object)val; } VehicleController.Awake += (hook_Awake)obj; } private static void VehicleController_Awake(orig_Awake orig, VehicleController self) { orig.Invoke(self); RabbitMagician.vehicleController = self; foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!(spawnedEnemy is RabbitMagician)) { continue; } Collider[] componentsInChildren = ((Component)spawnedEnemy).GetComponentsInChildren(); foreach (Collider val in componentsInChildren) { Collider[] componentsInChildren2 = ((Component)self).GetComponentsInChildren(); foreach (Collider val2 in componentsInChildren2) { Physics.IgnoreCollision(val, val2, true); } } } } } } namespace CodeRebirth.src.ModCompats { internal static class CullFactorySoftCompat { private static bool CullFactoryDynamicObjectsAPIExists = Chainloader.PluginInfos.TryGetValue("com.fumiko.CullFactory", out var value) && value.Metadata.Version >= new Version(1, 5, 0); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void TryRefreshDynamicLight(Light light) { if (CullFactoryDynamicObjectsAPIExists) { RefreshDynamicLight(light); } } [MethodImpl(MethodImplOptions.NoInlining)] private static void RefreshDynamicLight(Light light) { DynamicObjectsAPI.RefreshLightPosition(light); } } internal static class ImperiumCompat { internal static bool Enabled => Chainloader.PluginInfos.ContainsKey("giosuel.Imperium"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void ToggleInputs(bool enable) { if (enable) { ((LcInputActions)Imperium.InputBindings.InterfaceMap).Enable(); ((LcInputActions)Imperium.InputBindings.BaseMap).Enable(); Imperium.InputBindings.StaticMap.Enable(); ((LcInputActions)Imperium.InputBindings.FreecamMap).Enable(); } else { ((LcInputActions)Imperium.InputBindings.BaseMap).Disable(); Imperium.InputBindings.StaticMap.Disable(); ((LcInputActions)Imperium.InputBindings.FreecamMap).Disable(); ((LcInputActions)Imperium.InputBindings.InterfaceMap).Disable(); } } } internal static class LateGameUpgradesCompat { internal static bool LateGameUpgradesExists = Chainloader.PluginInfos.ContainsKey("com.malco.lethalcompany.moreshipupgrades"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static float GetSellableScrapMultiplier() { if (LateGameUpgradesExists) { return GetSigurdAccessMultiplier(); } return 1f; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static float GetSigurdAccessMultiplier() { return Sigurd.GetBuyingRate(1f); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void PatchDropshipUpgrades() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) new Hook((MethodBase)AccessTools.DeclaredMethod(typeof(FasterDropPod), "CanLeaveEarly", (Type[])null, (Type[])null), (Delegate)new Func, float, bool>(FixDropshipOnOxyde)); } private static bool FixDropshipOnOxyde(Func orig, float shipTimer) { DawnMoonInfo val = default(DawnMoonInfo); if (((Registry)(object)LethalContent.Moons).TryGetValue(CodeRebirthMoonKeys.Oxyde, ref val) && (Object)(object)val.Level == (Object)(object)RoundManager.Instance.currentLevel) { return false; } return orig.Invoke(shipTimer); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static float TryGetItemWeight(float currentItemWeight) { if (LateGameUpgradesExists) { Plugin.ExtendedLogging($"Current item weight: {currentItemWeight}"); return GetItemWeight(currentItemWeight); } return currentItemWeight - 1f; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static float GetItemWeight(float currentItemWeight) { Plugin.ExtendedLogging($"New item weight: {BackMuscles.DecreasePossibleWeight(currentItemWeight - 1f)}"); return BackMuscles.DecreasePossibleWeight(currentItemWeight - 1f); } } internal static class LethalMoonUnlocksCompat { internal static bool LethalMoonUnlocksExists = Chainloader.PluginInfos.TryGetValue("com.xmods.lethalmoonunlocks", out var value) && value.Metadata.Version >= new Version(2, 2, 0); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void ReleaseOxydeStoryLock(SelectableLevel selectableLevel) { UnlockManager.TryReleaseStoryLock(SelectableLevelExtensions.GetDawnInfo(selectableLevel).GetNumberlessPlanetName()); } } internal static class MoreCompanySoftCompat { private static bool MoreCompanyAPIExists = Chainloader.PluginInfos.TryGetValue("me.swipez.melonloader.morecompany", out var value) && value.Metadata.Version >= new Version(1, 5, 0); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void TryDisableOrEnableCosmetics(PlayerControllerB targetPlayer, bool disable) { if (MoreCompanyAPIExists) { DisableOrEnableCosmetics(targetPlayer, disable); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void DisableOrEnableCosmetics(PlayerControllerB targetPlayer, bool disable) { CosmeticApplication component = ((Component)((Component)targetPlayer).transform.Find("ScavengerModel").Find("metarig")).gameObject.GetComponent(); if (disable) { foreach (CosmeticInstance spawnedCosmetic in component.spawnedCosmetics) { ((Component)spawnedCosmetic).gameObject.SetActive(!disable); } return; } component.UpdateAllCosmeticVisibilities(PlayerControllerBExtensions.IsLocalPlayer(targetPlayer)); } } internal static class MoreCounterplayCompat { internal static bool MoreCounterplayExists = Chainloader.PluginInfos.TryGetValue("BaronDrakula.MoreCounterplay", out var value) && value.Metadata.Version >= new Version(1, 4, 1); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static bool CoilheadCounterplayEnabled() { return SyncedEntry.op_Implicit(MoreCounterplay.Settings.EnableCoilheadCounterplay); } } internal static class NavmeshInCompanyCompat { internal static bool Enabled => Chainloader.PluginInfos.ContainsKey("dev.kittenji.NavMeshInCompany"); } internal static class OpenBodyCamCompatibilityChecker { [CompilerGenerated] private static class <>O { public static TargetChangedToTransform <0>__OverrideAttachmentPoint; } internal static bool Enabled => Chainloader.PluginInfos.ContainsKey("Zaggy1024.OpenBodyCams"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void Init() { Plugin.ExtendedLogging("No way openbodycams is on?!"); InitializeImpl(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void InitializeImpl() { //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>__OverrideAttachmentPoint; if (obj == null) { TargetChangedToTransform val = OverrideAttachmentPoint; <>O.<0>__OverrideAttachmentPoint = val; obj = (object)val; } BodyCamComponent.BeforeTargetChangedToTransform += (TargetChangedToTransform)obj; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool OverrideAttachmentPoint(MonoBehaviour bodyCam, Transform target, ref Transform attachmentPoint, ref Vector3 offset, ref Quaternion angle, ref Renderer[] renderersToHide) { GalAI galAI = default(GalAI); if (((Component)target).TryGetComponent(ref galAI)) { attachmentPoint = galAI.GalHead; renderersToHide = galAI.renderersToHideIn; return true; } return false; } } internal class TooManyEmotesCompat { internal static bool Enabled => Chainloader.PluginInfos.ContainsKey("FlipMods.TooManyEmotes"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void AddCredits(int profit) { if (Enabled) { AddToEmoteCredits(profit); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void AddToEmoteCredits(int profit) { TerminalPatcher.OnGainGroupCredits(profit, 0, (DepositItemsDesk)null); } } internal static class WeatherRegistryCompat { internal static bool WeatherRegistryAPIExists = Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry"); } } namespace CodeRebirth.src.MiscScripts { public class ACUnitBounds : BoundsDefiner { public void OnEnable() { AirControlUnit.safeBounds.Add(this); } public void OnDisable() { AirControlUnit.safeBounds.Remove(this); } } public static class AnimationCurveUtil { public enum TangentMode { Free, Smooth, Linear } public static void SetKeyTangentMode(AnimationCurve curve, int index, TangentMode mode) { //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_0136: 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_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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (index < 0 || index >= curve.length) { return; } Keyframe val = curve[index]; switch (mode) { case TangentMode.Free: ((Keyframe)(ref val)).inTangent = float.PositiveInfinity; ((Keyframe)(ref val)).outTangent = float.PositiveInfinity; break; case TangentMode.Smooth: { float time = ((Keyframe)(ref val)).time; float num; Keyframe val2; if (index <= 0) { num = ((Keyframe)(ref val)).time - 1f; } else { val2 = curve[index - 1]; num = ((Keyframe)(ref val2)).time; } float num2 = time - num; float value = ((Keyframe)(ref val)).value; float value2; if (index <= 0) { value2 = ((Keyframe)(ref val)).value; } else { val2 = curve[index - 1]; value2 = ((Keyframe)(ref val2)).value; } float num3 = value - value2; ((Keyframe)(ref val)).inTangent = num3 / num2; float num4; if (index >= curve.length - 1) { num4 = ((Keyframe)(ref val)).time + 1f; } else { val2 = curve[index + 1]; num4 = ((Keyframe)(ref val2)).time; } float num5 = num4 - ((Keyframe)(ref val)).time; float value3; if (index >= curve.length - 1) { value3 = ((Keyframe)(ref val)).value; } else { val2 = curve[index + 1]; value3 = ((Keyframe)(ref val2)).value; } float num6 = value3 - ((Keyframe)(ref val)).value; ((Keyframe)(ref val)).outTangent = num6 / num5; break; } case TangentMode.Linear: ((Keyframe)(ref val)).inTangent = 0f; ((Keyframe)(ref val)).outTangent = 0f; break; } curve.MoveKey(index, val); } } public class AttachToPlayerHUD : MonoBehaviour { [field: SerializeField] public Vector3 Position { get; private set; } [field: SerializeField] public Vector2 WidthHeight { get; private set; } private void Start() { //IL_0006: 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) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) ((Transform)(RectTransform)((Component)this).transform).SetParent(GameNetworkManager.Instance.localPlayerController.playerHudUIContainer, false); ((RectTransform)((Component)this).transform).anchoredPosition3D = Position; ((RectTransform)((Component)this).transform).sizeDelta = WidthHeight; } } [Serializable] public class AudioSourceWithClips { [Tooltip("Near AudioSource that will play the clips.")] public AudioSource nearAudioSource; [Tooltip("List of close audio clips that can be played.")] public AudioClip[] nearClips; [Tooltip("Far AudioSource that will play the clips.")] public AudioSource farAudioSource; [Tooltip("List of far audio clips that can be played.")] public AudioClip[] farClips; } public class BetterCooldownTrigger : NetworkBehaviour { public enum DeathAnimation { Default, HeadBurst, Spring, Electrocuted, ComedyMask, TragedyMask, Burnt, Snipped, SliceHead, PlaceHolder1, PlaceHolder2, PlaceHolder3, PlaceHolder4, PlaceHolder5, PlaceHolder6 } public enum ForceDirection { Forward, Backward, Up, Down, Left, Right, Center } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BetterCooldownTrigger <>4__this; public EnemyAI enemy; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown int num = <>1__state; BetterCooldownTrigger betterCooldownTrigger = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (betterCooldownTrigger.enemyCoroutineStatus[enemy]) { if (betterCooldownTrigger.sharedCooldown && Time.time < lastDamageTime + betterCooldownTrigger.damageIntervalForEnemies) { <>2__current = null; <>1__state = 1; return true; } lastDamageTime = Time.time; betterCooldownTrigger.ApplyDamageToEnemy(enemy); <>2__current = (object)new WaitForSeconds(betterCooldownTrigger.damageIntervalForEnemies); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__47 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BetterCooldownTrigger <>4__this; public PlayerControllerB player; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown int num = <>1__state; BetterCooldownTrigger betterCooldownTrigger = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (betterCooldownTrigger.playerCoroutineStatus[player]) { if (betterCooldownTrigger.sharedCooldown && Time.time < lastDamageTime + betterCooldownTrigger.damageIntervalForPlayers) { <>2__current = null; <>1__state = 1; return true; } lastDamageTime = Time.time; betterCooldownTrigger.ApplyDamageToPlayer(player); <>2__current = (object)new WaitForSeconds(betterCooldownTrigger.damageIntervalForPlayers); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__44 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BetterCooldownTrigger <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__44(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown int num = <>1__state; BetterCooldownTrigger betterCooldownTrigger = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if (betterCooldownTrigger.damageDuration <= 0f) { return false; } <>2__current = (object)new WaitForSeconds(betterCooldownTrigger.damageDuration); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)betterCooldownTrigger).gameObject.SetActive(false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Script Enabled")] [Tooltip("Whether this script is enabled.")] public bool enabledScript = true; [Header("Death Animation Settings")] [Tooltip("Different ragdoll body types that spawn after death.")] public DeathAnimation deathAnimation; [Space(2f)] [Header("Force Settings")] [Tooltip("The force direction of the damage.")] public ForceDirection forceDirection; [Tooltip("The force magnitude of the damage.")] public float forceMagnitudeAfterDamage; [Tooltip("The force magnitude after death of player.")] public float forceMagnitudeAfterDeath; [Tooltip("If true, the force direction will be calculated from the object's transform. If false, the force direction will be calculated from the player's transform.")] public bool forceDirectionFromThisObject = true; [Space(2f)] [Header("Cause of Death")] [Tooltip("Cause of death displayed in ScanNode after death.")] public CauseOfDeath causeOfDeath; [Space(2f)] [Header("Trigger Settings")] [Tooltip("Whether to trigger for players.")] public bool triggerForPlayers; [Tooltip("Whether to trigger for enemies.")] public bool triggerForEnemies; [Tooltip("Whether player/enemy can exit the trigger's effect.")] public bool canThingExit = true; [Tooltip("Whether to use shared cooldown between different GameObjects that use this script.")] public bool sharedCooldown; [Tooltip("Whether to play default player damage SFX when damage is dealt.")] public bool playDefaultPlayerDamageSFX; [Tooltip("Whether to play sound when damage is dealt to player that enemies can hear.")] public bool soundAttractsDogs; [Space(2f)] [Header("Damage Settings")] [Tooltip("Enemy Main Script if put on an enemy")] public EnemyAI? enemyMainScript; [Tooltip("Timer in which the gameobject will disable itself, 0 will not disable itself after any point of time.")] public float damageDuration; [Tooltip("Damage to deal every interval for players.")] public int damageToDealForPlayers; [Tooltip("Damage to deal every interval for enemies.")] public int damageToDealForEnemies; [Tooltip("Cooldown to deal damage for players.")] public float damageIntervalForPlayers = 0.25f; [Tooltip("Cooldown to deal damage for enemies.")] public float damageIntervalForEnemies = 0.25f; [Space(2f)] [Header("Audio Settings")] [Tooltip("Damage clip to play when damage is dealt to player/enemy.")] public List damageClips = new List(); [Tooltip("Damage audio sources to play when damage is dealt to player (picks the closest AudioSource to the player).")] public List damageAudioSources = new List(); [Space(2f)] [Header("Death Prefab Settings")] [Tooltip("Prefab to spawn when the player dies.")] public GameObject? deathPrefabForPlayer; [Tooltip("Prefab to spawn when the enemy dies.")] public GameObject? deathPrefabForEnemy; [Space(2f)] [Header("Particle System Settings")] [Tooltip("Use particle systems when damage is dealt to player/enemy.")] public bool useParticleSystems; [Tooltip("Teleport particle system to enemy/player when damage is dealt.")] public bool teleportParticles; [Tooltip("Particle system to play when the player dies.")] public List deathParticlesForPlayer = new List(); [Tooltip("Particle system to play when the player is damaged.")] public List damageParticlesForPlayer = new List(); [Tooltip("Particle system to play when the enemy dies.")] public List deathParticlesForEnemy = new List(); [Tooltip("Particle system to play when the enemy is damaged.")] public List damageParticlesForEnemy = new List(); [Space(2f)] [Header("Display Message Settings")] [Tooltip("Whether to display message to player once damage is dealt to player.")] public bool displayMessage; [Tooltip("Header of message to display to player once damage is dealt to player.")] public string headerText = "Damage Dealt!"; [Tooltip("Message to display to player once damage is dealt to player.")] public string message = "Damage dealt!"; [Tooltip("Interval between displaying message to player once damage is dealt to player.")] public float messageInterval = 10f; private static float lastDamageTime = float.NegativeInfinity; private static float lastTipTime = float.NegativeInfinity; private Dictionary playerCoroutineStatus = new Dictionary(); private Dictionary enemyCoroutineStatus = new Dictionary(); private Dictionary playerClosestAudioSources = new Dictionary(); private Dictionary enemyClosestAudioSources = new Dictionary(); public void SetupFields(bool enableScripts = true, bool damagePlayers = true, bool damageEnemies = true, DeathAnimation deathAnimation = DeathAnimation.Default, ForceDirection forceDirection = ForceDirection.Down, float forceMagnitudeAfterDamage = 0f, float forceMagnitudeAfterDeath = 0f, bool forceDirectionFromThisObject = true, CauseOfDeath causeOfDeath = 10, bool canThingExit = true, bool sharedCooldown = false, bool playDefaultPlayerDamageSFX = true, bool soundAttractsDogs = true, float damageDuration = 0f, int damageToDealForPlayers = 0, float damageIntervalForPlayers = 0f, int damageToDealForEnemies = 0, float damageIntervalForEnemies = 0f, List? damageClips = null, List? damageAudioSources = null, GameObject? deathPrefabForPlayer = null, GameObject? deathPrefabForEnemy = null, bool useParticleSystems = false, bool teleportParticles = false, List? damageParticlesForPlayer = null, List? deathParticlesForPlayer = null, List? damageParticlesForEnemy = null, List? deathParticlesForEnemy = null, bool displayMessage = false, string headerText = "Damage", string message = "Damage dealt!", float messageInterval = 10f) { //IL_003e: 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) enabledScript = enableScripts; triggerForPlayers = damagePlayers; triggerForEnemies = damageEnemies; this.deathAnimation = deathAnimation; this.forceDirection = forceDirection; this.forceMagnitudeAfterDamage = forceMagnitudeAfterDamage; this.forceMagnitudeAfterDeath = forceMagnitudeAfterDeath; this.forceDirectionFromThisObject = forceDirectionFromThisObject; this.causeOfDeath = causeOfDeath; this.canThingExit = canThingExit; this.sharedCooldown = sharedCooldown; this.playDefaultPlayerDamageSFX = playDefaultPlayerDamageSFX; this.soundAttractsDogs = soundAttractsDogs; this.damageDuration = damageDuration; this.damageToDealForPlayers = damageToDealForPlayers; this.damageIntervalForPlayers = damageIntervalForPlayers; this.damageToDealForEnemies = damageToDealForEnemies; this.damageIntervalForEnemies = damageIntervalForEnemies; if (damageClips == null) { damageClips = new List(); } this.damageClips = damageClips; if (damageAudioSources == null) { damageAudioSources = new List(); } this.damageAudioSources = damageAudioSources; this.deathPrefabForPlayer = deathPrefabForPlayer; this.deathPrefabForEnemy = deathPrefabForEnemy; this.useParticleSystems = useParticleSystems; this.teleportParticles = teleportParticles; if (damageParticlesForPlayer == null) { damageParticlesForPlayer = new List(); } this.damageParticlesForPlayer = damageParticlesForPlayer; if (deathParticlesForPlayer == null) { deathParticlesForPlayer = new List(); } this.deathParticlesForPlayer = deathParticlesForPlayer; if (damageParticlesForEnemy == null) { damageParticlesForEnemy = new List(); } this.damageParticlesForEnemy = damageParticlesForEnemy; if (deathParticlesForEnemy == null) { deathParticlesForEnemy = new List(); } this.deathParticlesForEnemy = deathParticlesForEnemy; this.displayMessage = displayMessage; this.headerText = headerText; this.message = message; this.messageInterval = messageInterval; } public void OnEnable() { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB key in allPlayerScripts) { playerCoroutineStatus[key] = false; } ((UnityEvent)(object)StartOfRound.Instance.playerTeleportedEvent).AddListener((UnityAction)RemovePlayerFromList); ((MonoBehaviour)this).StartCoroutine(ManageDamageTimer()); } private void RemovePlayerFromList(PlayerControllerB player) { if (playerCoroutineStatus.ContainsKey(player) && playerCoroutineStatus[player]) { playerCoroutineStatus[player] = false; } } [IteratorStateMachine(typeof(d__44))] private IEnumerator ManageDamageTimer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__44(0) { <>4__this = this }; } private void OnTriggerEnter(Collider other) { if (!enabledScript) { return; } PlayerControllerB val = default(PlayerControllerB); if (triggerForPlayers && ((Component)other).gameObject.layer == 3 && ((Component)other).TryGetComponent(ref val) && PlayerControllerBExtensions.IsLocalPlayer(val)) { if (playerCoroutineStatus.ContainsKey(val)) { playerCoroutineStatus[val] = true; if (damageAudioSources.Count > 0) { playerClosestAudioSources[val] = GetClosestAudioSource(((Component)val).transform); } Plugin.ExtendedLogging("Player Coroutine Started"); ((MonoBehaviour)this).StartCoroutine(DamagePlayerCoroutine(val)); } } else { if (!triggerForEnemies) { return; } Transform val2 = CRUtilities.TryFindRoot(((Component)other).transform); EnemyAI val3 = default(EnemyAI); if ((Object)(object)val2 != (Object)null && ((Component)val2).TryGetComponent(ref val3) && !val3.isEnemyDead && (!((Object)(object)enemyMainScript != (Object)null) || (!((Object)(object)val3 == (Object)(object)enemyMainScript) && (!(enemyMainScript is RedwoodTitanAI redwoodTitanAI) || !((Object)(object)val3 == (Object)(object)redwoodTitanAI.targetEnemy)))) && !enemyCoroutineStatus.ContainsKey(val3)) { enemyCoroutineStatus[val3] = true; if (damageAudioSources.Count > 0) { enemyClosestAudioSources[val3] = GetClosestAudioSource(((Component)val3).transform); } ((MonoBehaviour)this).StartCoroutine(DamageEnemyCoroutine(val3)); } } } private void OnTriggerExit(Collider other) { if (!enabledScript || !canThingExit) { return; } PlayerControllerB val = default(PlayerControllerB); if (triggerForPlayers && ((Component)other).gameObject.layer == 3 && ((Component)other).TryGetComponent(ref val) && (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val) { Plugin.ExtendedLogging("Player Coroutine Stopped"); RemovePlayerFromList(val); playerClosestAudioSources.Remove(val); } else if (triggerForEnemies) { Transform val2 = CRUtilities.TryFindRoot(((Component)other).transform); EnemyAI key = default(EnemyAI); if ((Object)(object)val2 != (Object)null && ((Component)val2).TryGetComponent(ref key)) { enemyCoroutineStatus[key] = false; enemyClosestAudioSources.Remove(key); } } } [IteratorStateMachine(typeof(d__47))] private IEnumerator DamagePlayerCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__47(0) { <>4__this = this, player = player }; } [IteratorStateMachine(typeof(d__48))] private IEnumerator DamageEnemyCoroutine(EnemyAI enemy) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { <>4__this = this, enemy = enemy }; } private void ApplyDamageToPlayer(PlayerControllerB player) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) Vector3 val = CalculateForceDirection(player, forceMagnitudeAfterDamage); Vector3 val2 = CalculateForceDirection(player, forceMagnitudeAfterDeath); player.DamagePlayer(damageToDealForPlayers, playDefaultPlayerDamageSFX, true, causeOfDeath, (int)deathAnimation, false, val2); if (displayMessage && Time.time >= lastTipTime + messageInterval) { HUDManager.Instance.DisplayTip(headerText, message, true, false, "LC_Tip1"); lastTipTime = Time.time; } PlayDamageSound(((Component)player).transform, playerClosestAudioSources.ContainsKey(player) ? playerClosestAudioSources[player] : null); if (teleportParticles) { foreach (ParticleSystem item in damageParticlesForPlayer) { if ((Object)(object)item != (Object)null) { ((Component)item).transform.position = ((Component)player).transform.position; } } foreach (ParticleSystem item2 in deathParticlesForPlayer) { if ((Object)(object)item2 != (Object)null) { ((Component)item2).transform.position = ((Component)player).transform.position; } } } if (!player.isPlayerDead) { player.externalForces += val; } else if ((Object)(object)deathPrefabForPlayer != (Object)null && (Object)(object)deathPrefabForPlayer.GetComponent() != (Object)null) { SpawnDeathPrefabServerRpc(((Component)player).transform.position, ((Component)player).transform.rotation, forPlayer: true); } else if ((Object)(object)deathPrefabForPlayer != (Object)null) { Object.Instantiate(deathPrefabForPlayer, ((Component)player).transform.position, ((Component)player).transform.rotation); playerCoroutineStatus[player] = false; playerClosestAudioSources.Remove(player); } if (useParticleSystems) { HandleParticleSystemStuffServerRpc(((Component)player).transform.position, forPlayer: true, player.isPlayerDead); } } private void ApplyDamageToEnemy(EnemyAI enemy) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) enemy.HitEnemy(damageToDealForEnemies, (PlayerControllerB)null, false, -1); PlayDamageSound(((Component)enemy).transform, enemyClosestAudioSources.ContainsKey(enemy) ? enemyClosestAudioSources[enemy] : null); if (enemy.isEnemyDead) { if ((Object)(object)deathPrefabForEnemy != (Object)null && (Object)(object)deathPrefabForEnemy.GetComponent() != (Object)null) { SpawnDeathPrefabServerRpc(((Component)enemy).transform.position, ((Component)enemy).transform.rotation, forPlayer: false); } else if ((Object)(object)deathPrefabForEnemy != (Object)null) { Object.Instantiate(deathPrefabForEnemy, ((Component)enemy).transform.position, ((Component)enemy).transform.rotation); } enemyCoroutineStatus[enemy] = false; enemyClosestAudioSources.Remove(enemy); } if (useParticleSystems) { HandleParticleSystemStuffServerRpc(((Component)enemy).transform.position, forPlayer: false, enemy.isEnemyDead); } } [ServerRpc(RequireOwnership = false)] private void HandleParticleSystemStuffServerRpc(Vector3 position, bool forPlayer, bool isDead) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2523385192u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref forPlayer, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isDead, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2523385192u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HandleParticleSystemStuffClientRpc(position, forPlayer, isDead); } } } [ClientRpc] private void HandleParticleSystemStuffClientRpc(Vector3 position, bool forPlayer, bool isDead) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(102729034u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref forPlayer, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isDead, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 102729034u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (teleportParticles) { if (forPlayer) { foreach (ParticleSystem item in damageParticlesForPlayer) { if ((Object)(object)item != (Object)null) { ((Component)item).transform.position = position; } } foreach (ParticleSystem item2 in deathParticlesForPlayer) { if ((Object)(object)item2 != (Object)null) { ((Component)item2).transform.position = position; } } } else { foreach (ParticleSystem item3 in damageParticlesForEnemy) { if ((Object)(object)item3 != (Object)null) { ((Component)item3).transform.position = position; } } foreach (ParticleSystem item4 in deathParticlesForEnemy) { if ((Object)(object)item4 != (Object)null) { ((Component)item4).transform.position = position; } } } } if (forPlayer) { if (!isDead && damageParticlesForPlayer.Count > 0) { ParticleSystem val3 = damageParticlesForPlayer[Random.Range(0, damageParticlesForPlayer.Count)]; val3.Play(); } else if (isDead && deathParticlesForPlayer.Count > 0) { ParticleSystem val4 = deathParticlesForPlayer[Random.Range(0, deathParticlesForPlayer.Count)]; val4.Play(); } } else if (!isDead && damageParticlesForEnemy.Count > 0) { ParticleSystem val5 = damageParticlesForEnemy[Random.Range(0, damageParticlesForEnemy.Count)]; val5.Play(); } else if (isDead && deathParticlesForEnemy.Count > 0) { ParticleSystem val6 = deathParticlesForEnemy[Random.Range(0, deathParticlesForEnemy.Count)]; val6.Play(); } } [ServerRpc(RequireOwnership = false)] private void SpawnDeathPrefabServerRpc(Vector3 position, Quaternion rotation, bool forPlayer) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1574480725u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref forPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1574480725u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (forPlayer) { Object.Instantiate(deathPrefabForPlayer, position, rotation); GameObject? obj = deathPrefabForPlayer; if (obj != null) { obj.GetComponent().Spawn(false); } } else { Object.Instantiate(deathPrefabForEnemy, position, rotation); GameObject? obj2 = deathPrefabForEnemy; if (obj2 != null) { obj2.GetComponent().Spawn(false); } } } private Vector3 CalculateForceDirection(PlayerControllerB player, float baseForce) { //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_004f: 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_007a: 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_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0180: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; switch (forceDirection) { case ForceDirection.Forward: val = (forceDirectionFromThisObject ? ((Component)this).transform.forward : ((Component)player).transform.forward); break; case ForceDirection.Backward: val = (forceDirectionFromThisObject ? (-((Component)this).transform.forward) : (-((Component)player).transform.forward)); break; case ForceDirection.Up: val = (forceDirectionFromThisObject ? ((Component)this).transform.up : ((Component)player).transform.up); break; case ForceDirection.Down: val = (forceDirectionFromThisObject ? (-((Component)this).transform.up) : (-((Component)player).transform.up)); break; case ForceDirection.Left: val = (forceDirectionFromThisObject ? (-((Component)this).transform.right) : (-((Component)player).transform.right)); break; case ForceDirection.Right: val = (forceDirectionFromThisObject ? ((Component)this).transform.right : ((Component)player).transform.right); break; case ForceDirection.Center: { Vector3 val2; Vector3 normalized; if (!forceDirectionFromThisObject) { val2 = ((Component)this).transform.position - ((Component)player).transform.position; normalized = ((Vector3)(ref val2)).normalized; } else { val2 = ((Component)player).transform.position - ((Component)this).transform.position; normalized = ((Vector3)(ref val2)).normalized; } val = normalized; break; } } return ((Vector3)(ref val)).normalized * baseForce; } private void PlayDamageSound(Transform targetTransform, AudioSource? audioSource) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (soundAttractsDogs) { RoundManager.Instance.PlayAudibleNoise(((Component)targetTransform).transform.position, ((Object)(object)audioSource != (Object)null) ? audioSource.maxDistance : 10f, ((Object)(object)audioSource != (Object)null) ? audioSource.volume : 0.85f, 0, false, 0); } if (damageClips.Count > 0 && (Object)(object)audioSource != (Object)null) { WalkieTalkie.TransmitOneShotAudio(audioSource, damageClips[Random.Range(0, damageClips.Count)], audioSource.volume); RoundManager.PlayRandomClip(audioSource, damageClips.ToArray(), true, audioSource.volume, 0, damageClips.Count); } } private AudioSource GetClosestAudioSource(Transform targetTransform) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) AudioSource val = damageAudioSources[0]; float num = Vector3.Distance(((Component)val).transform.position, targetTransform.position); foreach (AudioSource damageAudioSource in damageAudioSources) { float num2 = Vector3.Distance(((Component)damageAudioSource).transform.position, targetTransform.position); if (num2 < num) { val = damageAudioSource; num = num2; } } return val; } public void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); playerCoroutineStatus.Clear(); enemyCoroutineStatus.Clear(); playerClosestAudioSources.Clear(); enemyClosestAudioSources.Clear(); ((UnityEvent)(object)StartOfRound.Instance.playerTeleportedEvent).RemoveListener((UnityAction)RemovePlayerFromList); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2523385192u, new RpcReceiveHandler(__rpc_handler_2523385192), "HandleParticleSystemStuffServerRpc"); ((NetworkBehaviour)this).__registerRpc(102729034u, new RpcReceiveHandler(__rpc_handler_102729034), "HandleParticleSystemStuffClientRpc"); ((NetworkBehaviour)this).__registerRpc(1574480725u, new RpcReceiveHandler(__rpc_handler_1574480725), "SpawnDeathPrefabServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2523385192(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool forPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref forPlayer, default(ForPrimitives)); bool isDead = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isDead, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BetterCooldownTrigger)(object)target).HandleParticleSystemStuffServerRpc(position, forPlayer, isDead); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_102729034(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool forPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref forPlayer, default(ForPrimitives)); bool isDead = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isDead, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BetterCooldownTrigger)(object)target).HandleParticleSystemStuffClientRpc(position, forPlayer, isDead); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1574480725(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); bool forPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref forPlayer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BetterCooldownTrigger)(object)target).SpawnDeathPrefabServerRpc(position, rotation, forPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BetterCooldownTrigger"; } } public class BillboardScript : MonoBehaviour { private Transform parentObject; [Tooltip("Locks the rotational up axis of the billboard.")] public bool lockUpAxis = true; private Camera camera; private void Start() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) camera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; parentObject = ((Component)this).transform.parent; ((Component)this).transform.rotation = parentObject.rotation; } private void Update() { //IL_00ed: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (lockUpAxis) { if (((Component)parentObject).transform.eulerAngles == Vector3.zero) { ((Component)this).gameObject.transform.eulerAngles = new Vector3(((Component)this).gameObject.transform.eulerAngles.x, ((Component)camera).transform.eulerAngles.y + 180f, ((Component)this).gameObject.transform.eulerAngles.z); } else { ((Component)this).gameObject.transform.eulerAngles = new Vector3(((Component)camera).transform.eulerAngles.x, ((Component)parentObject).transform.eulerAngles.y, ((Component)camera).transform.eulerAngles.z); } } else { ((Component)this).gameObject.transform.LookAt(((Component)camera).transform.position); } } } public class BoundsDefiner : MonoBehaviour { public Color boundColor = Color.blue; public Bounds bounds = new Bounds(Vector3.zero, Vector3.one); private void OnDrawGizmosSelected() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = boundColor; Matrix4x4 matrix = Gizmos.matrix; Gizmos.matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, Vector3.one); Gizmos.DrawWireCube(((Bounds)(ref bounds)).center, ((Bounds)(ref bounds)).size); Gizmos.matrix = matrix; } public bool BoundsContainTransform(Transform target) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.InverseTransformPoint(target.position); return ((Bounds)(ref bounds)).Contains(val); } } public enum SaveTypes { Contract, Save, Plugin } public class CommitKeyToSave : NetworkBehaviour { [CompilerGenerated] private static class <>O { public static hook_SaveItemsInShip <0>__SaveKeys; public static hook_AutoSaveShipData <1>__SaveKeys; } internal static readonly NamespacedKey CodeRebirthLoreKey = NamespacedKey.From("code_rebirth", "lore_collection"); private static HashSet _savedContractKeys = new HashSet(); private static HashSet _savedSaveKeys = new HashSet(); private static HashSet _savedPluginKeys = new HashSet(); private static bool _shouldSaveContract = false; private static bool _shouldSaveSave = false; private static bool _shouldSavePlugin = false; [field: SerializeField] public SaveTypes SaveType { get; private set; } [field: SerializeField] public string LoreEntryName { get; private set; } = string.Empty; [field: SerializeField] [field: InspectorName("Namespace")] [field: DefaultKeySource("GetLoreEntryName", false)] public NamespacedKey NamespacedKey { get; private set; } [field: SerializeField] [field: TextArea(2, 10)] public string FoundEntryText { get; private set; } = "Found journal entry: ''"; [field: SerializeField] public bool SaveOnServer { get; private set; } = true; [field: SerializeField] public bool SaveImmediately { get; private set; } internal 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown object obj = <>O.<0>__SaveKeys; if (obj == null) { hook_SaveItemsInShip val = SaveKeys; <>O.<0>__SaveKeys = val; obj = (object)val; } GameNetworkManager.SaveItemsInShip += (hook_SaveItemsInShip)obj; object obj2 = <>O.<1>__SaveKeys; if (obj2 == null) { hook_AutoSaveShipData val2 = SaveKeys; <>O.<1>__SaveKeys = val2; obj2 = (object)val2; } StartOfRound.AutoSaveShipData += (hook_AutoSaveShipData)obj2; } private static void SaveKeys(orig_AutoSaveShipData orig, StartOfRound self) { orig.Invoke(self); SaveKeys(); } private static void SaveKeys(orig_SaveItemsInShip orig, GameNetworkManager self) { orig.Invoke(self); SaveKeys(); } public void CommitKey() { if (!SaveOnServer || ((NetworkBehaviour)this).IsServer) { CommitNamespaceIntoFile(NamespacedKey); } } public void Destroy() { if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } private void CommitNamespaceIntoFile(NamespacedKey key) { switch (SaveType) { case SaveTypes.Contract: _savedContractKeys = ((DataContainer)DawnLib.GetCurrentContract()).GetOrCreateDefault>(CodeRebirthLoreKey); if (!_savedContractKeys.Add(key)) { return; } _shouldSaveContract = true; break; case SaveTypes.Save: _savedSaveKeys = ((DataContainer)DawnLib.GetCurrentSave()).GetOrCreateDefault>(CodeRebirthLoreKey); if (!_savedSaveKeys.Add(key)) { return; } _shouldSaveSave = true; break; case SaveTypes.Plugin: _savedPluginKeys = ((DataContainer)Plugin.PersistentDataContainer).GetOrCreateDefault>(CodeRebirthLoreKey); if (!_savedPluginKeys.Add(key)) { return; } _shouldSavePlugin = true; break; } HUDManager.Instance.DisplayGlobalNotification(FoundEntryText); if (SaveImmediately || StartOfRound.Instance.inShipPhase) { SaveKeys(); } } private static void SaveKeys() { if (_shouldSaveContract) { ((DataContainer)DawnLib.GetCurrentContract()).Set>(CodeRebirthLoreKey, _savedContractKeys); } if (_shouldSaveSave) { ((DataContainer)DawnLib.GetCurrentSave()).Set>(CodeRebirthLoreKey, _savedSaveKeys); } if (_shouldSavePlugin) { ((DataContainer)Plugin.PersistentDataContainer).Set>(CodeRebirthLoreKey, _savedPluginKeys); } _shouldSaveContract = false; _shouldSaveSave = false; _shouldSavePlugin = false; } public string GetLoreEntryName() { return NamespacedKey.NormalizeStringForNamespacedKey(LoreEntryName, false); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CommitKeyToSave"; } } public class CRDropShip : ItemDropship { [Header("Audio")] public AudioSource rumbleSource; public AudioSource audioSource; public AudioClip musicSound; public AudioClip leaveSound; [SerializeField] private Collider colliderEncompasingDropship; private VehicleController? _lastSpawnedVehicle; public void SpawnVehicleAnimEvent() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) base.shipAnimator.SetBool("landing", true); base.shipTimer = 0f; if (((NetworkBehaviour)this).IsServer) { GameObject val = Object.Instantiate(base.terminalScript.buyableVehicles[base.terminalScript.orderedVehicleFromTerminal].vehiclePrefab, base.deliverVehiclePoint.position, base.deliverVehiclePoint.rotation, RoundManager.Instance.VehiclesContainer); val.GetComponent().Spawn(false); if ((Object)(object)base.terminalScript.buyableVehicles[base.terminalScript.orderedVehicleFromTerminal].secondaryPrefab != (Object)null) { Object.Instantiate(base.terminalScript.buyableVehicles[base.terminalScript.orderedVehicleFromTerminal].secondaryPrefab, RoundManager.Instance.VehiclesContainer).GetComponent().Spawn(false); } _lastSpawnedVehicle = val.GetComponent(); } base.untetheredVehicle = true; base.deliveringOrder = true; base.terminalScript.orderedVehicleFromTerminal = -1; base.terminalScript.vehicleInDropship = false; base.deliveringVehicle = false; base.triggerScript.interactable = false; } [ClientRpc] public void PlayRumbleClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2992952287u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2992952287u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; rumbleSource.Play(); } } } public void PlayRumbleAnimEvent() { rumbleSource.Play(); } public void DestroyAnyVehiclesAnimEvent() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_lastSpawnedVehicle == (Object)null)) { Bounds bounds = colliderEncompasingDropship.bounds; if (((Bounds)(ref bounds)).Contains(((Component)_lastSpawnedVehicle).transform.position)) { _lastSpawnedVehicle.DestroyCar(); } } } protected override void __initializeVariables() { ((ItemDropship)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2992952287u, new RpcReceiveHandler(__rpc_handler_2992952287), "PlayRumbleClientRpc"); ((ItemDropship)this).__initializeRpcs(); } private static void __rpc_handler_2992952287(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; ((CRDropShip)(object)target).PlayRumbleClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CRDropShip"; } } public abstract class CRHittable : NetworkBehaviour { public abstract bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1); protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CRHittable"; } } public enum CRItemSpawnerType { Vanilla, Special } [Serializable] public class ItemNameWithRarity { public string Name; public float Rarity; } public class CRItemSpawner : MonoBehaviour { [SerializeField] private bool _spawnOnStart = true; [SerializeField] private CRItemSpawnerType spawnerType; [SerializeField] [Range(0f, 100f)] private float spawnChance; [SerializeField] private List spawnSpots = new List(); [Header("Special Items")] public List specialItemNamesWithRarity = new List(); public void Start() { if (spawnSpots.Count == 0) { spawnSpots.Add(((Component)this).transform); } if (_spawnOnStart && NetworkManager.Singleton.IsServer) { switch (spawnerType) { case CRItemSpawnerType.Vanilla: DoVanillaItemSpawn(); break; case CRItemSpawnerType.Special: DoSpecialItemSpawn(); break; } } } public void DoVanillaItemSpawn() { //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) if (NetworkManager.Singleton.IsServer && !((float)Random.Range(0, 100) >= spawnChance)) { Item randomVanillaItem = Merchant.GetRandomVanillaItem(excludeShopItems: false); Vector3 position = spawnSpots[Random.Range(0, spawnSpots.Count)].position; CodeRebirthUtils.Instance.SpawnScrap(randomVanillaItem, position); } } public void DoSpecialItemSpawn() { //IL_00f8: 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) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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) if (!NetworkManager.Singleton.IsServer || (float)Random.Range(0, 100) >= spawnChance) { return; } List<(Item, float)> list = new List<(Item, float)>(); foreach (ItemNameWithRarity itemNamesWithRarity in specialItemNamesWithRarity) { Item val = ((IEnumerable)StartOfRound.Instance.allItemsList.itemsList).FirstOrDefault((Func)((Item x) => x.itemName == itemNamesWithRarity.Name)); if ((Object)(object)val == (Object)null) { Plugin.Logger.LogWarning((object)("Item not found: " + itemNamesWithRarity.Name)); } else { list.Add((val, itemNamesWithRarity.Rarity)); } } if (list.Count != 0) { Item item = CRUtilities.ChooseRandomWeightedType(list); Vector3 position = spawnSpots[Random.Range(0, spawnSpots.Count)].position; CodeRebirthUtils.Instance.SpawnScrap(item, position); } } } [RequireComponent(typeof(Collider))] public class CRNoiseListener : MonoBehaviour, INoiseListener { [SerializeField] internal UnityEvent _onNoiseDetected = new UnityEvent(); public void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _onNoiseDetected.Invoke(new NoiseParams(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID)); } } [Serializable] public class NoiseParams { internal Vector3 noisePosition; internal float noiseLoudness; internal int timesPlayedInOneSpot; internal int noiseID; public NoiseParams(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) this.noisePosition = noisePosition; this.noiseLoudness = noiseLoudness; this.timesPlayedInOneSpot = timesPlayedInOneSpot; this.noiseID = noiseID; base..ctor(); } } [Serializable] public class CRObjectTypeWithRarity { public string CRObjectName; public int Rarity; } public class CRUtilities { [CompilerGenerated] private sealed class <>c__DisplayClass8_0 { public int playerObj; public float startTime; internal bool b__0() { if (!((Object)(object)StartOfRound.Instance.allPlayerScripts[playerObj].deadBody != (Object)null)) { return Time.realtimeSinceStartup - startTime > 2f; } return true; } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float length; public float intensity; public PlayerControllerB player; private float 5__2; private float 5__3; private Vector2 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0039: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = length; 5__3 = 0f; 5__4 = new Vector2(0f, 1f) * intensity; break; case 1: <>1__state = -1; break; } if (5__3 <= 5__2) { CalculateVerticalLookingInput(5__4, player); 5__3 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float intensity; public PlayerControllerB player; private float 5__2; private float 5__3; private Vector2 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 1f / intensity; 5__3 = 0f; 5__4 = new Vector2(0f, 1f) * intensity; break; case 1: <>1__state = -1; break; } if (5__3 <= 5__2) { CalculateVerticalLookingInput(5__4, player); 5__3 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int playerObj; private <>c__DisplayClass8_0 <>8__1; public Vector3 teleportPosition; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0155: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass8_0(); <>8__1.playerObj = playerObj; <>8__1.startTime = Time.realtimeSinceStartup; <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)StartOfRound.Instance.allPlayerScripts[<>8__1.playerObj].deadBody != (Object)null || Time.realtimeSinceStartup - <>8__1.startTime > 2f)); <>1__state = 1; return true; case 1: { <>1__state = -1; if (StartOfRound.Instance.inShipPhase || SceneManager.sceneCount <= 1) { return false; } DeadBodyInfo deadBody = StartOfRound.Instance.allPlayerScripts[<>8__1.playerObj].deadBody; if ((Object)(object)deadBody != (Object)null) { deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.secondaryAttachedLimb = null; deadBody.secondaryAttachedTo = null; if ((Object)(object)deadBody.grabBodyObject != (Object)null && deadBody.grabBodyObject.isHeld && (Object)(object)deadBody.grabBodyObject.playerHeldBy != (Object)null) { deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); } deadBody.isInShip = false; deadBody.parentedToShip = false; ((Component)deadBody).transform.SetParent((Transform)null, true); deadBody.SetRagdollPositionSafely(teleportPosition, true); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Dictionary _masksByLayer = new Dictionary(); private static AudioReverbPresets? audioReverbPreset = null; private static Collider[] cachedColliders = (Collider[])(object)new Collider[64]; private static Dictionary playerControllerBToDamage = new Dictionary(); private static Dictionary enemyAICollisionDetectToDamage = new Dictionary(); private static Dictionary explodeablesToDamage = new Dictionary(); private static List landmineList = new List(); private static List hittablesList = new List(); public static void Init() { GenerateLayerMap(); } public static Transform? TryFindRoot(Transform child) { Transform val = child; while ((Object)(object)val != (Object)null && (Object)(object)((Component)val).GetComponent() == (Object)null) { val = ((Component)val).transform.parent; } return val; } public static void GenerateLayerMap() { _masksByLayer = new Dictionary(); for (int i = 0; i < 32; i++) { int num = 0; for (int j = 0; j < 32; j++) { if (!Physics.GetIgnoreLayerCollision(i, j)) { num |= 1 << j; } } _masksByLayer.Add(i, num); } } public static int MaskForLayer(int layer) { return _masksByLayer[layer]; } public static void TeleportPlayerToShip(int playerObj, Vector3 teleportPos) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; if ((Object)(object)audioReverbPreset != (Object)null) { audioReverbPreset.audioPresets[3].ChangeAudioReverbForPlayer(val); } else { audioReverbPreset = Object.FindObjectOfType(); audioReverbPreset.audioPresets[3].ChangeAudioReverbForPlayer(val); } val.isInElevator = true; val.isInHangarShipRoom = true; val.isInsideFactory = false; val.averageVelocity = 0f; val.velocityLastFrame = Vector3.zero; StartOfRound.Instance.allPlayerScripts[playerObj].TeleportPlayer(teleportPos, false, 0f, false, true); StartOfRound.Instance.allPlayerScripts[playerObj].beamOutParticle.Play(); if (PlayerControllerBExtensions.IsLocalPlayer(val)) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } [IteratorStateMachine(typeof(d__8))] public static IEnumerator TeleportPlayerBody(int playerObj, Vector3 teleportPosition) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { playerObj = playerObj, teleportPosition = teleportPosition }; } public static void TeleportEnemy(EnemyAI enemy, Vector3 teleportPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) enemy.serverPosition = teleportPos; ((Component)enemy).transform.position = teleportPos; enemy.agent.Warp(teleportPos); enemy.SyncPositionToClients(); } public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect, int damage, float minDamageRange, float maxDamageRange, int enemyHitForce, PlayerControllerB? attacker, GameObject? overridePrefab, float pushForce) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) Plugin.ExtendedLogging($"Spawning explosion at pos: {explosionPosition}"); Transform val = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null) { val = RoundManager.Instance.mapPropsContainer.transform; } if (spawnExplosionEffect) { float num = Mathf.Clamp((maxDamageRange - minDamageRange) / 4f, 0.25f, 20f); GameObject val2; if ((Object)(object)overridePrefab == (Object)null) { val2 = Object.Instantiate(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val); AudioSource componentInChildren = val2.GetComponentInChildren(); componentInChildren.maxDistance *= num; ParticleSystem[] componentsInChildren = val2.GetComponentsInChildren(); foreach (ParticleSystem val3 in componentsInChildren) { Transform transform = ((Component)val3).gameObject.transform; transform.localScale *= num; } } else { val2 = Object.Instantiate(overridePrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val); } val2.SetActive(true); } float num2 = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num2 <= 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); } else if (num2 <= 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } int num3 = Physics.OverlapSphereNonAlloc(explosionPosition, maxDamageRange, cachedColliders, MoreLayerMasks.PlayersAndInteractableAndEnemiesAndPropsHazardMask, (QueryTriggerInteraction)2); RaycastHit val4 = default(RaycastHit); PlayerControllerB val5 = default(PlayerControllerB); EnemyAICollisionDetect key = default(EnemyAICollisionDetect); IExplodeable key2 = default(IExplodeable); IHittable item = default(IHittable); for (int j = 0; j < num3; j++) { Plugin.ExtendedLogging("Explosion hit " + ((Object)cachedColliders[j]).name); float num4 = Vector3.Distance(explosionPosition, cachedColliders[j].ClosestPoint(explosionPosition)); if (num4 > 4f && Physics.Linecast(explosionPosition, ((Component)cachedColliders[j]).transform.position + Vector3.up * 0.3f, ref val4, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { continue; } if (((Component)cachedColliders[j]).gameObject.layer == 3 && ((Component)cachedColliders[j]).TryGetComponent(ref val5)) { if (val5.isPlayerControlled && !val5.isPlayerDead) { int num5 = (int)((float)damage * (1f - Mathf.Clamp01((num4 - minDamageRange) / (maxDamageRange - minDamageRange)))); if (playerControllerBToDamage.ContainsKey(val5) && playerControllerBToDamage[val5].damage < num5) { playerControllerBToDamage[val5] = (num4, num5); } else if (!playerControllerBToDamage.ContainsKey(val5)) { playerControllerBToDamage.Add(val5, (num4, num5)); } } } else if (((Component)cachedColliders[j]).gameObject.layer == 19 && ((Component)cachedColliders[j]).TryGetComponent(ref key)) { if (enemyAICollisionDetectToDamage.ContainsKey(key) && enemyAICollisionDetectToDamage[key].damage < enemyHitForce) { enemyAICollisionDetectToDamage[key] = (num4, enemyHitForce); } else if (!enemyAICollisionDetectToDamage.ContainsKey(key)) { enemyAICollisionDetectToDamage.Add(key, (num4, enemyHitForce)); } } else if (((Component)cachedColliders[j]).gameObject.layer == 21 && num4 < maxDamageRange) { Landmine componentInChildren2 = ((Component)cachedColliders[j]).gameObject.GetComponentInChildren(); if (!((Object)(object)componentInChildren2 == (Object)null) && !landmineList.Contains(componentInChildren2)) { landmineList.Add(componentInChildren2); } } else if (((Component)cachedColliders[j]).TryGetComponent(ref key2)) { if (explodeablesToDamage.ContainsKey(key2) && explodeablesToDamage[key2].damage < enemyHitForce) { explodeablesToDamage[key2] = (num4, enemyHitForce); } else if (!explodeablesToDamage.ContainsKey(key2)) { explodeablesToDamage.Add(key2, (num4, enemyHitForce)); } } else if (((Component)cachedColliders[j]).TryGetComponent(ref item) && !hittablesList.Contains(item)) { hittablesList.Add(item); } } Vector3 val6; for (int num6 = playerControllerBToDamage.Count - 1; num6 >= 0; num6--) { PlayerControllerB key3 = playerControllerBToDamage.ElementAt(num6).Key; val6 = ((Component)key3).transform.position - explosionPosition; Vector3 normalized = ((Vector3)(ref val6)).normalized; key3.DamagePlayer(playerControllerBToDamage[key3].damage, true, true, (CauseOfDeath)13, 6, false, normalized * pushForce * 5f); key3.externalForceAutoFade += normalized * pushForce; } for (int num7 = enemyAICollisionDetectToDamage.Count - 1; num7 >= 0; num7--) { EnemyAICollisionDetect key4 = enemyAICollisionDetectToDamage.ElementAt(num7).Key; if (!((Object)(object)key4.mainScript == (Object)null) && ((NetworkBehaviour)key4.mainScript).IsSpawned) { if ((Object)(object)attacker != (Object)null) { if (PlayerControllerBExtensions.IsLocalPlayer(attacker)) { EnemyAI mainScript = key4.mainScript; int item2 = enemyAICollisionDetectToDamage[key4].damage; PlayerControllerB val7 = attacker; val6 = default(Vector3); mainScript.HitEnemyOnLocalClient(item2, val6, val7, false, -1); } } else if (((NetworkBehaviour)key4.mainScript).IsOwner) { EnemyAI mainScript2 = key4.mainScript; int item3 = enemyAICollisionDetectToDamage[key4].damage; PlayerControllerB val7 = attacker; val6 = default(Vector3); mainScript2.HitEnemyOnLocalClient(item3, val6, val7, false, -1); } if (((NetworkBehaviour)key4.mainScript).IsOwner) { key4.mainScript.HitFromExplosion(enemyAICollisionDetectToDamage[key4].distance); } } } for (int num8 = landmineList.Count - 1; num8 >= 0; num8--) { ((MonoBehaviour)landmineList[num8]).StartCoroutine(landmineList[num8].TriggerOtherMineDelayed(landmineList[num8])); } for (int num9 = hittablesList.Count - 1; num9 >= 0; num9--) { IHittable val8 = hittablesList[num9]; if (NetworkManager.Singleton.IsServer) { val8.Hit(5, explosionPosition, attacker, true, -1); } } for (int num10 = explodeablesToDamage.Count - 1; num10 >= 0; num10--) { if (NetworkManager.Singleton.IsServer) { IExplodeable key5 = explodeablesToDamage.ElementAt(num10).Key; key5.OnExplosion(explodeablesToDamage[key5].damage, explosionPosition, explodeablesToDamage[key5].distance); } } playerControllerBToDamage.Clear(); enemyAICollisionDetectToDamage.Clear(); landmineList.Clear(); hittablesList.Clear(); explodeablesToDamage.Clear(); } public static void MakePlayerGrabObject(PlayerControllerB player, GrabbableObject grabbableObject) { //IL_014e: Unknown result type (might be due to invalid IL or missing references) player.currentlyGrabbingObject = grabbableObject; player.currentlyGrabbingObject.InteractItem(); if (player.currentlyGrabbingObject.grabbable && player.FirstEmptyItemSlot((GrabbableObject)null) != -1) { player.playerBodyAnimator.SetBool("GrabInvalidated", false); player.playerBodyAnimator.SetBool("GrabValidated", false); player.playerBodyAnimator.SetBool("cancelHolding", false); player.playerBodyAnimator.ResetTrigger("Throw"); player.SetSpecialGrabAnimationBool(true, (GrabbableObject)null); player.isGrabbingObjectAnimation = true; ((Behaviour)player.cursorIcon).enabled = false; ((TMP_Text)player.cursorTip).text = ""; player.twoHanded = player.currentlyGrabbingObject.itemProperties.twoHanded; player.carryWeight = Mathf.Clamp(player.carryWeight + LateGameUpgradesCompat.TryGetItemWeight(player.currentlyGrabbingObject.itemProperties.weight), 1f, 10f); if (player.currentlyGrabbingObject.itemProperties.grabAnimationTime > 0f) { player.grabObjectAnimationTime = player.currentlyGrabbingObject.itemProperties.grabAnimationTime; } else { player.grabObjectAnimationTime = 0.4f; } if (!player.isTestingPlayer) { Plugin.ExtendedLogging($"heldByPlayerOnServer: {grabbableObject.heldByPlayerOnServer}"); grabbableObject.heldByPlayerOnServer = false; player.GrabObjectServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)grabbableObject).NetworkObject)); } if (player.grabObjectCoroutine != null) { ((MonoBehaviour)player).StopCoroutine(player.grabObjectCoroutine); } player.grabObjectCoroutine = ((MonoBehaviour)player).StartCoroutine(player.GrabObject()); } } public static T? ChooseRandomWeightedType(IEnumerable<(T objectType, float rarity)> rarityList) { List<(T, float)> list = rarityList.Where<(T, float)>(((T objectType, float rarity) x) => x.rarity > 0f).ToList(); float num = 0f; List<(T, float)> list2 = new List<(T, float)>(list.Count); for (int i = 0; i < list.Count; i++) { num += list[i].Item2; list2.Add((list[i].Item1, num)); } float num2 = Random.Range(0f, num); T val = default(T); foreach (var (val2, num3) in list2) { if (num2 < num3) { val = val2; break; } } if (val == null) { Plugin.ExtendedLogging("Could not find a valid object to spawn of type " + typeof(T).Name + "!"); return default(T); } return val; } public static Vector3 CalculateAverageLandNodePosition(IEnumerable nodes) { //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_0018: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; int num = 0; foreach (GameObject node in nodes) { val += node.transform.position; num++; } if (num <= 0) { return Vector3.zero; } return val / (float)num; } [IteratorStateMachine(typeof(d__19))] public static IEnumerator ForcePlayerLookup(PlayerControllerB player, float intensity) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { player = player, intensity = intensity }; } [IteratorStateMachine(typeof(d__20))] public static IEnumerator AlternateForcePlayerLookup(PlayerControllerB player, float length, float intensity) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { player = player, length = length, intensity = intensity }; } public static void CalculateVerticalLookingInput(Vector2 inputVector, PlayerControllerB playerCurrentlyControlling) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!playerCurrentlyControlling.smoothLookEnabledLastFrame) { playerCurrentlyControlling.smoothLookEnabledLastFrame = true; playerCurrentlyControlling.smoothLookTurnCompass.rotation = ((Component)playerCurrentlyControlling.gameplayCamera).transform.rotation; playerCurrentlyControlling.smoothLookTurnCompass.SetParent((Transform)null); } playerCurrentlyControlling.cameraUp -= inputVector.y; playerCurrentlyControlling.cameraUp = Mathf.Clamp(playerCurrentlyControlling.cameraUp, -80f, 60f); playerCurrentlyControlling.smoothLookTurnCompass.localEulerAngles = new Vector3(playerCurrentlyControlling.cameraUp, playerCurrentlyControlling.smoothLookTurnCompass.localEulerAngles.y, playerCurrentlyControlling.smoothLookTurnCompass.localEulerAngles.z); ((Component)playerCurrentlyControlling.gameplayCamera).transform.localEulerAngles = new Vector3(Mathf.LerpAngle(((Component)playerCurrentlyControlling.gameplayCamera).transform.localEulerAngles.x, playerCurrentlyControlling.cameraUp, playerCurrentlyControlling.smoothLookMultiplier * Time.deltaTime), ((Component)playerCurrentlyControlling.gameplayCamera).transform.localEulerAngles.y, ((Component)playerCurrentlyControlling.gameplayCamera).transform.localEulerAngles.z); } } public class DeathTrigger : MonoBehaviour { public void OnTriggerEnter(Collider other) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); if (((Component)other).TryGetComponent(ref val) && PlayerControllerBExtensions.IsLocalPlayer(val)) { val.KillPlayer(val.velocityLastFrame, true, (CauseOfDeath)8, 0, default(Vector3), false); } } } public class DetectLightInSurroundings : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DetectLightInSurroundings <>4__this; private List<(Light light, HDAdditionalLightData hDAdditionalLightData)>.Enumerator <>7__wrap1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = default(List<(Light, HDAdditionalLightData)>.Enumerator); <>1__state = -2; } private bool MoveNext() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) try { int num = <>1__state; DetectLightInSurroundings detectLightInSurroundings = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; List<(Light, HDAdditionalLightData)> list = new List<(Light, HDAdditionalLightData)>(); detectLightInSurroundings.lightValueOnThisObject = 0f; list.Clear(); list.AddRange(CodeRebirthUtils.currentRoundLightData); <>7__wrap1 = list.GetEnumerator(); <>1__state = -3; break; } case 1: <>1__state = -3; break; } while (<>7__wrap1.MoveNext()) { var (val, val2) = <>7__wrap1.Current; if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null) && ((Behaviour)val).enabled && !((Object)(object)((Component)detectLightInSurroundings).transform == (Object)null) && !((Object)(object)GameNetworkManager.Instance.localPlayerController.nightVision == (Object)(object)val)) { Vector3 position = ((Component)detectLightInSurroundings).transform.position; float num2 = detectLightInSurroundings.CalculateAttenuation(val, position); if (num2 != 0f) { float num3 = val.intensity * num2; detectLightInSurroundings.lightValueOnThisObject += num3; <>2__current = null; <>1__state = 1; return true; } } } <>m__Finally1(); <>7__wrap1 = default(List<(Light, HDAdditionalLightData)>.Enumerator); detectLightInSurroundings.OnLightValueChange.Invoke(detectLightInSurroundings.lightValueOnThisObject); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HideInInspector] public float lightValueOnThisObject; [HideInInspector] public UnityEvent OnLightValueChange = new UnityEvent(); public void OnEnable() { LightUpdateManager.detectLightInSurroundings.Add(this); } public void OnDisable() { LightUpdateManager.detectLightInSurroundings.Remove(this); } [IteratorStateMachine(typeof(d__4))] public IEnumerator UpdateLightValue() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } private float CalculateAttenuation(Light light, Vector3 samplePosition) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_004f: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_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_0018: 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_0024: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) float range = light.range; RaycastHit val = default(RaycastHit); if ((int)light.type == 1) { if ((int)light.shadows != 0 && Physics.Raycast(samplePosition, -((Component)light).transform.forward, ref val, float.PositiveInfinity, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return 0f; } return 1f; } if ((int)light.type == 0) { float num = Vector3.Angle(((Component)light).transform.forward, samplePosition - ((Component)light).transform.position); if (num > light.spotAngle / 2f) { return 0f; } } float num2 = Vector3.Distance(samplePosition, ((Component)light).transform.position); if (num2 > range) { return 0f; } if ((int)light.shadows != 0 && Physics.Linecast(((Component)light).transform.position, samplePosition, ref val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return 0f; } return 1f / (num2 * num2); } public void OnDestroy() { ((MonoBehaviour)this).StopAllCoroutines(); } } public delegate void OnFinishTalking(); public class DuckUI : NetworkBehaviour { [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DuckUI <>4__this; public OnFinishTalking onFinishTalking; private string <>7__wrap1; private int <>7__wrap2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown int num = <>1__state; DuckUI duckUI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((TMP_Text)duckUI.uiText).text = ""; <>7__wrap1 = duckUI.fullText; <>7__wrap2 = 0; goto IL_00ac; case 1: <>1__state = -1; <>7__wrap2++; goto IL_00ac; case 2: { <>1__state = -1; onFinishTalking?.Invoke(); return false; } IL_00ac: if (<>7__wrap2 < <>7__wrap1.Length) { char c = <>7__wrap1[<>7__wrap2]; TextMeshProUGUI uiText = duckUI.uiText; ((TMP_Text)uiText).text = ((TMP_Text)uiText).text + c; <>2__current = (object)new WaitForSeconds(duckUI.talkSpeed); <>1__state = 1; return true; } <>7__wrap1 = null; duckUI.duckTransform.localPosition = duckUI.originalLocalDuckPos; duckUI.isTalking = false; duckUI.duckCoroutine = null; <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DuckUI <>4__this; public bool visible; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DuckUI duckUI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = duckUI.canvasGroup.alpha; 5__3 = (visible ? 1 : 0); 5__4 = 0f; break; case 1: <>1__state = -1; break; } if (5__4 < 0.3f) { duckUI.canvasGroup.alpha = Mathf.Lerp(5__2, 5__3, 5__4 / 0.3f); 5__4 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } duckUI.canvasGroup.alpha = 5__3; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public ItemUI itemUI; [SerializeField] private TextMeshProUGUI uiText; [SerializeField] private Transform duckTransform; public float bobDuration = 1f; public float talkSpeed = 0.1f; public CanvasGroup canvasGroup; private string fullText = string.Empty; private Vector3 originalDuckPos; private Vector3 originalLocalDuckPos; [HideInInspector] public bool isTalking; private float bobTimer; private AnimationCurve bobCurve; private Coroutine? duckCoroutine; public static DuckUI Instance; private void Awake() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_008f: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null) { Instance = this; } else { Object.Destroy((Object)(object)((Component)this).gameObject); } ((Component)this).gameObject.transform.localPosition = Vector3.zero; SetTextManually(""); SetUIVisible(visible: false, instant: true); originalDuckPos = duckTransform.position; originalLocalDuckPos = duckTransform.localPosition; bobCurve = new AnimationCurve(); bobCurve.AddKey(new Keyframe(0f, 0f, 0f, 10f)); bobCurve.AddKey(new Keyframe(0.25f, 1f, 0f, 0f)); bobCurve.AddKey(new Keyframe(0.5f, 0f, 10f, 0f)); bobCurve.AddKey(new Keyframe(0.75f, -1f, 0f, 0f)); bobCurve.AddKey(new Keyframe(1f, 0f, -10f, 0f)); for (int i = 0; i < bobCurve.keys.Length; i++) { AnimationCurveUtil.SetKeyTangentMode(bobCurve, i, AnimationCurveUtil.TangentMode.Smooth); } } public void Update() { //IL_0012: 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) if (isTalking) { duckTransform.position = originalDuckPos; bobTimer += Time.deltaTime * 2.2f; if (bobTimer > bobDuration) { bobTimer = 0f; } float num = bobCurve.Evaluate(bobTimer / bobDuration); float num2 = Mathf.Lerp(140f, 150f, (num + 1f) / 2f); float num3 = originalLocalDuckPos.y + (num2 - 145f); duckTransform.localPosition = new Vector3(originalLocalDuckPos.x, num3, originalLocalDuckPos.z); } } public void SetTextManually(string text) { ((TMP_Text)uiText).text = text; } public void SetUIVisible(bool visible, bool instant = false) { if (instant) { canvasGroup.alpha = (visible ? 1f : 0f); } else { ((MonoBehaviour)this).StartCoroutine(FadeUI(visible)); } } [IteratorStateMachine(typeof(d__18))] private IEnumerator FadeUI(bool visible) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, visible = visible }; } public void StartTalking(string text, float talkspeed, PlayerControllerB targetPlayer, bool isGlobal = false, OnFinishTalking? onFinishTalking = null) { if (!((Object)(object)targetPlayer == (Object)null) && (PlayerControllerBExtensions.IsLocalPlayer(targetPlayer) || isGlobal)) { if (duckCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(duckCoroutine); SetTextManually(""); } talkSpeed = talkspeed; fullText = text; isTalking = true; bobTimer = 0f; duckCoroutine = ((MonoBehaviour)this).StartCoroutine(DuckTalkCoroutine(onFinishTalking)); } } [IteratorStateMachine(typeof(d__20))] private IEnumerator DuckTalkCoroutine(OnFinishTalking? onFinishTalking) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this, onFinishTalking = onFinishTalking }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DuckUI"; } } [CreateAssetMenu(fileName = "DynamicScreenShakeFalloff", menuName = "CodeRebirth/DynamicScreenShakeFalloff", order = 1)] public class DynamicScreenShakeFalloff : ScriptableObject { public float dynamicIncreaseFromBigToSmall; public float dynamicIncreaseFromLongToBig; public float dynamicIncreaseFromVeryStrongToLong; } [Serializable] public class ScanNodeData { public bool editMinRange; public int minRange; public bool editMaxRange; public int maxRange; public bool editHeader; public string headerText; public bool editSubText; public string subText; public bool editNodeType; public int nodeType; } public class EditScanNodeProperties : MonoBehaviour { [SerializeField] internal ScanNodeProperties? _scanNodeProperties; [SerializeField] private ScanNodeData _editedScanNodeData; public void EditScanNode() { if (!((Object)(object)_scanNodeProperties == (Object)null)) { if (_editedScanNodeData.editMinRange) { _scanNodeProperties.minRange = _editedScanNodeData.minRange; } if (_editedScanNodeData.editMaxRange) { _scanNodeProperties.maxRange = _editedScanNodeData.maxRange; } if (_editedScanNodeData.editHeader) { _scanNodeProperties.headerText = _editedScanNodeData.headerText; } if (_editedScanNodeData.editSubText) { _scanNodeProperties.subText = _editedScanNodeData.subText; } if (_editedScanNodeData.editNodeType) { _scanNodeProperties.nodeType = _editedScanNodeData.nodeType; } } } } public class EnemyLevelSpawner : MonoBehaviour { [Header("Misc")] public bool daytimeSpawner; public List enemySizesAllowed = new List { (EnemySize)0, (EnemySize)2, (EnemySize)1 }; public Transform spawnPosition; public int maxEnemiesToSpawn = 999; [Header("Timers")] public float spawnTimerStart = 10f; public float spawnTimerMin = 20f; public float spawnTimerMax = 30f; [Header("Special Enemies")] [Tooltip("Use EnemyType.EnemyName here.")] public List specialEnemiesToSpawn = new List(); internal float spawnTimer = 10f; public static Dictionary entitiesSpawned = new Dictionary(); private float enemiesSpawnedByPipe; private List<(EnemyType, float)> specialEnemies = new List<(EnemyType, float)>(); private IEnumerable<(EnemyType, float)> mainEnemiesToSpawn; private IEnumerable<(EnemyType, float)> ambientEnemiesToSpawn; [HideInInspector] public static List enemyLevelSpawners = new List(); public void Start() { enemyLevelSpawners.Add(this); foreach (string item in specialEnemiesToSpawn) { foreach (SpawnableEnemyWithRarity enemy in RoundManager.Instance.currentLevel.Enemies) { if (!(enemy.enemyType.enemyName != item)) { specialEnemies.Add((enemy.enemyType, enemy.rarity)); break; } } } foreach (KeyValuePair item2 in entitiesSpawned) { Plugin.ExtendedLogging($"{item2.Key.enemyName} spawned {item2.Value} times"); } mainEnemiesToSpawn = ((IEnumerable)RoundManager.Instance.currentLevel.OutsideEnemies).Select((Func)((SpawnableEnemyWithRarity x) => (x.enemyType, x.rarity))).Concat<(EnemyType, float)>(specialEnemies); mainEnemiesToSpawn = mainEnemiesToSpawn.Where<(EnemyType, float)>(((EnemyType, float) x) => enemySizesAllowed.Contains(x.Item1.EnemySize)); ambientEnemiesToSpawn = ((IEnumerable)RoundManager.Instance.currentLevel.DaytimeEnemies).Select((Func)((SpawnableEnemyWithRarity x) => (x.enemyType, x.rarity))); spawnTimer = spawnTimerStart * 4f; spawnTimerMax *= 4f; spawnTimerMin *= 4f; if (spawnTimerMin > spawnTimerMax) { spawnTimerMin = spawnTimerMax; } } public void Update() { if (NetworkManager.Singleton.IsServer && (daytimeSpawner || !(RoundManager.Instance.currentOutsideEnemyPower > (float)RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount)) && (!daytimeSpawner || !(RoundManager.Instance.currentDaytimeEnemyPower > (float)RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount)) && !(enemiesSpawnedByPipe >= (float)maxEnemiesToSpawn)) { spawnTimer -= Time.deltaTime; if (!(spawnTimer > 0f)) { spawnTimer = Random.Range(spawnTimerMin, spawnTimerMax); SpawnRandomEnemy(); } } } public EnemyAI? SpawnRandomEnemy() { //IL_0087: 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) EnemyType val = (daytimeSpawner ? CRUtilities.ChooseRandomWeightedType(ambientEnemiesToSpawn) : CRUtilities.ChooseRandomWeightedType(mainEnemiesToSpawn)); if ((Object)(object)val == (Object)null) { return null; } if (entitiesSpawned.TryGetValue(val, out var value) && value >= val.MaxCount) { return null; } entitiesSpawned[val] = value + 1; enemiesSpawnedByPipe += 1f; Plugin.ExtendedLogging("Spawning " + val.enemyName); GameObject val2 = NetworkObjectReference.op_Implicit(RoundManager.Instance.SpawnEnemyGameObject(spawnPosition.position, -1f, -3, val)); EnemySpawnerTracker enemySpawnerTracker = val2.AddComponent(); EnemyAI val3 = (enemySpawnerTracker.enemyAI = val2.GetComponent()); if (val3.enemyType.canDie) { RoundManager instance = RoundManager.Instance; instance.currentOutsideEnemyPower += val3.enemyType.PowerLevel; } return enemySpawnerTracker.enemyAI; } public void OnDestroy() { enemyLevelSpawners.Remove(this); entitiesSpawned.Clear(); } } public class EnemySpawnerTracker : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemySpawnerTracker <>4__this; public bool immediate; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown int num = <>1__state; EnemySpawnerTracker enemySpawnerTracker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; enemySpawnerTracker._removedFromSpawnedEnemies = true; if (!immediate) { <>2__current = (object)new WaitForSeconds(15f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; break; } if ((Object)(object)enemySpawnerTracker.enemyAI.creatureAnimator != (Object)null) { ((Behaviour)enemySpawnerTracker.enemyAI.creatureAnimator).enabled = false; } if ((Object)(object)enemySpawnerTracker.enemyAI.creatureVoice != (Object)null) { ((Behaviour)enemySpawnerTracker.enemyAI.creatureVoice).enabled = false; } if ((Object)(object)enemySpawnerTracker.enemyAI.creatureSFX != (Object)null) { ((Behaviour)enemySpawnerTracker.enemyAI.creatureSFX).enabled = false; } DawnEnemyAdditionalData val = DawnEnemyAdditionalData.CreateOrGet(enemySpawnerTracker.enemyAI); foreach (EnemyAICollisionDetect enemyAICollisionDetect in val.EnemyAICollisionDetects) { Object.Destroy((Object)(object)enemyAICollisionDetect); } EnemyLevelSpawner.entitiesSpawned[enemySpawnerTracker.enemyAI.enemyType]--; ((Behaviour)enemySpawnerTracker.enemyAI).enabled = false; Object.Destroy((Object)(object)enemySpawnerTracker); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HideInInspector] public EnemyAI enemyAI; private bool _removedFromSpawnedEnemies; public void Update() { if ((Object)(object)enemyAI == (Object)null) { Object.Destroy((Object)(object)this); } else if (!_removedFromSpawnedEnemies && enemyAI.isEnemyDead) { ((MonoBehaviour)this).StartCoroutine(HandleRemovingFromSpawnedEnemies(immediate: false)); } } public void OnDestroy() { ((MonoBehaviour)this).StartCoroutine(HandleRemovingFromSpawnedEnemies(immediate: true)); } [IteratorStateMachine(typeof(d__4))] private IEnumerator HandleRemovingFromSpawnedEnemies(bool immediate) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, immediate = immediate }; } } public enum Direction { East, West, North, South } public class FallingObjectBehaviour : NetworkBehaviour { private float _timeInAir; private bool _isMoving; public AnimationCurve animationCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); [SerializeField] private UnityEvent _onImpact = new UnityEvent(); protected Vector3 _origin { get; private set; } protected Vector3 _target { get; private set; } protected Vector3 _normal { get; private set; } protected float _speed { get; private set; } public float Progress => _timeInAir / _travelTime; protected float _travelTime { get; private set; } public Vector3 CalculateRandomSkyOrigin(Direction direction, Vector3 target, Random random) { //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_0072: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = 0f; float num3 = RandomExtensions.NextFloat(random, 250f, 500f); float num4 = RandomExtensions.NextFloat(random, 250f, 500f); switch (direction) { case Direction.East: num = num3; break; case Direction.West: num = 0f - num3; break; case Direction.North: num2 = num4; break; case Direction.South: num2 = 0f - num4; break; } float num5 = RandomExtensions.NextFloat(random, 600f, 900f); return target + new Vector3(num, num5, num2); } protected virtual void Update() { if (_isMoving) { MoveObject(); } } protected void MoveObject() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) _timeInAir += Time.deltaTime; float progress = Progress; if (progress >= 1f) { ((Component)this).transform.position = _target; _isMoving = false; OnImpact(); } else { Vector3 position = Vector3.Lerp(_origin, _target, animationCurve.Evaluate(progress)); ((Component)this).transform.position = position; } } protected virtual void OnImpact() { _onImpact.Invoke(); } protected virtual void OnSetup() { } protected virtual float CalculateTravelTime(float distance) { return Mathf.Sqrt(2f * distance / _speed); } public void StopMoving() { _isMoving = false; } [ServerRpc(RequireOwnership = false)] public void SetupFallingObjectServerRpc(Vector3 origin, Vector3 target, float speed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3493845079u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref origin); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref target); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref speed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3493845079u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetupFallingObjectClientRpc(origin, target, speed); } } } [ClientRpc] public void SetupFallingObjectClientRpc(Vector3 origin, Vector3 target, float speed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(769320563u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref origin); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref target); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref speed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 769320563u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetupFallingObject(origin, target, speed); } } } public void SetupFallingObject(Vector3 origin, Vector3 target, float speed) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0045: 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_007c: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) _origin = origin; _target = target; _speed = speed; float num = Vector3.Distance(_origin, _target); Ray val = default(Ray); ((Ray)(ref val))..ctor(_origin, _target - _origin); RaycastHit val2 = default(RaycastHit); Physics.Raycast(val, ref val2, num + 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1); Plugin.ExtendedLogging($"Raycast started at: {_origin} and wanted to end at: {_target}, hit: {((RaycastHit)(ref val2)).point} with normal: {((RaycastHit)(ref val2)).normal}"); _target = ((RaycastHit)(ref val2)).point; _normal = ((RaycastHit)(ref val2)).normal; num = Vector3.Distance(_origin, _target); _travelTime = CalculateTravelTime(num); Plugin.ExtendedLogging($"Travel Time: {_travelTime}"); _isMoving = true; ((Component)this).transform.LookAt(_target); OnSetup(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3493845079u, new RpcReceiveHandler(__rpc_handler_3493845079), "SetupFallingObjectServerRpc"); ((NetworkBehaviour)this).__registerRpc(769320563u, new RpcReceiveHandler(__rpc_handler_769320563), "SetupFallingObjectClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3493845079(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 origin = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref origin); Vector3 target2 = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref target2); float speed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref speed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FallingObjectBehaviour)(object)target).SetupFallingObjectServerRpc(origin, target2, speed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_769320563(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 origin = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref origin); Vector3 target2 = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref target2); float speed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref speed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FallingObjectBehaviour)(object)target).SetupFallingObjectClientRpc(origin, target2, speed); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "FallingObjectBehaviour"; } } public class ForceEnemyToDestination : MonoBehaviour { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ForceEnemyToDestination <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; ForceEnemyToDestination CS$<>8__locals0 = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)CS$<>8__locals0.enemy != (Object)null && CS$<>8__locals0.Destination != Vector3.zero)); <>1__state = 1; return true; case 1: <>1__state = -1; if (CS$<>8__locals0.enemy is Janitor janitor) { janitor.CalculateAndSetNewPath(CS$<>8__locals0.Destination); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public EnemyAI? enemy; public Vector3 Destination = Vector3.zero; public bool needed = true; [IteratorStateMachine(typeof(d__3))] public IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } public void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if (!needed) { ((Behaviour)this).enabled = false; } if ((Object)(object)enemy == (Object)null || Destination == Vector3.zero || (Object)(object)enemy.agent == (Object)null || !((Behaviour)enemy.agent).enabled) { return; } if ((Object)(object)enemy.targetPlayer != (Object)null || Vector3.Distance(((Component)enemy).transform.position, Destination) <= 10f + enemy.agent.stoppingDistance) { needed = false; } else if (enemy is CodeRebirthEnemyAI codeRebirthEnemyAI) { if (codeRebirthEnemyAI is Janitor janitor) { if (((EnemyAI)janitor).currentBehaviourStateIndex != 0) { needed = false; } } else { codeRebirthEnemyAI.smartAgentNavigator.DoPathingToDestination(Destination); } } else { enemy.agent.SetDestination(Destination); } } } public class ForceLineRendererPositions : MonoBehaviour { [SerializeField] private LineRenderer _lineRenderer; [SerializeField] private Transform[] _transforms = Array.Empty(); private void Awake() { _lineRenderer.positionCount = _transforms.Length; } private void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _transforms.Length; i++) { _lineRenderer.SetPosition(i, _transforms[i].position); } } } public class ForcePlayerCamera : MonoBehaviour { [Header("Auto-Aim Pull Settings")] [SerializeField] private float horizontalPullStrength = 2000f; [SerializeField] private float verticalPullStrength = 25f; [SerializeField] private Vector2 horizontalDeadzone = new Vector2(0.46f, 0.54f); [SerializeField] private Vector2 verticalDeadzone = new Vector2(0.35f, 0.6f); [SerializeField] private float cameraLerpSpeed = 20f; [SerializeField] private bool forceAlign = true; [SerializeField] private float forceAlignMinPull = 0.01f; [Header("Aim Target Override")] [SerializeField] private AnimationCurve AimTargetCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); [SerializeField] private float AimSpeedMouse = 1f; [Header("References")] public Camera gameplayCamera; public Transform turnCompass; public Transform playerBody; public Animator playerBodyAnimator; [Range(0f, 1f)] public float normalizedStrength = 1f; private float aimHorizontal; private float aimVertical; private Quaternion playerAim = Quaternion.identity; private bool AimTargetActive; private Vector3 AimTargetPosition; private float AimTargetTimer; private float AimTargetSpeed; private float AimTargetLerp; private int AimTargetPriority = -999; private Vector3 AimTargetSoftPosition; private float AimTargetSoftTimer; private float AimTargetSoftStrength; private float AimTargetSoftStrengthNoAim; private float AimTargetSoftStrengthCurrent; private int AimTargetSoftPriority = -999; private float PlayerAimingTimer; private float overrideAimStopTimer; private bool overrideAimStop; private float overrideAimSmooth; private float overrideAimSmoothTimer; public void SetupPlayer(PlayerControllerB player) { gameplayCamera = player.gameplayCamera; turnCompass = player.turnCompass; playerBody = player.thisPlayerBody; playerBodyAnimator = player.playerBodyAnimator; } public void AimTargetSet(Vector3 position, float time, float speed, GameObject obj, int priority) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (priority >= AimTargetPriority && AimTargetLerp == 0f) { AimTargetActive = true; AimTargetPosition = position; AimTargetTimer = time; AimTargetSpeed = speed; AimTargetPriority = priority; } } public void SetNormalizedStrength(float strength) { normalizedStrength = strength; } public void AimTargetSoftSet(Vector3 position, float time, float strength, float strengthNoAim, GameObject obj, int priority) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (priority >= AimTargetSoftPriority && !(AimTargetSoftPosition != Vector3.zero)) { if ((Object)(object)obj != (Object)null && AimTargetSoftTimer <= 0f) { PlayerAimingTimer = 0f; } AimTargetSoftPosition = position; AimTargetSoftTimer = time; AimTargetSoftStrength = strength; AimTargetSoftStrengthNoAim = strengthNoAim; AimTargetSoftPriority = priority; } } public void OverrideAimStop() { overrideAimStopTimer = 0.2f; } private void OverrideAimStopTick() { if (overrideAimStopTimer > 0f) { overrideAimStop = true; overrideAimStopTimer -= Time.deltaTime; } else { overrideAimStop = false; } } private void ResetPlayerAim(Quaternion _rotation) { //IL_0002: 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) //IL_0038: 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) float x = ((Quaternion)(ref _rotation)).eulerAngles.x; aimVertical = ((x > 180f) ? (x - 360f) : x); aimHorizontal = ((Quaternion)(ref _rotation)).eulerAngles.y; playerAim = _rotation; } private void HandleAutoAim() { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_0060: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) Vector3 aimTargetPosition = AimTargetPosition; float num = Mathf.Clamp(Time.deltaTime, 0f, 0.1f); Vector3 val = gameplayCamera.WorldToViewportPoint(aimTargetPosition); float num2 = val.x - 0.5f; float num3 = Mathf.Abs(num2); float num4 = horizontalPullStrength * normalizedStrength; if (val.x < horizontalDeadzone.x || val.x > horizontalDeadzone.y) { float num5 = Mathf.Sign(num2); float num6 = num5 * num4 * num * num3; turnCompass.Rotate(Vector3.up * num6); playerBodyAnimator.SetBool("PullingCameraRight", num5 > 0f); playerBodyAnimator.SetBool("PullingCameraLeft", num5 < 0f); } else { playerBodyAnimator.SetBool("PullingCameraLeft", false); playerBodyAnimator.SetBool("PullingCameraRight", false); if (forceAlign && num3 < forceAlignMinPull) { Vector3 val2 = aimTargetPosition - turnCompass.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; Quaternion val3 = Quaternion.LookRotation(normalized, Vector3.up); turnCompass.rotation = Quaternion.Slerp(turnCompass.rotation, val3, num * cameraLerpSpeed * normalizedStrength); } } Vector3 val4 = gameplayCamera.WorldToViewportPoint(aimTargetPosition + Vector3.up * 0.35f); float num7 = val4.y - 0.5f; float num8 = Mathf.Abs(num7); float num9 = verticalPullStrength * normalizedStrength; float num10 = aimVertical; if (val4.y > verticalDeadzone.y) { num10 = Mathf.Clamp(Mathf.Lerp(aimVertical, aimVertical - num9, num9 * num * num8), -89f, 89f); } else if (val4.y < verticalDeadzone.x) { num10 = Mathf.Clamp(Mathf.Lerp(aimVertical, aimVertical + num9, num9 * num * num8), -89f, 89f); } aimVertical = num10; Vector3 localEulerAngles = ((Component)gameplayCamera).transform.localEulerAngles; ((Component)gameplayCamera).transform.localEulerAngles = new Vector3(aimVertical, localEulerAngles.y, localEulerAngles.z); Vector3 val5 = Vector3.up * turnCompass.eulerAngles.y; playerBody.rotation = Quaternion.Lerp(playerBody.rotation, Quaternion.Euler(val5), num * cameraLerpSpeed * (1f - num3)); } private void Update() { //IL_0082: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) float num = 1f; AimSpeedMouse = Mathf.Lerp(0.2f, 4f, 0.2f); if (AimTargetTimer <= 0f && !overrideAimStop) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); val = ((!(AimTargetSoftTimer > 0f)) ? (val * AimSpeedMouse) : ((((Vector2)(ref val)).magnitude > 1f) ? ((Vector2)(ref val)).normalized : Vector2.zero)); aimHorizontal += val.x; aimVertical = Mathf.Clamp(aimVertical - val.y, -70f, 80f); playerAim = Quaternion.Euler(aimVertical, aimHorizontal, 0f); if (num > 0f) { playerAim = Quaternion.RotateTowards(((Component)this).transform.localRotation, playerAim, 10000f * Time.deltaTime); } if (((Vector2)(ref val)).magnitude > 0f) { PlayerAimingTimer = 0.1f; } } if (PlayerAimingTimer > 0f) { PlayerAimingTimer -= Time.deltaTime; } if (AimTargetTimer > 0f) { AimTargetTimer -= Time.deltaTime; AimTargetLerp = Mathf.Clamp01(AimTargetLerp + Time.deltaTime * AimTargetSpeed); } else if (AimTargetLerp > 0f) { ResetPlayerAim(((Component)this).transform.localRotation); AimTargetLerp = 0f; AimTargetPriority = -999; AimTargetActive = false; } Quaternion val2 = playerAim; if (AimTargetActive) { val2 = Quaternion.LerpUnclamped(playerAim, Quaternion.LookRotation(AimTargetPosition - ((Component)this).transform.position), AimTargetCurve.Evaluate(AimTargetLerp)); } if (AimTargetSoftTimer > 0f && AimTargetTimer <= 0f) { float num2 = ((PlayerAimingTimer <= 0f) ? AimTargetSoftStrengthNoAim : AimTargetSoftStrength); AimTargetSoftStrengthCurrent = Mathf.Lerp(AimTargetSoftStrengthCurrent, num2, 10f * Time.deltaTime); Quaternion val3 = Quaternion.LookRotation(AimTargetSoftPosition - ((Component)this).transform.position); val2 = Quaternion.Lerp(val2, val3, AimTargetSoftStrengthCurrent * Time.deltaTime); AimTargetSoftTimer -= Time.deltaTime; if (AimTargetSoftTimer <= 0f) { AimTargetSoftPriority = -999; } } if (overrideAimSmoothTimer > 0f) { num = overrideAimSmooth; overrideAimSmoothTimer -= Time.deltaTime; } if (!AimTargetActive && AimTargetSoftTimer <= 0f) { HandleAutoAim(); } else { ((Component)this).transform.localRotation = Quaternion.Lerp(((Component)this).transform.localRotation, val2, num / 100f * Time.deltaTime); ResetPlayerAim(((Component)this).transform.localRotation); } OverrideAimStopTick(); } } public class GameObjectEvents : MonoBehaviour { public GameObject[] gameObjects = Array.Empty(); public void EnableGameObject(int index) { gameObjects[index].SetActive(true); } public void DisableGameObject(int index) { gameObjects[index].SetActive(false); } } public class GrabAndLaunchPlayer : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass7_0 { public PlayerControllerB player; internal bool b__0() { if (!player.isPlayerDead) { return player.thisController.isGrounded; } return true; } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; private <>c__DisplayClass7_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass7_0(); <>8__1.player = player; if (!PlayerControllerBExtensions.IsLocalPlayer(<>8__1.player)) { return false; } <>2__current = (object)new WaitUntil((Func)(() => <>8__1.player.isPlayerDead || <>8__1.player.thisController.isGrounded)); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>8__1.player.isPlayerDead) { return false; } DuskAchievementExtensions.TryTriggerAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.Crateapult); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabAndLaunchPlayer <>4__this; public PlayerControllerB player; private ItemCrate 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown int num = <>1__state; GrabAndLaunchPlayer grabAndLaunchPlayer = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; grabAndLaunchPlayer.audioSource.PlayOneShot(grabAndLaunchPlayer.launchSounds[Random.Range(0, grabAndLaunchPlayer.launchSounds.Length)]); player.disableMoveInput = true; grabAndLaunchPlayer.playerToLaunch = player; 5__2 = ((Component)((Component)grabAndLaunchPlayer).transform.parent).GetComponent(); <>2__current = (object)new WaitForSeconds(1.375f); <>1__state = 1; return true; case 1: { <>1__state = -1; grabAndLaunchPlayer.playerToLaunch = null; player.disableMoveInput = false; PlayerControllerB obj = player; obj.externalForceAutoFade += ((Component)5__2).transform.up * 1000f; <>2__current = (object)new WaitForSeconds(0.458f); <>1__state = 2; return true; } case 2: <>1__state = -1; 5__2.ResetWoodenCrate(); <>2__current = (object)new WaitForSeconds(0.458f); <>1__state = 3; return true; case 3: <>1__state = -1; ((MonoBehaviour)grabAndLaunchPlayer).StartCoroutine(grabAndLaunchPlayer.CheckIfPlayerIsDead(player)); grabAndLaunchPlayer.pullRoutine = null; ((Behaviour)grabAndLaunchPlayer).enabled = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform pullTransform; private Coroutine? pullRoutine; private PlayerControllerB? playerToLaunch; public AudioSource audioSource; public AudioClip[] launchSounds = Array.Empty(); public void OnTriggerStay(Collider other) { PlayerControllerB player = default(PlayerControllerB); if (((Behaviour)this).enabled && pullRoutine == null && ((Component)other).gameObject.TryGetComponent(ref player)) { pullRoutine = ((MonoBehaviour)this).StartCoroutine(PullAndTrapPlayer(player)); } } [IteratorStateMachine(typeof(d__6))] private IEnumerator PullAndTrapPlayer(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this, player = player }; } [IteratorStateMachine(typeof(d__7))] private IEnumerator CheckIfPlayerIsDead(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { player = player }; } public void Update() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (pullRoutine != null && (Object)(object)playerToLaunch != (Object)null) { ((Component)playerToLaunch).transform.position = pullTransform.position; } } } public class GrabAndPullPlayer : MonoBehaviour { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabAndPullPlayer <>4__this; public PlayerControllerB player; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown int num = <>1__state; GrabAndPullPlayer grabAndPullPlayer = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; grabAndPullPlayer.audioSource.PlayOneShot(grabAndPullPlayer.pullSounds[Random.Range(0, grabAndPullPlayer.pullSounds.Length)]); player.disableMoveInput = true; ItemCrate component = ((Component)((Component)grabAndPullPlayer).transform.parent).GetComponent(); component.CloseCrateOnPlayerLocally(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, player)); <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; } case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (((Behaviour)grabAndPullPlayer).enabled) { ((Component)player).transform.position = grabAndPullPlayer.pullTransform.position; <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 2; return true; } player.disableMoveInput = false; grabAndPullPlayer.pullRoutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform pullTransform; private Coroutine? pullRoutine; public AudioSource audioSource; public AudioClip[] pullSounds = Array.Empty(); public void OnTriggerStay(Collider other) { PlayerControllerB player = default(PlayerControllerB); if (((Behaviour)this).enabled && pullRoutine == null && ((Component)other).gameObject.TryGetComponent(ref player)) { pullRoutine = ((MonoBehaviour)this).StartCoroutine(PullAndTrapPlayer(player)); } } [IteratorStateMachine(typeof(d__5))] private IEnumerator PullAndTrapPlayer(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this, player = player }; } } public class GregBounds : BoundsDefiner { public void OnEnable() { GunslingerGreg.safeBounds.Add(this); } public void OnDisable() { GunslingerGreg.safeBounds.Remove(this); } } public class HittableCollisionDetect : MonoBehaviour, IHittable { [SerializeField] private CRHittable _mainScript; public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return _mainScript.Hit(force, hitDirection, playerWhoHit, playHitSFX, hitID); } } public class HUDMessageEvent : MonoBehaviour { public HUDDisplayTip tip; public bool playOnAwake; private void Awake() { if (playOnAwake) { PlayTip(); } } public void PlayTip() { HUDManagerExtensions.DisplayTip(HUDManager.Instance, tip); } public void PlayNetworkedTip() { NetworkSingleton.Instance.BroadcastDisplayTipServerRpc(tip); } } public interface IExplodeable { void OnExplosion(int force, Vector3 explosionPosition, float distanceToExplosion); } public class InteractSeatable : InteractTrigger { [Header("Interact Seatable")] [SerializeField] private string _actionToExit = ""; [SerializeField] private AudioSource? _seatableSource; [SerializeField] private UnityEvent _onPlayerSit = new UnityEvent(); [SerializeField] private UnityEvent _onPlayerStand = new UnityEvent(); private InputAction? _playerAction; public PlayerControllerB? SittingPlayer { get; private set; } public bool LocalPlayerSeated { get; private set; } public Vector3 PlayerExitPoint { get; private set; } = Vector3.zero; private void Reset() { base.hoverTip = "Sit down : [LMB]"; base.oneHandedItemAllowed = true; base.holdInteraction = true; base.timeToHold = 0.2f; base.cooldownTime = 0.3f; base.specialCharacterAnimation = true; base.stopAnimationManually = true; base.stopAnimationString = "SA_stopAnimation"; base.hidePlayerItem = true; base.animationWaitTime = 2f; base.animationString = "SA_Truck"; base.lockPlayerPosition = true; base.clampLooking = true; base.setVehicleAnimation = true; base.minVerticalClamp = 50f; base.maxVerticalClamp = -70f; base.horizontalClamp = 120f; } public void Awake() { ((UnityEvent)(object)base.onInteractEarlyOtherClients).AddListener((UnityAction)delegate(PlayerControllerB player) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (PlayerControllerBExtensions.IsLocalPlayer(player)) { SetPlayerOnSeatServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)player)); } }); _playerAction = GameNetworkManager.Instance.localPlayerController.playerActions.m_Movement.FindAction(_actionToExit, false); } public void Update() { ((InteractTrigger)this).Update(); if (LocalPlayerSeated && !((Object)(object)SittingPlayer == (Object)null) && _playerAction != null && _playerAction.WasPressedThisFrame()) { ExitChairLocal(teleport: true); ExitChairServerRpc(); } } public void SetPlayerOnSeatLocal(PlayerControllerB playerSitting) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (PlayerControllerBExtensions.IsLocalPlayer(playerSitting)) { PlayerExitPoint = ((Component)playerSitting.visorCamera).transform.position; LocalPlayerSeated = true; } SittingPlayer = playerSitting; base.interactable = false; _onPlayerSit.Invoke(); } public void ExitChairLocal(bool teleport = false) { //IL_0037: 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 (!((Object)(object)SittingPlayer == (Object)null)) { if (teleport) { SittingPlayer.TeleportPlayer(PlayerExitPoint, false, 0f, false, true); } _onPlayerStand.Invoke(); PlayerExitPoint = Vector3.zero; LocalPlayerSeated = false; SittingPlayer = null; base.interactable = true; } } [ServerRpc(RequireOwnership = false)] public void SetPlayerOnSeatServerRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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(3500255656u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3500255656u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!LocalPlayerSeated && !((Object)(object)SittingPlayer != (Object)null)) { SetPlayerOnSeatClientRpc(playerReference); } } } [ClientRpc] public void SetPlayerOnSeatClientRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(223200312u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 223200312u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB playerOnSeatLocal = default(PlayerControllerB); if (((NetworkBehaviourReference)(ref playerReference)).TryGet(ref playerOnSeatLocal, (NetworkManager)null)) { SetPlayerOnSeatLocal(playerOnSeatLocal); } } } [ServerRpc(RequireOwnership = false)] public void ExitChairServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1085247933u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1085247933u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExitChairClientRpc(); } } } [ClientRpc] public void ExitChairClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2621657423u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2621657423u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExitChairLocal(); } } } protected override void __initializeVariables() { ((InteractTrigger)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3500255656u, new RpcReceiveHandler(__rpc_handler_3500255656), "SetPlayerOnSeatServerRpc"); ((NetworkBehaviour)this).__registerRpc(223200312u, new RpcReceiveHandler(__rpc_handler_223200312), "SetPlayerOnSeatClientRpc"); ((NetworkBehaviour)this).__registerRpc(1085247933u, new RpcReceiveHandler(__rpc_handler_1085247933), "ExitChairServerRpc"); ((NetworkBehaviour)this).__registerRpc(2621657423u, new RpcReceiveHandler(__rpc_handler_2621657423), "ExitChairClientRpc"); ((InteractTrigger)this).__initializeRpcs(); } private static void __rpc_handler_3500255656(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_004f: 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) { NetworkBehaviourReference playerOnSeatServerRpc = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerOnSeatServerRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((InteractSeatable)(object)target).SetPlayerOnSeatServerRpc(playerOnSeatServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_223200312(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_004f: 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) { NetworkBehaviourReference playerOnSeatClientRpc = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerOnSeatClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((InteractSeatable)(object)target).SetPlayerOnSeatClientRpc(playerOnSeatClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1085247933(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; ((InteractSeatable)(object)target).ExitChairServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2621657423(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; ((InteractSeatable)(object)target).ExitChairClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string? __getTypeName() { return "InteractSeatable"; } } [Serializable] public class InterfaceReference where TInterface : class where TObject : Object { [SerializeField] [HideInInspector] private TObject underlyingValue; public TInterface Value { get { TObject val = underlyingValue; if (val != null) { if ((object)val is TInterface result) { return result; } throw new InvalidOperationException(string.Format("{0} needs to implement interface {1}.", underlyingValue, "TInterface")); } return null; } set { TObject val2; if (value != null) { TObject val = (TObject)(object)((value is TObject) ? value : null); if (val == null) { throw new ArgumentException($"{value} needs to be of type {typeof(TObject)}.", string.Empty); } val2 = val; } else { val2 = default(TObject); } underlyingValue = val2; } } public TObject UnderlyingValue { get { return underlyingValue; } set { underlyingValue = value; } } public InterfaceReference() { } public InterfaceReference(TObject target) { underlyingValue = target; } public InterfaceReference(TInterface @interface) { underlyingValue = (TObject)(object)((@interface is TObject) ? @interface : null); } public static implicit operator TInterface(InterfaceReference obj) { return obj.Value; } } [Serializable] public class InterfaceReference : InterfaceReference where TInterface : class { } public class ItemUI : MonoBehaviour { public RectTransform uiElement; public float defaultScale = 0.2f; [SerializeField] private TextMeshProUGUI itemName; [SerializeField] private Image itemImage; [SerializeField] private CanvasGroup canvasGroup; [HideInInspector] public Camera mainCamera; [HideInInspector] public PlayerControllerB? player; private PhysicsProp? parentItem; public void StartUIforItem(PhysicsProp item) { if (!((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)(object)player)) { parentItem = item; itemImage.sprite = ((GrabbableObject)item).itemProperties.itemIcon; ((TMP_Text)itemName).text = ((GrabbableObject)item).itemProperties.itemName; mainCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; } } public void Update() { //IL_002a: 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_006f: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)parentItem == (Object)null) { canvasGroup.alpha = 0f; return; } ((Component)itemImage).transform.localScale = Vector3.one * Mathf.LerpUnclamped(0.45f, 0.5f, Mathf.Sin(Time.time * 4f) * 0.5f + 0.5f); float num = Vector3.Distance(((Component)mainCamera).transform.position, ((Component)parentItem).transform.position); Vector3 val = mainCamera.WorldToScreenPoint(((Component)parentItem).transform.position); if (val.z > 0f && num > 1f) { RectTransform component = ((Component)((Component)uiElement).GetComponentInParent()).GetComponent(); Vector2 val2 = Vector2.op_Implicit(mainCamera.ScreenToViewportPoint(val)); Vector2 sizeDelta = component.sizeDelta; Vector2 anchoredPosition = default(Vector2); ((Vector2)(ref anchoredPosition))..ctor(val2.x * sizeDelta.x - sizeDelta.x * 0.5f, val2.y * sizeDelta.y - sizeDelta.y * 0.5f); uiElement.anchoredPosition = anchoredPosition; float num2 = Mathf.Clamp01(num * defaultScale); ((Transform)uiElement).localScale = new Vector3(num2, num2, num2); canvasGroup.alpha = 1f; } else { canvasGroup.alpha = 0f; } } } [Serializable] public class ItemWithRarityAndColor { public string itemName = "Item Name"; public float rarity; public int minPrice; public int maxPrice; public Color borderColor = new Color(0.18039216f, 0.7058824f, 0f, 1f); public Color textColor = new Color(13f / 51f, 1f, 0f, 1f); } [Serializable] public class RealItemWithRarityAndColor { public Item? item; public float rarity; public int minPrice; public int maxPrice; public Color borderColor; public Color textColor; public RealItemWithRarityAndColor(Item? item, float rarity, int minPrice, int maxPrice, Color borderColor, Color textColor) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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) this.item = item; this.rarity = rarity; this.minPrice = minPrice; this.maxPrice = maxPrice; this.borderColor = borderColor; this.textColor = textColor; base..ctor(); } } [Serializable] public class SimplifiedRealItemWithRarityAndColor { public Item? item; public float rarity; public Color borderColor; public Color textColor; public SimplifiedRealItemWithRarityAndColor(Item? item, float rarity, Color borderColor, Color textColor) { //IL_000f: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) this.item = item; this.rarity = rarity; this.borderColor = borderColor; this.textColor = textColor; base..ctor(); } } [Serializable] public class SimplifiedItemWithRarityAndColor { public string itemName; public float rarity; public Color borderColor; public Color textColor; } public interface ITriggerProxy { void OnProxyTriggerEnter(Collider other) { } void OnProxyTriggerStay(Collider other) { } void OnProxyTriggerExit(Collider other) { } } public class LightningStrikeScript { public static StormyWeather? stormyWeather; public static void SpawnLightningBolt(Vector3 strikePosition, Random lightningRandom, AudioSource lightningSource) { //IL_002c: 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_0037: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(RandomExtensions.NextFloat(lightningRandom, -32f, 32f), 0f, RandomExtensions.NextFloat(lightningRandom, -32f, 32f)); Vector3 position = strikePosition + Vector3.up * 160f + val; if ((Object)(object)stormyWeather == (Object)null) { stormyWeather = Object.FindObjectOfType(true); Plugin.ExtendedLogging("Getting stormy weather for the first time"); } LightningBoltPrefabScript val2 = Object.Instantiate(stormyWeather.targetedThunder); ((Behaviour)val2).enabled = true; ((LightningBoltPrefabScriptBase)val2).GlowWidthMultiplier = 2.5f; ((LightningBoltPrefabScriptBase)val2).DurationRange = new RangeOfFloats { Minimum = 0.6f, Maximum = 1.2f }; ((LightningBoltPrefabScriptBase)val2).TrunkWidthRange = new RangeOfFloats { Minimum = 0.6f, Maximum = 1.2f }; ((LightningBoltScript)val2).Camera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; val2.Source.transform.position = position; val2.Destination.transform.position = strikePosition; ((LightningBoltPrefabScriptBase)val2).AutomaticModeSeconds = 0.2f; ((LightningBoltPrefabScriptBase)val2).Generations = 8; ((LightningBoltPrefabScriptBase)val2).CreateLightningBoltsNow(); ((Component)lightningSource).transform.position = strikePosition + Vector3.up * 0.5f; if (GameNetworkManager.Instance.localPlayerController.isInsideFactory) { lightningSource.volume = 0f; } else { lightningSource.volume = 0.2f; } stormyWeather.PlayThunderEffects(strikePosition, lightningSource); } } public class LightUpdateManager : MonoBehaviour { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LightUpdateManager <>4__this; private List 5__2; private List.Enumerator <>7__wrap2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 2) <= 1u) { try { } finally { <>m__Finally1(); } } 5__2 = null; <>7__wrap2 = default(List.Enumerator); <>1__state = -2; } private bool MoveNext() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown try { int num = <>1__state; LightUpdateManager lightUpdateManager = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = new List(); goto IL_003d; case 1: <>1__state = -1; 5__2.Clear(); 5__2.AddRange(detectLightInSurroundings); <>7__wrap2 = 5__2.GetEnumerator(); <>1__state = -3; goto IL_0106; case 2: <>1__state = -3; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 3; return true; case 3: { <>1__state = -3; goto IL_0106; } IL_0106: if (<>7__wrap2.MoveNext()) { DetectLightInSurroundings current = <>7__wrap2.Current; <>2__current = ((MonoBehaviour)lightUpdateManager).StartCoroutine(current.UpdateLightValue()); <>1__state = 2; return true; } <>m__Finally1(); <>7__wrap2 = default(List.Enumerator); goto IL_003d; IL_003d: <>2__current = (object)new WaitUntil((Func)(() => CodeRebirthUtils.currentRoundLightData.Count > 0 && detectLightInSurroundings.Count > 0)); <>1__state = 1; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static HashSet detectLightInSurroundings = new HashSet(); public void Start() { ((MonoBehaviour)this).StartCoroutine(DoUpdateDetectLightInSurroundings()); } [IteratorStateMachine(typeof(d__2))] public IEnumerator DoUpdateDetectLightInSurroundings() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { <>4__this = this }; } } [CreateAssetMenu(fileName = "LogCommandDetails", menuName = "CodeRebirth/LogCommandDetails", order = 2)] public class LogCommandDetails : ScriptableObject { [field: SerializeField] public NamespacedKey NamespacedKey { get; private set; } [field: SerializeField] public TerminalCommandBasicInformation CommandBasicInformation { get; private set; } [field: SerializeField] public string MainKeyword { get; private set; } [field: SerializeField] public List InputKeywords { get; private set; } = new List(); [field: SerializeField] [field: TextArea(2, 10)] public List ResultDisplayTexts { get; private set; } = new List(); [field: SerializeField] public List SavedResultKeys { get; private set; } = new List(); [field: SerializeField] public List TextToAppendAfterEmptyResult { get; private set; } = new List(); [field: SerializeField] [field: TextArea(2, 10)] public string EmptyResultDisplayText { get; private set; } [field: SerializeField] [field: TextArea(2, 10)] public string PostEmptyResultDisplayText { get; private set; } internal string ResultDisplayText(string userInput) { PersistentDataContainer currentSave = DawnLib.GetCurrentSave(); if (currentSave == null) { return EmptyResultDisplayText; } HashSet orCreateDefault = ((DataContainer)currentSave).GetOrCreateDefault>(ExtraScanEvents._dataKey); orCreateDefault.UnionWith(((DataContainer)currentSave).GetOrCreateDefault>(CommitKeyToSave.CodeRebirthLoreKey)); for (int i = 0; i < InputKeywords.Count; i++) { if (orCreateDefault.Contains(SavedResultKeys[i]) && userInput.Equals(InputKeywords[i], StringComparison.OrdinalIgnoreCase)) { return ResultDisplayTexts[i]; } } StringBuilder stringBuilder = new StringBuilder(EmptyResultDisplayText); for (int j = 0; j < InputKeywords.Count; j++) { if (orCreateDefault.Contains(SavedResultKeys[j])) { stringBuilder.Append(TextToAppendAfterEmptyResult[j]); } } stringBuilder.Append(PostEmptyResultDisplayText); return stringBuilder.ToString(); } } public enum RaycastDirection { Forward, Back, Up, Down, Left, Right } public class MoveObjectToRaycastResult : MonoBehaviour { [field: SerializeField] public RaycastDirection RaycastDirection { get; private set; } [field: SerializeField] public bool WorldDirection { get; private set; } [field: SerializeField] public LayerMask LayerMask { get; private set; } [field: SerializeField] public QueryTriggerInteraction QueryTriggerInteraction { get; private set; } [field: SerializeField] public float Distance { get; private set; } [field: SerializeField] public bool DoOnAwake { get; private set; } public void Awake() { if (DoOnAwake) { MoveToRaycastResult(); } } public void MoveToRaycastResult() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)this).transform.position, CalculateForceDirection()); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, Distance, LayerMask.op_Implicit(LayerMask), QueryTriggerInteraction)) { Plugin.ExtendedLogging($"Starting from: {((Component)this).transform.position}, hit: {((RaycastHit)(ref val2)).point} with normal: {((RaycastHit)(ref val2)).normal} and Direction: {((Ray)(ref val)).direction}"); ((Component)this).transform.position = ((RaycastHit)(ref val2)).point; } } private Vector3 CalculateForceDirection() { //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_0045: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0094: 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_00bb: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0099: 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) //IL_0109: 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) Vector3 result = Vector3.zero; switch (RaycastDirection) { case RaycastDirection.Forward: result = (WorldDirection ? Vector3.forward : ((Component)this).transform.forward); break; case RaycastDirection.Back: result = (WorldDirection ? Vector3.back : (-((Component)((Component)this).transform).transform.forward)); break; case RaycastDirection.Up: result = (WorldDirection ? Vector3.up : ((Component)((Component)this).transform).transform.up); break; case RaycastDirection.Down: result = (WorldDirection ? Vector3.down : (-((Component)((Component)this).transform).transform.up)); break; case RaycastDirection.Right: result = (WorldDirection ? Vector3.right : ((Component)((Component)this).transform).transform.right); break; case RaycastDirection.Left: result = (WorldDirection ? Vector3.left : (-((Component)((Component)this).transform).transform.right)); break; } return result; } } public class OnEnemyDeath : MonoBehaviour { [SerializeField] private EnemyType _enemyType; [SerializeField] private UnityEvent _onDeath; [SerializeReference] private DuskAchievementReference _achievementReference; public void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EnemyAI.KillEnemy += new hook_KillEnemy(CheckWhoKilledEnemy); } private void CheckWhoKilledEnemy(orig_KillEnemy orig, EnemyAI self, bool destroy) { orig.Invoke(self, destroy); if ((Object)(object)self.enemyType != (Object)(object)_enemyType) { return; } DawnEnemyAdditionalData val = DawnEnemyAdditionalData.CreateOrGet(self); if (self.isEnemyDead) { _onDeath.Invoke(); if (val.KilledByPlayer && !((Object)(object)val.PlayerThatLastHit == (Object)null) && PlayerControllerBExtensions.IsLocalPlayer(val.PlayerThatLastHit)) { ((DuskContentReference)(object)_achievementReference).Resolve().TryCompleteAchievement(); } } } public void OnDestroy() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown EnemyAI.KillEnemy -= new hook_KillEnemy(CheckWhoKilledEnemy); } } public class OnParticlesCollision : MonoBehaviour { [field: SerializeField] public ParticleSystem ParticleSystem { get; private set; } private void OnParticleCollision(GameObject other) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) if (NetworkManager.Singleton.IsServer) { Plugin.Logger.LogInfo((object)("Particle hit: " + ((Object)other).name)); List list = new List(); int collisionEvents = ParticlePhysicsExtensions.GetCollisionEvents(ParticleSystem, other, list); if (collisionEvents > 0) { CodeRebirthUtils instance = CodeRebirthUtils.Instance; Item item = ((Registry)(object)LethalContent.Items)[CodeRebirthItemKeys.Coin].Item; ParticleCollisionEvent val = list[0]; instance.SpawnScrap(item, ((ParticleCollisionEvent)(ref val)).intersection + Vector3.up * 0.25f); } } } } public class OxydeLightsManager : MonoBehaviour { [SerializeField] private Color[] _colors = Array.Empty(); [SerializeField] private Renderer[] _renderers = Array.Empty(); [SerializeField] private Light[] _lights = Array.Empty(); private int _currentLightIndex; internal static OxydeLightsManager Instance; private void Start() { Instance = this; IncrementLights(); } public void IncrementLights() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (_currentLightIndex > _colors.Length - 1 || _colors.Length == 0) { return; } Light[] lights = _lights; foreach (Light val in lights) { val.color = _colors[_currentLightIndex]; } Renderer[] renderers = _renderers; foreach (Renderer val2 in renderers) { val2.sharedMaterials[1].color = _colors[_currentLightIndex]; } if (_currentLightIndex != 0) { foreach (EnemyLevelSpawner enemyLevelSpawner in EnemyLevelSpawner.enemyLevelSpawners) { if (!(enemyLevelSpawner is CompactorEnemyLevelSpawner)) { enemyLevelSpawner.spawnTimer = Random.Range(5, 10); } } } _currentLightIndex++; } } public class PlayEffectsOnAnimation : MonoBehaviour { [SerializeField] private ParticleSystem[] _particleSystems = Array.Empty(); public void PlayEffect() { ParticleSystem[] particleSystems = _particleSystems; foreach (ParticleSystem val in particleSystems) { val.Play(); } } public void PlayEffectWithIndex(int effectIndex) { _particleSystems[effectIndex].Play(true); } } public class PlaySoundOnAnimation : MonoBehaviour { [SerializeField] private List _audioSourcesWithClips = new List(); public void PlaySelectSourcesWithRandomSound(int index) { if (index < 0 || index >= _audioSourcesWithClips.Count) { Plugin.Logger.LogWarning((object)$"Index {index} is out of range for audio sources with clips."); return; } bool flag = false; bool flag2 = false; AudioSourceWithClips audioSourceWithClips = _audioSourcesWithClips[index]; if ((Object)(object)audioSourceWithClips.nearAudioSource != (Object)null && audioSourceWithClips.nearClips.Length != 0) { flag = true; PlayNearAudioClip(audioSourceWithClips); } if ((Object)(object)audioSourceWithClips.farAudioSource != (Object)null && audioSourceWithClips.farClips.Length != 0) { flag2 = true; PlayFarAudioClip(audioSourceWithClips); } if (!flag && !flag2) { Plugin.Logger.LogWarning((object)"No valid audio sources or clips found for the specified index."); } } private void PlayNearAudioClip(AudioSourceWithClips audioSourceWithClips) { int num = Random.Range(0, audioSourceWithClips.nearClips.Length); AudioClip val = audioSourceWithClips.nearClips[num]; audioSourceWithClips.nearAudioSource.PlayOneShot(val); Plugin.ExtendedLogging("Playing near audio clip: " + ((Object)val).name); } private void PlayFarAudioClip(AudioSourceWithClips audioSourceWithClips) { int num = Random.Range(0, audioSourceWithClips.farClips.Length); AudioClip val = audioSourceWithClips.farClips[num]; audioSourceWithClips.farAudioSource.PlayOneShot(val); Plugin.ExtendedLogging("Playing far audio clip: " + ((Object)val).name); } } public class PuppetDamageDealer : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject gameObject; public PuppetDamageDealer <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown int num = <>1__state; PuppetDamageDealer puppetDamageDealer = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; gameObject.GetComponent().Hit(1, ((Component)puppetDamageDealer.puppeteer).transform.forward); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; if (puppetDamageDealer.puppeteers.Contains(gameObject)) { puppetDamageDealer.puppeteers.Remove(gameObject); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public bool isEnabled; public Puppeteer puppeteer; private List puppeteers = new List(); public void OnTriggerStay(Collider other) { if (isEnabled && ((Object)((Component)other).gameObject).name.StartsWith("PuppeteerPuppet") && !puppeteers.Contains(((Component)other).gameObject)) { puppeteers.Add(((Component)other).gameObject); ((MonoBehaviour)this).StartCoroutine(ClearPuppet(((Component)other).gameObject)); } } [IteratorStateMachine(typeof(d__4))] private IEnumerator ClearPuppet(GameObject gameObject) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, gameObject = gameObject }; } } public class RainbowMaterialShift : MonoBehaviour { [SerializeField] private Renderer _renderer; [SerializeField] private float _speed = 1f; [Range(0f, 1f)] [SerializeField] private float _alpha = 1f; private Material _material; private float _currentColorHSV; private Random _colourRandom = new Random(); private static int counter = 0; private static readonly int ColorHash = Shader.PropertyToID("_Color"); private void Awake() { counter++; _material = _renderer.material; _colourRandom = new Random(StartOfRound.Instance.randomMapSeed + StartOfRound.Instance.allPlayerScripts.Length + counter); _currentColorHSV = (float)_colourRandom.NextDouble(); } private void Update() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0078: Unknown result type (might be due to invalid IL or missing references) _currentColorHSV += Time.deltaTime * _speed; if (_currentColorHSV > 1f) { _currentColorHSV -= 1f; } Color val = Color.HSVToRGB(_currentColorHSV, 1f, 1f); Color val2 = default(Color); ((Color)(ref val2))..ctor(val.r, val.g, val.b, _alpha); _material.SetColor(ColorHash, val2); } } public class ReactToVehicleCollision : MonoBehaviour { [SerializeField] private UnityEvent _onVehicleCollision = new UnityEvent(); private int _obstacleId = -1; private static int _nextObstacleId = 1; private static readonly Dictionary _reactToVehicleCollisions = new Dictionary(); private void Awake() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) _obstacleId = _nextObstacleId; _nextObstacleId++; _reactToVehicleCollisions.Add(_obstacleId, this); Plugin.ExtendedLogging($"ReactToVehicleCollision: Registered vehicle reaction with ID {_obstacleId} at position {((Component)this).transform.position}"); } public void OnDestroy() { if (_reactToVehicleCollisions.ContainsKey(_obstacleId)) { _reactToVehicleCollisions.Remove(_obstacleId); Plugin.ExtendedLogging($"ReactToVehicleCollision: Unregistered vehicle reaction with ID {_obstacleId}"); } } public void OnTriggerEnter(Collider other) { //IL_002b: 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_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) VehicleController val = default(VehicleController); if (((Component)other).TryGetComponent(ref val) && ((NetworkBehaviour)val).IsOwner && ((Vector3)(ref val.averageVelocity)).magnitude > 5f && Vector3.Angle(val.averageVelocity, ((Component)this).transform.position - val.mainRigidbody.position) < 80f) { CodeRebirthUtils.Instance.ReactToVehicleCollisionServerRpc(_obstacleId); val.CarReactToObstacle(val.mainRigidbody.position - ((Component)this).transform.position, ((Component)this).transform.position, Vector3.zero, (CarObstacleType)2, 1f, (EnemyAI)null, false); } } public void InvokeCollisionEvent() { _onVehicleCollision.Invoke(); } public static bool TryGetById(int obstacleId, out ReactToVehicleCollision? result) { return _reactToVehicleCollisions.TryGetValue(obstacleId, out result); } } [AttributeUsage(AttributeTargets.Field)] public class RequireInterfaceAttribute : PropertyAttribute { public readonly Type InterfaceType; public RequireInterfaceAttribute(Type interfaceType) { InterfaceType = interfaceType; } } [Serializable] public class RiseFromDifferentGroundTypes { public string groundTag; [Header("Events")] public UnityEvent onRiseStart = new UnityEvent(); public UnityEvent onRiseComplete = new UnityEvent(); public UnityEvent onGroundStart = new UnityEvent(); public UnityEvent onGroundComplete = new UnityEvent(); [Header("Rising Or Descending Settings")] public float depthToRaise = 1f; public float raiseSpeed = 0.25f; } public class RiseFromGroundOnSpawn : MonoBehaviour { [SerializeField] internal RiseFromDifferentGroundTypes[] _riseFromDifferentGroundTypes = Array.Empty(); internal RiseFromDifferentGroundTypes _riseFromDifferentGroundType = new RiseFromDifferentGroundTypes(); internal float _timeToTake; private Vector3 _originalPosition = Vector3.zero; public void Start() { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(((Component)this).transform.position + ((Component)this).transform.up * 0.1f, -((Component)this).transform.up, ref val, 2f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; _riseFromDifferentGroundType = _riseFromDifferentGroundTypes[0]; RiseFromDifferentGroundTypes[] riseFromDifferentGroundTypes = _riseFromDifferentGroundTypes; foreach (RiseFromDifferentGroundTypes riseFromDifferentGroundTypes2 in riseFromDifferentGroundTypes) { if (riseFromDifferentGroundTypes2.groundTag.Equals(tag, StringComparison.OrdinalIgnoreCase)) { _riseFromDifferentGroundType = riseFromDifferentGroundTypes2; break; } } _riseFromDifferentGroundType.onRiseStart.Invoke(); _originalPosition = ((Component)this).transform.position; ((Component)this).transform.position = ((Component)this).transform.position + ((Component)this).transform.up * (0f - _riseFromDifferentGroundType.depthToRaise); if (_riseFromDifferentGroundType.raiseSpeed > 0f) { _timeToTake = _riseFromDifferentGroundType.depthToRaise / _riseFromDifferentGroundType.raiseSpeed; } } public void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0066: Unknown result type (might be due to invalid IL or missing references) _timeToTake -= Time.deltaTime; ((Component)this).transform.position = ((Component)this).transform.position + ((Component)this).transform.up * _riseFromDifferentGroundType.raiseSpeed * Time.deltaTime; if (_timeToTake <= 0f) { ((Component)this).transform.position = _originalPosition; FinishRisingOrGrounding(); } } private void FinishRisingOrGrounding() { if (_riseFromDifferentGroundType.raiseSpeed > 0f) { _riseFromDifferentGroundType.onRiseComplete.Invoke(); _riseFromDifferentGroundType.raiseSpeed *= -0.5f; } else { _riseFromDifferentGroundType.onGroundComplete.Invoke(); _riseFromDifferentGroundType.raiseSpeed *= -2f; } _timeToTake = _riseFromDifferentGroundType.depthToRaise / Mathf.Abs(_riseFromDifferentGroundType.raiseSpeed); ((Behaviour)this).enabled = false; } } public class RotateToDirection : MonoBehaviour { [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RotateToDirection <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; RotateToDirection rotateToDirection = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; rotateToDirection.Rotate(); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; rotateToDirection.Rotate(); <>2__current = null; <>1__state = 3; return true; case 3: <>1__state = -1; rotateToDirection.Rotate(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [field: SerializeField] public Vector3 Direction { get; private set; } = new Vector3(-90f, 0f, -45f); [field: SerializeField] public bool RotateOnAwake { get; private set; } = true; private void Awake() { if (RotateOnAwake) { ((MonoBehaviour)this).StartCoroutine(EnsureRotationIsForced()); } } public void Rotate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.rotation = Quaternion.Euler(Direction); } [IteratorStateMachine(typeof(d__10))] private IEnumerator EnsureRotationIsForced() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this }; } } public class ScreenShakeOnAnimation : MonoBehaviour { [SerializeField] [Tooltip("List of screen shake targets that can be used to play audio when the screen shake is triggered.")] private ScreenShakeTarget[] _screenShakeTargets = Array.Empty(); public void ShakeScreenAnimEvent(AnimationEvent animationEvent) { Plugin.ExtendedLogging($"ShakeScreenAnimEvent called with AnimationEvent: {animationEvent}"); ShakeScreen(animationEvent.floatParameter, animationEvent.intParameter, animationEvent.stringParameter, animationEvent.objectReferenceParameter); } public void ShakeScreen(float outwardDistance, int shakeType, string shakeGameObjectName, Object objectReferenceParameter) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_0057: 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_0060: 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) DynamicScreenShakeFalloff dynamicScreenShakeFalloff = null; if (objectReferenceParameter is DynamicScreenShakeFalloff dynamicScreenShakeFalloff2) { dynamicScreenShakeFalloff = dynamicScreenShakeFalloff2; } Vector3 position = ((Component)this).transform.position; if (!string.IsNullOrEmpty(shakeGameObjectName)) { ScreenShakeTarget[] screenShakeTargets = _screenShakeTargets; foreach (ScreenShakeTarget screenShakeTarget in screenShakeTargets) { if (!(((Object)screenShakeTarget.screenShakeTarget).name != shakeGameObjectName)) { position = screenShakeTarget.screenShakeTarget.transform.position; PlayScreenShakeAudio(screenShakeTarget, position); PlayScreenShakeParticles(screenShakeTarget, position); break; } } } shakeType = Mathf.Clamp(shakeType, 0, 3); float num = Vector3.Distance(position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); if (outwardDistance == -1f || num < outwardDistance) { HUDManager.Instance.ShakeCamera((ScreenShakeType)shakeType); } else { if (!((Object)(object)dynamicScreenShakeFalloff != (Object)null)) { return; } float num2 = 0f; for (int j = 0; j <= shakeType; j++) { switch (shakeType - j) { case 0: num2 += dynamicScreenShakeFalloff.dynamicIncreaseFromBigToSmall; break; case 1: num2 += dynamicScreenShakeFalloff.dynamicIncreaseFromLongToBig; break; case 2: num2 += dynamicScreenShakeFalloff.dynamicIncreaseFromVeryStrongToLong; break; case 3: num2 += 0f; break; } if (!(num > outwardDistance + num2)) { Plugin.ExtendedLogging($"ShakeType: {shakeType} - i: {j} - outwardDistanceIncrease: {num2} - distanceToPlayer: {num} - outwardDistance: {outwardDistance}"); HUDManager.Instance.ShakeCamera((ScreenShakeType)(shakeType - j)); break; } } } } private void PlayScreenShakeAudio(ScreenShakeTarget screenShakeTarget, Vector3 shakeStartPosition) { //IL_0041: 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) if (screenShakeTarget.nearAudioClips.Length != 0) { AudioClip val = screenShakeTarget.nearAudioClips[CodeRebirthUtils.Instance.CRRandom.Next(screenShakeTarget.nearAudioClips.Length)]; if ((Object)(object)screenShakeTarget.audioSourceNear != (Object)null) { ((Component)screenShakeTarget.audioSourceNear).transform.position = shakeStartPosition; screenShakeTarget.audioSourceNear.PlayOneShot(val); } } if (screenShakeTarget.farAudioClips.Length != 0) { AudioClip val2 = screenShakeTarget.farAudioClips[CodeRebirthUtils.Instance.CRRandom.Next(screenShakeTarget.farAudioClips.Length)]; if ((Object)(object)screenShakeTarget.audioSourceFar != (Object)null) { ((Component)screenShakeTarget.audioSourceFar).transform.position = shakeStartPosition; screenShakeTarget.audioSourceFar.PlayOneShot(val2); } } } private void PlayScreenShakeParticles(ScreenShakeTarget screenShakeTarget, Vector3 shakeStartPosition) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (screenShakeTarget.particleSystems.Length != 0) { ParticleSystem[] particleSystems = screenShakeTarget.particleSystems; foreach (ParticleSystem val in particleSystems) { ((Component)val).transform.position = shakeStartPosition; val.Play(); } } } } public class ScreenShakeTarget : MonoBehaviour { [Tooltip("The target GameObject that will have it's position used for screen shake effects.")] public GameObject? screenShakeTarget; [Space(5f)] [Header("Visual Settings")] public ParticleSystem[] particleSystems = Array.Empty(); [Space(5f)] [Header("Audio Settings")] public AudioSource? audioSourceNear; public AudioClip[] nearAudioClips = Array.Empty(); public AudioSource? audioSourceFar; public AudioClip[] farAudioClips = Array.Empty(); public void ShakeScreenAnimEvent(AnimationEvent animationEvent) { ShakeScreen(animationEvent.floatParameter, animationEvent.intParameter, animationEvent.stringParameter, animationEvent.objectReferenceParameter); } public void ShakeScreen(float outwardDistance, int shakeType, string stringParameters, Object objectReferenceParameter) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0039: Unknown result type (might be due to invalid IL or missing references) DynamicScreenShakeFalloff dynamicScreenShakeFalloff = null; if (objectReferenceParameter is DynamicScreenShakeFalloff dynamicScreenShakeFalloff2) { dynamicScreenShakeFalloff = dynamicScreenShakeFalloff2; } Vector3 position = ((Component)this).transform.position; if ((Object)(object)screenShakeTarget != (Object)null) { position = screenShakeTarget.transform.position; } PlayScreenShakeAudio(position); PlayScreenShakeParticles(position); shakeType = Mathf.Clamp(shakeType, 0, 3); float num = Vector3.Distance(position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); if (outwardDistance == -1f || num < outwardDistance) { HUDManager.Instance.ShakeCamera((ScreenShakeType)shakeType); } else { if (!((Object)(object)dynamicScreenShakeFalloff != (Object)null)) { return; } float num2 = 0f; for (int i = 0; i <= shakeType; i++) { switch (shakeType - i) { case 0: num2 += dynamicScreenShakeFalloff.dynamicIncreaseFromBigToSmall; break; case 1: num2 += dynamicScreenShakeFalloff.dynamicIncreaseFromLongToBig; break; case 2: num2 += dynamicScreenShakeFalloff.dynamicIncreaseFromVeryStrongToLong; break; case 3: num2 += 0f; break; } if (!(num > outwardDistance + num2)) { HUDManager.Instance.ShakeCamera((ScreenShakeType)(shakeType - i)); break; } } } } private void PlayScreenShakeAudio(Vector3 shakeStartPosition) { //IL_0041: 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) if (nearAudioClips.Length != 0) { AudioClip val = nearAudioClips[CodeRebirthUtils.Instance.CRRandom.Next(nearAudioClips.Length)]; if ((Object)(object)audioSourceNear != (Object)null) { ((Component)audioSourceNear).transform.position = shakeStartPosition; audioSourceNear.PlayOneShot(val); } } if (farAudioClips.Length != 0) { AudioClip val2 = farAudioClips[CodeRebirthUtils.Instance.CRRandom.Next(farAudioClips.Length)]; if ((Object)(object)audioSourceFar != (Object)null) { ((Component)audioSourceFar).transform.position = shakeStartPosition; audioSourceFar.PlayOneShot(val2); } } } private void PlayScreenShakeParticles(Vector3 shakeStartPosition) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (particleSystems.Length != 0) { ParticleSystem[] array = particleSystems; foreach (ParticleSystem val in array) { ((Component)val).transform.position = shakeStartPosition; val.Play(); } } } } public class ShipAnimator : MonoBehaviour { [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ShipAnimator <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown int num = <>1__state; ShipAnimator shipAnimator = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; goto IL_007d; case 1: <>1__state = -1; CodeRebirthUtils.Instance.CloseEyeVolume.weight = Mathf.MoveTowards(CodeRebirthUtils.Instance.CloseEyeVolume.weight, 0.8f, 4f * Time.deltaTime); goto IL_007d; case 2: <>1__state = -1; CodeRebirthUtils.Instance.CloseEyeVolume.weight = Mathf.MoveTowards(CodeRebirthUtils.Instance.CloseEyeVolume.weight, 0.3f, 0.5f * Time.deltaTime); goto IL_00df; case 3: <>1__state = -1; break; case 4: { <>1__state = -1; CodeRebirthUtils.Instance.CloseEyeVolume.weight = Mathf.MoveTowards(CodeRebirthUtils.Instance.CloseEyeVolume.weight, 1f, 0.4f * Time.deltaTime); break; } IL_007d: if (CodeRebirthUtils.Instance.CloseEyeVolume.weight < 0.8f) { <>2__current = null; <>1__state = 1; return true; } goto IL_00df; IL_00df: if (CodeRebirthUtils.Instance.CloseEyeVolume.weight > 0.3f) { <>2__current = null; <>1__state = 2; return true; } <>2__current = (object)new WaitForSeconds(3f); <>1__state = 3; return true; } if (CodeRebirthUtils.Instance.CloseEyeVolume.weight < 1f) { <>2__current = null; <>1__state = 4; return true; } shipAnimator._messWithEyeVolumeRoutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ShipAnimator <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown int num = <>1__state; ShipAnimator CS$<>8__locals0 = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => CS$<>8__locals0._messWithEyeVolumeRoutine == null)); <>1__state = 1; return true; case 1: <>1__state = -1; break; case 2: <>1__state = -1; CodeRebirthUtils.Instance.CloseEyeVolume.weight = Mathf.MoveTowards(CodeRebirthUtils.Instance.CloseEyeVolume.weight, 0f, Time.deltaTime); break; } if (CodeRebirthUtils.Instance.CloseEyeVolume.weight > 0f) { <>2__current = null; <>1__state = 2; return true; } Plugin.ExtendedLogging("Reverted to the original HangarShipLand animation clip."); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ShipAnimator <>4__this; private bool 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Expected O, but got Unknown int num = <>1__state; ShipAnimator shipAnimator = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; goto IL_0035; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipHasLanded)); <>1__state = 2; return true; case 2: <>1__state = -1; ((Behaviour)StartOfRound.Instance.shipAnimator).enabled = false; <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipIsLeaving)); <>1__state = 3; return true; case 3: <>1__state = -1; ((Behaviour)StartOfRound.Instance.shipAnimator).enabled = true; if (StartOfRound.Instance.connectedPlayersAmount + 1 - StartOfRound.Instance.livingPlayers == 0 && (float)(TimeOfDay.Instance.profitQuota - TimeOfDay.Instance.quotaFulfilled) <= 0f) { DuskAchievementExtensions.TryTriggerAchievement(DuskModContent.Achievements, CodeRebirthAchievementKeys.GreatestAsset); } <>2__current = (object)new WaitUntil((Func)(() => StartOfRound.Instance.shipDoorsEnabled)); <>1__state = 4; return true; case 4: <>1__state = -1; 5__2 = false; if (StartOfRound.Instance.livingPlayers == 0) { 5__2 = true; } <>2__current = (object)new WaitUntil((Func)(() => RoundManager.Instance.currentLevel.sceneName != "Oxyde" || StartOfRound.Instance.inShipPhase)); <>1__state = 5; return true; case 5: { <>1__state = -1; if (5__2) { HUDManagerExtensions.DisplayTip(HUDManager.Instance, new HUDDisplayTip("Warning", "All players found dead, rerouting back to company for a rest.", (AlertType)1)); if (NetworkManager.Singleton.IsServer) { ((Registry)(object)LethalContent.Moons)[MoonKeys.Gordion].RouteTo(); } } ((MonoBehaviour)shipAnimator).StartCoroutine(shipAnimator.UnReplaceAnimationClip()); goto IL_0035; } IL_0035: <>2__current = (object)new WaitUntil((Func)(() => RoundManager.Instance.currentLevel.sceneName == "Oxyde" && !StartOfRound.Instance.inShipPhase)); <>1__state = 1; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HideInInspector] public AnimationClip originalShipLeaveClip; private Coroutine? _messWithEyeVolumeRoutine; private void Start() { AnimationClip[] animationClips = StartOfRound.Instance.shipAnimator.runtimeAnimatorController.animationClips; foreach (AnimationClip val in animationClips) { if (((Object)val).name == "ShipLeave") { originalShipLeaveClip = val; break; } } ((MonoBehaviour)this).StartCoroutine(WaitToReplaceClip()); } [IteratorStateMachine(typeof(d__3))] private IEnumerator WaitToReplaceClip() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } public void TurnOnDarkenedVolumeAnimEvent() { //IL_0053: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Plugin.ExtendedLogging("Animation Event worked"); StartOfRound.Instance.shipDoorAudioSource.PlayOneShot(StartOfRound.Instance.alarmSFX); SoundManager.Instance.earsRingingTimer = 0.6f; _messWithEyeVolumeRoutine = ((MonoBehaviour)this).StartCoroutine(MessWithEyeVolume()); CRUtilities.CreateExplosion(((Component)StartOfRound.Instance.shipAnimatorObject).transform.position + Vector3.back * 3f, spawnExplosionEffect: true, 0, 0f, 10f, 0, null, null, 0f); } public void KillAllPlayersAnimEvent() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_0029: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.isPlayerControlled && !val.isPlayerDead) { CRUtilities.CreateExplosion(((Component)val).transform.position, spawnExplosionEffect: true, 999, 0f, 5f, 50, null, null, 100f); } } CRUtilities.CreateExplosion(((Component)StartOfRound.Instance.shipAnimatorObject).transform.position + Vector3.forward * 3f + Vector3.left * 3f, spawnExplosionEffect: true, 0, 0f, 10f, 0, null, null, 0f); CRUtilities.CreateExplosion(((Component)StartOfRound.Instance.shipAnimatorObject).transform.position + Vector3.forward * 3f + Vector3.right * 3f, spawnExplosionEffect: true, 0, 0f, 10f, 0, null, null, 0f); } [IteratorStateMachine(typeof(d__6))] private IEnumerator MessWithEyeVolume() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__7))] private IEnumerator UnReplaceAnimationClip() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } } public static class SlowDownEffect { [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public List<(AudioSource audioSource, float pitch, float volume, float dopplerLevel)> audioSourcesWithOldValues; public List occludeAudiosToReEnable; public List<(AudioLowPassFilter filter, float oldCutOffFrequency)> lowPassFiltersWithOldValues; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: { <>1__state = -1; if ((Object)(object)CurrentlyEditedTrigger != (Object)null) { ResetSlowTrigger(CurrentlyEditedTrigger); } Time.timeScale = 1f; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.movementSpeed /= 6f; Animator playerBodyAnimator = GameNetworkManager.Instance.localPlayerController.playerBodyAnimator; playerBodyAnimator.speed /= 5f; foreach (var (audioSource, pitch, volume, dopplerLevel) in audioSourcesWithOldValues) { ResetAudioSourceVariables(audioSource, pitch, volume, dopplerLevel); } foreach (OccludeAudio item in occludeAudiosToReEnable) { ReEnableOccludeAudio(item); } foreach (var (filter, cutoffFrequency) in lowPassFiltersWithOldValues) { ResetLowPassFilterValue(filter, cutoffFrequency); } 5__2 = 1f; break; } case 2: <>1__state = -1; break; } if (5__2 > 0f) { 5__2 -= Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } isSlowDownEffectActive = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool isSlowDownEffectActive = false; public static AudioSource[] audioSourcesToAffect = Array.Empty(); public static List<(AudioSource audioSource, float pitch, float volume, float dopplerLevel)> audioSourcesWithOldValues = new List<(AudioSource, float, float, float)>(); public static List occludeAudiosToReEnable = new List(); public static List<(AudioLowPassFilter filter, float oldCutOffFrequency)> lowPassFiltersWithOldValues = new List<(AudioLowPassFilter, float)>(); public static InteractTrigger? CurrentlyEditedTrigger { get; private set; } public static void SlowTrigger(InteractTrigger? trigger) { if (isSlowDownEffectActive && !((Object)(object)trigger == (Object)null) && !((Object)(object)CurrentlyEditedTrigger == (Object)(object)trigger)) { if ((Object)(object)CurrentlyEditedTrigger != (Object)null) { ResetSlowTrigger(CurrentlyEditedTrigger); } CurrentlyEditedTrigger = trigger; InteractTrigger? currentlyEditedTrigger = CurrentlyEditedTrigger; currentlyEditedTrigger.timeToHoldSpeedMultiplier /= Time.timeScale; } } public static void ResetSlowTrigger(InteractTrigger trigger) { if (isSlowDownEffectActive && !((Object)(object)trigger != (Object)(object)CurrentlyEditedTrigger)) { InteractTrigger? currentlyEditedTrigger = CurrentlyEditedTrigger; currentlyEditedTrigger.timeToHoldSpeedMultiplier *= Time.timeScale; CurrentlyEditedTrigger = null; } } public static void DoSlowdownEffect(float timeLength, float timeScale) { isSlowDownEffectActive = true; audioSourcesToAffect = Resources.FindObjectsOfTypeAll(); Time.timeScale = timeScale; audioSourcesWithOldValues.Clear(); occludeAudiosToReEnable.Clear(); lowPassFiltersWithOldValues.Clear(); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.movementSpeed /= Time.timeScale * 0.8f; Animator playerBodyAnimator = GameNetworkManager.Instance.localPlayerController.playerBodyAnimator; playerBodyAnimator.speed /= Time.timeScale; AudioSource[] array = audioSourcesToAffect; foreach (AudioSource audioSource in array) { SlowdownAudioSource(audioSource, timeLength); } ((MonoBehaviour)GameNetworkManager.Instance.localPlayerController).StartCoroutine(ResetTimeScaleAndMisc(audioSourcesWithOldValues, occludeAudiosToReEnable, lowPassFiltersWithOldValues, timeLength * Time.timeScale)); } public static void SlowdownAudioSource(AudioSource audioSource, float timeDelay) { audioSourcesWithOldValues.Add((audioSource, audioSource.pitch, audioSource.volume, audioSource.dopplerLevel)); audioSource.pitch = 0.2f; audioSource.volume = 0.7f * audioSource.volume; audioSource.dopplerLevel = 0f; OccludeAudio val = default(OccludeAudio); if (((Component)audioSource).gameObject.TryGetComponent(ref val) && ((Behaviour)val).enabled) { occludeAudiosToReEnable.Add(val); ((Behaviour)val).enabled = false; } AudioLowPassFilter val2 = default(AudioLowPassFilter); if (((Component)audioSource).gameObject.TryGetComponent(ref val2)) { lowPassFiltersWithOldValues.Add((val2, val2.cutoffFrequency)); val2.cutoffFrequency = 1000f; } else { val2 = ((Component)audioSource).gameObject.AddComponent(); Object.Destroy((Object)(object)val2, timeDelay * Time.timeScale); val2.cutoffFrequency = 1000f; } } public static void ReEnableOccludeAudio(OccludeAudio occludeAudio) { if (!((Object)(object)occludeAudio == (Object)null)) { ((Behaviour)occludeAudio).enabled = true; } } public static void ResetAudioSourceVariables(AudioSource audioSource, float pitch, float volume, float dopplerLevel) { if (!((Object)(object)audioSource == (Object)null)) { audioSource.pitch = pitch; audioSource.volume = volume; audioSource.dopplerLevel = dopplerLevel; } } public static void ResetLowPassFilterValue(AudioLowPassFilter filter, float cutoffFrequency) { if (!((Object)(object)filter == (Object)null)) { filter.cutoffFrequency = cutoffFrequency; } } [IteratorStateMachine(typeof(d__16))] public static IEnumerator ResetTimeScaleAndMisc(List<(AudioSource audioSource, float pitch, float volume, float dopplerLevel)> audioSourcesWithOldValues, List occludeAudiosToReEnable, List<(AudioLowPassFilter filter, float oldCutOffFrequency)> lowPassFiltersWithOldValues, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { audioSourcesWithOldValues = audioSourcesWithOldValues, occludeAudiosToReEnable = occludeAudiosToReEnable, lowPassFiltersWithOldValues = lowPassFiltersWithOldValues, delay = delay }; } } public class SpawnAndParentObject : NetworkBehaviour { private GameObject objectToSpawn; [field: SerializeField] public List ObjectsToSpawnList { get; private set; } public override void OnNetworkSpawn() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); if (!((NetworkBehaviour)this).IsServer) { return; } int num = Random.Range(0, ObjectsToSpawnList.Count); objectToSpawn = ObjectsToSpawnList[num]; GameObject val = Object.Instantiate(objectToSpawn, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); NetworkObject networkObject = default(NetworkObject); if (val.TryGetComponent(ref networkObject)) { networkObject.Spawn(true); NetworkObjectExtensions.OnSpawn(networkObject, (Action)delegate { networkObject.TrySetParent(((Component)this).transform, true); }); } else { SpawnGameObjectOnIndexServerRpc(num); } } [ServerRpc(RequireOwnership = false)] private void SpawnGameObjectOnIndexServerRpc(int indexToSpawn) { //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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(378487171u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, indexToSpawn); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 378487171u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnGameObjectOnIndexClientRpc(indexToSpawn); } } } [ClientRpc] private void SpawnGameObjectOnIndexClientRpc(int indexToSpawn) { //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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1105733801u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, indexToSpawn); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1105733801u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { GameObject val3 = Object.Instantiate(ObjectsToSpawnList[indexToSpawn], ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(378487171u, new RpcReceiveHandler(__rpc_handler_378487171), "SpawnGameObjectOnIndexServerRpc"); ((NetworkBehaviour)this).__registerRpc(1105733801u, new RpcReceiveHandler(__rpc_handler_1105733801), "SpawnGameObjectOnIndexClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_378487171(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 indexToSpawn = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref indexToSpawn); target.__rpc_exec_stage = (__RpcExecStage)1; ((SpawnAndParentObject)(object)target).SpawnGameObjectOnIndexServerRpc(indexToSpawn); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1105733801(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 indexToSpawn = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref indexToSpawn); target.__rpc_exec_stage = (__RpcExecStage)1; ((SpawnAndParentObject)(object)target).SpawnGameObjectOnIndexClientRpc(indexToSpawn); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SpawnAndParentObject"; } } public class SpookyFlicker : MonoBehaviour { [CompilerGenerated] private sealed class d__44 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpookyFlicker <>4__this; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__44(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SpookyFlicker spookyFlicker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; spookyFlicker._inEvent = true; 5__2 = Random.Range(spookyFlicker.BlackoutDurationRange.x, spookyFlicker.BlackoutDurationRange.y); spookyFlicker.PlayOneShot(spookyFlicker.DimOrBlackoutClips); <>2__current = spookyFlicker.TweenTo(0f, 0.01f, 0.03f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__3 = 0f; if ((Object)(object)spookyFlicker.LoopSource != (Object)null) { 5__3 = spookyFlicker.LoopSource.volume; spookyFlicker.LoopSource.volume = 5__3 * 0.35f; } 5__4 = 0f; goto IL_0103; case 2: <>1__state = -1; goto IL_0103; case 3: { <>1__state = -1; spookyFlicker._inEvent = false; return false; } IL_0103: if (5__4 < 5__2) { 5__4 += Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } if ((Object)(object)spookyFlicker.LoopSource != (Object)null) { spookyFlicker.LoopSource.volume = 5__3; } spookyFlicker.PlayOneShot(spookyFlicker.RecoverClips); <>2__current = spookyFlicker.TweenTo(spookyFlicker.BaseIntensity * Random.Range(0.9f, 1.15f), 0.06f, 0.15f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__43 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpookyFlicker <>4__this; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; SpookyFlicker spookyFlicker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; spookyFlicker._inEvent = true; 5__2 = Random.Range(spookyFlicker.DimDurationRange.x, spookyFlicker.DimDurationRange.y); spookyFlicker.PlayOneShot(spookyFlicker.DimOrBlackoutClips); <>2__current = spookyFlicker.TweenTo(spookyFlicker.BaseIntensity * spookyFlicker.DimFloorFrac, 0.02f, 0.04f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__3 = 0f; goto IL_0108; case 2: <>1__state = -1; goto IL_0108; case 3: { <>1__state = -1; spookyFlicker._inEvent = false; return false; } IL_0108: if (5__3 < 5__2) { 5__3 += Time.deltaTime; float num2 = 1f + (Mathf.PerlinNoise(spookyFlicker._noiseT * 3f, 1f) - 0.5f) * 0.15f; spookyFlicker.ApplyIntensity(spookyFlicker.BaseIntensity * spookyFlicker.DimFloorFrac * num2); <>2__current = null; <>1__state = 2; return true; } spookyFlicker.PlayOneShot(spookyFlicker.RecoverClips); <>2__current = spookyFlicker.TweenTo(spookyFlicker.BaseIntensity * Random.Range(0.85f, 1.1f), 0.05f, 0.12f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__42 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpookyFlicker <>4__this; private float 5__2; private float