Decompiled source of MushroomPlus v1.0.0

MushroomPlus.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MushroomPlus")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MushroomPlus")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
[BepInPlugin("com.DirtyGames.MushroomPlus", "MushroomPlus", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class MushroomPlus : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Player), "PlacePiece")]
	public class ShrineMusicPatch
	{
		[HarmonyPostfix]
		private static void PatchContainerMusic(ref Piece piece)
		{
			if (piece.m_name == "Shroom Shrine")
			{
				MonoBehaviour.print((object)"Placed Trader");
				((Behaviour)((Component)piece).GetComponentInChildren<AudioSource>()).enabled = shrineMusic.Value;
				MonoBehaviour.print((object)shrineMusic.Value);
			}
		}
	}

	[HarmonyPatch(typeof(Container), "SetInUse")]
	public class ShrinePatch
	{
		public static int refGold;

		[HarmonyPostfix]
		private static void ContainerUsagePatch(ref Container __instance)
		{
			int num = 0;
			if (__instance.m_inUse && __instance.m_name == "Mushroom Trader")
			{
				tradePanel.SetActive(true);
				shrineContain = __instance;
				List<ItemData> allItems = __instance.m_inventory.GetAllItems();
				foreach (ItemData item in allItems)
				{
					switch (((Object)item.m_dropPrefab).name)
					{
					case "RawTruffle":
						num += highProfitVal.Value * item.m_stack;
						break;
					case "RawMorel":
						num += highProfitVal.Value * item.m_stack;
						break;
					case "RawCotw":
						num += highProfitVal.Value * item.m_stack;
						break;
					case "RawCinc":
						num += highProfitVal.Value * item.m_stack;
						break;
					case "RawFoen":
						num += mediumProfitVal.Value * item.m_stack;
						break;
					case "RawChanterelle":
						num += mediumProfitVal.Value * item.m_stack;
						break;
					case "RawBolete":
						num += mediumProfitVal.Value * item.m_stack;
						break;
					case "RawCyan":
						num += lowProfitVal.Value * item.m_stack;
						break;
					case "RawDeathCap":
						num += mediumProfitVal.Value * item.m_stack;
						break;
					case "RawChlorophyllum":
						num += lowProfitVal.Value * item.m_stack;
						break;
					case "RawNoxus":
						num += lowProfitVal.Value * item.m_stack;
						break;
					case "RawRussula":
						num += lowProfitVal.Value * item.m_stack;
						break;
					case "RawMuscaria":
						num += littleProfitVal.Value * item.m_stack;
						break;
					case "RawDulcis":
						num += littleProfitVal.Value * item.m_stack;
						break;
					case "RawJack":
						num += littleProfitVal.Value * item.m_stack;
						break;
					case "RawSatan":
						num += littleProfitVal.Value * item.m_stack;
						break;
					case "MushroomYellow":
						num += littleProfitVal.Value * item.m_stack;
						break;
					case "Mushroom":
						num += littleProfitVal.Value * item.m_stack;
						break;
					}
				}
				tradeText.GetComponent<Text>().text = "Gold Value: " + num;
				UpdateGoldRef(num);
			}
			if (!__instance.m_inUse && __instance.m_name == "Mushroom Trader")
			{
				tradePanel.SetActive(false);
			}
		}

		private static void UpdateGoldRef(int goldPrice)
		{
			refGold = goldPrice;
		}
	}

	[HarmonyPatch(typeof(Humanoid), "UseItem")]
	private class PatchBookEquip
	{
		[HarmonyPostfix]
		private static void OnBookUse(ref ItemData item)
		{
			if (!(item.m_shared.m_name != "Mycology Book"))
			{
				if (item.m_equipped)
				{
					mainPanel.SetActive(false);
				}
				if (!item.m_equipped)
				{
					mainPanel.SetActive(true);
				}
			}
		}
	}

	[HarmonyPatch(typeof(Humanoid), "Pickup")]
	private class PatchShroomPickup
	{
		[HarmonyPostfix]
		private static void OnMushroomInteract(ref GameObject go)
		{
			ItemData val = default(ItemData);
			if (go.TryGetComponent<ItemData>(ref val))
			{
				if (((Object)val.m_dropPrefab).name == "RawNoxus" || ((Object)val.m_dropPrefab).name == "CookedNoxus")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = medRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawCyan")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedCinc")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = highRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawChlorophyllum" || ((Object)val.m_dropPrefab).name == "CookedChlorophyllum")
				{
					val.m_shared.m_food = lowFoodStat.Value;
					val.m_shared.m_foodStamina = lowStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawDulcis")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawBolete" || ((Object)val.m_dropPrefab).name == "RawSatan")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = lowStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedBolete" || ((Object)val.m_dropPrefab).name == "CookedSatan")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawChanterelle" || ((Object)val.m_dropPrefab).name == "RawJack")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedChanterelle" || ((Object)val.m_dropPrefab).name == "CookedJack")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = highBurnStat.Value;
					val.m_shared.m_foodRegen = highRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawTruffle")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedTruffle")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = highBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedMuscaria")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedCyan")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = highBurnStat.Value;
					val.m_shared.m_foodRegen = highRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawCinc")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = highRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawFoen" || ((Object)val.m_dropPrefab).name == "CookedFoen")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawMorel" || ((Object)val.m_dropPrefab).name == "RawFalseMorel")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = lowBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedMorel" || ((Object)val.m_dropPrefab).name == "CookedFalseMorel")
				{
					val.m_shared.m_food = highFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "RawCotw")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = medStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "CookedCotw")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = lowRegenStat.Value;
				}
				if (((Object)val.m_dropPrefab).name == "DeadlyJam")
				{
					val.m_shared.m_food = medFoodStat.Value;
					val.m_shared.m_foodStamina = highStaminaStat.Value;
					val.m_shared.m_foodBurnTime = medBurnStat.Value;
					val.m_shared.m_foodRegen = highRegenStat.Value;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Player), "ConsumeItem")]
	private class PatchConsume
	{
		[HarmonyPrefix]
		private static void AddConsumePenalty(ref ItemData item, ref Player __instance)
		{
			MonoBehaviour.print((object)((Object)item.m_dropPrefab).name);
			if (((Object)item.m_dropPrefab).name == "RawDeathCap" || ((Object)item.m_dropPrefab).name == "CookedDeathCap")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 10, 5f);
				float maxHealth = ((Character)__instance).GetMaxHealth();
				((Character)__instance).AddPoisonDamage(maxHealth);
			}
			if (((Object)item.m_dropPrefab).name == "RawNoxus" || ((Object)item.m_dropPrefab).name == "CookedNoxus")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 20, 5f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Burning".GetHashCode(), resetEffects.Value, 20, 5f);
				float maxHealth2 = ((Character)__instance).GetMaxHealth();
				((Character)__instance).AddPoisonDamage(maxHealth2);
			}
			if (((Object)item.m_dropPrefab).name == "RawCyan")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 20, 5f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Freezing".GetHashCode(), resetEffects.Value, 20, 5f);
				float maxHealth3 = ((Character)__instance).GetMaxHealth();
				((Character)__instance).AddPoisonDamage(maxHealth3);
			}
			if (((Object)item.m_dropPrefab).name == "CookedCinc")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 20, 5f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Freezing".GetHashCode(), resetEffects.Value, 20, 5f);
				float maxHealth4 = ((Character)__instance).GetMaxHealth();
				((Character)__instance).AddPoisonDamage(maxHealth4);
			}
			if (((Object)item.m_dropPrefab).name == "RawChlorophyllum" || ((Object)item.m_dropPrefab).name == "CookedChlorophyllum")
			{
				float num = ((Character)__instance).GetMaxHealth() / 3f;
				((Character)__instance).AddPoisonDamage(num);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 10, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "RawMuscaria")
			{
				float num2 = ((Character)__instance).GetMaxHealth() / 2f;
				((Character)__instance).AddPoisonDamage(num2);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 5, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedRussula" || ((Object)item.m_dropPrefab).name == "RawRussula")
			{
				float num3 = ((Character)__instance).GetMaxHealth() / 2f;
				((Character)__instance).AddPoisonDamage(num3);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 10, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "RawDulcis")
			{
				float num4 = ((Character)__instance).GetMaxHealth() / 2f;
				((Character)__instance).AddPoisonDamage(num4);
			}
			if (((Object)item.m_dropPrefab).name == "RawBolete")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_minor".GetHashCode(), resetEffects.Value, 20, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedBolete")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_medium".GetHashCode(), resetEffects.Value, 20, 5f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedChanterelle")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_minor".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawTruffle")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_tasty".GetHashCode(), resetEffects.Value, 20, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedTruffle")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_major".GetHashCode(), resetEffects.Value, 20, 1f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_tasty".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedMuscaria")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Rested".GetHashCode(), resetEffects.Value, 10, 1f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_stamina_minor".GetHashCode(), resetEffects.Value, 10, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedDulcis")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Warm".GetHashCode(), resetEffects.Value, 10, 1f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_medium".GetHashCode(), resetEffects.Value, 10, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawDulcis")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_minor".GetHashCode(), resetEffects.Value, 10, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedCyan")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_frostresist".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawCinc")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_frostresist".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawFoen" || ((Object)item.m_dropPrefab).name == "CookedFoen")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_etir_minor".GetHashCode(), resetEffects.Value, 20, 1f);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_tasty".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawJack" || ((Object)item.m_dropPrefab).name == "CookedJack")
			{
				float num5 = ((Character)__instance).GetMaxHealth() / 2f;
				((Character)__instance).AddPoisonDamage(num5);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 5, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "RawCotw" || ((Object)item.m_dropPrefab).name == "CookedCotw")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_minor".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "CookedMorel" || ((Object)item.m_dropPrefab).name == "DeadlyJam")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_medium".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawMorel")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Potion_health_minor".GetHashCode(), resetEffects.Value, 20, 1f);
			}
			if (((Object)item.m_dropPrefab).name == "RawSatan" || ((Object)item.m_dropPrefab).name == "CookedSatan")
			{
				float maxHealth5 = ((Character)__instance).GetMaxHealth();
				((Character)__instance).AddPoisonDamage(maxHealth5);
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 5, 3f);
			}
			if (((Object)item.m_dropPrefab).name == "RawFalseMorel" || ((Object)item.m_dropPrefab).name == "CookedFalseMorel")
			{
				((Character)__instance).m_seman.Internal_AddStatusEffect("Puke".GetHashCode(), resetEffects.Value, 10, 5f);
				float maxHealth6 = ((Character)__instance).GetMaxHealth();
				((Character)__instance).AddPoisonDamage(maxHealth6);
			}
		}
	}

	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static EventHandler<ConfigurationSynchronizationEventArgs> <>9__65_0;

		public static UnityAction <>9__72_0;

		internal void <DelcareConfig>b__65_0(object obj, ConfigurationSynchronizationEventArgs attr)
		{
			if (attr.InitialSynchronization)
			{
				Logger.LogMessage((object)"Initial Config sync event received for MushroomPlus");
			}
			else
			{
				Logger.LogMessage((object)"Config sync event received for MushroomPlus");
			}
		}

		internal void <CreateCustomUI>b__72_0()
		{
			AcceptedOffer(ShrinePatch.refGold);
		}
	}

	public const string PluginGUID = "com.DirtyGames.MushroomPlus";

	public const string PluginName = "MushroomPlus";

	public const string PluginVersion = "1.0.0";

	private static Harmony harmony = new Harmony("com.DirtyGames.MushroomPlus");

	private static AssetBundle muscBundle;

	private static AssetBundle falseParasolBundle;

	private static AssetBundle mycologyBookBundle;

	private static AssetBundle boleteBundle;

	private static AssetBundle chantBundle;

	private static AssetBundle russulaBundle;

	private static AssetBundle truffleBundle;

	private static AssetBundle maulBundle;

	private static AssetBundle deathcapBundle;

	private static AssetBundle noxusBundle;

	private static AssetBundle dulcisBundle;

	private static AssetBundle cyanBundle;

	private static AssetBundle foenBundle;

	private static AssetBundle cincBundle;

	private static AssetBundle shroomersBundle;

	private static AssetBundle muscexBundle;

	private static AssetBundle chewinBundle;

	private static AssetBundle shrineBundle;

	private static AssetBundle traderBundle;

	private static AssetBundle decoBundle;

	private static AssetBundle mycoBundle;

	private static AssetBundle extractorBundle;

	private static AssetBundle stoolBundle;

	private static AssetBundle stumpBundle;

	private static AssetBundle jackBundle;

	private static AssetBundle morelBundle;

	private static AssetBundle satanBundle;

	private static GameObject mainPanel;

	private static GameObject backButton;

	private static GameObject tradeText;

	private static GameObject tradePanel;

	private static GameObject acceptButton;

	private List<GameObject> customMushroomObjects = new List<GameObject>();

	private int pageCount = 1;

	public static Container shrineContain;

	public CustomLocalization Localization;

	public static ConfigEntry<int> littleProfitVal;

	public static ConfigEntry<int> lowProfitVal;

	public static ConfigEntry<int> mediumProfitVal;

	public static ConfigEntry<int> highProfitVal;

	public static ConfigEntry<int> lowFoodStat;

	public static ConfigEntry<int> medFoodStat;

	public static ConfigEntry<int> highFoodStat;

	public static ConfigEntry<int> lowHealthStat;

	public static ConfigEntry<int> medHealthStat;

	public static ConfigEntry<int> highHealthStat;

	public static ConfigEntry<int> lowStaminaStat;

	public static ConfigEntry<int> medStaminaStat;

	public static ConfigEntry<int> highStaminaStat;

	public static ConfigEntry<int> lowEtirStat;

	public static ConfigEntry<int> medEtirStat;

	public static ConfigEntry<int> highEtirStat;

	public static ConfigEntry<int> lowRegenStat;

	public static ConfigEntry<int> medRegenStat;

	public static ConfigEntry<int> highRegenStat;

	public static ConfigEntry<int> lowBurnStat;

	public static ConfigEntry<int> medBurnStat;

	public static ConfigEntry<int> highBurnStat;

	public static ConfigEntry<bool> resetEffects;

	public static ConfigEntry<bool> shrineMusic;

	private void Awake()
	{
		Logger.LogInfo((object)"Thank you for supporting MushroomPlus! Report issues in Discord..");
		harmony.PatchAll();
		mycologyBookBundle = AssetUtils.LoadAssetBundleFromResources("mycobook");
		muscBundle = AssetUtils.LoadAssetBundleFromResources("amanitamuscaria");
		falseParasolBundle = AssetUtils.LoadAssetBundleFromResources("falseparasol");
		boleteBundle = AssetUtils.LoadAssetBundleFromResources("boleteking");
		chantBundle = AssetUtils.LoadAssetBundleFromResources("chantshroom");
		russulaBundle = AssetUtils.LoadAssetBundleFromResources("russulaemetica");
		truffleBundle = AssetUtils.LoadAssetBundleFromResources("trufflebundle");
		maulBundle = AssetUtils.LoadAssetBundleFromResources("maulaxe");
		mycoBundle = AssetUtils.LoadAssetBundleFromResources("mycopages");
		deathcapBundle = AssetUtils.LoadAssetBundleFromResources("deathcap");
		noxusBundle = AssetUtils.LoadAssetBundleFromResources("noxusbundle");
		dulcisBundle = AssetUtils.LoadAssetBundleFromResources("dulcisbundle");
		cyanBundle = AssetUtils.LoadAssetBundleFromResources("lumincyan");
		foenBundle = AssetUtils.LoadAssetBundleFromResources("foenbundle");
		cincBundle = AssetUtils.LoadAssetBundleFromResources("cincbundle");
		shrineBundle = AssetUtils.LoadAssetBundleFromResources("shroomshrine");
		traderBundle = AssetUtils.LoadAssetBundleFromResources("truffletrader");
		shroomersBundle = AssetUtils.LoadAssetBundleFromResources("shroomersjam");
		muscexBundle = AssetUtils.LoadAssetBundleFromResources("muscjam");
		chewinBundle = AssetUtils.LoadAssetBundleFromResources("chewinbundle");
		decoBundle = AssetUtils.LoadAssetBundleFromResources("decoratives");
		extractorBundle = AssetUtils.LoadAssetBundleFromResources("mushroomextractor");
		stoolBundle = AssetUtils.LoadAssetBundleFromResources("shroomstools");
		stumpBundle = AssetUtils.LoadAssetBundleFromResources("stumpshroom");
		jackBundle = AssetUtils.LoadAssetBundleFromResources("jackbundle");
		morelBundle = AssetUtils.LoadAssetBundleFromResources("morelbundle");
		satanBundle = AssetUtils.LoadAssetBundleFromResources("satanbundle");
		AddCustomMushroom(muscBundle, "Pickable_Amanita", (Biome)8, (BiomeArea)3);
		AddCustomMushroom(falseParasolBundle, "Pickable_Parasol", (Biome)1, (BiomeArea)2);
		AddCustomMushroom(boleteBundle, "Pickable_Bolete", (Biome)16, (BiomeArea)2);
		AddCustomMushroom(chantBundle, "Pickable_Chanterelle", (Biome)1, (BiomeArea)2);
		AddCustomMushroom(jackBundle, "Pickable_Jack", (Biome)1, (BiomeArea)2);
		AddCustomMushroom(russulaBundle, "Pickable_Russula", (Biome)16, (BiomeArea)3);
		AddCustomMushroom(truffleBundle, "Pickable_Truffle", (Biome)2, (BiomeArea)1);
		AddCustomMushroom(deathcapBundle, "Pickable_Deathcap", (Biome)8, (BiomeArea)1);
		AddCustomMushroom(noxusBundle, "Pickable_Noxus", (Biome)2, (BiomeArea)2);
		AddCustomMushroom(dulcisBundle, "Pickable_Dulcis", (Biome)8, (BiomeArea)1);
		AddCustomMushroom(cyanBundle, "Pickable_Cyan", (Biome)4, (BiomeArea)3);
		AddCustomMushroom(foenBundle, "Pickable_Foen", (Biome)4, (BiomeArea)2);
		AddCustomMushroom(cincBundle, "Pickable_Cinc", (Biome)4, (BiomeArea)1);
		AddCustomMushroom(stumpBundle, "Pickable_Cotw", (Biome)8, (BiomeArea)2);
		AddCustomMushroom(morelBundle, "Pickable_Morel", (Biome)2, (BiomeArea)3);
		AddCustomMushroom(morelBundle, "Pickable_FalseMorel", (Biome)16, (BiomeArea)1);
		AddCustomMushroom(satanBundle, "Pickable_SatanBolete", (Biome)1, (BiomeArea)2);
		AddMushroomToCook(muscBundle, "CookedMuscaria", "RawMuscaria", "piece_cookingstation");
		AddMushroomToCook(falseParasolBundle, "CookedChlorophyllum", "RawChlorophyllum", "piece_cookingstation");
		AddMushroomToCook(boleteBundle, "CookedBolete", "RawBolete", "piece_cookingstation");
		AddMushroomToCook(satanBundle, "CookedSatan", "RawSatan", "piece_cookingstation");
		AddMushroomToCook(chantBundle, "CookedChanterelle", "RawChanterelle", "piece_cookingstation");
		AddMushroomToCook(jackBundle, "CookedJack", "RawJack", "piece_cookingstation");
		AddMushroomToCook(russulaBundle, "CookedRussula", "RawRussula", "piece_cookingstation");
		AddMushroomToCook(deathcapBundle, "CookedDeathCap", "RawDeathCap", "piece_cookingstation");
		AddMushroomToCook(truffleBundle, "CookedTruffle", "RawTruffle", "piece_cookingstation_iron");
		AddMushroomToCook(noxusBundle, "CookedNoxus", "RawNoxus", "piece_cookingstation_iron");
		AddMushroomToCook(dulcisBundle, "CookedDulcis", "RawDulcis", "piece_cookingstation");
		AddMushroomToCook(cyanBundle, "CookedCyan", "RawCyan", "piece_cookingstation_iron");
		AddMushroomToCook(foenBundle, "CookedFoen", "RawFoen", "piece_cookingstation_iron");
		AddMushroomToCook(cincBundle, "CookedCinc", "RawCinc", "piece_cookingstation_iron");
		AddMushroomToCook(stumpBundle, "CookedCotw", "RawCotw", "piece_cookingstation");
		AddMushroomToCook(morelBundle, "CookedMorel", "RawMorel", "piece_cookingstation_iron");
		AddMushroomToCook(morelBundle, "CookedFalseMorel", "RawFalseMorel", "piece_cookingstation_iron");
		AddJamCook(shroomersBundle, "ShroomersJam", "piece_cauldron", "RawTruffle", "RawChanterelle", "Guck", 5, 5, 1);
		AddJamCook(muscexBundle, "MuscExtract", "piece_cauldron", "RawMuscaria", "Honey", "Guck", 4, 6, 1);
		AddJamCook(chewinBundle, "LuminJam", "piece_cauldron", "RawCyan", "RawDulcis", "RawFoen", 3, 6, 2);
		AddJamCook(muscexBundle, "MuscariaSlime", "piece_cauldron", "Guck", "RawMuscaria", "MuscExtract", 1, 3, 1);
		AddJamCook(shroomersBundle, "DeadlyJam", "piece_cauldron", "RawFalseMorel", "RawNoxus", "RawSatan", 6, 6, 6);
		BookCraftableAdd();
		CreateShrine();
		CreateExtractor();
		AddLocalizations();
		ZoneManager.OnVanillaLocationsAvailable += AddTrader;
		GUIManager.OnCustomGUIAvailable += CreateCustomUI;
		AddCustomShroomItem(maulBundle, "BattleAxeShroom");
		CreateDecorativesWithRequire("Decorative_Amanita", "Decoration Shroom 1", "Hammer", "Shroom Decor", "RawMuscaria");
		CreateDecorativesWithRequire("Decorative_Bolete", "Decoration Shroom 2", "Hammer", "Shroom Decor", "RawBolete");
		CreateDecorativesWithRequire("Decorative_Chant", "Decoration Shroom 3", "Hammer", "Shroom Decor", "RawChanterelle");
		CreateDecorativesWithRequire("Decorative_Parasol", "Decoration Shroom 4", "Hammer", "Shroom Decor", "RawChlorophyllum");
		CreateDecorativesWithRequire("Decorative_Russula", "Decoration Shroom 5", "Hammer", "Shroom Decor", "RawRussula");
		CreateDecoPiece("Myco Lantern", "piece_mycolantern", "Hammer", "Shroom Buildables", decoBundle);
		CreateDecoPiece("Shroom Stool Elder", "piece_shroom_stool_elder", "Hammer", "Shroom Chairs", stoolBundle);
		CreateDecoPiece("Shroom Stool Grumpy", "piece_shroom_stool_grumpy", "Hammer", "Shroom Chairs", stoolBundle);
		CreateDecoPiece("Shroom Stool Silly", "piece_shroom_stool_silly", "Hammer", "Shroom Chairs", stoolBundle);
		CreateDecoPiece("Shroom Stool Toad", "piece_shroom_stool_toad", "Hammer", "Shroom Chairs", stoolBundle);
		DelcareConfig();
	}

	private void DelcareConfig()
	{
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Expected O, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Expected O, but got Unknown
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Expected O, but got Unknown
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Expected O, but got Unknown
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Expected O, but got Unknown
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Expected O, but got Unknown
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Expected O, but got Unknown
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Expected O, but got Unknown
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Expected O, but got Unknown
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Expected O, but got Unknown
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Expected O, but got Unknown
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Expected O, but got Unknown
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Expected O, but got Unknown
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Expected O, but got Unknown
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Expected O, but got Unknown
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Expected O, but got Unknown
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: Expected O, but got Unknown
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Expected O, but got Unknown
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Expected O, but got Unknown
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Expected O, but got Unknown
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c1: Expected O, but got Unknown
		//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Expected O, but got Unknown
		//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fe: Expected O, but got Unknown
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0308: Expected O, but got Unknown
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Expected O, but got Unknown
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Expected O, but got Unknown
		//IL_0369: Unknown result type (might be due to invalid IL or missing references)
		//IL_036e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: Expected O, but got Unknown
		//IL_0377: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Expected O, but got Unknown
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b3: Expected O, but got Unknown
		//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Expected O, but got Unknown
		//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ef: Expected O, but got Unknown
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f9: Expected O, but got Unknown
		//IL_0421: Unknown result type (might be due to invalid IL or missing references)
		//IL_0426: Unknown result type (might be due to invalid IL or missing references)
		//IL_042f: Expected O, but got Unknown
		//IL_042f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0439: Expected O, but got Unknown
		//IL_0461: Unknown result type (might be due to invalid IL or missing references)
		//IL_0466: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Expected O, but got Unknown
		//IL_046f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0479: Expected O, but got Unknown
		//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Expected O, but got Unknown
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b9: Expected O, but got Unknown
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04eb: Expected O, but got Unknown
		//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f5: Expected O, but got Unknown
		//IL_0519: Unknown result type (might be due to invalid IL or missing references)
		//IL_051e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0527: Expected O, but got Unknown
		//IL_0527: Unknown result type (might be due to invalid IL or missing references)
		//IL_0531: Expected O, but got Unknown
		((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
		SynchronizationManager.OnConfigurationSynchronized += delegate(object obj, ConfigurationSynchronizationEventArgs attr)
		{
			if (attr.InitialSynchronization)
			{
				Logger.LogMessage((object)"Initial Config sync event received for MushroomPlus");
			}
			else
			{
				Logger.LogMessage((object)"Config sync event received for MushroomPlus");
			}
		};
		littleProfitVal = ((BaseUnityPlugin)this).Config.Bind<int>("Shrine Values", "LittleProfitValue", 5, new ConfigDescription("Value of lowest profit mushrooms that are sellable in the shrine.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		lowProfitVal = ((BaseUnityPlugin)this).Config.Bind<int>("Shrine Values", "LowProfitValue", 15, new ConfigDescription("Value of low profit mushrooms that are sellable in the shrine.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		mediumProfitVal = ((BaseUnityPlugin)this).Config.Bind<int>("Shrine Values", "MediumProfitValue", 35, new ConfigDescription("Value of medium profit mushrooms that are sellable in the shrine.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		highProfitVal = ((BaseUnityPlugin)this).Config.Bind<int>("Shrine Values", "HighProfitValue", 50, new ConfigDescription("Value of high profit mushrooms that are sellable in the shrine.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		lowFoodStat = ((BaseUnityPlugin)this).Config.Bind<int>("Food Values", "LowFoodItem", 10, new ConfigDescription("The value of low tier mushrooms food stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		medFoodStat = ((BaseUnityPlugin)this).Config.Bind<int>("Food Values", "MediumFoodItem", 20, new ConfigDescription("The value of medium tier mushrooms food stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		highFoodStat = ((BaseUnityPlugin)this).Config.Bind<int>("Food Values", "HighFoodItem", 50, new ConfigDescription("The value of high tier mushrooms food stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		lowStaminaStat = ((BaseUnityPlugin)this).Config.Bind<int>("Stamina Values", "LowStaminaItem", 5, new ConfigDescription("The value of low tier mushrooms stamina stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		medStaminaStat = ((BaseUnityPlugin)this).Config.Bind<int>("Stamina Values", "MediumStaminaItem", 15, new ConfigDescription("The value of medium tier mushrooms stamina stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		highStaminaStat = ((BaseUnityPlugin)this).Config.Bind<int>("Stamina Values", "HighStaminaItem", 20, new ConfigDescription("The value of high tier mushrooms stamina stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		lowEtirStat = ((BaseUnityPlugin)this).Config.Bind<int>("Etir Values", "LowEtirItem", 12, new ConfigDescription("The value of low tier mushrooms etir stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		medEtirStat = ((BaseUnityPlugin)this).Config.Bind<int>("Etir Values", "MediumEtirItem", 15, new ConfigDescription("The value of medium tier mushrooms etir stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		highEtirStat = ((BaseUnityPlugin)this).Config.Bind<int>("Etir Values", "HighEtirItem", 22, new ConfigDescription("The value of high tier mushrooms etir stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		lowRegenStat = ((BaseUnityPlugin)this).Config.Bind<int>("Regen Values", "LowRegenItem", 1, new ConfigDescription("The value of low tier mushrooms regen stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		medRegenStat = ((BaseUnityPlugin)this).Config.Bind<int>("Regen Values", "MediumRegenItem", 2, new ConfigDescription("The value of medium tier mushrooms regen stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		highRegenStat = ((BaseUnityPlugin)this).Config.Bind<int>("Regen Values", "HighRegenItem", 3, new ConfigDescription("The value of high tier mushrooms regen stat.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		lowBurnStat = ((BaseUnityPlugin)this).Config.Bind<int>("Burn Time Values", "LowBurnItem", 500, new ConfigDescription("The value of low tier mushrooms burn time.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		medBurnStat = ((BaseUnityPlugin)this).Config.Bind<int>("Burn Time Values", "MediumBurnItem", 1000, new ConfigDescription("The value of medium tier mushrooms burn time.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		highBurnStat = ((BaseUnityPlugin)this).Config.Bind<int>("Burn Time Values", "HighBurnItem", 1500, new ConfigDescription("The value of high tier mushrooms burn time.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		resetEffects = ((BaseUnityPlugin)this).Config.Bind<bool>("Mushroom Reset Effect", "ResetEffects", false, new ConfigDescription("Should the effects of consuming be reset?", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
		shrineMusic = ((BaseUnityPlugin)this).Config.Bind<bool>("Mushroom Trader Effect", "EnableMusic", true, new ConfigDescription("Should the Mushroom Trader make noise?", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
		{
			IsAdminOnly = true
		} }));
	}

	private void AddLocalizations()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Localization = new CustomLocalization();
		LocalizationManager.Instance.AddLocalization(Localization);
		CustomLocalization localization = Localization;
		string text = "English";
		localization.AddTranslation(ref text, new Dictionary<string, string>
		{
			{ "raw_muscaria", "Raw Day Fungus" },
			{ "cooked_muscaria", "Cooked Day Fungus" },
			{ "raw_deathcap", "Raw Day Fungus" },
			{ "cooked_deathcap", "Cooked Day Fungus" },
			{ "raw_bolete", "Raw Day Fungus" },
			{ "cooked_bolete", "Cooked Day Fungus" },
			{ "raw_moly", "Raw Day Fungus" },
			{ "cooked_moly", "Cooked Day Fungus" },
			{ "raw_chanterelle", "Raw Day Fungus" },
			{ "cooked_chanterelle", "Cooked Day Fungus" },
			{ "raw_jack", "Raw Day Fungus" },
			{ "cooked_jack", "Cooked Day Fungus" },
			{ "raw_emetica", "Raw Day Fungus" },
			{ "cooked_emetica", "Cooked Day Fungus" },
			{ "cooked_morel", "Cooked Day Fungus" },
			{ "raw_morel", "Raw Day Fungus" },
			{ "cooked_falsemorel", "Cooked Day Fungus" },
			{ "raw_falsemorel", "Raw Day Fungus" },
			{ "raw_noxus", "Raw Night Fungus" },
			{ "cooked_noxus", "Cooked Night Fungus" },
			{ "raw_dulcis", "Raw Night Fungus" },
			{ "cooked_dulcis", "Cooked Night Fungus" },
			{ "raw_cyan", "Raw Night Fungus" },
			{ "cooked_cyan", "Cooked Night Fungus" },
			{ "raw_foen", "Raw Night Fungus" },
			{ "cooked_satan", "Cooked Night Fungus" },
			{ "raw_satan", "Raw Night Fungus" },
			{ "cooked_foen", "Cooked Night Fungus" },
			{ "cooked_cinc", "Cooked Night Fungus" },
			{ "raw_cinc", "Raw Night Fungus" },
			{ "raw_cotw", "Raw Stump Fungus" }
		});
	}

	private void CreateCustomUI()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: 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_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c4: Expected O, but got Unknown
		//IL_040b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0415: Expected O, but got Unknown
		//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f3: Expected O, but got Unknown
		mainPanel = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 850f, 700f, false);
		mainPanel.SetActive(false);
		Image component = mainPanel.GetComponent<Image>();
		Sprite val2 = (mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookFlip1"));
		Sprite val4 = (component.sprite = val2);
		Sprite val5 = val4;
		GameObject val6 = GUIManager.Instance.CreateButton("Next Page", mainPanel.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(325f, -300f), 100f, 30f);
		GameObject val7 = GUIManager.Instance.CreateButton("X", mainPanel.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(385f, 315f), 30f, 30f);
		backButton = GUIManager.Instance.CreateButton("Back Page", mainPanel.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(-325f, -300f), 100f, 30f);
		backButton.SetActive(false);
		tradePanel = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 500f, 500f, true);
		tradePanel.SetActive(false);
		acceptButton = GUIManager.Instance.CreateButton("Accept Deal", tradePanel.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 150f, 50f);
		acceptButton.SetActive(true);
		GameObject val8 = GUIManager.Instance.CreateButton("Decline Deal", tradePanel.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -100f), 150f, 50f);
		val8.SetActive(true);
		GameObject val9 = GUIManager.Instance.CreateText("Place Shrooms For A Trade..", tradePanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(50f, -50f), GUIManager.Instance.AveriaSerifBold, 22, GUIManager.Instance.ValheimOrange, true, Color.black, 350f, 40f, false);
		val9.SetActive(true);
		tradeText = GUIManager.Instance.CreateText("Gold Trade: ", tradePanel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(50f, -100f), GUIManager.Instance.AveriaSerifBold, 22, GUIManager.Instance.ValheimOrange, true, Color.black, 350f, 40f, false);
		tradeText.SetActive(true);
		((UnityEvent)val6.GetComponent<Button>().onClick).AddListener(new UnityAction(ClickedToNextPage));
		ButtonClickedEvent onClick = acceptButton.GetComponent<Button>().onClick;
		object obj = <>c.<>9__72_0;
		if (obj == null)
		{
			UnityAction val10 = delegate
			{
				AcceptedOffer(ShrinePatch.refGold);
			};
			<>c.<>9__72_0 = val10;
			obj = (object)val10;
		}
		((UnityEvent)onClick).AddListener((UnityAction)obj);
		((UnityEvent)val7.GetComponent<Button>().onClick).AddListener(new UnityAction(CloseBook));
	}

	private static void AcceptedOffer(int goldPrice)
	{
		if (goldPrice <= 0)
		{
			Logger.LogInfo((object)goldPrice);
			return;
		}
		shrineContain.m_inventory.RemoveAll();
		GameObject prefab = PrefabManager.Instance.GetPrefab("Coins");
		shrineContain.m_inventory.AddItem(prefab, goldPrice);
	}

	private void CloseBook()
	{
		mainPanel.SetActive(false);
	}

	private void ClickedToNextPage()
	{
		pageCount++;
		switch (pageCount)
		{
		case 1:
			mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookFlip1");
			break;
		case 2:
			mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookFlip2");
			break;
		case 3:
			mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookFlip3");
			break;
		case 4:
			mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookFlip4");
			break;
		case 5:
			mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookPageLast");
			break;
		default:
			mainPanel.GetComponent<Image>().sprite = mycoBundle.LoadAsset<Sprite>("BookFlip1");
			pageCount = 1;
			break;
		}
	}

	private void ClickedToBackPage()
	{
		pageCount--;
		ClickedToNextPage();
		if (pageCount >= 0)
		{
			pageCount = 1;
		}
	}

	private void AddCustomMushroom(AssetBundle mushroomBundle, string pickable, Biome biomeType, BiomeArea area)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Expected O, but got Unknown
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Expected O, but got Unknown
		GameObject val = mushroomBundle.LoadAsset<GameObject>(pickable);
		VegetationConfig val2 = new VegetationConfig();
		val2.Biome = biomeType;
		val2.BlockCheck = true;
		val2.BiomeArea = area;
		CustomVegetation val3 = new CustomVegetation(val, true, val2);
		ZoneManager.Instance.AddCustomVegetation(val3);
		CollectionExtensions.AddItem<GameObject>((IEnumerable<GameObject>)customMushroomObjects, val);
	}

	private void AddMushroomToCook(AssetBundle mushroomBundle, string cookedShroom, string rawShroom, string typeStation)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Expected O, but got Unknown
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Expected O, but got Unknown
		GameObject val = mushroomBundle.LoadAsset<GameObject>(cookedShroom);
		CustomItem val2 = new CustomItem(val, false);
		GameObject val3 = mushroomBundle.LoadAsset<GameObject>(rawShroom);
		CustomItem val4 = new CustomItem(val3, false);
		ItemManager.Instance.AddItem(val2);
		ItemManager.Instance.AddItem(val4);
		CookingConversionConfig val5 = new CookingConversionConfig();
		((ConversionConfig)val5).Station = typeStation;
		((ConversionConfig)val5).FromItem = rawShroom;
		((ConversionConfig)val5).ToItem = cookedShroom;
		ItemManager.Instance.AddItemConversion(new CustomItemConversion((ConversionConfig)(object)val5));
	}

	private void AddJamCook(AssetBundle jamBundle, string prefabName, string craftingType, string requireItem0, string requireItem1, string requireItem2, int require1, int require2, int require3)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Expected O, but got Unknown
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Expected O, but got Unknown
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Expected O, but got Unknown
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		GameObject val = jamBundle.LoadAsset<GameObject>(prefabName);
		ItemConfig val2 = new ItemConfig();
		val2.CraftingStation = craftingType;
		val2.AddRequirement(new RequirementConfig(requireItem0, require1, 0, false));
		val2.AddRequirement(new RequirementConfig(requireItem1, require2, 0, false));
		val2.AddRequirement(new RequirementConfig(requireItem2, require3, 0, false));
		CustomItem val3 = new CustomItem(val, false, val2);
		ItemManager.Instance.AddItem(val3);
	}

	private void BookCraftableAdd()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Expected O, but got Unknown
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		ItemConfig val = new ItemConfig();
		val.Amount = 1;
		val.AddRequirement(new RequirementConfig("RawMuscaria", 1, 0, false));
		val.AddRequirement(new RequirementConfig("Wood", 10, 0, false));
		val.AddRequirement(new RequirementConfig("Bronze", 3, 0, false));
		CustomItem val2 = new CustomItem(mycologyBookBundle, "MycologyBook", false, val);
		ItemManager.Instance.AddItem(val2);
	}

	private void AddCustomShroomItem(AssetBundle customBundle, string itemName)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		GameObject val = customBundle.LoadAsset<GameObject>(itemName);
		CustomItem val2 = new CustomItem(val, true);
		ItemManager.Instance.AddItem(val2);
	}

	private void CreateShrine()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Expected O, but got Unknown
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		PieceConfig val = new PieceConfig();
		val.Name = "Shroom Shrine";
		val.PieceTable = "Hammer";
		val.Category = "Shroom Buildables";
		val.AddRequirement(new RequirementConfig("Stone", 50, 0, true));
		val.AddRequirement(new RequirementConfig("RawTruffle", 5, 0, true));
		val.AddRequirement(new RequirementConfig("SurtlingCore", 5, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(shrineBundle, "piece_mushroom_shrine", false, val));
	}

	private void CreateExtractor()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		PieceConfig val = new PieceConfig();
		val.Name = "Shroom Extractor";
		val.PieceTable = "Hammer";
		val.Category = "Shroom Buildables";
		PieceManager.Instance.AddPiece(new CustomPiece(extractorBundle, "piece_shroom_extractor", true, val));
	}

	private void CreateDecoPiece(string decoName, string pieceName, string pieceTable, string catType, AssetBundle bundle)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Expected O, but got Unknown
		PieceConfig val = new PieceConfig();
		val.Name = decoName;
		val.PieceTable = pieceTable;
		val.Category = catType;
		PieceManager.Instance.AddPiece(new CustomPiece(bundle, pieceName, false, val));
	}

	private void CreateDecorativesWithRequire(string pieceName, string decoName, string decoPiece, string decoCategory, string requireName)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		PieceConfig val = new PieceConfig();
		val.Name = decoName;
		val.PieceTable = decoPiece;
		val.Category = decoCategory;
		val.AddRequirement(new RequirementConfig(requireName, 1, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(decoBundle, pieceName, false, val));
	}

	private void AddTrader()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Expected O, but got Unknown
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		GameObject val = ZoneManager.Instance.CreateLocationContainer(traderBundle.LoadAsset<GameObject>("Truffles_Weird_Place"));
		val.GetComponentInChildren<AudioSource>().outputAudioMixerGroup = AudioMan.instance.m_ambientMixer;
		ZoneManager.Instance.AddCustomLocation(new CustomLocation(val, true, new LocationConfig
		{
			Biome = (Biome)8,
			Quantity = 5,
			Priotized = true,
			ClearArea = true,
			MinDistanceFromSimilar = 1500f
		}));
	}
}