Decompiled source of LambdaCompany v1.0.2

LambdaCompany.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using Microsoft.CodeAnalysis;
using On;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("Noosh")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A mod that adds scrap and items and various other things from Half Life 2 and other source games!")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+81fc1a73240fac591eac3173fcf50b6b6f4c4a5d")]
[assembly: AssemblyProduct("LambdaCompany")]
[assembly: AssemblyTitle("LambdaCompany")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LambdaCompany
{
	public class ExplosiveBarrel : GrabbableObject, IHittable
	{
		public bool exploded;

		public AudioSource barrelAudio;

		public AudioSource barrelFarAudio;

		public AudioClip barrelBlast;

		public AudioClip dropSFX;

		public AudioClip intenseSFX;

		[HideInInspector]
		internal static float explodeChance = 1f / 3f;

		[HideInInspector]
		public float distanceFallen
		{
			get
			{
				//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_0013: 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)
				if (base.startFallingPosition == Vector3.zero || base.targetFloorPosition == Vector3.zero)
				{
					return 0f;
				}
				return base.startFallingPosition.y - base.targetFloorPosition.y;
			}
		}

		public override void Start()
		{
			((GrabbableObject)this).Start();
			explodeChance = P.explodeChance.Value;
		}

		bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID)
		{
			if (playHitSFX)
			{
				barrelAudio.PlayOneShot(intenseSFX, 1f);
				WalkieTalkie.TransmitOneShotAudio(barrelAudio, intenseSFX, 1f);
			}
			P.Log("Hit barrel with shovel, setting off.", (LogLevel)8);
			SetOffServerRpc();
			return true;
		}

		public override void OnHitGround()
		{
			((GrabbableObject)this).OnHitGround();
			if (exploded)
			{
				return;
			}
			P.Log($"Fall distance = {distanceFallen}", (LogLevel)4);
			if (!((NetworkBehaviour)this).IsOwner)
			{
				return;
			}
			bool flag = false;
			bool safeDrop = false;
			float num = distanceFallen;
			if (!(num > 2f))
			{
				if (num > 1f)
				{
					flag = Random.Range(0f, 1f) <= explodeChance;
					P.Log(flag ? "Setting off explosion due to failed roll!" : "Barrel explosion avoided!", (LogLevel)8);
				}
				else
				{
					safeDrop = true;
					P.Log("Barrel not exploding, drop too short.", (LogLevel)8);
				}
			}
			else
			{
				flag = true;
				P.Log("Setting off guarunteed barrel explosion!", (LogLevel)8);
			}
			if (StartOfRound.Instance.inShipPhase)
			{
				flag = false;
			}
			if (flag)
			{
				if (!exploded)
				{
					SetOffServerRpc();
				}
			}
			else
			{
				DropSoundServerRPC(safeDrop);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DropSoundServerRPC(bool safeDrop)
		{
			DropSoundClientRPC(safeDrop);
		}

		[ClientRpc]
		public void DropSoundClientRPC(bool safeDrop)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			barrelAudio.PlayOneShot(safeDrop ? dropSFX : intenseSFX);
			WalkieTalkie.TransmitOneShotAudio(barrelAudio, safeDrop ? dropSFX : intenseSFX, 1f);
			if (((NetworkBehaviour)this).IsOwner)
			{
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 8f + distanceFallen, 0.5f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 941);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetOffServerRpc()
		{
			SetOffClientRpc();
		}

		[ClientRpc]
		public void SetOffClientRpc()
		{
			Detonate();
		}

		public void Detonate()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0071: 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)
			exploded = true;
			barrelAudio.PlayOneShot(barrelBlast, 1f);
			WalkieTalkie.TransmitOneShotAudio(barrelAudio, barrelBlast, 1f);
			Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 5f, 8f, 50, 0f, (GameObject)null, false);
			StunGrenadeItem.StunExplosion(((Component)this).transform.position + Vector3.up, true, 0.1f, 3f, 0.5f, false, (PlayerControllerB)null, (PlayerControllerB)null, 0f);
			if (((NetworkBehaviour)this).IsOwner)
			{
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 11f, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 941);
				RemoveScrapServerRpc();
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void RemoveScrapServerRpc()
		{
			base.grabbable = false;
			base.grabbableToEnemies = false;
			base.deactivated = true;
			P.Log("Despawning barrel object.", (LogLevel)8);
			((NetworkBehaviour)this).NetworkObject.Despawn(true);
		}
	}
	internal static class NetPatcher
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Start <0>__GameNetworkManager_Start;
		}

		internal static List<GameObject> netPrefabs = new List<GameObject>();

		private static void Collect()
		{
			foreach (ScrapEntry value in ScrapPatcher.scrapCatelog.Values)
			{
				if (!netPrefabs.Contains(value.item.spawnPrefab))
				{
					netPrefabs.Add(value.item.spawnPrefab);
				}
			}
		}

		private static void GameNetworkManager_Start(orig_Start orig, GameNetworkManager self)
		{
			orig.Invoke(self);
			foreach (GameObject netPrefab in netPrefabs)
			{
				if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Contains(netPrefab))
				{
					NetworkManager.Singleton.AddNetworkPrefab(netPrefab);
					P.Log("Added prefab " + ((Object)netPrefab).name, (LogLevel)8);
				}
			}
		}

		internal static void Patch()
		{
			//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_0020: Expected O, but got Unknown
			Collect();
			object obj = <>O.<0>__GameNetworkManager_Start;
			if (obj == null)
			{
				hook_Start val = GameNetworkManager_Start;
				<>O.<0>__GameNetworkManager_Start = val;
				obj = (object)val;
			}
			GameNetworkManager.Start += (hook_Start)obj;
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
						P.Log("Invoked " + methodInfo.Name, (LogLevel)8);
					}
				}
			}
		}
	}
	[BepInPlugin("LambdaCompany", "LambdaCompany", "1.0.2")]
	public class P : BaseUnityPlugin
	{
		internal static AssetBundle assets;

		internal static P Instance;

		internal static ConfigEntry<float> explodeChance;

		private void Awake()
		{
			Instance = this;
			assets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lambdacompany"));
			explodeChance = ((BaseUnityPlugin)this).Config.Bind<float>("Chance", "Explode Chance", 1f / 3f, "Chance for Explosive Barrel to explode when dropped from standing height. (0.0 - 1.0)");
			Scrap();
			NetPatcher.Patch();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"LambdaCompany [1.0.2] loaded");
		}

		private void Scrap()
		{
			Dictionary<string, int[]> dictionary = new Dictionary<string, int[]>();
			dictionary.Add("GnomeScrap", new int[11]
			{
				2, 5, 4, 4, 1, 1, 10, 15, 1, 15,
				20
			});
			dictionary.Add("DollScrap", new int[11]
			{
				30, 10, 10, -1, -1, 25, 60, -1, 10, 50,
				15
			});
			dictionary.Add("LanternScrap", new int[11]
			{
				-1, -1, -1, 12, 12, 20, 15, 15, 5, 15,
				30
			});
			dictionary.Add("ExplosiveBarrelScrap", new int[11]
			{
				10, 18, -1, 25, -1, 8, -1, 30, 15, 12,
				28
			});
			Dictionary<string, int[]> dictionary2 = dictionary;
			ScrapPatcher.scrapCatelog.Add("GnomeScrap", new ScrapEntry("Assets/Scrap/Gnome/GnomeScrap.asset", dictionary2["GnomeScrap"]));
			ScrapPatcher.scrapCatelog.Add("DollScrap", new ScrapEntry("Assets/Scrap/Doll/DollScrap.asset", dictionary2["DollScrap"]));
			ScrapPatcher.scrapCatelog.Add("LanternScrap", new ScrapEntry("Assets/Scrap/Lantern/LanternScrap.asset", dictionary2["LanternScrap"]));
			ScrapPatcher.scrapCatelog.Add("ExplosiveBarrelScrap", new ScrapEntry("Assets/Scrap/ExplosiveBarrel/ExplosiveBarrelScrap.asset", dictionary2["ExplosiveBarrelScrap"]));
			ScrapPatcher.Activate();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static void Log(object data, LogLevel lvl = 8)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)Instance).Logger.Log(lvl, data);
		}
	}
	public static class ScrapPatcher
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__StartOfRound_Awake;

			public static hook_Start <1>__StartOfRound_Start;

			public static hook_Start <2>__MenuManager_Start;
		}

		internal static Dictionary<string, ScrapEntry> scrapCatelog = new Dictionary<string, ScrapEntry>();

		internal static List<GameObject> prefabsToFix = new List<GameObject>();

		internal static List<GameObject> fixedPrefabs = new List<GameObject>();

		internal static Dictionary<string, int> MoonIndex = new Dictionary<string, int>
		{
			{ "ExperimentationLevel", 0 },
			{ "AssuranceLevel", 1 },
			{ "VowLevel", 2 },
			{ "OffenseLevel", 3 },
			{ "MarchLevel", 4 },
			{ "RendLevel", 5 },
			{ "DineLevel", 6 },
			{ "TitanLevel", 7 },
			{ "ModdedLevel", 8 },
			{ "ModdedLevel15", 9 },
			{ "ModdedLevel30", 10 }
		};

		public static void Activate()
		{
			//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>__StartOfRound_Awake;
			if (obj == null)
			{
				hook_Awake val = StartOfRound_Awake;
				<>O.<0>__StartOfRound_Awake = val;
				obj = (object)val;
			}
			StartOfRound.Awake += (hook_Awake)obj;
			object obj2 = <>O.<1>__StartOfRound_Start;
			if (obj2 == null)
			{
				hook_Start val2 = StartOfRound_Start;
				<>O.<1>__StartOfRound_Start = val2;
				obj2 = (object)val2;
			}
			StartOfRound.Start += (hook_Start)obj2;
			object obj3 = <>O.<2>__MenuManager_Start;
			if (obj3 == null)
			{
				hook_Start val3 = MenuManager_Start;
				<>O.<2>__MenuManager_Start = val3;
				obj3 = (object)val3;
			}
			MenuManager.Start += (hook_Start)obj3;
		}

		public static ScrapEntry GetEntry(string item)
		{
			return scrapCatelog[item];
		}

		private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self)
		{
			//IL_00df: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			orig.Invoke(self);
			SelectableLevel[] levels = self.levels;
			foreach (SelectableLevel val in levels)
			{
				foreach (ScrapEntry scrap in scrapCatelog.Values)
				{
					if (!val.spawnableScrap.Any((SpawnableItemWithRarity x) => (Object)(object)x.spawnableItem == (Object)(object)scrap.item))
					{
						int num = MoonIndex.GetValueOrDefault(((Object)val).name, -9);
						if (num == -9)
						{
							int maxScrap = val.maxScrap;
							num = ((maxScrap >= 30) ? MoonIndex["ModdedLevel30"] : ((maxScrap < 15) ? MoonIndex["ModdedLevel"] : MoonIndex["ModdedLevel15"]));
						}
						if (scrap.rarity[num] != -1)
						{
							val.spawnableScrap.Add(new SpawnableItemWithRarity
							{
								spawnableItem = scrap.item,
								rarity = scrap.rarity[num]
							});
						}
					}
				}
			}
			foreach (ScrapEntry value in scrapCatelog.Values)
			{
				if (!self.allItemsList.itemsList.Contains(value.item))
				{
					P.Log("Registered item: " + value.item.itemName, (LogLevel)8);
					self.allItemsList.itemsList.Add(value.item);
				}
			}
		}

		private static void StartOfRound_Start(orig_Start orig, StartOfRound self)
		{
			AudioMixer diageticMixer = SoundManager.Instance.diageticMixer;
			List<GameObject> list = new List<GameObject>();
			for (int num = prefabsToFix.Count - 1; num >= 0; num--)
			{
				GameObject val = prefabsToFix[num];
				AudioSource[] componentsInChildren = val.GetComponentsInChildren<AudioSource>();
				AudioSource[] array = componentsInChildren;
				foreach (AudioSource val2 in array)
				{
					if (!((Object)(object)val2.outputAudioMixerGroup == (Object)null) && ((Object)val2.outputAudioMixerGroup.audioMixer).name == "Diagetic")
					{
						AudioMixerGroup val3 = diageticMixer.FindMatchingGroups(((Object)val2.outputAudioMixerGroup).name)[0];
						if ((Object)(object)val3 != (Object)null)
						{
							val2.outputAudioMixerGroup = val3;
							P.Log("Set mixer group for " + ((Object)val2).name + " in " + ((Object)val).name + " to Diagetic:" + ((Object)val3).name, (LogLevel)8);
							list.Add(val);
						}
					}
				}
			}
			foreach (GameObject item in list)
			{
				prefabsToFix.Remove(item);
			}
			orig.Invoke(self);
		}

		private static void MenuManager_Start(orig_Start orig, MenuManager self)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0069: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			PropertyInfo property = typeof(HDRenderPipeline).GetProperty("currentPipeline", BindingFlags.Static | BindingFlags.NonPublic);
			HDRenderPipeline val = (HDRenderPipeline)property.GetValue(typeof(HDRenderPipeline));
			PropertyInfo property2 = ((object)val).GetType().GetProperty("defaultDiffusionProfile", BindingFlags.Instance | BindingFlags.NonPublic);
			DiffusionProfileSettings val2 = (DiffusionProfileSettings)property2.GetValue(val);
			val2.scatteringDistance = new Color(0.5f, 0.5f, 0.5f, 1f);
			FieldInfo field = ((object)val2).GetType().GetField("profile", BindingFlags.Instance | BindingFlags.NonPublic);
			object value = field.GetValue(val2);
			value.GetType().GetField("scatteringDistanceMultiplier").SetValue(value, 1f);
			value.GetType().GetField("transmissionTint").SetValue(value, (object)new Color(1f, 1f, 1f, 1f));
			value.GetType().GetField("texturingMode").SetValue(value, 1u);
			value.GetType().GetField("transmissionMode").SetValue(value, 1u);
			value.GetType().GetField("thicknessRemap").SetValue(value, (object)new Vector2(0f, 5f));
			value.GetType().GetField("worldScale").SetValue(value, 1f);
			value.GetType().GetField("ior").SetValue(value, 1.8f);
			P.Log("Patched the default diffusion profile!", (LogLevel)8);
			if ((Object)(object)((Component)self).GetComponent<AudioSource>() == (Object)null)
			{
				return;
			}
			AudioMixer audioMixer = ((Component)self).GetComponent<AudioSource>().outputAudioMixerGroup.audioMixer;
			List<GameObject> list = new List<GameObject>();
			for (int num = prefabsToFix.Count - 1; num >= 0; num--)
			{
				GameObject val3 = prefabsToFix[num];
				AudioSource[] componentsInChildren = val3.GetComponentsInChildren<AudioSource>();
				AudioSource[] array = componentsInChildren;
				foreach (AudioSource val4 in array)
				{
					if (!((Object)(object)val4.outputAudioMixerGroup == (Object)null) && ((Object)val4.outputAudioMixerGroup.audioMixer).name == "NonDiagetic")
					{
						AudioMixerGroup val5 = audioMixer.FindMatchingGroups(((Object)val4.outputAudioMixerGroup).name)[0];
						if ((Object)(object)val5 != (Object)null)
						{
							val4.outputAudioMixerGroup = val5;
							P.Log("Set mixer group for " + ((Object)val4).name + " in " + ((Object)val3).name + " to NonDiagetic:" + ((Object)val5).name, (LogLevel)8);
							list.Add(val3);
						}
					}
				}
			}
			foreach (GameObject item in list)
			{
				prefabsToFix.Remove(item);
			}
		}

		public static void FixMixerGroups(GameObject prefab)
		{
			if (!fixedPrefabs.Contains(prefab))
			{
				fixedPrefabs.Add(prefab);
				prefabsToFix.Add(prefab);
			}
		}
	}
	public struct ScrapEntry
	{
		internal Item item;

		internal int[] rarity;

		public ScrapEntry(string assetpath, int[] rarity)
		{
			this = default(ScrapEntry);
			item = P.assets.LoadAsset<Item>(assetpath);
			this.rarity = rarity;
			ScrapPatcher.FixMixerGroups(item.spawnPrefab);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "LambdaCompany";

		public const string PLUGIN_NAME = "LambdaCompany";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}