Decompiled source of AskaPlus v0.5.1

askaplus.bepinex.mod.dll

Decompiled 3 weeks ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Fusion;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections;
using Il2CppSystem.Collections.Generic;
using Invector;
using Microsoft.CodeAnalysis;
using SSSGame;
using SSSGame.Combat;
using SSSGame.Localization;
using SSSGame.Network;
using SSSGame.Render;
using SSSGame.UI;
using SandSailorStudio.Attributes;
using SandSailorStudio.Inventory;
using SandSailorStudio.Pooling;
using SandSailorStudio.UI;
using SandSailorStudio.Utils;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;
using askaplus.bepinex.mod.Properties;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("askaplus.bepinex.mod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.5.1")]
[assembly: AssemblyInformationalVersion("0.5.1+bc8ce8928975dcd1ead6ab1cf4b06a1f69835355")]
[assembly: AssemblyProduct("Aska Plus")]
[assembly: AssemblyTitle("askaplus.bepinex.mod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.5.1.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace askaplus.bepinex.mod
{
	[HarmonyPatch(typeof(MainMenu))]
	internal class AnchorsFix
	{
		private static bool patched;

		[HarmonyPostfix]
		[HarmonyPatch("OnActivate")]
		public static void PostAwake(MainMenu __instance)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Expected O, but got Unknown
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			if (patched)
			{
				return;
			}
			patched = true;
			Il2CppArrayBase<Anchor> val = Resources.FindObjectsOfTypeAll<Anchor>();
			string empty = string.Empty;
			Vector3 zero = Vector3.zero;
			bool flag = default(bool);
			foreach (Anchor item in val)
			{
				GameObject gameObject = ((Component)item).gameObject;
				BoxCollider val2 = null;
				if (gameObject == null)
				{
					continue;
				}
				empty = ((Object)gameObject).name;
				Transform val3 = ((gameObject != null) ? gameObject.transform.parent : null);
				if (val3 == null)
				{
					continue;
				}
				Transform obj = ((Component)val3).transform.FindChild("Footprint");
				val2 = ((obj != null) ? ((Component)obj).GetComponentInChildren<BoxCollider>() : null);
				empty = ((Object)val3).name;
				Transform val4 = ((val3 != null) ? ((Component)val3).transform.parent : null);
				if (val4 != null)
				{
					empty = ((Object)val4).name;
					Transform val5 = ((val4 != null) ? ((Component)val4).transform.parent : null);
					if (val5 != null)
					{
						empty = ((Object)val5).name;
					}
				}
				ManualLogSource log = Plugin.Log;
				BepInExMessageLogInterpolatedStringHandler val6 = new BepInExMessageLogInterpolatedStringHandler(31, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("Found Anchor in GO ");
					((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<string>(empty);
					((BepInExLogInterpolatedStringHandler)val6).AppendLiteral(" with value ");
					((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<float>(item.offset);
				}
				log.LogMessage(val6);
				if (empty.Contains("WallHedgePillar") || empty.Contains("Cave") || empty.Contains("WaterWell"))
				{
					item.offset = 0f;
					ManualLogSource log2 = Plugin.Log;
					val6 = new BepInExMessageLogInterpolatedStringHandler(14, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("New offset is ");
						((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<float>(item.offset);
					}
					log2.LogMessage(val6);
				}
				else
				{
					if (!empty.StartsWith("WallHedge") && !empty.StartsWith("WallPlank"))
					{
						continue;
					}
					item.offset = 0.1f;
					ManualLogSource log3 = Plugin.Log;
					val6 = new BepInExMessageLogInterpolatedStringHandler(14, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("New offset is ");
						((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<float>(item.offset);
					}
					log3.LogMessage(val6);
					if ((Object)(object)val2 != (Object)null)
					{
						Vector3 size = val2.size;
						size.x -= 0.15f;
						if (val2.size.z >= 1f)
						{
							size.z -= 0.15f;
						}
						val2.size = size;
					}
				}
			}
		}
	}
	internal class AskaPlusSpawner : SubcomponentSpawner
	{
		public HarvestInteraction harvestInteraction;

		private Action onFullyHarvestedDelegate;

		private Action onHarvestedDamageTakenDelegate;

		public bool UseFullyHarvested;

		public void Start()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(20, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("bonusSpawner. START ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(((Object)((Component)this).gameObject).GetInstanceID());
			}
			log.LogMessage(val);
			if ((Object)(object)harvestInteraction == (Object)null)
			{
				Plugin.Log.LogError((object)"HarvestInteraction not assigned!");
			}
			else if (UseFullyHarvested)
			{
				ManualLogSource log2 = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(35, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Adding delegate to onFullyHarvested");
				}
				log2.LogMessage(val);
				onFullyHarvestedDelegate = Action.op_Implicit((Action)OnFullyHarvested);
				harvestInteraction.OnFullyHarvested += onFullyHarvestedDelegate;
			}
			else
			{
				ManualLogSource log3 = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(39, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Adding delegate to onHarvestDamageTaken");
				}
				log3.LogMessage(val);
				onHarvestedDamageTakenDelegate = Action.op_Implicit((Action)OnHarvestDamageTaken);
				harvestInteraction.OnHarvestDamageTaken += onHarvestedDamageTakenDelegate;
			}
		}

		private void OnFullyHarvested()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(56, 3, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Running AskaPlusSpawner with amount = ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(((SubcomponentSpawner)this).amount);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" on game object ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)((Component)this).gameObject).name);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("(");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(((Object)((Component)this).gameObject).GetInstanceID());
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")");
			}
			log.LogMessage(val);
			if ((Delegate)(object)onFullyHarvestedDelegate != (Delegate)null)
			{
				ManualLogSource log2 = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(33, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Removing onFullyHarvestedDelegate");
				}
				log2.LogMessage(val);
				harvestInteraction.OnFullyHarvested -= onFullyHarvestedDelegate;
			}
			((ItemSpawner)this).Run();
			Plugin.Log.LogInfo((object)"Deleting bonusspawner - fully harvested");
			Object.Destroy((Object)(object)this, 2f);
		}

		private void OnHarvestDamageTaken()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			IResourceHealthModifier healthModifier = harvestInteraction._healthModifier;
			float num = ((healthModifier != null) ? healthModifier.GetHealth() : 0f);
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(52, 3, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Harvest damage taken on game object ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)((Component)this).gameObject).name);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("(");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(((Object)((Component)this).gameObject).GetInstanceID());
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") with health: ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num);
			}
			log.LogMessage(val);
			if (num <= 0f)
			{
				ManualLogSource log2 = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(37, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Removing onHarvestDamageTakenDelegate");
				}
				log2.LogMessage(val);
				harvestInteraction.OnHarvestDamageTaken -= onHarvestedDamageTakenDelegate;
				((ItemSpawner)this).Run();
				Plugin.Log.LogInfo((object)"Deleting bonusspawner -  On HarvestedDamageTaken with remaining healt <= 0)");
				Object.Destroy((Object)(object)this, 2f);
			}
		}

		private void OnDestroy()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExMessageLogInterpolatedStringHandler val = new BepInExMessageLogInterpolatedStringHandler(9, 0, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("OnDestroy");
			}
			log.LogMessage(val);
			onFullyHarvestedDelegate = null;
			onHarvestedDamageTakenDelegate = null;
		}
	}
	internal static class AskaRecipes
	{
		internal struct RecipeCreateStruct
		{
			internal string RecipeName;

			internal List<ItemInfoQuantity> Ingredients;

			internal List<BlueprintConditionsRule> BlueprintConditionsRules;

			internal int Quantity;

			internal ItemCategoryInfo Category;

			internal ItemInfo Result;

			internal CraftInteraction Interaction;

			internal string Description;

			internal string Lore;

			internal string Name;

			internal List<string> ItemInfoListTargets;
		}

		internal static void CreateRecipes()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Expected O, but got Unknown
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Expected O, but got Unknown
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Expected O, but got Unknown
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Expected O, but got Unknown
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Expected O, but got Unknown
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: 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_040b: Expected O, but got Unknown
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Expected O, but got Unknown
			//IL_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Expected O, but got Unknown
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Expected O, but got Unknown
			//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Expected O, but got Unknown
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Expected O, but got Unknown
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Expected O, but got Unknown
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_0598: Expected O, but got Unknown
			//IL_059a: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05be: Expected O, but got Unknown
			//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Expected O, but got Unknown
			//IL_0605: Unknown result type (might be due to invalid IL or missing references)
			//IL_060a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0629: Expected O, but got Unknown
			//IL_062b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0630: Unknown result type (might be due to invalid IL or missing references)
			//IL_0638: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Expected O, but got Unknown
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_065f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Expected O, but got Unknown
			//IL_0696: Unknown result type (might be due to invalid IL or missing references)
			//IL_069b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Expected O, but got Unknown
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Expected O, but got Unknown
			//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Expected O, but got Unknown
			//IL_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0734: Unknown result type (might be due to invalid IL or missing references)
			//IL_074b: Expected O, but got Unknown
			//IL_074d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0771: Expected O, but got Unknown
			//IL_0773: Unknown result type (might be due to invalid IL or missing references)
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_0781: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Expected O, but got Unknown
			//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dc: Expected O, but got Unknown
			//IL_07de: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0802: Expected O, but got Unknown
			//IL_0804: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Expected O, but got Unknown
			//IL_085c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_0869: Unknown result type (might be due to invalid IL or missing references)
			//IL_0884: Expected O, but got Unknown
			//IL_098f: 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_099c: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b7: Expected O, but got Unknown
			//IL_09b9: 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_09c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e1: Expected O, but got Unknown
			if (Plugin.configRecipesEnable.Value)
			{
				RecipeCreateStruct data = default(RecipeCreateStruct);
				data.RecipeName = "Aska+ Resin";
				data.Ingredients = new List<ItemInfoQuantity>(1)
				{
					new ItemInfoQuantity
					{
						quantity = 1,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_CrawlerSack"]
					}
				};
				data.BlueprintConditionsRules = new List<BlueprintConditionsRule>();
				data.BlueprintConditionsRules.Add(Plugin.Helpers.Dict_BCR["CaveEntranceL2_Rule"]);
				data.Quantity = 25;
				data.Result = Plugin.Helpers.itemInfoSO["Item_Wood_Resin"];
				data.Category = Plugin.Helpers.Dict_ICI["Categ_Blueprints_Materials"];
				data.Interaction = Plugin.Helpers.Dict_CI["VirtualCraftingStation"];
				data.ItemInfoListTargets = new List<string>(2) { "WorkshopBlueprints_T2", "WorkshopBlueprints_T1" };
				data.Description = "ASKA+ Found in fir trees";
				data.Lore = string.Empty;
				data.Name = "Resin";
				AddRecipe(data);
				RecipeCreateStruct data2 = default(RecipeCreateStruct);
				data2.RecipeName = "Aska+ Firewood";
				data2.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 1,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Wood_Sticks"]
					},
					new ItemInfoQuantity
					{
						quantity = 1,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Wood_Bark"]
					},
					new ItemInfoQuantity
					{
						quantity = 1,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Wood_Resin"]
					}
				}));
				data2.BlueprintConditionsRules = new List<BlueprintConditionsRule>();
				data2.BlueprintConditionsRules.Add(Plugin.Helpers.Dict_BCR["CarpenterL1_Rule"]);
				data2.Quantity = 1;
				data2.Result = Plugin.Helpers.itemInfoSO["Item_Wood_Firewood"];
				data2.Category = Plugin.Helpers.Dict_ICI["Categ_Blueprints_Materials"];
				data2.ItemInfoListTargets = new List<string>(2) { "WorkshopBlueprints_T2", "WorkshopBlueprints_T1" };
				data2.Description = "ASKA+ Found in Logs";
				data2.Lore = "General purpose fuel obtained by harvesting logs and removing tree stumps.";
				data2.Name = "Firewood";
				AddRecipe(data2);
				RecipeCreateStruct data3 = default(RecipeCreateStruct);
				data3.RecipeName = "Aska+ Compost 1";
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_BeetrootSeeds"]
					}
				}));
				data3.BlueprintConditionsRules = new List<BlueprintConditionsRule>();
				data3.BlueprintConditionsRules.Add(Plugin.Helpers.Dict_BCR["Farm_Rule"]);
				data3.Quantity = 1;
				data3.Result = Plugin.Helpers.itemInfoSO["Item_Junk_Compost"];
				data3.Category = Plugin.Helpers.Dict_ICI["Categ_Blueprints_Materials"];
				data3.ItemInfoListTargets = new List<string>(2) { "WorkshopBlueprints_T2", "WorkshopBlueprints_T1" };
				data3.Description = "ASKA+ It is just a junk, but pLants will love it";
				data3.Lore = "General purpose compost.";
				data3.Name = "Compost";
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_BerriesSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_CabbageSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_CarrotSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_FlaxSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_GarlicSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_OnionSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_ReedsSeeds"]
					}
				}));
				AddRecipe(data3);
				data3.Ingredients = new List<ItemInfoQuantity>(new <>z__ReadOnlyArray<ItemInfoQuantity>((ItemInfoQuantity[])(object)new ItemInfoQuantity[3]
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherScraps"]
					},
					new ItemInfoQuantity
					{
						quantity = 4,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Misc_BoneFragments"]
					},
					new ItemInfoQuantity
					{
						quantity = 10,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Seeds_SpruceSeeds"]
					}
				}));
				AddRecipe(data3);
				data = default(RecipeCreateStruct);
				data.RecipeName = "Aska+ Resin";
				data.Ingredients = new List<ItemInfoQuantity>(1)
				{
					new ItemInfoQuantity
					{
						quantity = 2,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Wood_Bark"]
					}
				};
				data.BlueprintConditionsRules = new List<BlueprintConditionsRule>();
				data.BlueprintConditionsRules.Add(Plugin.Helpers.Dict_BCR["WoodCutterL0_Rule"]);
				data.BlueprintConditionsRules.Add(Plugin.Helpers.Dict_BCR["WorkshopL0_Rule"]);
				data.Quantity = 1;
				data.Result = Plugin.Helpers.itemInfoSO["Item_Wood_Resin"];
				data.Category = Plugin.Helpers.Dict_ICI["Categ_Blueprints_Materials"];
				data.Interaction = Plugin.Helpers.Dict_CI["VirtualCraftingStation"];
				data.ItemInfoListTargets = new List<string>(3) { "WorkshopBlueprints_T2", "WorkshopBlueprints_T1", "WorkshopBlueprints_T0" };
				data.Description = "ASKA+ Found in fir trees";
				data.Lore = string.Empty;
				data.Name = "Resin";
				AddRecipe(data);
				RecipeCreateStruct data4 = default(RecipeCreateStruct);
				data4.RecipeName = "Aska+ Heavy pelt";
				data4.Ingredients = new List<ItemInfoQuantity>(2)
				{
					new ItemInfoQuantity
					{
						quantity = 3,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherPelt"]
					},
					new ItemInfoQuantity
					{
						quantity = 8,
						itemInfo = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherHide"]
					}
				};
				data4.BlueprintConditionsRules = new List<BlueprintConditionsRule>();
				data4.BlueprintConditionsRules.Add(Plugin.Helpers.Dict_BCR["LeatherWorkerL2_Rule"]);
				data4.Quantity = 1;
				data4.Result = Plugin.Helpers.itemInfoSO["Item_Materials_LeatherHeavyPelt"];
				data4.Category = Plugin.Helpers.Dict_ICI["Categ_Blueprints_Materials"];
				data4.Interaction = Plugin.Helpers.Dict_CI["LeatherworkerTableInteraction"];
				data4.ItemInfoListTargets = new List<string>(1) { "LeatherworkerBlueprints_T1" };
				data4.Description = "ASKA+ Heavy pelt from pelt and hide";
				data4.Lore = string.Empty;
				data4.Name = "Heavy pelt";
				AddRecipe(data4);
			}
		}

		internal static void AddRecipe(RecipeCreateStruct data)
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			CraftBlueprintInfo val = ScriptableObject.CreateInstance<CraftBlueprintInfo>();
			val.availableInTrialVersion = false;
			val.blueprintConditionsRules = data.BlueprintConditionsRules;
			val.craftVolume = 1f;
			((BlueprintInfo)val).quantity = data.Quantity;
			((ItemInfo)val).category = data.Category;
			((BlueprintInfo)val).parts = Il2CppReferenceArray<ItemInfoQuantity>.op_Implicit(data.Ingredients.ToArray());
			((BlueprintInfo)val).cost = new ItemInfoQuantity();
			((BlueprintInfo)val).result = data.Result;
			val.interaction = data.Interaction;
			((ItemInfo)val).icon = ((BlueprintInfo)val).result.icon;
			((ItemInfo)val).Localized = false;
			((ItemInfo)val).localizedDescription = data.Description;
			((ItemInfo)val).localizedLore = data.Lore;
			((ItemInfo)val).localizedName = data.Name;
			((ItemInfo)val).stackSize = 1;
			((ItemInfo)val).spawnHeight = 1f;
			((ItemInfo)val)._cachedComponents = new List<ItemInfo>();
			((ItemInfo)val)._cachedComponentsTable = new Dictionary<ItemInfo, ValueTuple<int, int>>();
			((ItemInfo)val).components = Il2CppReferenceArray<ItemInfoChance>.op_Implicit(Array.Empty<ItemInfoChance>());
			((ItemInfo)val).attributes = Il2CppReferenceArray<AttributeData>.op_Implicit(Array.Empty<AttributeData>());
			((ItemInfo)val).networkedInventoryAttributes = Il2CppReferenceArray<AttributeConfig>.op_Implicit(Array.Empty<AttributeConfig>());
			((ItemInfo)val).processes = Il2CppReferenceArray<ItemProcess>.op_Implicit(Array.Empty<ItemProcess>());
			((ItemInfo)val).unique = true;
			((Object)val).name = data.RecipeName;
			((ItemInfo)val).previewImage = ((BlueprintInfo)val).result.previewImage;
			((ItemInfo)val).storageClass = Plugin.Helpers.Dict_ISC["VirtualItem"];
			((ItemInfo)val).spawnObject = ((BlueprintInfo)val).result.spawnObject;
			((ItemInfo)val).id = ((Object)val).GetHashCode();
			foreach (string itemInfoListTarget in data.ItemInfoListTargets)
			{
				Plugin.Helpers.Dict_BlueprintsList[itemInfoListTarget].itemInfoList.Add((ItemInfo)(object)val);
			}
		}

		internal static void OnSettingsMenu(Transform parent)
		{
			Plugin.Helpers.CreateCategory(parent, "Recipes mod");
			Plugin.Helpers.CreateSwitch(parent, "*! Enable Aska+ recipes", Plugin.configRecipesEnable);
		}
	}
	[HarmonyPatch(typeof(ItemInfo))]
	internal class ItemInfoPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Configure")]
		public static void ItemInfoConfigurePreFix(ref ItemInfo __instance)
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_0306: 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_0281: Invalid comparison between Unknown and I4
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Invalid comparison between Unknown and I4
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Invalid comparison between Unknown and I4
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Invalid comparison between Unknown and I4
			if (Plugin.configSeedsDecayEnable.Value && ((Object)__instance).name.Contains("Seed") && Object.op_Implicit((Object)(object)((Il2CppObjectBase)__instance).TryCast<PlantableItemInfo>()))
			{
				PlantableItemInfo val = ((Il2CppObjectBase)__instance).Cast<PlantableItemInfo>();
				val.MaxOffseasonDays = val.TimeToGrow;
				AttributeData[] array = (from at in (IEnumerable<AttributeData>)((ItemInfo)val).attributes
					where at.attribute.attributeId == 1011
					select (at)).ToArray();
				bool flag = default(bool);
				if (array.Length != 1)
				{
					ManualLogSource log = Plugin.Log;
					BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(46, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Decay attribute (id 1011) not found at object ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)__instance).name);
					}
					log.LogError(val2);
					return;
				}
				ManualLogSource log2 = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(47, 3, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Trying to change decay rate of ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" from value ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(array[0].value);
					((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" to ");
					((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(0.07f);
				}
				log2.LogInfo(val3);
				array[0].value = 0.07f;
			}
			if (Plugin.configFoodEnable.Value && ((Object)__instance).name.Contains("_Food_") && Object.op_Implicit((Object)(object)((Il2CppObjectBase)__instance).TryCast<ConsumableInfo>()))
			{
				ConsumableInfo val4 = ((Il2CppObjectBase)__instance).Cast<ConsumableInfo>();
				int[] source = new int[6] { 10, 14, 15, 11, 12, 13 };
				Enumerator<StatusEffect> enumerator = val4.consumeEffects.GetEnumerator();
				while (enumerator.MoveNext())
				{
					StatusEffect current = enumerator.Current;
					if (!(current.duration > 0f))
					{
						continue;
					}
					StatusEffectModifierTable table = current.table;
					if (table == null || !(table.attrElements?.Count > 0))
					{
						continue;
					}
					Enumerator<AttributeElement> enumerator2 = current.table.attrElements.GetEnumerator();
					while (enumerator2.MoveNext())
					{
						AttributeElement current2 = enumerator2.Current;
						AttributeModifier modifier = current2.modifier;
						if (modifier == null || (int)modifier.Operation != 2)
						{
							AttributeModifier modifier2 = current2.modifier;
							if (modifier2 == null || (int)modifier2.Operation != 0)
							{
								continue;
							}
						}
						if (source.Contains(current2.targetAttribute.attributeId))
						{
							current.duration = 300f;
						}
					}
				}
				foreach (RandomModulatedStatusEffect item in (Il2CppArrayBase<RandomModulatedStatusEffect>)(object)val4.modulatedConsumeEffects)
				{
					if (item.normalizedRange.min != 0f)
					{
						continue;
					}
					foreach (StatusEffect item2 in (Il2CppArrayBase<StatusEffect>)(object)item.randomStatusEffects)
					{
						if (!(item2.duration > 0f))
						{
							continue;
						}
						StatusEffectModifierTable table2 = item2.table;
						if (table2 == null || table2.attrElements.Count <= 0)
						{
							continue;
						}
						Enumerator<AttributeElement> enumerator5 = item2.table.attrElements.GetEnumerator();
						while (enumerator5.MoveNext())
						{
							AttributeElement current5 = enumerator5.Current;
							AttributeModifier modifier3 = current5.modifier;
							if (modifier3 == null || (int)modifier3.Operation != 2)
							{
								AttributeModifier modifier4 = current5.modifier;
								if (modifier4 == null || (int)modifier4.Operation != 0)
								{
									continue;
								}
							}
							if (source.Contains(current5.targetAttribute.attributeId))
							{
								item2.duration = 300f;
							}
						}
					}
				}
			}
			if (!((Object)__instance).name.Contains("Item_Misc_CrawlerEgg"))
			{
				return;
			}
			foreach (ItemInfoChance item3 in (Il2CppArrayBase<ItemInfoChance>)(object)__instance.components)
			{
				if (item3.chance == 0.2f)
				{
					item3.chance = 0.4f;
				}
			}
		}

		public static void OnSettingsMenu(Transform parent)
		{
			Plugin.Helpers.CreateCategory(parent, "Seeds mod");
			Plugin.Helpers.CreateSwitch(parent, "* Increase decay rate of seeds.", Plugin.configSeedsDecayEnable);
			Plugin.Helpers.CreateCategory(parent, "Food mod");
			Plugin.Helpers.CreateSwitch(parent, "* Increase duration of food effects", Plugin.configFoodEnable);
			UnityAction val = UnityAction.op_Implicit((Action)delegate
			{
				Plugin.configGrassPaintKey.Value = (KeyCode)122;
			});
		}
	}
	[HarmonyPatch(typeof(Structure))]
	internal class Marks
	{
		[HarmonyPostfix]
		[HarmonyPatch("_Initialize")]
		public static void MarkPostFix(Structure __instance)
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Expected O, but got Unknown
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Expected O, but got Unknown
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Expected O, but got Unknown
			//IL_048b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Expected O, but got Unknown
			//IL_0580: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Expected O, but got Unknown
			if (!Plugin.configMarksEnable.Value)
			{
				return;
			}
			bool flag = default(bool);
			if (((Object)__instance).name.StartsWith("FoodHarvestMaker"))
			{
				float num = 60f;
				float num2 = num * Plugin.configMarks_FoodHarvestRange.Value;
				HarvestMarker componentInChildren = ((Component)__instance).gameObject.GetComponentInChildren<HarvestMarker>(true);
				NavMeshInterestArea component = ((Component)__instance).gameObject.GetComponent<NavMeshInterestArea>();
				StructureObjectiveMarker component2 = ((Component)__instance).gameObject.GetComponent<StructureObjectiveMarker>();
				if (componentInChildren != null)
				{
					componentInChildren.radius = num2;
				}
				if (component != null)
				{
					component.size = num2 * 1.2f;
				}
				if (component2 != null)
				{
					((WorldObjectiveMarker)component2).range = num2;
				}
				ManualLogSource log = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Marker ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" range changed to ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num2);
				}
				log.LogInfo(val);
			}
			else if (((Object)__instance).name.StartsWith("WoodHarvestMarker"))
			{
				float num3 = 60f;
				float num4 = num3 * Plugin.configMarks_WoodHarvestRange.Value;
				HarvestMarker componentInChildren2 = ((Component)__instance).gameObject.GetComponentInChildren<HarvestMarker>(true);
				NavMeshInterestArea component3 = ((Component)__instance).gameObject.GetComponent<NavMeshInterestArea>();
				StructureObjectiveMarker component4 = ((Component)__instance).gameObject.GetComponent<StructureObjectiveMarker>();
				if (componentInChildren2 != null)
				{
					componentInChildren2.radius = num4;
				}
				if (component3 != null)
				{
					component3.size = num4 * 1.2f;
				}
				if (component4 != null)
				{
					((WorldObjectiveMarker)component4).range = num4;
				}
				ManualLogSource log2 = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Marker ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" range changed to ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num4);
				}
				log2.LogInfo(val);
			}
			else if (((Object)__instance).name.StartsWith("HuntingMarker"))
			{
				float num5 = 75f;
				float num6 = num5 * Plugin.configMarks_HuntingRange.Value;
				HarvestMarker componentInChildren3 = ((Component)__instance).gameObject.GetComponentInChildren<HarvestMarker>(true);
				NavMeshInterestArea component5 = ((Component)__instance).gameObject.GetComponent<NavMeshInterestArea>();
				StructureObjectiveMarker component6 = ((Component)__instance).gameObject.GetComponent<StructureObjectiveMarker>();
				if (componentInChildren3 != null)
				{
					componentInChildren3.radius = num6;
				}
				if (component5 != null)
				{
					component5.size = num6 * 1.2f;
				}
				if (component6 != null)
				{
					((WorldObjectiveMarker)component6).range = num6;
				}
				ManualLogSource log3 = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Marker ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" range changed to ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num6);
				}
				log3.LogInfo(val);
			}
			else if (((Object)__instance).name.StartsWith("BuildingResourcesMarker"))
			{
				float num7 = 50f;
				float num8 = num7 * Plugin.configMarks_BuildingResourcesRange.Value;
				HarvestMarker componentInChildren4 = ((Component)__instance).gameObject.GetComponentInChildren<HarvestMarker>(true);
				NavMeshInterestArea component7 = ((Component)__instance).gameObject.GetComponent<NavMeshInterestArea>();
				StructureObjectiveMarker component8 = ((Component)__instance).gameObject.GetComponent<StructureObjectiveMarker>();
				if (componentInChildren4 != null)
				{
					componentInChildren4.radius = num8;
				}
				if (component7 != null)
				{
					component7.size = num8 * 1.2f;
				}
				if (component8 != null)
				{
					((WorldObjectiveMarker)component8).range = num8;
				}
				ManualLogSource log4 = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Marker ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" range changed to ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num8);
				}
				log4.LogInfo(val);
			}
			else if (((Object)__instance).name.StartsWith("StoneHarvestMarker"))
			{
				float num9 = 60f;
				float num10 = num9 * Plugin.configMarks_StoneHarvestRange.Value;
				HarvestMarker componentInChildren5 = ((Component)__instance).gameObject.GetComponentInChildren<HarvestMarker>(true);
				NavMeshInterestArea component9 = ((Component)__instance).gameObject.GetComponent<NavMeshInterestArea>();
				StructureObjectiveMarker component10 = ((Component)__instance).gameObject.GetComponent<StructureObjectiveMarker>();
				if (componentInChildren5 != null)
				{
					componentInChildren5.radius = num10;
				}
				if (component9 != null)
				{
					component9.size = num10 * 1.2f;
				}
				if (component10 != null)
				{
					((WorldObjectiveMarker)component10).range = num10;
				}
				ManualLogSource log5 = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Marker ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" range changed to ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num10);
				}
				log5.LogInfo(val);
			}
			else if (((Object)__instance).name.StartsWith("ForestryMarker"))
			{
				float num11 = 40f;
				float num12 = num11 * Plugin.configMarks_ForestryRange.Value;
				HarvestMarker componentInChildren6 = ((Component)__instance).gameObject.GetComponentInChildren<HarvestMarker>(true);
				NavMeshInterestArea component11 = ((Component)__instance).gameObject.GetComponent<NavMeshInterestArea>();
				StructureObjectiveMarker component12 = ((Component)__instance).gameObject.GetComponent<StructureObjectiveMarker>();
				if (componentInChildren6 != null)
				{
					componentInChildren6.radius = num12;
				}
				if (component11 != null)
				{
					component11.size = num12 * 1.2f;
				}
				if (component12 != null)
				{
					((WorldObjectiveMarker)component12).range = num12;
				}
				ManualLogSource log6 = Plugin.Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(25, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Marker ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)__instance).name);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" range changed to ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num12);
				}
				log6.LogInfo(val);
			}
		}

		public static void OnSettingsMenu(Transform parent)
		{
			Plugin.Helpers.CreateCategory(parent, "Markers mod");
			Plugin.Helpers.CreateSwitch(parent, "* Enable mod", Plugin.configMarksEnable);
			Plugin.Helpers.CreateSelectRange(parent, "* Food Harvest Range", Plugin.configMarks_FoodHarvestRange, new float[4] { 1f, 1.5f, 3f, 5f });
			Plugin.Helpers.CreateSelectRange(parent, "* Wood Harvest Range", Plugin.configMarks_WoodHarvestRange, new float[3] { 1f, 1.5f, 3f });
			Plugin.Helpers.CreateSelectRange(parent, "* Stone Harvest Range", Plugin.configMarks_StoneHarvestRange, new float[4] { 1f, 1.5f, 3f, 5f });
			Plugin.Helpers.CreateSelectRange(parent, "* Building Resources Range", Plugin.configMarks_BuildingResourcesRange, new float[4] { 1f, 1.5f, 3f, 5f });
			Plugin.Helpers.CreateSelectRange(parent, "* Hunting Range", Plugin.configMarks_HuntingRange, new float[4] { 1f, 1.5f, 3f, 5f });
			Plugin.Helpers.CreateSelectRange(parent, "* Forestry Range", Plugin.configMarks_ForestryRange, new float[3] { 1f, 1.5f, 3f });
		}
	}
	[HarmonyPatch(typeof(Character))]
	public static class CharacterPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("Spawned")]
		public static void Spawned(Character __instance)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if (__instance.IsPlayer() && ((NetworkBehaviour)__instance).GetLocalAuthorityMask() == 1)
			{
				Console.WriteLine("Player spawned");
				if (!((Object)(object)((Component)__instance).GetComponentInChildren<GrassTool>() != (Object)null))
				{
					Transform val = Extensions.CreateChild(((Component)__instance).gameObject.transform, "AskaPlusMODS");
					((Component)val).transform.localPosition = new Vector3(0f, 0f, 2f);
					((Component)val).gameObject.AddComponent<HeightmapTool>();
					GrassTool grassTool = ((Component)val).gameObject.AddComponent<GrassTool>();
					((Component)val).gameObject.AddComponent<PlayerBonusSpawn>();
					((Component)val).gameObject.SetActive(true);
				}
			}
		}

		public static void OnSettingsMenu(Transform parent)
		{
			Plugin.Helpers.CreateCategory(parent, "Grass painting");
			Plugin.Helpers.CreateSwitch(parent, "Enable Mod", Plugin.configGrassPaintEnable);
			Plugin.Helpers.CreateCategory(parent, "Bonus items");
			Plugin.Helpers.CreateSwitch(parent, "* Enable Mod", Plugin.configBonusSpawnEnable);
		}
	}
	internal class GrassTool : MonoBehaviour
	{
		private Vector3 position;

		private HeightmapTool HeightmapTool;

		private PlayerInteractionAgent PlayerInteractionAgent;

		private TerraformingToolOperation operation = (TerraformingToolOperation)3;

		private void Start()
		{
			PlayerInteractionAgent = ((Component)this).gameObject.GetComponentInParent<PlayerInteractionAgent>();
			HeightmapTool = ((Component)this).gameObject.GetComponent<HeightmapTool>();
		}

		private void Update()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.configGrassPaintEnable.Value && Input.GetKeyDown(Plugin.configGrassPaintKey.Value))
			{
				position = ((Component)this).gameObject.transform.position;
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(39, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Trying _UpdateTerraforming with radius ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(HeightmapTool.radius);
				}
				log.LogDebug(val);
				HeightmapTool.radius = 1f;
				HeightmapTool.clearVegetation = false;
				HeightmapTool.setTerrainType = true;
				HeightmapTool.terrainType = (TerrainType)0;
				HeightmapTool.Run(operation, position);
				HeightmapTool.PaintHere();
			}
		}
	}
	internal class PlayerBonusSpawn : MonoBehaviour
	{
		private PlayerInteractionAgent playerInteractionAgent;

		private AttributeManager attributeManager;

		public GameObject lastPickable;

		private void Update()
		{
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0463: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.configBonusSpawnEnable.Value)
			{
				return;
			}
			if (playerInteractionAgent == null)
			{
				Plugin.Log.LogError((object)"PlayerInteractionAgent is null");
			}
			Pickable favoritePickable = playerInteractionAgent._favoritePickable;
			if (favoritePickable == null)
			{
				return;
			}
			if (lastPickable == null)
			{
				Plugin.Log.LogInfo((object)"Last pickable was null. Trying to get game object");
				lastPickable = ((favoritePickable != null) ? ((Component)favoritePickable).gameObject : null);
			}
			if ((Object)(object)((favoritePickable != null) ? ((Component)favoritePickable).gameObject : null) == (Object)(object)lastPickable)
			{
				return;
			}
			lastPickable = ((favoritePickable != null) ? ((Component)favoritePickable).gameObject : null);
			if (lastPickable != null)
			{
				ManualLogSource log = Plugin.Log;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Target changed to ");
					GameObject obj = lastPickable;
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>((obj != null) ? ((Object)obj).name : null);
				}
				log.LogInfo(val);
				GameObject obj2 = lastPickable;
				switch ((obj2 != null) ? ((Object)obj2).name : null)
				{
				case "Harvest_Stone4":
				case "Harvest_StoneClumpSmall":
					TryAddBonusSpawner(lastPickable, Plugin.Helpers.AskaAttributesEnum.StoneHarvest, (ItemInfo)(object)Plugin.Helpers.resourceInfoSO["Item_Stone_Raw"], Vector3.zero, 1, AmountIsFix: true, RunOnFullyHarvested: true);
					break;
				case "Item_Wood_birch1":
				case "Item_Wood_birch2":
					TryAddBonusSpawner(lastPickable, Plugin.Helpers.AskaAttributesEnum.WoodHarvest, (ItemInfo)(object)Plugin.Helpers.resourceInfoSO["Item_Wood_HardWoodLog"], Vector3.zero, 1, AmountIsFix: true, RunOnFullyHarvested: true);
					break;
				case "Item_Wood_Willow":
					TryAddBonusSpawner(lastPickable, Plugin.Helpers.AskaAttributesEnum.WoodHarvest, (ItemInfo)(object)Plugin.Helpers.resourceInfoSO["Item_Wood_HardWoodLog"], Vector3.zero, 2, AmountIsFix: false, RunOnFullyHarvested: true);
					break;
				case "Item_Wood_Fir1":
				case "Item_Wood_Fir2":
				case "Item_Wood_Fir3":
				case "Item_Wood_Fir4":
				case "Item_Wood_Fir5":
					TryAddBonusSpawner(lastPickable, Plugin.Helpers.AskaAttributesEnum.WoodHarvest, (ItemInfo)(object)Plugin.Helpers.resourceInfoSO["Item_Wood_RawLog"], Vector3.zero, 1, AmountIsFix: true, RunOnFullyHarvested: true);
					break;
				case "Harvest_JotunBlood":
					break;
				case "Harvest_JotunBloodSmall":
					break;
				case "Item_Misc_CrawlerEgg1":
					break;
				case "Item_Misc_CrawlerEgg2":
					break;
				case "Item_Misc_CrawlerEgg3":
					break;
				case "Item_Misc_CrawlerEgg4":
					break;
				}
			}
		}

		private void TryAddBonusSpawner(GameObject WhereToLook, Plugin.Helpers.AskaAttributesEnum skill, ItemInfo whatToSpawn, Vector3 offsetOfSpawn, int HowMuchToAdd, bool AmountIsFix, bool RunOnFullyHarvested)
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Expected O, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Expected O, but got Unknown
			//IL_0292: 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)
			AskaPlusSpawner askaPlusSpawner = default(AskaPlusSpawner);
			if (WhereToLook.TryGetComponent<AskaPlusSpawner>(ref askaPlusSpawner))
			{
				return;
			}
			askaPlusSpawner = WhereToLook.AddComponent<AskaPlusSpawner>();
			HarvestInteraction componentInChildren = lastPickable.GetComponentInChildren<HarvestInteraction>();
			float value = ((Property)attributeManager.GetAttribute((int)skill)).GetValue();
			float num = Random.value * 75f;
			bool flag = default(bool);
			BepInExMessageLogInterpolatedStringHandler val;
			if (num <= value)
			{
				((SubcomponentSpawner)askaPlusSpawner).amount = HowMuchToAdd;
				ManualLogSource log = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(38, 5, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RND ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" <= (");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Plugin.Helpers.AskaAttributesEnum>(skill);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(value);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" = Spawning additional ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(HowMuchToAdd);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" of ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)whatToSpawn).name);
				}
				log.LogMessage(val);
			}
			else if (!AmountIsFix)
			{
				((SubcomponentSpawner)askaPlusSpawner).amount = Mathf.CeilToInt((100f - (num - value)) / 100f * (float)HowMuchToAdd);
				ManualLogSource log2 = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(48, 6, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("RND ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" > (");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Plugin.Helpers.AskaAttributesEnum>(skill);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(") ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(value);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" = Diff is ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num - value);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" = Spawning additional ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(((SubcomponentSpawner)askaPlusSpawner).amount);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" of ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)whatToSpawn).name);
				}
				log2.LogMessage(val);
			}
			else
			{
				ManualLogSource log3 = Plugin.Log;
				val = new BepInExMessageLogInterpolatedStringHandler(24, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("No luck this time with ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Plugin.Helpers.AskaAttributesEnum>(skill);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(".");
				}
				log3.LogMessage(val);
				((SubcomponentSpawner)askaPlusSpawner).amount = 0;
			}
			if (RunOnFullyHarvested)
			{
				askaPlusSpawner.UseFullyHarvested = true;
			}
			ManualLogSource log4 = Plugin.Log;
			val = new BepInExMessageLogInterpolatedStringHandler(42, 0, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Adding harvestInteraction to bonusSpawner.");
			}
			log4.LogMessage(val);
			((SubcomponentSpawner)askaPlusSpawner).positionNoise = 0.5f;
			((SubcomponentSpawner)askaPlusSpawner).rotationNoise = 0.2f;
			((SubcomponentSpawner)askaPlusSpawner).spacing = new Vector3(2f, 0f, 0f);
			askaPlusSpawner.harvestInteraction = componentInChildren;
			((SubcomponentSpawner)askaPlusSpawner).componentInfo = whatToSpawn;
			((SubcomponentSpawner)askaPlusSpawner).ignoreMasterItem = true;
			((SubcomponentSpawner)askaPlusSpawner).originOffset = offsetOfSpawn;
		}

		private void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ManualLogSource log = Plugin.Log;
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(33, 0, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("PlayerCharacter bonus spawn awake");
			}
			log.LogDebug(val);
			playerInteractionAgent = ((Component)this).gameObject.GetComponentInParent<PlayerInteractionAgent>();
			attributeManager = ((Component)this).gameObject.GetComponentInParent<AttributeManager>();
		}
	}
	[BepInPlugin("askaplus.bepinex.mod", "Aska Plus", "0.5.1")]
	public class Plugin : BasePlugin
	{
		internal static class Helpers
		{
			public enum AskaAttributesEnum
			{
				WoodHarvest = 300,
				StoneHarvest = 301,
				Skinning = 307
			}

			public static Color greenColor = new Color(0f, 0.5f, 0f, 1f);

			public static Color backGroundColor = new Color(0f, 0f, 0f, 0.8f);

			public static Color SelectedOpt = new Color(1f, 0.6824f, 0f);

			public static Color UnselectedOpt = new Color(1f, 1f, 1f);

			public static readonly Vector2 HalfHalf = new Vector2(0.5f, 0.5f);

			public static Dictionary<string, AssetBundle> loadedAssetBundles = new Dictionary<string, AssetBundle>();

			public static Dictionary<string, ResourceInfo> resourceInfoSO = new Dictionary<string, ResourceInfo>();

			public static Dictionary<string, ItemInfo> itemInfoSO = new Dictionary<string, ItemInfo>();

			public static Dictionary<string, BlueprintConditionsRule> Dict_BCR = new Dictionary<string, BlueprintConditionsRule>();

			public static Dictionary<string, ItemStorageClass> Dict_ISC = new Dictionary<string, ItemStorageClass>();

			public static Dictionary<string, ItemCategoryInfo> Dict_ICI = new Dictionary<string, ItemCategoryInfo>();

			public static Dictionary<string, CraftInteraction> Dict_CI = new Dictionary<string, CraftInteraction>();

			public static Dictionary<string, ItemInfoList> Dict_BlueprintsList = new Dictionary<string, ItemInfoList>();

			internal static Transform FindChildByNameCaseInsensitive(Transform parent, string name)
			{
				IEnumerator enumerator = parent.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						Object current = enumerator.Current;
						Transform val = ((Il2CppObjectBase)current).TryCast<Transform>();
						if (string.Equals(((Object)val).name, name, StringComparison.OrdinalIgnoreCase))
						{
							return val;
						}
						Transform val2 = FindChildByNameCaseInsensitive(val, name);
						if ((Object)(object)val2 != (Object)null)
						{
							return val2;
						}
					}
				}
				finally
				{
					if (enumerator is IDisposable disposable)
					{
						disposable.Dispose();
					}
				}
				return null;
			}

			internal static Object LoadAssetBundle(string assetBundleFileName, string prefabName, bool dontDestroyOnLoad = true)
			{
				ResourceManager resourceManager = Resources.ResourceManager;
				AssetBundle val;
				if (loadedAssetBundles.ContainsKey(assetBundleFileName))
				{
					val = loadedAssetBundles[assetBundleFileName];
					Debug.Log(Object.op_Implicit("AssetBundle is already loaded."));
				}
				else
				{
					val = AssetBundle.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit((byte[])resourceManager.GetObject(assetBundleFileName)));
					if ((Object)(object)val == (Object)null)
					{
						Log.LogError((object)"Failed to load AssetBundle!");
						return null;
					}
					loadedAssetBundles[assetBundleFileName] = val;
				}
				return val.LoadAsset(prefabName);
			}

			internal static Sprite GetSpriteFromTexture2D(Texture2D texture2D)
			{
				//IL_0044: 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)
				if (!Object.op_Implicit((Object)(object)texture2D))
				{
					return null;
				}
				Rect val = default(Rect);
				((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture2D).width, (float)((Texture)texture2D).height);
				Vector2 val2 = default(Vector2);
				((Vector2)(ref val2))..ctor(0.5f, 0.5f);
				return Sprite.Create(texture2D, val, val2);
			}

			internal static void CreateSwitch(Transform parent, string text, ConfigEntry<bool> configEntry)
			{
				//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_016f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0168: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_019c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_0219: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Object.Instantiate<GameObject>(SettingsMenuPatch.Toggle, parent);
				((TMP_Text)((Component)val.transform.GetChild(7)).GetComponent<TextMeshProUGUI>()).text = text;
				((Component)val.transform.GetChild(8)).gameObject.SetActive(true);
				GameObject imgA = ((Component)val.transform.GetChild(8).GetChild(0)).gameObject;
				GameObject imgB = Object.Instantiate<GameObject>(imgA, imgA.transform.parent);
				imgA.SetActive(true);
				imgB.SetActive(true);
				Object.DestroyImmediate((Object)(object)((Component)val.transform.GetChild(7)).GetComponent<LocalizedText>());
				ColorBlock colors = ((Selectable)((Component)val.transform.GetChild(6)).GetComponent<Button>()).colors;
				Object.DestroyImmediate((Object)(object)((Component)val.transform.GetChild(6)).GetComponent<Button>());
				Object.DestroyImmediate((Object)(object)((Component)val.transform.GetChild(5)).GetComponent<Button>());
				Object.DestroyImmediate((Object)(object)val.GetComponent<IncreaseDecreasePanel>());
				TextMeshProUGUI valu = ((Component)val.transform.GetChild(4)).GetComponent<TextMeshProUGUI>();
				((TMP_Text)valu).text = (configEntry.Value ? "On" : "Off");
				((Graphic)imgA.GetComponent<Image>()).color = ((((TMP_Text)valu).text == "Off") ? SelectedOpt : UnselectedOpt);
				((Graphic)imgB.GetComponent<Image>()).color = ((((TMP_Text)valu).text == "Off") ? UnselectedOpt : SelectedOpt);
				Button val2 = ((Component)val.transform.GetChild(5)).gameObject.AddComponent<Button>();
				Button val3 = ((Component)val.transform.GetChild(6)).gameObject.AddComponent<Button>();
				((Selectable)val2).targetGraphic = (Graphic)(object)((Component)((Component)val2).transform.GetChild(0)).GetComponent<Image>();
				((Selectable)val3).targetGraphic = (Graphic)(object)((Component)((Component)val3).transform.GetChild(0)).GetComponent<Image>();
				((Selectable)val2).colors = colors;
				((Selectable)val3).colors = colors;
				UnityAction val4 = UnityAction.op_Implicit((Action)delegate
				{
					//IL_007a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0073: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
					((TMP_Text)valu).text = ((((TMP_Text)valu).text == "Off") ? "On" : "Off");
					configEntry.Value = ((TMP_Text)valu).text == "On";
					((Graphic)imgA.GetComponent<Image>()).color = ((((TMP_Text)valu).text == "Off") ? SelectedOpt : UnselectedOpt);
					((Graphic)imgB.GetComponent<Image>()).color = ((((TMP_Text)valu).text == "Off") ? UnselectedOpt : SelectedOpt);
				});
				((UnityEvent)val2.onClick).AddListener(val4);
				((UnityEvent)val3.onClick).AddListener(val4);
			}

			internal static void CreateSelectRange(Transform parent, string text, ConfigEntry<float> configEntry, float[] ranges)
			{
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0266: Unknown result type (might be due to invalid IL or missing references)
				//IL_026b: Unknown result type (might be due to invalid IL or missing references)
				//IL_031e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0326: Unknown result type (might be due to invalid IL or missing references)
				//IL_01de: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_020d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0206: Unknown result type (might be due to invalid IL or missing references)
				GameObject button = Object.Instantiate<GameObject>(SettingsMenuPatch.SelectRange, parent);
				((TMP_Text)((Component)button.transform.GetChild(7)).GetComponent<TextMeshProUGUI>()).text = text;
				((Component)button.transform.GetChild(8)).gameObject.SetActive(true);
				ManualLogSource log = Log;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(34, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Item has this amount of childrens ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(button.transform.GetChild(8).childCount);
				}
				log.LogInfo(val);
				TextMeshProUGUI valu = ((Component)button.transform.GetChild(4)).GetComponent<TextMeshProUGUI>();
				float value = configEntry.Value;
				float num = value;
				if (num != 1f)
				{
					if (num != 1.5f)
					{
						if (num != 3f)
						{
							if (num == 5f)
							{
								((TMP_Text)valu).text = "Huge";
							}
							else
							{
								((TMP_Text)valu).text = "Default";
								configEntry.Value = 1f;
							}
						}
						else
						{
							((TMP_Text)valu).text = "Big";
						}
					}
					else
					{
						((TMP_Text)valu).text = "Extended";
					}
				}
				else
				{
					((TMP_Text)valu).text = "Default";
				}
				Log.LogInfo((object)"Creating images");
				for (int i = 1; i < ranges.Length; i++)
				{
					GameObject gameObject = ((Component)button.transform.GetChild(8).GetChild(0)).gameObject;
					GameObject val2 = Object.Instantiate<GameObject>(gameObject, gameObject.transform.parent);
					((Graphic)gameObject.GetComponent<Image>()).color = ((configEntry.Value == ranges[0]) ? SelectedOpt : UnselectedOpt);
					((Graphic)val2.GetComponent<Image>()).color = ((configEntry.Value == ranges[i]) ? SelectedOpt : UnselectedOpt);
				}
				Object.DestroyImmediate((Object)(object)((Component)button.transform.GetChild(7)).GetComponent<LocalizedText>());
				ColorBlock colors = ((Selectable)((Component)button.transform.GetChild(6)).GetComponent<Button>()).colors;
				Object.DestroyImmediate((Object)(object)((Component)button.transform.GetChild(6)).GetComponent<Button>());
				Object.DestroyImmediate((Object)(object)((Component)button.transform.GetChild(5)).GetComponent<Button>());
				Object.DestroyImmediate((Object)(object)button.GetComponent<IncreaseDecreasePanel>());
				Button val3 = ((Component)button.transform.GetChild(5)).gameObject.AddComponent<Button>();
				Button val4 = ((Component)button.transform.GetChild(6)).gameObject.AddComponent<Button>();
				((Selectable)val3).targetGraphic = (Graphic)(object)((Component)((Component)val3).transform.GetChild(0)).GetComponent<Image>();
				((Selectable)val4).targetGraphic = (Graphic)(object)((Component)((Component)val4).transform.GetChild(0)).GetComponent<Image>();
				((Selectable)val3).colors = colors;
				((Selectable)val4).colors = colors;
				UnityAction val5 = UnityAction.op_Implicit((Action)delegate
				{
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
					//IL_0120: Unknown result type (might be due to invalid IL or missing references)
					//IL_0184: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
					float value3 = configEntry.Value;
					float num3 = value3;
					if (num3 != 1f)
					{
						if (num3 != 1.5f)
						{
							if (num3 == 3f && ranges.Length != 3)
							{
								((TMP_Text)valu).text = "Huge";
								configEntry.Value = 5f;
								((Graphic)((Component)button.transform.GetChild(8).GetChild(2)).gameObject.GetComponent<Image>()).color = UnselectedOpt;
								((Graphic)((Component)button.transform.GetChild(8).GetChild(3)).gameObject.GetComponent<Image>()).color = SelectedOpt;
							}
						}
						else
						{
							((TMP_Text)valu).text = "Big";
							configEntry.Value = 3f;
							((Graphic)((Component)button.transform.GetChild(8).GetChild(1)).gameObject.GetComponent<Image>()).color = UnselectedOpt;
							((Graphic)((Component)button.transform.GetChild(8).GetChild(2)).gameObject.GetComponent<Image>()).color = SelectedOpt;
						}
					}
					else
					{
						((TMP_Text)valu).text = "Extended";
						configEntry.Value = 1.5f;
						((Graphic)((Component)button.transform.GetChild(8).GetChild(0)).gameObject.GetComponent<Image>()).color = UnselectedOpt;
						((Graphic)((Component)button.transform.GetChild(8).GetChild(1)).gameObject.GetComponent<Image>()).color = SelectedOpt;
					}
				});
				UnityAction val6 = UnityAction.op_Implicit((Action)delegate
				{
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
					//IL_0120: Unknown result type (might be due to invalid IL or missing references)
					//IL_0170: Unknown result type (might be due to invalid IL or missing references)
					//IL_019c: Unknown result type (might be due to invalid IL or missing references)
					float value2 = configEntry.Value;
					float num2 = value2;
					if (num2 != 5f)
					{
						if (num2 != 3f)
						{
							if (num2 == 1.5f)
							{
								((TMP_Text)valu).text = "Default";
								configEntry.Value = 1f;
								((Graphic)((Component)button.transform.GetChild(8).GetChild(1)).gameObject.GetComponent<Image>()).color = UnselectedOpt;
								((Graphic)((Component)button.transform.GetChild(8).GetChild(0)).gameObject.GetComponent<Image>()).color = SelectedOpt;
							}
						}
						else
						{
							((TMP_Text)valu).text = "Extended";
							configEntry.Value = 1.5f;
							((Graphic)((Component)button.transform.GetChild(8).GetChild(2)).gameObject.GetComponent<Image>()).color = UnselectedOpt;
							((Graphic)((Component)button.transform.GetChild(8).GetChild(1)).gameObject.GetComponent<Image>()).color = SelectedOpt;
						}
					}
					else
					{
						((TMP_Text)valu).text = "Big";
						configEntry.Value = 3f;
						((Graphic)((Component)button.transform.GetChild(8).GetChild(3)).gameObject.GetComponent<Image>()).color = UnselectedOpt;
						((Graphic)((Component)button.transform.GetChild(8).GetChild(2)).gameObject.GetComponent<Image>()).color = SelectedOpt;
					}
				});
				((UnityEvent)val4.onClick).AddListener(val6);
				((UnityEvent)val3.onClick).AddListener(val5);
			}

			internal static void CreateCategory(Transform parent, string text)
			{
				GameObject label = SettingsMenuPatch.Label;
				GameObject val = Object.Instantiate<GameObject>(label, parent);
				((TMP_Text)((Component)val.transform.GetChild(0)).GetComponent<TextMeshProUGUI>()).text = text;
				Object.DestroyImmediate((Object)(object)((Component)val.transform.GetChild(0)).GetComponent<LocalizedText>());
			}

			internal static void CreateItemsGoogleSheet()
			{
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Expected O, but got Unknown
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Expected O, but got Unknown
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Expected O, but got Unknown
				//IL_0157: Unknown result type (might be due to invalid IL or missing references)
				//IL_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Expected O, but got Unknown
				//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f4: Expected O, but got Unknown
				//IL_0311: Unknown result type (might be due to invalid IL or missing references)
				//IL_0420: Unknown result type (might be due to invalid IL or missing references)
				//IL_0427: Expected O, but got Unknown
				//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_05df: Expected O, but got Unknown
				//IL_0444: Unknown result type (might be due to invalid IL or missing references)
				//IL_0605: Unknown result type (might be due to invalid IL or missing references)
				//IL_0626: Unknown result type (might be due to invalid IL or missing references)
				//IL_06af: Unknown result type (might be due to invalid IL or missing references)
				//IL_0743: Unknown result type (might be due to invalid IL or missing references)
				//IL_074a: Expected O, but got Unknown
				//IL_0770: Unknown result type (might be due to invalid IL or missing references)
				//IL_0791: Unknown result type (might be due to invalid IL or missing references)
				//IL_081a: Unknown result type (might be due to invalid IL or missing references)
				Log.LogMessage((object)"CONSUMABLES");
				bool flag = default(bool);
				foreach (ResourceInfo value in resourceInfoSO.Values)
				{
					if (!((Object)value).name.StartsWith("Item_Food") || !Object.op_Implicit((Object)(object)((Il2CppObjectBase)value).TryCast<ConsumableInfo>()))
					{
						continue;
					}
					ConsumableInfo val = ((Il2CppObjectBase)value).Cast<ConsumableInfo>();
					ManualLogSource log = Log;
					BepInExMessageLogInterpolatedStringHandler val2 = new BepInExMessageLogInterpolatedStringHandler(12, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)val).name);
						((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" is type of ");
						((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((object)val).GetType().Name);
					}
					log.LogMessage(val2);
					ManualLogSource log2 = Log;
					BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(13, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)value).name);
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" has ");
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(((Il2CppArrayBase<RandomModulatedStatusEffect>)(object)val.modulatedConsumeEffects).Length);
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" effects");
					}
					log2.LogInfo(val3);
					foreach (RandomModulatedStatusEffect item in (Il2CppArrayBase<RandomModulatedStatusEffect>)(object)val.modulatedConsumeEffects)
					{
						ManualLogSource log3 = Log;
						val3 = new BepInExInfoLogInterpolatedStringHandler(22, 3, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("from ");
							((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item.normalizedRange.min);
							((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" to ");
							((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item.normalizedRange.max);
							((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" has ");
							((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(((Il2CppArrayBase<StatusEffect>)(object)item.randomStatusEffects).Length);
							((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" effects");
						}
						log3.LogInfo(val3);
						foreach (StatusEffect item2 in (Il2CppArrayBase<StatusEffect>)(object)item.randomStatusEffects)
						{
							ManualLogSource log4 = Log;
							val3 = new BepInExInfoLogInterpolatedStringHandler(88, 5, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("duration ");
								((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item2.duration);
								((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" with effect ");
								((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)item2.table.effectType).name);
								((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("(");
								((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(item2.table.dialogueAdded);
								((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(") which modify ");
								((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(item2.table.vattrElements.Count);
								((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" vital attributes and modify ");
								((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(item2.table.attrElements.Count);
								((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" character attributes");
							}
							log4.LogInfo(val3);
							Enumerator<VariableAttributeElement> enumerator4 = item2.table.vattrElements.GetEnumerator();
							while (enumerator4.MoveNext())
							{
								VariableAttributeElement current4 = enumerator4.Current;
								ManualLogSource log5 = Log;
								val3 = new BepInExInfoLogInterpolatedStringHandler(65, 6, ref flag);
								if (flag)
								{
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("VITAL ATTRIBUTE: ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<VariableModifierProcessMode>(current4.modifier.mode);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" effect give ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(current4.modifier.value);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" of attribute ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)current4.targetAttribute).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("/");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(current4.targetAttribute.localizedName);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" (attribid: ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(current4.targetAttribute.attributeId);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(", type ");
									BepInExInfoLogInterpolatedStringHandler obj = val3;
									AttributeType attributeType = current4.targetAttribute.attributeType;
									((BepInExLogInterpolatedStringHandler)obj).AppendFormatted<string>((attributeType != null) ? ((Object)attributeType).name : null);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")");
								}
								log5.LogInfo(val3);
							}
							Enumerator<AttributeElement> enumerator5 = item2.table.attrElements.GetEnumerator();
							while (enumerator5.MoveNext())
							{
								AttributeElement current5 = enumerator5.Current;
								ManualLogSource log6 = Log;
								val3 = new BepInExInfoLogInterpolatedStringHandler(69, 6, ref flag);
								if (flag)
								{
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("CHARACTER ATTRIBUTE: ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<ModifierOperation>(current5.modifier.Operation);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" effect give ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(current5.modifier.Value);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" of attribute ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)current5.targetAttribute).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("/");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(current5.targetAttribute.localizedName);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" (attribid: ");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(current5.targetAttribute.attributeId);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(", type ");
									BepInExInfoLogInterpolatedStringHandler obj2 = val3;
									AttributeType attributeType2 = current5.targetAttribute.attributeType;
									((BepInExLogInterpolatedStringHandler)obj2).AppendFormatted<string>((attributeType2 != null) ? ((Object)attributeType2).name : null);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")");
								}
								log6.LogInfo(val3);
							}
						}
					}
					Log.LogMessage((object)"EXPORT strings:");
					foreach (RandomModulatedStatusEffect item3 in (Il2CppArrayBase<RandomModulatedStatusEffect>)(object)val.modulatedConsumeEffects)
					{
						foreach (StatusEffect item4 in (Il2CppArrayBase<StatusEffect>)(object)item3.randomStatusEffects)
						{
							Enumerator<VariableAttributeElement> enumerator8 = item4.table.vattrElements.GetEnumerator();
							while (enumerator8.MoveNext())
							{
								VariableAttributeElement current8 = enumerator8.Current;
								ManualLogSource log7 = Log;
								val3 = new BepInExInfoLogInterpolatedStringHandler(9, 9, ref flag);
								if (flag)
								{
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)value).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item3.normalizedRange.min);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item3.normalizedRange.max);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)item4.table.effectType).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("(");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(item4.table.dialogueAdded);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(");");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item4.duration);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<VariableModifierProcessMode>(current8.modifier.mode);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)current8.targetAttribute).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(current8.modifier.value);
								}
								log7.LogInfo(val3);
							}
							Enumerator<AttributeElement> enumerator9 = item4.table.attrElements.GetEnumerator();
							while (enumerator9.MoveNext())
							{
								AttributeElement current9 = enumerator9.Current;
								ManualLogSource log8 = Log;
								val3 = new BepInExInfoLogInterpolatedStringHandler(9, 9, ref flag);
								if (flag)
								{
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)value).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item3.normalizedRange.min);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item3.normalizedRange.max);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)item4.table.effectType).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("(");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(item4.table.dialogueAdded);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(");");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(item4.duration);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<ModifierOperation>(current9.modifier.Operation);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)current9.targetAttribute).name);
									((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(";");
									((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(current9.modifier.Value);
								}
								log8.LogInfo(val3);
							}
						}
					}
				}
			}

			internal static void ResourceInfos()
			{
				Il2CppReferenceArray<Object> val = Resources.LoadAll("", Type.GetType("SSSGame.ResourceInfo, Assembly-CSharp"));
				Il2CppArrayBase<ItemInfo> val2 = Resources.FindObjectsOfTypeAll<ItemInfo>();
				foreach (ItemInfo item in val2)
				{
					if (!itemInfoSO.ContainsKey(((Object)item).name))
					{
						itemInfoSO.Add(((Object)item).name, item);
					}
				}
				resourceInfoSO = ((IEnumerable<ResourceInfo>)Resources.FindObjectsOfTypeAll<ResourceInfo>()).ToDictionary((ResourceInfo name) => ((Object)name).name, (ResourceInfo ri) => ri);
				Dict_BlueprintsList = ((IEnumerable<ItemInfoList>)Resources.FindObjectsOfTypeAll<ItemInfoList>()).ToDictionary((ItemInfoList name) => ((Object)name).name, (ItemInfoList i) => i);
				Log.LogMessage((object)"-----BlueprintsConditionRule-----");
				Dict_BCR = ((IEnumerable<BlueprintConditionsRule>)Resources.FindObjectsOfTypeAll<BlueprintConditionsRule>()).ToDictionary((BlueprintConditionsRule name) => ((Object)name).name, (BlueprintConditionsRule bcr) => bcr);
				Log.LogMessage((object)"-----ItemStorageClass-----");
				Dict_ISC = ((IEnumerable<ItemStorageClass>)Resources.FindObjectsOfTypeAll<ItemStorageClass>()).ToDictionary((ItemStorageClass name) => ((Object)name).name, (ItemStorageClass bcr) => bcr);
				Log.LogMessage((object)"-----ItemInfoCategory-----");
				Dict_ICI = ((IEnumerable<ItemCategoryInfo>)Resources.FindObjectsOfTypeAll<ItemCategoryInfo>()).ToDictionary((ItemCategoryInfo name) => ((Object)name).name, (ItemCategoryInfo bcr) => bcr);
				Log.LogMessage((object)"-----CraftInteractions-----");
				Il2CppArrayBase<CraftInteraction> val3 = Resources.FindObjectsOfTypeAll<CraftInteraction>();
				Dict_CI = new Dictionary<string, CraftInteraction>();
				foreach (CraftInteraction item2 in val3)
				{
					if (!Dict_CI.ContainsKey(((Object)item2).name))
					{
						Dict_CI.Add(((Object)item2).name, item2);
					}
				}
			}
		}

		internal static ManualLogSource Log;

		internal static ConfigEntry<bool> configGrassPaintEnable;

		internal static ConfigEntry<KeyCode> configGrassPaintKey;

		internal static ConfigEntry<bool> configSpikesSelfDamageEnable;

		internal static ConfigEntry<bool> configBonusSpawnEnable;

		internal static ConfigEntry<bool> configTorchesBuildingEnable;

		internal static ConfigEntry<bool> configTorchesBuildingShadowsEnable;

		internal static ConfigEntry<bool> configSeedsDecayEnable;

		internal static ConfigEntry<bool> configFoodEnable;

		internal static ConfigEntry<bool> configRecipesEnable;

		internal static ConfigEntry<bool> configTorchesLightExtended;

		internal static ConfigEntry<bool> configMarksEnable;

		internal static ConfigEntry<float> configMarks_FoodHarvestRange;

		internal static ConfigEntry<float> configMarks_WoodHarvestRange;

		internal static ConfigEntry<float> configMarks_ForestryRange;

		internal static ConfigEntry<float> configMarks_StoneHarvestRange;

		internal static ConfigEntry<float> configMarks_HuntingRange;

		internal static ConfigEntry<float> configMarks_BuildingResourcesRange;

		public override void Load()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			Log = ((BasePlugin)this).Log;
			ManualLogSource log = Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("askaplus.bepinex.mod");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
			}
			log.LogInfo(val);
			configGrassPaintEnable = ((BasePlugin)this).Config.Bind<bool>("GrassPaintig", "Enable mod", true, "Enable or disable mod");
			configGrassPaintKey = ((BasePlugin)this).Config.Bind<KeyCode>("GrassPainting", "KeyCode", (KeyCode)93, "Key to paint grass");
			configSpikesSelfDamageEnable = ((BasePlugin)this).Config.Bind<bool>("Spikes selfdamage", "Enable mod", true, "Enable or disable mod");
			configBonusSpawnEnable = ((BasePlugin)this).Config.Bind<bool>("Bonus spawn", "Enable mod", true, "Enable or disable mod");
			configTorchesBuildingEnable = ((BasePlugin)this).Config.Bind<bool>("Torches to buildings", "Enable mod", true, "Enable or disable mod");
			configTorchesBuildingShadowsEnable = ((BasePlugin)this).Config.Bind<bool>("Torches to buildings", "Enable shadows", true, "If torches should cast shadows. False can improve performance.");
			configSeedsDecayEnable = ((BasePlugin)this).Config.Bind<bool>("Seeds mod", "Enable mod", true, "If seeds decay rate should be increased to get rid of a seeds mess on floor.");
			configFoodEnable = ((BasePlugin)this).Config.Bind<bool>("Food mod", "Increase duration of food buff", true, "If foods duration effect should be increased to 5 minutes");
			configRecipesEnable = ((BasePlugin)this).Config.Bind<bool>("Recipes mod", "Add custom recipes", true, "Add custom recipes to some stations");
			configTorchesLightExtended = ((BasePlugin)this).Config.Bind<bool>("Torches to buildings", "Extended visibility range", false, "Light visibility distance. Default 60m, extended 200m");
			configMarksEnable = ((BasePlugin)this).Config.Bind<bool>("Marks", "Enable mod", true, "Enable or disable mod");
			configMarks_WoodHarvestRange = ((BasePlugin)this).Config.Bind<float>("Marks", "Wood Harvest Distance", 2.5f, "Distance multiplikator");
			configMarks_StoneHarvestRange = ((BasePlugin)this).Config.Bind<float>("Marks", "Stone Harvest Distance", 2.5f, "Distance multiplikator");
			configMarks_FoodHarvestRange = ((BasePlugin)this).Config.Bind<float>("Marks", "Food Harvest Distance", 2.5f, "Distance multiplikator");
			configMarks_HuntingRange = ((BasePlugin)this).Config.Bind<float>("Marks", "Hunting Distance", 2.5f, "Distance multiplikator");
			configMarks_BuildingResourcesRange = ((BasePlugin)this).Config.Bind<float>("Marks", "Building Resources Distance", 2.5f, "Distance multiplikator");
			configMarks_ForestryRange = ((BasePlugin)this).Config.Bind<float>("Marks", "Forestry Distance", 2.5f, "Distance multiplikator");
			ClassInjector.RegisterTypeInIl2Cpp<GrassTool>();
			Harmony.CreateAndPatchAll(typeof(SpikesSelfDamageMod), (string)null);
			SettingsMenuPatch.OnSettingsMenu = (Action<Transform>)Delegate.Combine(SettingsMenuPatch.OnSettingsMenu, new Action<Transform>(SpikesSelfDamageMod.OnSettingsMenu));
			ClassInjector.RegisterTypeInIl2Cpp<AskaPlusSpawner>();
			ClassInjector.RegisterTypeInIl2Cpp<VillagerBonusSpawn>();
			ClassInjector.RegisterTypeInIl2Cpp<PlayerBonusSpawn>();
			Harmony.CreateAndPatchAll(typeof(VillagerPatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(VillagerSurvivalPatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(CharacterPatch), (string)null);
			SettingsMenuPatch.OnSettingsMenu = (Action<Transform>)Delegate.Combine(SettingsMenuPatch.OnSettingsMenu, new Action<Transform>(CharacterPatch.OnSettingsMenu));
			Harmony.CreateAndPatchAll(typeof(TorchesToBuildings), (string)null);
			Harmony.CreateAndPatchAll(typeof(StrucutrePatch), (string)null);
			SettingsMenuPatch.OnSettingsMenu = (Action<Transform>)Delegate.Combine(SettingsMenuPatch.OnSettingsMenu, new Action<Transform>(TorchesToBuildings.OnSettingsMenu));
			Harmony.CreateAndPatchAll(typeof(AnchorsFix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ItemInfoPatch), (string)null);
			SettingsMenuPatch.OnSettingsMenu = (Action<Transform>)Delegate.Combine(SettingsMenuPatch.OnSettingsMenu, new Action<Transform>(ItemInfoPatch.OnSettingsMenu));
			Harmony.CreateAndPatchAll(typeof(Marks), (string)null);
			SettingsMenuPatch.OnSettingsMenu = (Action<Transform>)Delegate.Combine(SettingsMenuPatch.OnSettingsMenu, new Action<Transform>(Marks.OnSettingsMenu));
			Harmony.CreateAndPatchAll(typeof(SettingsMenuPatch