Decompiled source of UnnamedProducts v1.2.3

plugins/com.github.MiiMii1205.UnnamedProducts.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
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.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using PEAKLib.Core.Extensions;
using PEAKLib.Items;
using PEAKLib.Items.UnityEditor;
using Peak.Afflictions;
using Photon.Pun;
using Photon.Realtime;
using PiggyBank.Behaviours;
using PiggyBank.Behaviours.GUI;
using Sirenix.Utilities;
using TMPro;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.TextCore;
using UnityEngine.UI;
using UnityEngine.UI.Extensions;
using UnnamedProducts.Behaviours;
using UnnamedProducts.Behaviours.Item;
using UnnamedProducts.Behaviours.Item.GarbageBag;
using UnnamedProducts.Behaviours.Item.GarbageBag.GUI;
using UnnamedProducts.Compatibility;
using UnnamedProducts.Compatibility.Patchers;
using UnnamedProducts.Extensions;
using UnnamedProducts.Patchers;
using Zorro.Core;
using Zorro.Core.CLI;
using Zorro.Core.Serizalization;
using Zorro.Settings;
using pworld.Scripts.Extensions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.MiiMii1205.UnnamedProducts")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.2.3.0")]
[assembly: AssemblyInformationalVersion("1.2.3+a97f0bbb1f17c201ed53ac9d469ac000349ad3ea")]
[assembly: AssemblyProduct("com.github.MiiMii1205.UnnamedProducts")]
[assembly: AssemblyTitle("UnnamedProducts")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.3.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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace UnnamedProducts
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.github.MiiMii1205.UnnamedProducts", "UnnamedProducts", "1.2.3")]
	public class UnnamedPlugin : BaseUnityPlugin
	{
		public const float UnnamedModifier = 0.5f;

		public const float UnnamedChance = 0.25f;

		public const float UnnamedLuggageChance = 0.125f;

		public const byte UnnamedTotalBaseDataEntryKey = 15;

		private static readonly Dictionary<string, GameObject> UnnamedDatabase = new Dictionary<string, GameObject>();

		private static TMP_FontAsset? _darumaFontAsset;

		private static Material? _darumaShadowMaterial;

		private static readonly string[] GlobalZombieSpawnModList = new string[5] { "com.EMOKaMi.Zombie", "com.emokami.mimic", "Heroes", "sinik.zombiespawner", "legocool.LuckyBlocks" };

		public static GameObject UnnamedGarbageBagPrefab = null;

		public static Texture2D GarbageBagIcon = null;

		private static readonly HashSet<string> UnnamedUniques = new HashSet<string>();

		private static readonly Dictionary<BiomeType, State> BiomeSeeds = new Dictionary<BiomeType, State>();

		private static readonly int UnderlayDilate = Shader.PropertyToID("_UnderlayDilate");

		private static readonly int UnderlayOffsetY = Shader.PropertyToID("_UnderlayOffsetY");

		private static readonly int UnderlaySoftness = Shader.PropertyToID("_UnderlaySoftness");

		private static readonly int UnderlayColor = Shader.PropertyToID("_UnderlayColor");

		private static bool _hasAnyGlobalSpawningZombies;

		private static string _unnamedPrefix = null;

		private static string _modInfoPrefix = null;

		public const string Id = "com.github.MiiMii1205.UnnamedProducts";

		internal static ManualLogSource Log { get; private set; } = null;


		internal static PluginInfo UnnamedInfo { get; private set; } = null;


		public static Material SmallLuggageMaterial { get; private set; } = null;


		public static Material SmallLuggageInteriorMaterial { get; private set; } = null;


		public static Material LargeLuggageMaterial { get; private set; } = null;


		public static Material EpicLuggageMaterial { get; private set; } = null;


		public static Material LargeLuggageInteriorMaterial { get; private set; } = null;


		public static Material AncientLuggageMaterial { get; private set; } = null;


		public static Material AncientLuggageMetalMaterial { get; private set; } = null;


		public static Material AncientLuggageCrystalMaterial { get; private set; } = null;


		public static Material RespawnStatueCalderaMaterial { get; private set; } = null;


		public static Material RespawnStatueAlpineMaterial { get; private set; } = null;


		public static Material RespawnStatueMesaMaterial { get; private set; } = null;


		public static Material RespawnStatueRockVFXMaterial { get; private set; } = null;


		public static Material RespawnStatueRootsMaterial { get; private set; } = null;


		public static Material RespawnStatueTropicsMaterial { get; private set; } = null;


		public static Material RespawnStatueShoreMaterial { get; private set; } = null;


		public static SpawnPool UnnamedSpawnPool { get; private set; } = (SpawnPool)0;


		public static GameObject BigUnnamedLuggagePrefab { get; private set; } = null;


		public static GameObject SmallUnnamedLuggagePrefab { get; private set; } = null;


		public static GameObject EpicUnnamedLuggagePrefab { get; private set; } = null;


		public static GameObject AncientUnnamedLuggagePrefab { get; private set; } = null;


		public static TMP_FontAsset DarumaDropOne
		{
			get
			{
				if ((Object)(object)_darumaFontAsset == (Object)null)
				{
					TMP_FontAsset[] source = Resources.FindObjectsOfTypeAll<TMP_FontAsset>();
					_darumaFontAsset = ((IEnumerable<TMP_FontAsset>)source).FirstOrDefault((Func<TMP_FontAsset, bool>)delegate(TMP_FontAsset fontAsset)
					{
						//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)
						FaceInfo faceInfo = ((TMP_Asset)fontAsset).faceInfo;
						return ((FaceInfo)(ref faceInfo)).familyName == "Daruma Drop One";
					});
					Log.LogInfo((object)"Daruma Drop One font found!");
				}
				return _darumaFontAsset;
			}
		}

		public static Material DarumaDropOneShadowMaterial
		{
			get
			{
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_darumaShadowMaterial == (Object)null)
				{
					_darumaShadowMaterial = ThrowHelper.ThrowIfArgumentNull<Material>(Object.Instantiate<Material>(((TMP_Asset)DarumaDropOne).material), "GameObject.Instantiate(DarumaDropOne.material)");
					_darumaShadowMaterial.EnableKeyword("UNDERLAY_ON");
					_darumaShadowMaterial.SetFloat(UnderlayDilate, 1f);
					_darumaShadowMaterial.SetFloat(UnderlayOffsetY, -0.7f);
					_darumaShadowMaterial.SetFloat(UnderlaySoftness, 1f);
					_darumaShadowMaterial.SetColor(UnderlayColor, new Color(0f, 0f, 0f, 0.1960784f));
					Log.LogInfo((object)"Shadow material for Critial Hit indicator was successfully generated!");
				}
				return _darumaShadowMaterial;
			}
		}

		public GameObject UnnamedKioskSetup { get; private set; }

		public GameObject UnnamedBrokenStandeeSetup { get; private set; }

		public Dictionary<string, Material> PlaneMaterials { get; set; }

		public Dictionary<string, Material> MirageMaterials { get; set; }

		public static bool ShouldBeUnnamed => Random.value <= 0.25f;

		public static bool LuggageShouldBeUnnamed => Random.value <= 0.125f;

		public static float RandomUnnamedModifier => RandomModifier();

		public static bool RandomUnnamedBool => IsUnnamedLucky();

		public static string Name => "UnnamedProducts";

		public static string Version => "1.2.3";

		private void Awake()
		{
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			UnnamedInfo = ((BaseUnityPlugin)this).Info;
			_modInfoPrefix = ModDefinition.GetOrCreate(UnnamedInfo).Id + ":";
			_unnamedPrefix = _modInfoPrefix + "Unnamed";
			AddLocalizedTextCsv();
			int num = 0;
			foreach (int value in Enum.GetValues(typeof(SpawnPool)))
			{
				if (value > num)
				{
					num = value;
				}
			}
			UnnamedSpawnPool = (SpawnPool)(num * 2);
			Log.LogInfo((object)$"Highest spawn pool: {num}. Using {num * 2} as the unnamed pool");
			Log.LogInfo((object)("Plugin " + Name + " is loading..."));
			_hasAnyGlobalSpawningZombies = GlobalZombieSpawnModList.Any(Chainloader.PluginInfos.ContainsKey);
			GlobalEvents.OnItemRequested = (Action<Item, Character>)Delegate.Combine(GlobalEvents.OnItemRequested, new Action<Item, Character>(CheckForStickyFireballs));
			BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "unnamed.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
			{
				//IL_0151: 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_0237: Unknown result type (might be due to invalid IL or missing references)
				//IL_023c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0261: Unknown result type (might be due to invalid IL or missing references)
				//IL_0266: Unknown result type (might be due to invalid IL or missing references)
				//IL_028b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0290: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b5: 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_02df: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0309: Unknown result type (might be due to invalid IL or missing references)
				//IL_030e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0333: Unknown result type (might be due to invalid IL or missing references)
				//IL_0338: Unknown result type (might be due to invalid IL or missing references)
				//IL_035d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0362: Unknown result type (might be due to invalid IL or missing references)
				//IL_0387: Unknown result type (might be due to invalid IL or missing references)
				//IL_038c: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c6: Expected O, but got Unknown
				//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0403: Expected O, but got Unknown
				//IL_042c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0431: Unknown result type (might be due to invalid IL or missing references)
				//IL_0436: Unknown result type (might be due to invalid IL or missing references)
				//IL_0440: Expected O, but got Unknown
				//IL_0469: Unknown result type (might be due to invalid IL or missing references)
				//IL_046e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0473: Unknown result type (might be due to invalid IL or missing references)
				//IL_047d: Expected O, but got Unknown
				//IL_0673: Unknown result type (might be due to invalid IL or missing references)
				//IL_0678: Unknown result type (might be due to invalid IL or missing references)
				//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_07ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_07f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_080a: Unknown result type (might be due to invalid IL or missing references)
				//IL_080f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0825: Unknown result type (might be due to invalid IL or missing references)
				//IL_082a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0866: Unknown result type (might be due to invalid IL or missing references)
				//IL_086b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0881: Unknown result type (might be due to invalid IL or missing references)
				//IL_0886: Unknown result type (might be due to invalid IL or missing references)
				//IL_089c: Unknown result type (might be due to invalid IL or missing references)
				//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_08b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_08bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_093d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0942: Unknown result type (might be due to invalid IL or missing references)
				//IL_094d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0958: Unknown result type (might be due to invalid IL or missing references)
				//IL_095f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0966: Unknown result type (might be due to invalid IL or missing references)
				//IL_096d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0974: Unknown result type (might be due to invalid IL or missing references)
				//IL_097f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0986: Unknown result type (might be due to invalid IL or missing references)
				//IL_098d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0994: Unknown result type (might be due to invalid IL or missing references)
				//IL_099b: Unknown result type (might be due to invalid IL or missing references)
				//IL_09a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_09b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_09b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_09be: Unknown result type (might be due to invalid IL or missing references)
				//IL_09c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_09dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_09ed: Expected O, but got Unknown
				//IL_0a43: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a48: Unknown result type (might be due to invalid IL or missing references)
				//IL_1433: Unknown result type (might be due to invalid IL or missing references)
				//IL_1363: Unknown result type (might be due to invalid IL or missing references)
				GameObject val5 = peakBundle.LoadAsset<GameObject>("Antifreeze.prefab");
				Log.LogInfo((object)"Loading Antifreeze...");
				MeshRenderer[] componentsInChildren = val5.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val6 in componentsInChildren)
				{
					((Renderer)val6).sortingOrder = 1;
					if (((Object)((Renderer)val6).sharedMaterial.shader).name == "Shader Graphs/LiquidEffect" || ((Object)((Renderer)val6).material.shader).name == "Shader Graphs/LiquidEffect")
					{
						GameObject gameObject = ((Component)val6).gameObject;
						LiquidController orAddComponent3 = ExtGameObject.GetOrAddComponent<LiquidController>(gameObject);
						Log.LogInfo((object)"Initializing Liquid Controller...");
						orAddComponent3.mesh = gameObject.GetComponent<MeshFilter>().sharedMesh;
						orAddComponent3.rend = (Renderer)(object)val6;
						orAddComponent3.compensateShapeAmount = 0.132f;
						orAddComponent3.Thickness = 0.5f;
						orAddComponent3.fillAmount = 0.4f;
						orAddComponent3.Recovery = 1f;
						orAddComponent3.MaxWobble = 0.03f;
						orAddComponent3.WobbleSpeedMove = 0.5f;
					}
				}
				ExplodeOnBurningAction explodeOnBurningAction = val5.AddComponent<ExplodeOnBurningAction>();
				explodeOnBurningAction.dontRunIfOutOfFuel = false;
				((ItemAction)explodeOnBurningAction).OnCastFinished = true;
				UnnamedSpawnRestriction orAddComponent4 = ExtGameObject.GetOrAddComponent<UnnamedSpawnRestriction>(val5);
				orAddComponent4.biomeType = CollectionExtensions.AddToArray<BiomeType>(orAddComponent4.biomeType, (BiomeType)2);
				orAddComponent4.whenNightIsCold = true;
				orAddComponent4.hasColdNightRestrictions = true;
				LootData orAddComponent5 = ExtGameObject.GetOrAddComponent<LootData>(val5);
				orAddComponent5.spawnLocations = UnnamedSpawnPool;
				Log.LogInfo((object)"Loading sticky fireball...");
				GameObject val7 = peakBundle.LoadAsset<GameObject>("StickyFireball.prefab");
				StickyFireballController orAddComponent6 = ExtGameObject.GetOrAddComponent<StickyFireballController>(val7);
				orAddComponent6.destroyAfterTime = val7.GetComponent<DestroyAfterTime>();
				orAddComponent6.rb = val7.GetComponent<Rigidbody>();
				AudioSource component = ((Component)orAddComponent6).GetComponent<AudioSource>();
				Item val8 = default(Item);
				if (ItemDatabase.TryGetItem((ushort)62, ref val8))
				{
					AudioClip clip = ((Component)val8).GetComponent<Constructable>().constructedPrefab.gameObject.GetComponent<AudioSource>().clip;
					component.clip = clip;
					Campfire componentInChildren = ((Component)val8).GetComponent<Constructable>().constructedPrefab.GetComponentInChildren<Campfire>();
					SFX_Instance[] fireStart = componentInChildren.fireStart;
					SFX_Instance[] extinguish = componentInChildren.extinguish;
					orAddComponent6.extinguish = extinguish;
					orAddComponent6.fireStart = fireStart;
				}
				component.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[10]
				{
					new Keyframe(0.002f, 1f, -500.2007f, -500.2007f, 0f, 0f),
					new Keyframe(0.004f, 0.5f, -125.0502f, -125.0502f, 0f, 0f),
					new Keyframe(0.008f, 0.25f, -31.2625f, -31.2625f, 0f, 0f),
					new Keyframe(0.016f, 0.125f, -7.8156f, -7.8156f, 0f, 0f),
					new Keyframe(0.032f, 0.0625f, -1.9539f, -1.9539f, 0f, 0f),
					new Keyframe(0.064f, 1f / 32f, -0.4885f, -0.4885f, 0f, 0f),
					new Keyframe(0.128f, 1f / 64f, -0.1221f, -0.1221f, 0f, 0f),
					new Keyframe(0.256f, 1f / 128f, -0.0305f, -0.0305f, 0f, 0f),
					new Keyframe(0.512f, 0.00390625f, -0.00076f, -0.00076f, 0f, 0f),
					new Keyframe(1f, 0f, -0.002f, -0.002f, 0f, 0f)
				}));
				component.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 1f, 0f, 0f, 0.3333f, 0.3333f)
				}));
				component.SetCustomCurve((AudioSourceCurveType)2, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 1f, 0f, 0f, 0.3333f, 0.3333f)
				}));
				component.SetCustomCurve((AudioSourceCurveType)3, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 1f, 0f, 0f, 0.3333f, 0.3333f)
				}));
				Renderer[] componentsInChildren2 = ((Component)orAddComponent6).GetComponentsInChildren<Renderer>(true);
				Material item;
				foreach (Renderer val9 in componentsInChildren2)
				{
					Material[] materials = val9.materials;
					int l = 0;
					for (int num3 = materials.Length; l < num3; l++)
					{
						Material val10 = materials[l];
						val10.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val10.shader).name), "Shader.Find(mat.shader.name)");
					}
					Renderer val11 = val9;
					Material[] array = materials;
					List<Material> list = new List<Material>(array.Length);
					Material[] array2 = array;
					for (int m = 0; m < array2.Length; m++)
					{
						item = array2[m];
						list.Add(item);
					}
					val11.SetMaterials(list);
				}
				Item val12 = default(Item);
				if (ItemDatabase.TryGetItem((ushort)35, ref val12))
				{
					ItemCooking orAddComponent7 = ExtGameObject.GetOrAddComponent<ItemCooking>(val5);
					GameObject val13 = peakBundle.LoadAsset<GameObject>("AntifreezeExplosion.prefab");
					AntifreezeExplosionController antifreezeExplosionController = val13.AddComponent<AntifreezeExplosionController>();
					antifreezeExplosionController.stickyFireball = ((Component)orAddComponent6).gameObject;
					antifreezeExplosionController.m_amountOfFireballs = 20;
					GameObject val14 = Object.Instantiate<GameObject>(((Component)val12).GetComponent<ItemCooking>().explosionPrefab);
					val14.SetActive(false);
					Object.DontDestroyOnLoad((Object)(object)val14);
					antifreezeExplosionController.explosionPrefab = val14;
					orAddComponent7.explosionPrefab = ((Component)antifreezeExplosionController).gameObject;
					NetworkPrefabManager.RegisterNetworkPrefab(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info), ((Component)antifreezeExplosionController).gameObject);
					NetworkPrefabManager.RegisterNetworkPrefab(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info), val14);
				}
				StickyFireballController.FireballPrefab = ((Component)orAddComponent6).gameObject;
				NetworkPrefabManager.RegisterNetworkPrefab(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info), ((Component)orAddComponent6).gameObject);
				UnnamedUniques.Add(((Object)val5).name.Trim());
				GameObject val15 = peakBundle.LoadAsset<GameObject>("LaundryDetergent.prefab");
				Action_Detergent orAddComponent8 = ExtGameObject.GetOrAddComponent<Action_Detergent>(val15);
				((ItemAction)orAddComponent8).OnCastFinished = true;
				UnnamedSpawnRestriction orAddComponent9 = ExtGameObject.GetOrAddComponent<UnnamedSpawnRestriction>(val15);
				orAddComponent9.biomeType = CollectionExtensions.AddToArray<BiomeType>(CollectionExtensions.AddToArray<BiomeType>(CollectionExtensions.AddToArray<BiomeType>(orAddComponent9.biomeType, (BiomeType)7), (BiomeType)6), (BiomeType)2);
				orAddComponent9.hasZombieRestrictions = true;
				orAddComponent9.whenZombieSpawnGlobally = true;
				LootData orAddComponent10 = ExtGameObject.GetOrAddComponent<LootData>(val15);
				orAddComponent10.spawnLocations = UnnamedSpawnPool;
				UnnamedUniques.Add(((Object)val15).name.Trim());
				GameObject val16 = peakBundle.LoadAsset<GameObject>("GarbageBag.prefab");
				Item val17 = default(Item);
				ItemDatabase.TryGetItem((ushort)91, ref val17);
				BananaPeel component2 = ((Component)val17).GetComponent<BananaPeel>();
				UnnamedGarbageBagController orAddComponent11 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagController>(val16);
				UnnamedGarbageBagSlips orAddComponent12 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagSlips>(val16);
				UnnamedGarbageBagAudio orAddComponent13 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagAudio>(val16);
				ItemCooking orAddComponent14 = ExtGameObject.GetOrAddComponent<ItemCooking>(val16);
				BackPackAudio val18 = default(BackPackAudio);
				if (val16.TryGetComponent<BackPackAudio>(ref val18))
				{
					orAddComponent13.holdSFX = val18.holdSFX;
					orAddComponent13.dropSFX = val18.dropSFX;
					Object.Destroy((Object)(object)val18);
				}
				orAddComponent11.slipSDSfxInstances = (SFX_Instance[])(object)new SFX_Instance[1] { component2.slipSFX[0] };
				orAddComponent14.additionalCookingBehaviors = CollectionExtensions.AddToArray<AdditionalCookingBehavior>(orAddComponent14.additionalCookingBehaviors, (AdditionalCookingBehavior)(object)new CookingBehavior_DestroyAndReleaseGarbageBagItems
				{
					cookedAmountToTrigger = 1
				});
				orAddComponent12.garbageBag = orAddComponent11;
				orAddComponent12.rig = val16.GetComponent<Rigidbody>();
				orAddComponent12.slipOnCollision = true;
				orAddComponent12.minSlipVelocity = 15f;
				orAddComponent12.ragdollCharacterOnSlip = false;
				orAddComponent12.pushForce = 2f;
				orAddComponent12.wholeBodyPushForce = 1f;
				orAddComponent11.fullBagGameObject = ((Component)val16.transform.Find("GarbageBag/filled")).gameObject;
				orAddComponent11.emptyBagGameObject = ((Component)val16.transform.Find("GarbageBag/empty")).gameObject;
				orAddComponent11.rightHandEmptyPosition = new Vector3(0.1941f, 0.179f, -0.3009f);
				orAddComponent11.leftHandEmptyPosition = new Vector3(-0.187f, 0.179f, -0.292f);
				orAddComponent11.rightHandFullPosition = new Vector3(0.407f, 0.17900696f, -0.429f);
				orAddComponent11.leftHandFullPosition = new Vector3(-0.377f, 0.179f, -0.42899966f);
				orAddComponent11.fullBagGameObject.SetActive(true);
				ShaderExtensions.ReplaceShaders(orAddComponent11.fullBagGameObject);
				orAddComponent11.fullBagGameObject.SetActive(false);
				((Item)orAddComponent11).defaultPos = new Vector3(0f, -0.3f, 1.3166288f);
				orAddComponent11.defaultPosFilled = new Vector3(0f, -0.3f, 1.3166288f);
				orAddComponent11.defaultPosEmpty = new Vector3(0f, -0.3f, 0.81002724f);
				((Item)orAddComponent11).defaultForward = new Vector3(0f, 0f, 1f);
				((Item)orAddComponent11).mainRenderer = orAddComponent11.fullBagGameObject.GetComponent<Renderer>();
				((Item)orAddComponent11).addtlRenderers = (Renderer[])(object)new Renderer[1] { orAddComponent11.emptyBagGameObject.GetComponent<Renderer>() };
				UnnamedGarbageBagVisuals orAddComponent15 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagVisuals>(val16);
				orAddComponent15.item = (Item)(object)orAddComponent11;
				orAddComponent11.m_unnamedGarbageBagVisuals = orAddComponent15;
				orAddComponent11.openRadialMenuTime = 0f;
				GarbageBagIcon = peakBundle.LoadAsset<Texture2D>("GarbageBag Icon.png");
				((Item)orAddComponent11).carryWeight = 1;
				((Item)orAddComponent11).mass = 50f;
				((Item)orAddComponent11).UIData = new ItemUIData
				{
					itemName = "Garbage Bag",
					icon = GarbageBagIcon,
					hasAltIcon = false,
					hasColorBlindIcon = false,
					altIcon = null,
					hasMainInteract = false,
					mainInteractPrompt = "OPEN",
					hasSecondInteract = false,
					secondaryInteractPrompt = null,
					hasScrollingInteract = false,
					scrollInteractPrompt = null,
					canDrop = true,
					canPocket = true,
					canBackpack = true,
					canThrow = true,
					isShootable = false,
					hideFuel = true,
					iconPositionOffset = default(Vector3),
					iconRotationOffset = default(Vector3),
					iconScaleOffset = 1.49f
				};
				((Item)orAddComponent11).totalUses = -1;
				UnnamedUniques.Add(((Object)val16).name.Trim());
				GameObject val19 = peakBundle.LoadAsset<GameObject>("GarbageBagBox.prefab");
				Action_SpawnAndGrab orAddComponent16 = ExtGameObject.GetOrAddComponent<Action_SpawnAndGrab>(val19);
				orAddComponent16.itemToSpawn = val16.GetComponent<Item>();
				((ItemAction)orAddComponent16).OnCastFinished = true;
				LootData orAddComponent17 = ExtGameObject.GetOrAddComponent<LootData>(val19);
				orAddComponent17.spawnLocations = UnnamedSpawnPool;
				UnnamedUniques.Add(((Object)val19).name.Trim());
				SmallLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage.mat");
				SmallLuggageInteriorMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_interior.mat");
				EpicLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_epic.mat");
				LargeLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_large.mat");
				LargeLuggageInteriorMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_interior_large.mat");
				AncientLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_ancient.mat");
				AncientLuggageMetalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedMetal.mat");
				AncientLuggageCrystalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_Crystal.mat");
				RespawnStatueCalderaMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_Volcano.mat");
				RespawnStatueAlpineMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_peak Snow.mat");
				RespawnStatueMesaMaterial = peakBundle.LoadAsset<Material>("M_UnnamedDesertSand.mat");
				RespawnStatueRootsMaterial = peakBundle.LoadAsset<Material>("M_UnnamedForest_rock.mat");
				RespawnStatueTropicsMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock 1.mat");
				RespawnStatueShoreMaterial = peakBundle.LoadAsset<Material>("M_UnnamedSaltRock.mat");
				RespawnStatueRockVFXMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_staticTopColour.mat");
				PlaneMaterials = new Dictionary<string, Material>();
				string[] array3 = new string[10] { "Plane", "Plane 1", "Plane 3", "Plane 4", "Plane cleaner", "Plane Glass", "Plane seat", "Plane-snow", "PlaneWings", "PlaneWings-snow" };
				string[] array4 = array3;
				foreach (string text in array4)
				{
					Material val20 = peakBundle.LoadAsset<Material>("M_Unnamed" + text + ".mat");
					val20.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val20.shader).name), "Shader.Find(planeMaterial.shader.name)");
					Log.LogInfo((object)("Added plane material named " + ((Object)val20).name + "."));
					PlaneMaterials[text] = val20;
				}
				MirageMaterials = new Dictionary<string, Material>();
				string[] array5 = new string[6] { "Luggage_Large_Mirage", "Luggage_Ancient_Mirage", "Luggage_AncientChain_Mirage", "Luggage_AncientCrystal_Mirage", "Luggage-mirage", "Luggage_Epic_Mirage" };
				string[] array6 = array5;
				foreach (string text2 in array6)
				{
					Material val21 = peakBundle.LoadAsset<Material>("M_Unnamed" + text2 + ".mat");
					val21.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val21.shader).name), "Shader.Find(mirageMaterial.shader.name)");
					Log.LogInfo((object)("Added mirage material named " + ((Object)val21).name + "."));
					MirageMaterials[text2] = val21;
				}
				SmallLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)SmallLuggageMaterial.shader).name), "Shader.Find(SmallLuggageMaterial.shader.name)");
				SmallLuggageInteriorMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)SmallLuggageInteriorMaterial.shader).name), "Shader.Find(SmallLuggageInteriorMaterial.shader.name)");
				EpicLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)EpicLuggageMaterial.shader).name), "Shader.Find(EpicLuggageMaterial.shader.name)");
				LargeLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)LargeLuggageMaterial.shader).name), "Shader.Find(LargeLuggageMaterial.shader.name)");
				LargeLuggageInteriorMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)LargeLuggageInteriorMaterial.shader).name), "Shader.Find(LargeLuggageInteriorMaterial.shader.name)");
				AncientLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AncientLuggageMaterial.shader).name), "Shader.Find(AncientLuggageMaterial.shader.name)");
				AncientLuggageMetalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AncientLuggageMetalMaterial.shader).name), "Shader.Find(AncientLuggageMetalMaterial.shader.name)");
				AncientLuggageCrystalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AncientLuggageCrystalMaterial.shader).name), "Shader.Find(AncientLuggageCrystalMaterial.shader.name)");
				RespawnStatueRockVFXMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueRockVFXMaterial.shader).name), "Shader.Find(RespawnStatueRockVFXMaterial.shader.name)");
				RespawnStatueCalderaMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueCalderaMaterial.shader).name), "Shader.Find(RespawnStatueCalderaMaterial.shader.name)");
				RespawnStatueAlpineMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueAlpineMaterial.shader).name), "Shader.Find(RespawnStatueAlpineMaterial.shader.name)");
				RespawnStatueMesaMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueMesaMaterial.shader).name), "Shader.Find(RespawnStatueMesaMaterial.shader.name)");
				RespawnStatueRootsMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueRootsMaterial.shader).name), "Shader.Find(RespawnStatueRootsMaterial.shader.name)");
				RespawnStatueTropicsMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueTropicsMaterial.shader).name), "Shader.Find(RespawnStatueTropicsMaterial.shader.name)");
				RespawnStatueShoreMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueShoreMaterial.shader).name), "Shader.Find(RespawnStatueShoreMaterial.shader.name)");
				Log.LogInfo((object)("Added material named " + ((Object)SmallLuggageMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)SmallLuggageInteriorMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)EpicLuggageMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)LargeLuggageMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)LargeLuggageInteriorMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)AncientLuggageMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)AncientLuggageMetalMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)AncientLuggageCrystalMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueRockVFXMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueCalderaMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueAlpineMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueMesaMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueRootsMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueTropicsMaterial).name + "."));
				Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueShoreMaterial).name + "."));
				List<ushort> list2 = new List<ushort>(34)
				{
					0, 1, 2, 7, 115, 17, 18, 24, 106, 27,
					29, 32, 152, 99, 33, 70, 35, 42, 43, 44,
					58, 98, 61, 62, 100, 63, 64, 65, 107, 66,
					67, 71, 104, 73
				};
				int num5 = 0;
				Item val22 = default(Item);
				for (int count = list2.Count; num5 < count; num5++)
				{
					ushort num6 = list2[num5];
					if (ItemDatabase.TryGetItem(num6, ref val22))
					{
						string itemName = val22.UIData.itemName;
						GameObject go = GenerateInstancedVariant(((Component)val22).gameObject, CleanItemName(((Object)((Component)val22).gameObject).name));
						Item it = go.gameObject.GetComponent<Item>();
						CopyUnnamedMaterials(ref go, peakBundle);
						CopyUnnamedIcons(ref it, peakBundle);
						PopulateUnnamedData(ref it, peakBundle);
						CopyExplosionData(ref it, peakBundle);
						LootData component3 = go.gameObject.GetComponent<LootData>();
						Object.Destroy((Object)(object)component3);
						AddItemToDatabase(itemName, go.gameObject);
						if (itemName == "Lantern")
						{
							GameObject gameObject2 = ((Component)it).gameObject;
							((Object)gameObject2).name = ((Object)gameObject2).name + "_lant";
						}
						new ItemContent(it).Register(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info));
					}
				}
				BigUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageBig");
				SmallUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageSmall");
				EpicUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageEpic");
				AncientUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageAncient");
				GameObject val23 = peakBundle.LoadAsset<GameObject>("UnnamedAirportSetup.prefab");
				ShaderExtensions.ReplaceShaders(val23);
				TextMeshProUGUI componentInChildren2 = val23.GetComponentInChildren<TextMeshProUGUI>(true);
				((TMP_Text)componentInChildren2).font = DarumaDropOne;
				((TMP_Text)componentInChildren2).lineSpacing = -50f;
				Material val24 = (((Graphic)componentInChildren2).material = DarumaDropOneShadowMaterial);
				item = (((TMP_Text)componentInChildren2).fontMaterial = val24);
				((TMP_Text)componentInChildren2).fontSharedMaterial = item;
				LocalizedText orAddComponent18 = ExtGameObject.GetOrAddComponent<LocalizedText>(((Component)componentInChildren2).gameObject);
				orAddComponent18.fontStyle = (FontStyle)1;
				orAddComponent18.index = "KIOSK_READY_TEXT";
				orAddComponent18.tmp = (TMP_Text)(object)componentInChildren2;
				orAddComponent18.autoSet = true;
				UnnamedKioskSetup = val23;
				GameObject val26 = peakBundle.LoadAsset<GameObject>("UnnamedBrokenStandee.prefab");
				ShaderExtensions.ReplaceShaders(val26);
				UnnamedBrokenStandeeSetup = val26;
				peakBundle.Mod.RegisterContent();
				Log.LogInfo((object)"Unnamed items are loaded!");
			});
			BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "unnamedui.peakbundle", (Action<PeakBundle>)delegate(PeakBundle bundle)
			{
				GameObject val2 = bundle.LoadAsset<GameObject>("UnnamedGarbageBagWheel.prefab");
				UnnamedGarbageBagScreen unnamedGarbageBagScreen = val2.AddComponent<UnnamedGarbageBagScreen>();
				((UIWheel)unnamedGarbageBagScreen).maxCursorDistance = 190f;
				unnamedGarbageBagScreen.chosenItemText = ((Component)((Component)unnamedGarbageBagScreen).transform.Find("SelectedItemName")).GetComponent<TextMeshProUGUI>();
				unnamedGarbageBagScreen.currentlyHeldItem = ((Component)((Component)unnamedGarbageBagScreen).transform.Find("HeldItem")).GetComponent<RawImage>();
				ShaderExtensions.ReplaceShaders(val2);
				int i = 0;
				BackpackWheelSlice val3 = default(BackpackWheelSlice);
				BackpackWheelSlice val4 = default(BackpackWheelSlice);
				for (int childCount = val2.transform.Find("Wheel").childCount; i < childCount; i++)
				{
					Transform child = val2.transform.Find("Wheel").GetChild(i);
					if (((Object)child).name == "UI_PickupZone")
					{
						UnnamedGarbageBagZone orAddComponent = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagZone>(((Component)child).gameObject);
						orAddComponent.image = ((Component)((Component)orAddComponent).transform.Find("Segment")).GetComponentInChildren<RawImage>();
						((UIWheelSlice)orAddComponent).button = ((Component)orAddComponent).GetComponent<Button>();
						unnamedGarbageBagScreen.pickupZone = orAddComponent;
						if (((Component)child).gameObject.TryGetComponent<BackpackWheelSlice>(ref val3))
						{
							Object.Destroy((Object)(object)val3);
						}
					}
					else
					{
						UnnamedGarbageBagZone orAddComponent2 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagZone>(((Component)child).gameObject);
						orAddComponent2.image = ((Component)((Component)orAddComponent2).transform.Find("Segment")).GetComponentInChildren<RawImage>();
						((UIWheelSlice)orAddComponent2).button = ((Component)orAddComponent2).GetComponent<Button>();
						unnamedGarbageBagScreen.garbageBagZones = CollectionExtensions.AddToArray<UnnamedGarbageBagZone>(unnamedGarbageBagScreen.garbageBagZones, orAddComponent2);
						if (((Component)child).gameObject.TryGetComponent<BackpackWheelSlice>(ref val4))
						{
							Object.Destroy((Object)(object)val4);
						}
					}
				}
				UnnamedGarbageBagPrefab = ((Component)unnamedGarbageBagScreen).gameObject;
				bundle.Mod.RegisterContent();
				Log.LogInfo((object)"Garbage Bag UI is loaded!");
			});
			Harmony val = new Harmony("com.github.MiiMii1205.UnnamedProducts");
			if (Unnamed4FoodCompatibility.enabled)
			{
				Unnamed4FoodCompatibility.LoadCompatibilityBundle(this);
			}
			if (UnnamedCanadianCompatibility.enabled)
			{
				UnnamedCanadianCompatibility.LoadCompatibilityBundle(this);
			}
			if (UnnamedPiggyBankCompatibility.enabled)
			{
				UnnamedPiggyBankCompatibility.LoadCompatibilityBundle(this, val);
			}
			val.PatchAll(typeof(UnnamedItemPatcher));
			val.PatchAll(typeof(UnnamedPatcher));
			val.PatchAll(typeof(UnnamedSpawnerPatcher));
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
		}

		private static string CleanItemName(string dirtyName)
		{
			return dirtyName.Replace(_modInfoPrefix, "").Replace("(Clone)", "").Replace("(Instanced)", "");
		}

		private GameObject GenerateUnnamedLuggagePrefab(string normalPrefabName)
		{
			GameObject val = Resources.Load<GameObject>(normalPrefabName);
			LuggageBrandHandler luggageBrandHandler = val.AddComponent<LuggageBrandHandler>();
			luggageBrandHandler.shouldBeUnnamed = true;
			luggageBrandHandler.luggage = val.GetComponent<Luggage>();
			val.SetActive(false);
			Object.DontDestroyOnLoad((Object)(object)val);
			return RegisterOrGetNetworkPrefab(val);
		}

		public GameObject RegisterOrGetNetworkPrefab(GameObject prefab, string folder = "")
		{
			string text = ((Object)prefab).name.Split(":").Last();
			string text2 = folder + ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info).Id + ":" + text;
			if (NetworkPrefabManager.TryRegisterNetworkPrefab(text2, prefab))
			{
				((Object)prefab).name = text2;
				return prefab;
			}
			GameObject val = default(GameObject);
			if (NetworkPrefabManager.TryGetNetworkPrefab(text2, ref val) && (Object)(object)val != (Object)null)
			{
				return val;
			}
			throw new Exception("Failed to get network prefab!");
		}

		public GameObject RegisterOrGetItemPrefab(GameObject prefab)
		{
			RegisterOrGetNetworkPrefab(prefab, "0_Items/");
			((Object)prefab).name = ((Object)prefab).name.Replace("0_Items/", "");
			return prefab;
		}

		public static void RenameToUnnamed(GameObject ob, bool withPrefix = true)
		{
			((Object)ob).name = ModDefinition.GetOrCreate(UnnamedInfo).Id + ":" + (withPrefix ? "Unnamed" : "") + ((Object)ob).name.Replace("Unnamed", "");
		}

		public void CopyExplosionData(ref Item newIt, PeakBundle peakBundle)
		{
			ItemCooking val = default(ItemCooking);
			if (((Component)newIt).gameObject.TryGetComponent<ItemCooking>(ref val) && Object.op_Implicit((Object)(object)val.explosionPrefab))
			{
				GameObject val2 = Object.Instantiate<GameObject>(val.explosionPrefab);
				((Object)val2).name = "Unnamed" + ((Object)val.explosionPrefab).name.Replace("Unnamed", "");
				AOE componentInChildren = val2.GetComponentInChildren<AOE>();
				if (componentInChildren != null && !IsUnnamed(((Component)componentInChildren).gameObject))
				{
					RenameToUnnamed(((Component)componentInChildren).gameObject);
				}
				val.explosionPrefab = RegisterOrGetNetworkPrefab(val2);
				Object.DontDestroyOnLoad((Object)(object)val2);
				val2.SetActive(false);
			}
			Breakable val3 = default(Breakable);
			if (!((Component)newIt).gameObject.TryGetComponent<Breakable>(ref val3))
			{
				return;
			}
			for (int i = 0; i < val3.instantiateNonItemOnBreak.Count; i++)
			{
				GameObject val4 = Object.Instantiate<GameObject>(val3.instantiateNonItemOnBreak[i]);
				((Object)val4).name = "Unnamed" + ((Object)val3.instantiateNonItemOnBreak[i]).name.Replace("Unnamed", "");
				AOE componentInChildren2 = val4.GetComponentInChildren<AOE>();
				if (componentInChildren2 != null && !IsUnnamed(((Component)componentInChildren2).gameObject))
				{
					RenameToUnnamed(((Component)componentInChildren2).gameObject);
				}
				val3.instantiateNonItemOnBreak[i] = RegisterOrGetNetworkPrefab(val4);
				Object.DontDestroyOnLoad((Object)(object)val4);
				val4.SetActive(false);
			}
		}

		private static void CheckForStickyFireballs(Item item, Character chara)
		{
			if (Object.op_Implicit((Object)(object)item))
			{
				StickyFireballController componentInChildren = ((Component)item).GetComponentInChildren<StickyFireballController>();
				if (componentInChildren != null && componentInChildren.m_isBurning)
				{
					StickyFireballController.Burn(chara.GetBodypart((BodypartType)(((double)Random.value > 0.5) ? 7 : 10)));
				}
			}
		}

		public void PopulateUnnamedData(ref Item it, PeakBundle peakBundle)
		{
			//IL_1e3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e61: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e81: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_13d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_13fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1655: Unknown result type (might be due to invalid IL or missing references)
			//IL_165a: Unknown result type (might be due to invalid IL or missing references)
			//IL_126f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1285: Unknown result type (might be due to invalid IL or missing references)
			//IL_12aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_15b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_15cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_15f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_2065: Unknown result type (might be due to invalid IL or missing references)
			//IL_206a: Unknown result type (might be due to invalid IL or missing references)
			//IL_208f: Unknown result type (might be due to invalid IL or missing references)
			//IL_2094: Unknown result type (might be due to invalid IL or missing references)
			//IL_2099: Unknown result type (might be due to invalid IL or missing references)
			//IL_20a3: Expected O, but got Unknown
			//IL_20cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_20d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_20d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_20e0: Expected O, but got Unknown
			//IL_2109: Unknown result type (might be due to invalid IL or missing references)
			//IL_210e: Unknown result type (might be due to invalid IL or missing references)
			//IL_2113: Unknown result type (might be due to invalid IL or missing references)
			//IL_211d: Expected O, but got Unknown
			//IL_2146: Unknown result type (might be due to invalid IL or missing references)
			//IL_214b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2150: Unknown result type (might be due to invalid IL or missing references)
			//IL_215a: Expected O, but got Unknown
			//IL_2183: Unknown result type (might be due to invalid IL or missing references)
			//IL_2188: Unknown result type (might be due to invalid IL or missing references)
			//IL_218d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2197: Expected O, but got Unknown
			//IL_222e: Unknown result type (might be due to invalid IL or missing references)
			//IL_2233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1aef: Unknown result type (might be due to invalid IL or missing references)
			//IL_1af4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b19: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b23: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b2d: Expected O, but got Unknown
			//IL_1b56: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b60: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b6a: Expected O, but got Unknown
			//IL_1b93: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b98: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ba7: Expected O, but got Unknown
			//IL_1bd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bda: Unknown result type (might be due to invalid IL or missing references)
			//IL_1be4: Expected O, but got Unknown
			//IL_1c0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c12: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c17: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c21: Expected O, but got Unknown
			//IL_1cc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_14fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1503: Unknown result type (might be due to invalid IL or missing references)
			//IL_17f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_17f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1802: Unknown result type (might be due to invalid IL or missing references)
			//IL_1807: Unknown result type (might be due to invalid IL or missing references)
			//IL_1810: Unknown result type (might be due to invalid IL or missing references)
			//IL_1815: Unknown result type (might be due to invalid IL or missing references)
			//IL_1856: Unknown result type (might be due to invalid IL or missing references)
			//IL_185b: Unknown result type (might be due to invalid IL or missing references)
			//IL_130d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1323: Unknown result type (might be due to invalid IL or missing references)
			//IL_1348: Unknown result type (might be due to invalid IL or missing references)
			//IL_23be: Unknown result type (might be due to invalid IL or missing references)
			//IL_23d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_23f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_249f: Unknown result type (might be due to invalid IL or missing references)
			//IL_24a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_2703: Unknown result type (might be due to invalid IL or missing references)
			//IL_2708: Unknown result type (might be due to invalid IL or missing references)
			//IL_272d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2732: Unknown result type (might be due to invalid IL or missing references)
			//IL_2737: Unknown result type (might be due to invalid IL or missing references)
			//IL_2741: Expected O, but got Unknown
			//IL_276a: Unknown result type (might be due to invalid IL or missing references)
			//IL_276f: Unknown result type (might be due to invalid IL or missing references)
			//IL_2774: Unknown result type (might be due to invalid IL or missing references)
			//IL_277e: Expected O, but got Unknown
			//IL_27a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_27ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_27b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_27bb: Expected O, but got Unknown
			//IL_27e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_27e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_27ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_27f8: Expected O, but got Unknown
			//IL_2821: Unknown result type (might be due to invalid IL or missing references)
			//IL_2826: Unknown result type (might be due to invalid IL or missing references)
			//IL_282b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2835: Expected O, but got Unknown
			//IL_2889: Unknown result type (might be due to invalid IL or missing references)
			//IL_288e: Unknown result type (might be due to invalid IL or missing references)
			//IL_290c: Unknown result type (might be due to invalid IL or missing references)
			//IL_291d: Unknown result type (might be due to invalid IL or missing references)
			//IL_292e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0768: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_111b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1131: Unknown result type (might be due to invalid IL or missing references)
			//IL_1156: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_054f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_11fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			string itemName = it.UIData.itemName;
			if (itemName == null)
			{
				return;
			}
			RopeSpool orAddComponent;
			UnnamedRopeSpool orAddComponent2;
			GameObject val;
			GameObject val2;
			RopeTier orAddComponent3;
			GameObject val3;
			GameObject val4;
			RopeBoneVisualizer component;
			AudioSource orAddComponent4;
			UnnamedRopeBreaker orAddComponent5;
			RopeAudio componentInChildren;
			RopeShooter orAddComponent9;
			UnnamedRopeShooter orAddComponent10;
			GameObject go3;
			RopeAnchorWithRope component4;
			GameObject go4;
			RopeBoneVisualizer component5;
			AudioSource orAddComponent11;
			UnnamedRopeBreaker orAddComponent12;
			StatusField componentInChildren3;
			switch (itemName.Length)
			{
			case 7:
				switch (itemName[0])
				{
				default:
					return;
				case 'F':
					if (itemName == "Frisbee")
					{
						Frisbee component14 = ((Component)it).GetComponent<Frisbee>();
						UnnamedFrisbeeItem orAddComponent29 = ExtGameObject.GetOrAddComponent<UnnamedFrisbeeItem>(((Component)it).gameObject);
						orAddComponent29.frisbee = component14;
						orAddComponent29.originalLiftForce = component14.liftForce;
						orAddComponent29.originalVelocityForLift = component14.velocityForLift;
					}
					return;
				case 'P':
				{
					if (!(itemName == "Parasol"))
					{
						return;
					}
					Parasol orAddComponent26 = ExtGameObject.GetOrAddComponent<Parasol>(((Component)it).gameObject);
					UnnamedParasol orAddComponent27 = ExtGameObject.GetOrAddComponent<UnnamedParasol>(((Component)it).gameObject);
					((Parasol)orAddComponent27).item = orAddComponent26.item;
					((Parasol)orAddComponent27).extraYDrag = orAddComponent26.extraYDrag;
					((Parasol)orAddComponent27).extraXZDrag = orAddComponent26.extraXZDrag;
					((Parasol)orAddComponent27).sinceGroundedOnClose = orAddComponent26.sinceGroundedOnClose;
					((Parasol)orAddComponent27).openParasol = orAddComponent26.openParasol;
					((Parasol)orAddComponent27).closedParasol = orAddComponent26.closedParasol;
					((Parasol)orAddComponent27).anim = orAddComponent26.anim;
					((Parasol)orAddComponent27).isOpen = orAddComponent26.isOpen;
					((Parasol)orAddComponent27).isOpen = orAddComponent26.isOpen;
					Action_Parasol orAddComponent28 = ExtGameObject.GetOrAddComponent<Action_Parasol>(((Component)it).gameObject);
					orAddComponent28.parasol = (Parasol)(object)orAddComponent27;
					MeshFilter[] componentsInChildren14 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val51 in componentsInChildren14)
					{
						string name = ((Object)((Component)val51).gameObject).name;
						if (name == "Parasol Open")
						{
							GameObject gameObject = ((Component)val51).gameObject;
							Object.DestroyImmediate((Object)(object)val51);
							Object.DestroyImmediate((Object)(object)gameObject.GetComponent<Collider>());
							GameObject val52 = peakBundle.LoadAsset<GameObject>("UnnamedParasolOpened.prefab");
							GameObject val53 = Object.Instantiate<GameObject>(val52, gameObject.transform, false);
							Renderer component10 = gameObject.GetComponent<Renderer>();
							Renderer component11 = val53.GetComponent<Renderer>();
							component11.materials = component10.materials;
							component11.sharedMaterials = component10.sharedMaterials;
							Object.DestroyImmediate((Object)(object)component10);
							val53.transform.localPosition = Vector3.zero;
							val53.transform.localScale = ExtDataTypes.ToVec(1f);
							val53.transform.localRotation = new Quaternion(0.7071068f, -3.7252903E-09f, -1.0104486E-09f, 0.7071068f);
						}
						if (name == "Parasol Closed")
						{
							GameObject gameObject2 = ((Component)val51).gameObject;
							Object.DestroyImmediate((Object)(object)val51);
							Object.DestroyImmediate((Object)(object)gameObject2.GetComponent<Collider>());
							GameObject val54 = peakBundle.LoadAsset<GameObject>("UnnamedParasolClosed.prefab");
							GameObject val55 = Object.Instantiate<GameObject>(val54, gameObject2.transform, false);
							Renderer component12 = gameObject2.GetComponent<Renderer>();
							Renderer component13 = val55.GetComponent<Renderer>();
							component13.materials = component12.materials;
							component13.sharedMaterials = component12.sharedMaterials;
							Object.DestroyImmediate((Object)(object)component12);
							val55.transform.localPosition = Vector3.zero;
							val55.transform.localScale = ExtDataTypes.ToVec(1f);
							val55.transform.localRotation = new Quaternion(0.7071068f, -3.7252903E-09f, -1.0104486E-09f, 0.7071068f);
						}
					}
					Object.Destroy((Object)(object)orAddComponent26);
					return;
				}
				case 'B':
				{
					if (!(itemName == "Blowgun"))
					{
						return;
					}
					MeshFilter[] componentsInChildren13 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val49 in componentsInChildren13)
					{
						if (((Object)((Component)val49).gameObject).name == "Blowgun")
						{
							Mesh mesh = (val49.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedBlowgun.fbx"));
							val49.mesh = mesh;
						}
					}
					return;
				}
				case 'L':
					break;
				}
				if (!(itemName == "Lantern"))
				{
					break;
				}
				goto IL_14d6;
			case 14:
				switch (itemName[5])
				{
				case 'b':
				{
					if (!(itemName == "Portable Stove"))
					{
						return;
					}
					Constructable component6 = ((Component)it).GetComponent<Constructable>();
					GameObject go7 = Object.Instantiate<GameObject>(component6.constructedPrefab);
					((Object)go7).name = "Unnamed" + ((Object)component6.constructedPrefab).name;
					Object.DontDestroyOnLoad((Object)(object)go7);
					GameObject val24 = peakBundle.LoadAsset<GameObject>("UnnamedStovePaint.prefab");
					MeshFilter[] componentsInChildren5 = go7.GetComponentsInChildren<MeshFilter>(true);
					MeshCollider val26 = default(MeshCollider);
					foreach (MeshFilter val25 in componentsInChildren5)
					{
						if (((Object)((Component)val25).gameObject).name == "Cube" && ((Component)val25).TryGetComponent<MeshCollider>(ref val26))
						{
							GameObject val27 = Object.Instantiate<GameObject>(val24, ((Component)val25).transform.parent, false);
							val27.transform.localPosition = Vector3.zero;
							val27.transform.localScale = ExtDataTypes.ToVec(3.827086f);
							val27.transform.localRotation = new Quaternion(0f, 0f, 0f, 1f);
							ShaderExtensions.ReplaceShaders(val27);
						}
					}
					MeshFilter[] componentsInChildren6 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val28 in componentsInChildren6)
					{
						if (((Object)((Component)val28).gameObject).name == "Cube" && ((Component)val28).TryGetComponent<MeshCollider>(ref val26))
						{
							GameObject val29 = Object.Instantiate<GameObject>(val24, ((Component)val28).transform.parent, false);
							val29.transform.localPosition = new Vector3(0f, 0f, -4.950033E-05f);
							val29.transform.localScale = ExtDataTypes.ToVec(3.827086f);
							val29.transform.localRotation = new Quaternion(0f, 0f, 0f, 1f);
							ShaderExtensions.ReplaceShaders(val29);
						}
					}
					go7.SetActive(false);
					CopyUnnamedMaterials(ref go7, peakBundle);
					Campfire component7 = go7.GetComponent<Campfire>();
					UnnamedCampfire orAddComponent17 = ExtGameObject.GetOrAddComponent<UnnamedCampfire>(go7);
					((Campfire)orAddComponent17).advanceToSegment = component7.advanceToSegment;
					((Campfire)orAddComponent17).state = component7.state;
					((Campfire)orAddComponent17).enableWhenLit = component7.enableWhenLit;
					((Campfire)orAddComponent17).disableWhenLit = component7.disableWhenLit;
					((Campfire)orAddComponent17).burnsFor = component7.burnsFor;
					((Campfire)orAddComponent17).cookTime = component7.cookTime;
					((Campfire)orAddComponent17).logRoot = component7.logRoot;
					((Campfire)orAddComponent17).endSize = component7.endSize;
					((Campfire)orAddComponent17).endRot = component7.endRot;
					((Campfire)orAddComponent17).beenBurningFor = component7.beenBurningFor;
					((Campfire)orAddComponent17).fireParticles = component7.fireParticles;
					((Campfire)orAddComponent17).smokeParticlesOff = component7.smokeParticlesOff;
					((Campfire)orAddComponent17).smokeParticlesLit = component7.smokeParticlesLit;
					((Campfire)orAddComponent17).moraleBoostRadius = component7.moraleBoostRadius;
					((Campfire)orAddComponent17).moraleBoostBaseline = component7.moraleBoostBaseline;
					((Campfire)orAddComponent17).moraleBoostPerAdditionalScout = component7.moraleBoostPerAdditionalScout;
					((Campfire)orAddComponent17).injuryReduction = component7.injuryReduction;
					((Campfire)orAddComponent17).fireStart = component7.fireStart;
					((Campfire)orAddComponent17).extinguish = component7.extinguish;
					((Campfire)orAddComponent17).moraleBoost = component7.moraleBoost;
					((Campfire)orAddComponent17).loop = component7.loop;
					((Campfire)orAddComponent17).nameOverride = component7.nameOverride;
					((Campfire)orAddComponent17).currentlyCookingItem = component7.currentlyCookingItem;
					((Campfire)orAddComponent17).mainRenderer = component7.mainRenderer;
					((Campfire)orAddComponent17).startRot = component7.startRot;
					((Campfire)orAddComponent17).startSize = component7.startSize;
					((Campfire)orAddComponent17).fireHasStarted = component7.fireHasStarted;
					((Campfire)orAddComponent17).view = component7.view;
					((Campfire)orAddComponent17)._timebuffLastApplied = component7._timebuffLastApplied;
					((Campfire)orAddComponent17).disableFogFakeMountain = component7.disableFogFakeMountain;
					((Campfire)orAddComponent17)._charactersInRadius = component7._charactersInRadius;
					Object.Destroy((Object)(object)component7);
					go7 = RegisterOrGetNetworkPrefab(go7);
					component6.constructedPrefab = go7;
					return;
				}
				case 'f':
				{
					if (!(itemName == "Fortified Milk"))
					{
						return;
					}
					MeshFilter[] componentsInChildren7 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val30 in componentsInChildren7)
					{
						if (((Object)((Component)val30).gameObject).name == "Milk")
						{
							Mesh mesh = (val30.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedMilk.fbx"));
							val30.mesh = mesh;
						}
					}
					return;
				}
				case 'e':
					break;
				case ' ':
				{
					if (!(itemName == "Chain Launcher"))
					{
						return;
					}
					VineShooter orAddComponent13 = ExtGameObject.GetOrAddComponent<VineShooter>(((Component)it).gameObject);
					UnnamedVineShooter orAddComponent14 = ExtGameObject.GetOrAddComponent<UnnamedVineShooter>(((Component)it).gameObject);
					orAddComponent14.baseReach = orAddComponent13.maxLength;
					GameObject go5 = Object.Instantiate<GameObject>(orAddComponent13.vinePrefab);
					((Object)go5).name = "Unnamed" + ((Object)orAddComponent13.vinePrefab).name.Replace("Unnamed", "");
					Object.DontDestroyOnLoad((Object)(object)go5);
					CopyUnnamedMaterials(ref go5, peakBundle);
					Renderer[] componentsInChildren4 = ((Component)it).gameObject.GetComponentsInChildren<Renderer>(true);
					foreach (Renderer val19 in componentsInChildren4)
					{
						if (!(((Object)((Component)val19).gameObject).name == "Rope"))
						{
							continue;
						}
						Material[] materials = val19.materials;
						int m = 0;
						for (int num = materials.Length; m < num; m++)
						{
							string text = ((Object)materials[m]).name.Replace("(Instance)", "").Replace("(Clone)", "").Trim();
							if (text == "M_RopeSpike")
							{
								Material val20 = peakBundle.LoadAsset<Material>("M_UnnamedChainShooterChains.mat");
								val20.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val20.shader).name), "Shader.Find(unnamedMaterial.shader.name)");
								materials[m] = val20;
							}
						}
						Renderer val21 = val19;
						Material[] array = materials;
						List<Material> list = new List<Material>(array.Length);
						Material[] array2 = array;
						foreach (Material item in array2)
						{
							list.Add(item);
						}
						val21.SetMaterials(list);
					}
					go5.SetActive(false);
					AudioSource orAddComponent15 = ExtGameObject.GetOrAddComponent<AudioSource>(go5);
					orAddComponent15.priority = 128;
					orAddComponent15.volume = 0.125f;
					orAddComponent15.pitch = 1f;
					orAddComponent15.reverbZoneMix = 1f;
					orAddComponent15.rolloffMode = (AudioRolloffMode)2;
					orAddComponent15.spatialBlend = 1f;
					orAddComponent15.dopplerLevel = 0.25f;
					orAddComponent15.maxDistance = 120f;
					orAddComponent15.minDistance = 39.1865f;
					orAddComponent15.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[2]
					{
						new Keyframe(0.0067737103f, 1f, -3.1092653f, -3.1092653f, 0f, 0.04103275f),
						new Keyframe(1f, 0f, 0.020448748f, 0.020448748f, 0.13781565f, 0f)
					}));
					orAddComponent15.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
					{
						new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f)
					}));
					orAddComponent15.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
					{
						new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f)
					}));
					orAddComponent15.SetCustomCurve((AudioSourceCurveType)3, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
					{
						new Keyframe(0f, 0f, 0f, 0f, 1f / 3f, 1f / 3f)
					}));
					orAddComponent15.SetCustomCurve((AudioSourceCurveType)2, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
					{
						new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f)
					}));
					orAddComponent15.loop = true;
					orAddComponent15.resource = peakBundle.LoadAsset<AudioResource>("Au_ChainLoop.ogg");
					orAddComponent15.playOnAwake = false;
					UnnamedVine orAddComponent16 = ExtGameObject.GetOrAddComponent<UnnamedVine>(go5);
					orAddComponent16.breakPoint = 0.4f;
					orAddComponent16.breakChance = 0.25f;
					orAddComponent16.axisMul = new Vector3(2f, 1f, 0f);
					orAddComponent16.shakeScale = 33f;
					orAddComponent16.fallTime = 3f;
					orAddComponent16.amount = 0.1f;
					orAddComponent16.startShakeDistance = 30.87f;
					orAddComponent16.startShakeAmount = 10f;
					orAddComponent16.climbingScreenShake = 5f;
					orAddComponent16.screenShakeTickTime = 0.2f;
					GameObject val22 = peakBundle.LoadAsset<GameObject>("VFX_ChainBreak.prefab");
					GameObject go6 = Object.Instantiate<GameObject>(val22, ((Component)orAddComponent16).transform, false);
					go6.transform.localPosition = Vector3.zero;
					go6.transform.localRotation = Quaternion.identity;
					go6.transform.localScale = Vector3.one;
					ShaderExtensions.ReplaceShaders(go6);
					CopyUnnamedMaterials(ref go6, peakBundle);
					orAddComponent16.breakParticles = ((Component)go6.transform.GetChild(0)).GetComponent<ParticleSystem>();
					orAddComponent16.breakSfx = (SFX_Instance[])(object)new SFX_Instance[2]
					{
						peakBundle.LoadAsset<SFX_Instance>("SFXI Break Coconut 1.asset"),
						peakBundle.LoadAsset<SFX_Instance>("SFXI Bridge Break 4.asset")
					};
					orAddComponent16.fullMesh = ((Component)orAddComponent16).transform.GetChild(0).GetChild(0);
					SFX_Instance[] sfxs = go5.GetComponent<SFX_PlayOneShot>().sfxs;
					foreach (SFX_Instance val23 in sfxs)
					{
						if (((Object)val23).name == "SFXI ChainLauncher 4")
						{
							orAddComponent16.breakSfx = CollectionExtensions.AddToArray<SFX_Instance>(orAddComponent16.breakSfx, val23);
						}
					}
					((VineShooter)orAddComponent14).disableOnFire = orAddComponent13.disableOnFire;
					((VineShooter)orAddComponent14).maxLength = orAddComponent13.maxLength;
					((VineShooter)orAddComponent14).actionReduceUses = orAddComponent13.actionReduceUses;
					Object.Destroy((Object)(object)orAddComponent13);
					go5 = RegisterOrGetNetworkPrefab(go5);
					((VineShooter)orAddComponent14).vinePrefab = go5;
					return;
				}
				default:
					return;
				}
				if (!(itemName == "Faerie Lantern"))
				{
					break;
				}
				goto IL_14d6;
			case 12:
				switch (itemName[6])
				{
				case 'e':
				{
					if (!(itemName == "Airline Food"))
					{
						break;
					}
					MeshFilter[] componentsInChildren = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val7 in componentsInChildren)
					{
						if (((Object)val7.mesh).name == "plastic")
						{
							val7.mesh = peakBundle.LoadAsset<Mesh>("UnnamedAirplaneFoodPackaging.fbx");
							((Component)val7).transform.localPosition = new Vector3(0f, 0f, 0.27986586f);
							((Component)val7).transform.localScale = ExtDataTypes.ToVec(3.436053f);
							((Component)val7).transform.localRotation = new Quaternion(-0.7071067f, 2.0861626E-07f, -1.1920929E-07f, -0.70710695f);
						}
					}
					break;
				}
				case 'C':
				{
					if (!(itemName == "Scout Cannon"))
					{
						break;
					}
					Constructable component2 = ((Component)it).GetComponent<Constructable>();
					MeshFilter[] componentsInChildren2 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val11 in componentsInChildren2)
					{
						if (((Object)((Component)val11).gameObject).name == "Rend")
						{
							Mesh mesh = (val11.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannon.fbx"));
							val11.mesh = mesh;
						}
					}
					GameObject go = Object.Instantiate<GameObject>(component2.constructedPrefab);
					((Object)go).name = "Unnamed" + ((Object)component2.constructedPrefab).name;
					MeshFilter[] componentsInChildren3 = go.GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val13 in componentsInChildren3)
					{
						if (((Object)((Component)val13).gameObject).name == "CannonFeet")
						{
							Mesh mesh = (val13.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannonFeets.fbx"));
							val13.mesh = mesh;
							((Component)val13).transform.localRotation = Quaternion.identity;
						}
						if (((Object)((Component)val13).gameObject).name == "Rend")
						{
							Mesh mesh = (val13.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannonBody.fbx"));
							val13.mesh = mesh;
						}
						if (((Object)((Component)val13).gameObject).name == "Rend2")
						{
							Mesh mesh = (val13.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannonInnerWall.fbx"));
							val13.mesh = mesh;
						}
					}
					Object.DontDestroyOnLoad((Object)(object)go);
					go.SetActive(false);
					CopyUnnamedMaterials(ref go, peakBundle);
					ScoutCannon component3 = go.GetComponent<ScoutCannon>();
					UnnamedScoutCannon orAddComponent8 = ExtGameObject.GetOrAddComponent<UnnamedScoutCannon>(go);
					((ScoutCannon)orAddComponent8).launchForce = component3.launchForce;
					((ScoutCannon)orAddComponent8).itemLaunchForce = component3.itemLaunchForce;
					((ScoutCannon)orAddComponent8).backpackLaunchForce = component3.backpackLaunchForce;
					((ScoutCannon)orAddComponent8).fallFor = component3.fallFor;
					((ScoutCannon)orAddComponent8).pullForce = component3.pullForce;
					((ScoutCannon)orAddComponent8).pushForce = component3.pushForce;
					((ScoutCannon)orAddComponent8).lit = component3.lit;
					((ScoutCannon)orAddComponent8).fireTime = component3.fireTime;
					((ScoutCannon)orAddComponent8).litParticle = component3.litParticle;
					((ScoutCannon)orAddComponent8).fireParticle = component3.fireParticle;
					((ScoutCannon)orAddComponent8).fireSFX = component3.fireSFX;
					((ScoutCannon)orAddComponent8).anim = component3.anim;
					((ScoutCannon)orAddComponent8).mpb = component3.mpb;
					((ScoutCannon)orAddComponent8).view = component3.view;
					((ScoutCannon)orAddComponent8).tube = component3.tube;
					((ScoutCannon)orAddComponent8).entry = component3.entry;
					((ScoutCannon)orAddComponent8).target = component3.target;
					((ScoutCannon)orAddComponent8).targetID = component3.targetID;
					((ScoutCannon)orAddComponent8).characters = component3.characters;
					((ScoutCannon)orAddComponent8)._mr = component3._mr;
					ScoutCannonFuse componentInChildren2 = go.GetComponentInChildren<ScoutCannonFuse>();
					GameObject go2 = ((Component)componentInChildren2).gameObject;
					CopyUnnamedMaterials(ref go2, peakBundle);
					componentInChildren2.scoutCannon = (ScoutCannon)(object)orAddComponent8;
					Object.Destroy((Object)(object)component3);
					go = RegisterOrGetNetworkPrefab(go);
					component2.constructedPrefab = go;
					break;
				}
				case 'l':
					if (itemName == "Big Lollipop")
					{
						GameObject val8 = peakBundle.LoadAsset<GameObject>("UnnamedPitonPackaging.prefab");
						GameObject val9 = Object.Instantiate<GameObject>(val8, ((Component)it.mainRenderer).transform.parent, false);
						val9.transform.localPosition = new Vector3(0f, 10.51f, -0.06f);
						val9.transform.localScale = ExtDataTypes.ToVec(18.1f);
						val9.transform.localRotation = new Quaternion(0f, 0.7071068f, 0f, 0.7071068f);
						Renderer val10 = default(Renderer);
						if (val9.TryGetComponent<Renderer>(ref val10))
						{
							val10.SetMaterials(new List<Material>(1) { peakBundle.LoadAsset<Material>("M_UnnamedLollypopWrapper.mat") });
						}
						it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val9.GetComponent<Renderer>());
					}
					break;
				case 'E':
					if (itemName == "Scout Effigy")
					{
						ScoutEffigy orAddComponent6 = ExtGameObject.GetOrAddComponent<ScoutEffigy>(((Component)it).gameObject);
						UnnamedScoutEffigy orAddComponent7 = ExtGameObject.GetOrAddComponent<UnnamedScoutEffigy>(((Component)it).gameObject);
						GameObject val5 = peakBundle.LoadAsset<GameObject>("UnnamedScoutEffigyPackaging.prefab");
						GameObject val6 = Object.Instantiate<GameObject>(val5, ((Component)it.mainRenderer).transform, false);
						val6.transform.localPosition = Vector3.zero;
						val6.transform.localScale = ExtDataTypes.ToVec(16.66667f);
						val6.transform.localRotation = new Quaternion(0.49991274f, 0.50008726f, 0.49991274f, 0.50008726f);
						it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val6.GetComponent<Renderer>());
						((Constructable)orAddComponent7).previewPrefab = ((Constructable)orAddComponent6).previewPrefab;
						((Constructable)orAddComponent7).constructedPrefab = ((Constructable)orAddComponent6).constructedPrefab;
						((Constructable)orAddComponent7).maxPreviewDistance = ((Constructable)orAddComponent6).maxPreviewDistance;
						((Constructable)orAddComponent7).maxConstructDistance = ((Constructable)orAddComponent6).maxConstructDistance;
						((Constructable)orAddComponent7).maxConstructVerticalAngle = ((Constructable)orAddComponent6).maxConstructVerticalAngle;
						((Constructable)orAddComponent7).angleToNormal = ((Constructable)orAddComponent6).angleToNormal;
						((Constructable)orAddComponent7).currentPreview = ((Constructable)orAddComponent6).currentPreview;
						((Constructable)orAddComponent7).angleOffset = ((Constructable)orAddComponent6).angleOffset;
						((Constructable)orAddComponent7).isAngleable = ((Constructable)orAddComponent6).isAngleable;
						((Constructable)orAddComponent7).currentConstructHit = ((Constructable)orAddComponent6).currentConstructHit;
						((Constructable)orAddComponent7).constructing = ((Constructable)orAddComponent6).constructing;
						((Constructable)orAddComponent7).valid = ((Constructable)orAddComponent6).valid;
						Object.Destroy((Object)(object)orAddComponent6);
					}
					break;
				}
				break;
			case 16:
				switch (itemName[0])
				{
				default:
					return;
				case 'P':
				{
					if (!(itemName == "Pirate's Compass"))
					{
						return;
					}
					MeshFilter[] componentsInChildren12 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val48 in componentsInChildren12)
					{
						if (((Object)((Component)val48).gameObject).name == "PirateHat")
						{
							val48.mesh = peakBundle.LoadAsset<Mesh>("UnnamedCompass.fbx");
						}
					}
					return;
				}
				case 'a':
					break;
				}
				if (!(itemName == "anti-rope cannon"))
				{
					break;
				}
				goto IL_1948;
			case 9:
				switch (itemName[0])
				{
				case 'T':
				{
					if (!(itemName == "Trail Mix"))
					{
						break;
					}
					MeshFilter[] componentsInChildren11 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val47 in componentsInChildren11)
					{
						if (((Object)((Component)val47).gameObject).name == "TrailMix")
						{
							val47.mesh = peakBundle.LoadAsset<Mesh>("UnnamedTrailMix.fbx");
							Renderer component9 = ((Component)val47).gameObject.GetComponent<Renderer>();
							component9.SetMaterials(new List<Material>(3)
							{
								component9.materials[0],
								peakBundle.LoadAsset<Material>("M_UnnamedTrailMixOpaque.mat"),
								component9.materials[1]
							});
						}
					}
					break;
				}
				case 'S':
				{
					Action_Spawn val45 = default(Action_Spawn);
					if (itemName == "Sunscreen" && ((Component)it).gameObject.TryGetComponent<Action_Spawn>(ref val45))
					{
						GameObject val46 = Object.Instantiate<GameObject>(val45.objectToSpawn);
						((Object)val46).name = "Unnamed" + ((Object)val45.objectToSpawn).name.Replace("Unnamed", "");
						AOE componentInChildren4 = val46.GetComponentInChildren<AOE>();
						if (componentInChildren4 != null && !IsUnnamed(((Component)componentInChildren4).gameObject))
						{
							RenameToUnnamed(((Component)componentInChildren4).gameObject);
						}
						val45.objectToSpawn = RegisterOrGetNetworkPrefab(val46);
						Object.DontDestroyOnLoad((Object)(object)val46);
						val46.SetActive(false);
					}
					break;
				}
				}
				break;
			case 5:
				switch (itemName[0])
				{
				case 'P':
				{
					if (!(itemName == "Piton"))
					{
						break;
					}
					GameObject val39 = peakBundle.LoadAsset<GameObject>("UnnamedPitonPackaging.prefab");
					GameObject val40 = Object.Instantiate<GameObject>(val39, ((Component)it.mainRenderer).transform, false);
					val40.transform.localPosition = Vector3.zero;
					val40.transform.localScale = ExtDataTypes.ToVec(15.85264f);
					val40.transform.localRotation = new Quaternion(0.5023786f, 0.4976101f, 0.49761012f, -0.5023785f);
					it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val40.GetComponent<Renderer>());
					ClimbingSpikeComponent orAddComponent24 = ExtGameObject.GetOrAddComponent<ClimbingSpikeComponent>(((Component)it).gameObject);
					UnnamedClimbingSpikeComponent orAddComponent25 = ExtGameObject.GetOrAddComponent<UnnamedClimbingSpikeComponent>(((Component)it).gameObject);
					GameObject go8 = peakBundle.LoadAsset<GameObject>("UnnamedClimbingSpikeHammered_Bad.prefab");
					GameObject go9 = peakBundle.LoadAsset<GameObject>("UnnamedClimbingSpikeHammered_Good.prefab");
					ShaderExtensions.ReplaceShaders(go8);
					ShaderExtensions.ReplaceShaders(go9);
					CopyUnnamedMaterials(ref go8, peakBundle);
					CopyUnnamedMaterials(ref go9, peakBundle);
					go8 = RegisterOrGetNetworkPrefab(go8);
					go9 = RegisterOrGetNetworkPrefab(go9);
					Renderer[] componentsInChildren9 = go8.gameObject.GetComponentsInChildren<Renderer>(true);
					foreach (Renderer val41 in componentsInChildren9)
					{
						Material[] materials2 = val41.materials;
						foreach (Material val42 in materials2)
						{
							val42.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val42.shader).name), "Shader.Find(material.shader.name)");
						}
					}
					Renderer[] componentsInChildren10 = go9.gameObject.GetComponentsInChildren<Renderer>(true);
					foreach (Renderer val43 in componentsInChildren10)
					{
						Material[] materials3 = val43.materials;
						foreach (Material val44 in materials3)
						{
							val44.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val44.shader).name), "Shader.Find(material.shader.name)");
						}
					}
					orAddComponent25.hammeredBadVersionPrefab = go8;
					orAddComponent25.hammeredGoodVersionPrefab = go9;
					((ClimbingSpikeComponent)orAddComponent25).hammeredVersionPrefab = orAddComponent24.hammeredVersionPrefab;
					((ClimbingSpikeComponent)orAddComponent25).climbingSpikeStartDistance = orAddComponent24.climbingSpikeStartDistance;
					((ClimbingSpikeComponent)orAddComponent25).climbingSpikePreviewPrefab = orAddComponent24.climbingSpikePreviewPrefab;
					((ClimbingSpikeComponent)orAddComponent25).climbingSpikePreviewDisableDistance = orAddComponent24.climbingSpikePreviewDisableDistance;
					((ClimbingSpikeComponent)orAddComponent25).climbingSpikeStartDistanceGrounded = orAddComponent24.climbingSpikeStartDistanceGrounded;
					((ClimbingSpikeComponent)orAddComponent25).climbingSpikePreviewDisableDistanceGrounded = orAddComponent24.climbingSpikePreviewDisableDistanceGrounded;
					Object.Destroy((Object)(object)orAddComponent24);
					break;
				}
				case 'F':
					if (itemName == "Flare")
					{
						Flare orAddComponent22 = ExtGameObject.GetOrAddComponent<Flare>(((Component)it).gameObject);
						UnnamedFlare orAddComponent23 = ExtGameObject.GetOrAddComponent<UnnamedFlare>(((Component)it).gameObject);
						((Flare)orAddComponent23).trackable = orAddComponent22.trackable;
						((Flare)orAddComponent23).flareVFXPrefab = orAddComponent22.flareVFXPrefab;
						((Flare)orAddComponent23).flareColor = orAddComponent22.flareColor;
						Object.Destroy((Object)(object)orAddComponent22);
						Action_Flare component8 = ((Component)it).gameObject.GetComponent<Action_Flare>();
						component8.flare = (Flare)(object)orAddComponent23;
					}
					break;
				}
				break;
			case 8:
				switch (itemName[0])
				{
				case 'D':
					if (itemName == "Dynamite")
					{
						Dynamite orAddComponent20 = ExtGameObject.GetOrAddComponent<Dynamite>(((Component)it).gameObject);
						UnnamedDynamite orAddComponent21 = ExtGameObject.GetOrAddComponent<UnnamedDynamite>(((Component)it).gameObject);
						orAddComponent21.baseFuseTime = orAddComponent20.startingFuseTime;
						((Dynamite)orAddComponent21)._hasExploded = orAddComponent20._hasExploded;
						((Dynamite)orAddComponent21).trackable = orAddComponent20.trackable;
						((Dynamite)orAddComponent21).smokeVFXPrefab = orAddComponent20.smokeVFXPrefab;
						((Dynamite)orAddComponent21).explosionPrefab = orAddComponent20.explosionPrefab;
						((Dynamite)orAddComponent21).startingFuseTime = orAddComponent20.startingFuseTime;
						((Dynamite)orAddComponent21).lightFuseRadius = orAddComponent20.lightFuseRadius;
						((Dynamite)orAddComponent21).fuseTime = orAddComponent20.fuseTime;
						((Dynamite)orAddComponent21).sparks = orAddComponent20.sparks;
						((Dynamite)orAddComponent21).sparksPhotosensitive = orAddComponent20.sparksPhotosensitive;
						((Dynamite)orAddComponent21).setting = orAddComponent20.setting;
						((Dynamite)orAddComponent21).DEBUG_PauseOnExplode = orAddComponent20.DEBUG_PauseOnExplode;
						Object.Destroy((Object)(object)orAddComponent20);
						if (Object.op_Implicit((Object)(object)((Dynamite)orAddComponent21).explosionPrefab))
						{
							GameObject val36 = Object.Instantiate<GameObject>(((Dynamite)orAddComponent21).explosionPrefab);
							((Object)val36).name = "Unnamed" + ((Object)((Dynamite)orAddComponent21).explosionPrefab).name.Replace("Unnamed", "");
							val36 = RegisterOrGetNetworkPrefab(val36);
							Object.DontDestroyOnLoad((Object)(object)val36);
							val36.SetActive(false);
							((Dynamite)orAddComponent21).explosionPrefab = val36;
						}
					}
					break;
				case 'B':
					if (itemName == "Bandages")
					{
						GameObject val37 = peakBundle.LoadAsset<GameObject>("UnnamedBandageWrapping.prefab");
						GameObject val38 = Object.Instantiate<GameObject>(val37, ((Component)it.mainRenderer).transform, false);
						val38.transform.localPosition = Vector3.zero;
						val38.transform.localScale = ExtDataTypes.ToVec(6.181997f);
						val38.transform.localRotation = new Quaternion(0.7071068f, 0f, 0f, 0.7071068f);
						it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val38.GetComponent<Renderer>());
					}
					break;
				case 'C':
					if (itemName == "Cure-All")
					{
						GameObject val34 = peakBundle.LoadAsset<GameObject>("UnnamedCureAllLabel.prefab");
						GameObject val35 = Object.Instantiate<GameObject>(val34, ((Component)it.mainRenderer).transform, false);
						val35.transform.localPosition = new Vector3(4.4668468E-05f, 0f, 0f);
						val35.transform.localScale = ExtDataTypes.ToVec(6.216943f);
						val35.transform.localRotation = new Quaternion(0.54746115f, -0.44753358f, -0.44753358f, 0.54746115f);
						it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val35.GetComponent<Renderer>());
					}
					break;
				}
				break;
			case 11:
				switch (itemName[0])
				{
				default:
					return;
				case 'R':
				{
					if (!(itemName == "Rescue Claw"))
					{
						return;
					}
					RescueHook orAddComponent18 = ExtGameObject.GetOrAddComponent<RescueHook>(((Component)it).gameObject);
					UnnamedRescueHook orAddComponent19 = ExtGameObject.GetOrAddComponent<UnnamedRescueHook>(((Component)it).gameObject);
					MeshFilter[] componentsInChildren8 = ((Component)it).GetComponentsInChildren<MeshFilter>(true);
					foreach (MeshFilter val32 in componentsInChildren8)
					{
						if (((Object)((Component)val32).gameObject).name == "RescueClawBody")
						{
							Mesh mesh = (val32.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedRescueClaw.fbx"));
							val32.mesh = mesh;
						}
					}
					((RescueHook)orAddComponent19).dragPoint = orAddComponent18.dragPoint;
					((RescueHook)orAddComponent19).claw = orAddComponent18.claw;
					((RescueHook)orAddComponent19).clawButt = orAddComponent18.clawButt;
					((RescueHook)orAddComponent19).maxLength = orAddComponent18.maxLength;
					((RescueHook)orAddComponent19).dragForce = orAddComponent18.dragForce;
					((RescueHook)orAddComponent19).liftDragForce = orAddComponent18.liftDragForce;
					((RescueHook)orAddComponent19).extraDragSelf = orAddComponent18.extraDragSelf;
					((RescueHook)orAddComponent19).extraDragOther = orAddComponent18.extraDragOther;
					((RescueHook)orAddComponent19).launchForce = orAddComponent18.launchForce;
					((RescueHook)orAddComponent19).liftForce = orAddComponent18.liftForce;
					((RescueHook)orAddComponent19).actionReduceUses = orAddComponent18.actionReduceUses;
					((RescueHook)orAddComponent19).camera = orAddComponent18.camera;
					((RescueHook)orAddComponent19).currentDistance = orAddComponent18.currentDistance;
					((RescueHook)orAddComponent19).fly = orAddComponent18.fly;
					((RescueHook)orAddComponent19).hitNothing = orAddComponent18.hitNothing;
					((RescueHook)orAddComponent19).isPulling = orAddComponent18.isPulling;
					((RescueHook)orAddComponent19).sinceFire = orAddComponent18.sinceFire;
					((RescueHook)orAddComponent19).targetPlayer = orAddComponent18.targetPlayer;
					((RescueHook)orAddComponent19).targetPos = orAddComponent18.targetPos;
					((RescueHook)orAddComponent19).startingPos = orAddComponent18.startingPos;
					((RescueHook)orAddComponent19).rescuedCharacterStartingPos = orAddComponent18.rescuedCharacterStartingPos;
					((RescueHook)orAddComponent19).threwAchievement = orAddComponent18.threwAchievement;
					((RescueHook)orAddComponent19).targetRig = orAddComponent18.targetRig;
					((RescueHook)orAddComponent19).ropeRender = orAddComponent18.ropeRender;
					((RescueHook)orAddComponent19).line = orAddComponent18.line;
					((RescueHook)orAddComponent19).startingClawLocalPos = orAddComponent18.startingClawLocalPos;
					((RescueHook)orAddComponent19).maxWallHookTime = orAddComponent18.maxWallHookTime;
					((RescueHook)orAddComponent19).maxScoutHookTime = orAddComponent18.maxScoutHookTime;
					((RescueHook)orAddComponent19).maxLiftDistance = orAddComponent18.maxLiftDistance;
					((RescueHook)orAddComponent19).stopPullDistance = orAddComponent18.stopPullDistance;
					((RescueHook)orAddComponent19).stopPullFriendDistance = orAddComponent18.stopPullFriendDistance;
					((RescueHook)orAddComponent19).minRaycastDistance = orAddComponent18.minRaycastDistance;
					((RescueHook)orAddComponent19).rescueShot = orAddComponent18.rescueShot;
					((RescueHook)orAddComponent19).rescueHit = orAddComponent18.rescueHit;
					((RescueHook)orAddComponent19).pulLStrengthCurve = orAddComponent18.pulLStrengthCurve;
					((RescueHook)orAddComponent19).firePoint = orAddComponent18.firePoint;
					((RescueHook)orAddComponent19).range = orAddComponent18.range;
					((RescueHook)orAddComponent19).rangeDownward = orAddComponent18.rangeDownward;
					((RescueHook)orAddComponent19).curRange = orAddComponent18.curRange;
					((RescueHook)orAddComponent19).afterLetGoDragSeconds = orAddComponent18.afterLetGoDragSeconds;
					((RescueHook)orAddComponent19).afterLetGoDragTime = orAddComponent18.afterLetGoDragTime;
					((RescueHook)orAddComponent19).selfFallSeconds = orAddComponent18.selfFallSeconds;
					Object.Destroy((Object)(object)orAddComponent18);
					return;
				}
				case 'r':
					break;
				}
				if (!(itemName == "rope cannon"))
				{
					break;
				}
				goto IL_1948;
			case 13:
				if (itemName == "First Aid Kit")
				{
					GameObject val17 = peakBundle.LoadAsset<GameObject>("UnnamedFirstAidKitPackaging.prefab");
					GameObject val18 = Object.Instantiate<GameObject>(val17, ((Component)it.mainRenderer).transform, false);
					val18.transform.localPosition = Vector3.zero;
					val18.transform.localScale = ExtDataTypes.ToVec(3.348572f);
					val18.transform.localRotation = new Quaternion(0.7071068f, 0f, 0f, 0.7071068f);
					it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val18.GetComponent<Renderer>());
				}
				break;
			case 10:
				if (!(itemName == "rope spool"))
				{
					break;
				}
				goto IL_1de8;
			case 15:
				if (!(itemName == "anti-rope spool"))
				{
					break;
				}
				goto IL_1de8;
			case 6:
				break;
				IL_1de8:
				orAddComponent = ExtGameObject.GetOrAddComponent<RopeSpool>(((Component)it).gameObject);
				orAddComponent2 = ExtGameObject.GetOrAddComponent<UnnamedRopeSpool>(((Component)it).gameObject);
				orAddComponent2.baseStartFuel = orAddComponent.ropeStartFuel;
				val = peakBundle.LoadAsset<GameObject>("UnnamedRopeWrapper.prefab");
				val2 = Object.Instantiate<GameObject>(val, ((Component)it.mainRenderer).transform, false);
				val2.transform.localPosition = Vector3.zero;
				val2.transform.localRotation = new Quaternion(-0.28808928f, 0.6457595f, 0.28809026f, 0.645758f);
				val2.transform.localScale = new Vector3(0.080336176f, 0.08033618f, 0.080336176f);
				if (it.UIData.itemName == "anti-rope spool")
				{
					val2.GetComponent<Renderer>().material = peakBundle.LoadAsset<Material>("M_UnnamedAnttiRopeWrapper.mat");
				}
				it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val2.GetComponent<Renderer>());
				orAddComponent3 = ExtGameObject.GetOrAddComponent<RopeTier>(((Component)it).gameObject);
				val3 = Object.Instantiate<GameObject>(orAddComponent3.anchorPrefab);
				((Object)val3).name = "Unnamed" + ((Object)orAddComponent3.anchorPrefab).name.Replace("Unnamed", "");
				val3 = RegisterOrGetNetworkPrefab(val3);
				Object.DontDestroyOnLoad((Object)(object)val3);
				CopyUnnamedMaterials(ref val3, peakBundle);
				val3.SetActive(false);
				orAddComponent3.anchorPrefab = val3;
				val4 = Object.Instantiate<GameObject>(orAddComponent.ropePrefab);
				((Object)val4).name = "Unnamed" + ((Object)orAddComponent.ropePrefab).name.Replace("Unnamed", "");
				val4 = RegisterOrGetNetworkPrefab(val4);
				component = val4.GetComponent<RopeBoneVisualizer>();
				component.ropeMaterial = GetUnnamedMaterial(component.ropeMaterial, peakBundle);
				Object.DontDestroyOnLoad((Object)(object)val4);
				CopyUnnamedMaterials(ref val4, peakBundle);
				val4.SetActive(false);
				orAddComponent4 = ExtGameObject.GetOrAddComponent<AudioSource>(val4);
				orAddComponent4.priority = 128;
				orAddComponent4.volume = 0.125f;
				orAddComponent4.pitch = 1f;
				orAddComponent4.reverbZoneMix = 1f;
				orAddComponent4.rolloffMode = (AudioRolloffMode)2;
				orAddComponent4.spatialBlend = 1f;
				orAddComponent4.dopplerLevel = 0.25f;
				orAddComponent4.maxDistance = 120f;
				orAddComponent4.minDistance = 39.1865f;
				orAddComponent4.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[2]
				{
					new Keyframe(0.0067737103f, 1f, -3.1092653f, -3.1092653f, 0f, 0.04103275f),
					new Keyframe(1f, 0f, 0.020448748f, 0.020448748f, 0.13781565f, 0f)
				}));
				orAddComponent4.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f)
				}));
				orAddComponent4.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f)
				}));
				orAddComponent4.SetCustomCurve((AudioSourceCurveType)3, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 0f, 0f, 0f, 1f / 3f, 1f / 3f)
				}));
				orAddComponent4.SetCustomCurve((AudioSourceCurveType)2, new AnimationCurve((Keyframe[])(object)new Keyframe[1]
				{
					new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f)
				}));
				orAddComponent4.resource = peakBundle.LoadAsset<AudioResource>("Au_RopeLoop.ogg");
				orAddComponent4.playOnAwake = false;
				orAddComponent5 = ExtGameObject.GetOrAddComponent<UnnamedRopeBreaker>(val4);
				orAddComponent5.startBreakSfx = peakBundle.LoadAsset<SFX_Instance>("SFXI Climb Rope Grab 1.asset");
				orAddComponent5.breakSfx = (SFX_Instance[])(object)new SFX_Instance[4]
				{
					peakBundle.LoadAsset<SFX_Instance>("SFXI Break Coconut 1.asset"),
					peakBundle.LoadAsset<SFX_Instance>("SFXI Bridge Break 4.asset"),
					peakBundle.LoadAsset<SFX_Instance>("SFXI Climb Rope Grab 1.asset"),
					peakBundle.LoadAsset<SFX_Instance>("SFXI RopeShooter 2.asset")
				};
				orAddComponent5.breakChance = 0.25f;
				orAddComponent5.axisMul = new Vector3(2f, 1f, 0f);
				orAddComponent5.shakeScale = 33f;
				orAddComponent5.fallTime = 3f;
				orAddComponent5.amount = 0.1f;
				orAddComponent5.startShakeDistance = 30.87f;
				orAddComponent5.startShakeAmount = 10f;
				orAddComponent5.climbingScreenShake = 5f;
				orAddComponent5.screenShakeTickTime = 0.2f;
				((RopeSpool)orAddComponent2).segments = orAddComponent.segments;
				((RopeSpool)orAddComponent2).minSegments = orAddComponent.minSegments;
				((RopeSpool)orAddComponent2).ropeStartFuel = orAddComponent.ropeStartFuel;
				((RopeSpool)orAddComponent2).ropeFuel = orAddComponent.ropeFuel;
				((RopeSpool)orAddComponent2).ropeBase = orAddComponent.ropeBase;
				((RopeSpool)orAddComponent2).ropeStart = orAddComponent.ropeStart;
				((RopeSpool)orAddComponent2).ropeSpoolTf = orAddComponent.ropeSpoolTf;
				((RopeSpool)orAddComponent2).ropeInstance = orAddComponent.ropeInstance;
				((RopeSpool)orAddComponent2).rig = orAddComponent.rig;
				((RopeSpool)orAddComponent2).rope = orAddComponent.rope;
				((RopeSpool)orAddComponent2).scroll = orAddComponent.scroll;
				((RopeSpool)orAddComponent2).segsVel = orAddComponent.segsVel;
				((RopeSpool)orAddComponent2).ropeTier = orAddComponent.ropeTier;
				((RopeSpool)orAddComponent2).isAntiRope = orAddComponent.isAntiRope;
				((RopeSpool)orAddComponent2).ropePrefab = val4;
				Object.Destroy((Object)(object)orAddComp