Decompiled source of MarsarahMod v3.1.0

MarsarahMod.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MarsarahMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MarsarahMod")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a5ef8741-f8ae-4520-90e7-70f066991530")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MarsarahMod;

[BepInPlugin("marsarah.MarsarahMod", "Marsarah Mod", "3.1.0")]
public class MarsarahMod : BaseUnityPlugin
{
	private struct BiomeArmors
	{
		public int _min;

		public int _max;

		public BiomeArmors(int min, int max)
		{
			_min = min;
			_max = max;
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class RecipeResourceAmounts_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			if (!cheaperGearEnabled)
			{
				return;
			}
			foreach (Recipe recipe in __instance.m_recipes)
			{
				switch (((Object)recipe).name)
				{
				case "Recipe_Club":
				{
					Requirement[] resources26 = recipe.m_resources;
					foreach (Requirement val26 in resources26)
					{
						string name22 = ((Object)val26.m_resItem).name;
						string text22 = name22;
						if (!(text22 == "Wood"))
						{
							if (text22 == "BoneFragments")
							{
								val26.m_amountPerLevel = 2;
							}
						}
						else
						{
							val26.m_amountPerLevel = 2;
						}
					}
					break;
				}
				case "Recipe_SledgeStagbreaker":
				{
					Requirement[] resources58 = recipe.m_resources;
					foreach (Requirement val58 in resources58)
					{
						string name52 = ((Object)val58.m_resItem).name;
						string text52 = name52;
						if (text52 == "BoneFragments")
						{
							val58.m_amount = 2;
							val58.m_amountPerLevel = 8;
						}
					}
					break;
				}
				case "Recipe_Bow":
				{
					Requirement[] resources74 = recipe.m_resources;
					foreach (Requirement val74 in resources74)
					{
						string name64 = ((Object)val74.m_resItem).name;
						string text64 = name64;
						if (text64 == "LeatherScraps")
						{
							val74.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_ShieldWood":
				{
					Requirement[] resources42 = recipe.m_resources;
					foreach (Requirement val42 in resources42)
					{
						string name37 = ((Object)val42.m_resItem).name;
						string text37 = name37;
						if (!(text37 == "Wood"))
						{
							if (text37 == "Resin")
							{
								val42.m_amount = 0;
								val42.m_amountPerLevel = 0;
							}
						}
						else
						{
							val42.m_amount = 8;
						}
					}
					break;
				}
				case "Recipe_ArrowWood":
				{
					Requirement[] resources10 = recipe.m_resources;
					foreach (Requirement val10 in resources10)
					{
						string name10 = ((Object)val10.m_resItem).name;
						string text10 = name10;
						if (text10 == "Wood")
						{
							val10.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_ArrowFire":
				{
					Requirement[] resources66 = recipe.m_resources;
					foreach (Requirement val66 in resources66)
					{
						string name58 = ((Object)val66.m_resItem).name;
						string text58 = name58;
						if (text58 == "Wood" || text58 == "Resin")
						{
							val66.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_AxeStone":
				{
					Requirement[] resources50 = recipe.m_resources;
					foreach (Requirement val50 in resources50)
					{
						string name45 = ((Object)val50.m_resItem).name;
						string text45 = name45;
						if (text45 == "Wood")
						{
							val50.m_amountPerLevel = 1;
						}
					}
					break;
				}
				case "Recipe_KnifeFlint":
				{
					Requirement[] resources34 = recipe.m_resources;
					foreach (Requirement val34 in resources34)
					{
						string name29 = ((Object)val34.m_resItem).name;
						string text29 = name29;
						if (text29 == "Wood")
						{
							val34.m_amountPerLevel = 1;
						}
					}
					break;
				}
				case "Recipe_SpearFlint":
				{
					Requirement[] resources18 = recipe.m_resources;
					foreach (Requirement val18 in resources18)
					{
						string name16 = ((Object)val18.m_resItem).name;
						string text16 = name16;
						if (text16 == "Flint")
						{
							val18.m_amount = 8;
						}
					}
					break;
				}
				case "Recipe_AxeFlint":
				{
					Requirement[] resources2 = recipe.m_resources;
					foreach (Requirement val2 in resources2)
					{
						string name2 = ((Object)val2.m_resItem).name;
						string text2 = name2;
						if (!(text2 == "Wood"))
						{
							if (text2 == "LeatherScraps")
							{
								val2.m_amount = 1;
								val2.m_amountPerLevel = 1;
							}
						}
						else
						{
							val2.m_amountPerLevel = 1;
						}
					}
					break;
				}
				case "Recipe_ArrowFlint":
				{
					Requirement[] resources70 = recipe.m_resources;
					foreach (Requirement val70 in resources70)
					{
						string name61 = ((Object)val70.m_resItem).name;
						string text61 = name61;
						if (text61 == "Wood")
						{
							val70.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_KnifeCopper":
				{
					Requirement[] resources62 = recipe.m_resources;
					foreach (Requirement val62 in resources62)
					{
						switch (((Object)val62.m_resItem).name)
						{
						case "Wood":
							val62.m_amountPerLevel = 1;
							break;
						case "Copper":
							val62.m_amountPerLevel = 3;
							break;
						case "GreydwarfEye":
							val62.m_amountPerLevel = 6;
							break;
						}
					}
					break;
				}
				case "Recipe_MaceBronze":
				{
					Requirement[] resources54 = recipe.m_resources;
					foreach (Requirement val54 in resources54)
					{
						switch (((Object)val54.m_resItem).name)
						{
						case "Wood":
						case "LeatherScraps":
							val54.m_amountPerLevel = 1;
							break;
						case "Bronze":
							val54.m_amountPerLevel = 3;
							break;
						}
					}
					break;
				}
				case "Recipe_SwordBronze":
				{
					Requirement[] resources46 = recipe.m_resources;
					foreach (Requirement val46 in resources46)
					{
						string name41 = ((Object)val46.m_resItem).name;
						string text41 = name41;
						if (!(text41 == "Bronze"))
						{
							if (text41 == "LeatherScraps")
							{
								val46.m_amount = 4;
							}
						}
						else
						{
							val46.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_AxeBronze":
				{
					Requirement[] resources38 = recipe.m_resources;
					foreach (Requirement val38 in resources38)
					{
						string name33 = ((Object)val38.m_resItem).name;
						string text33 = name33;
						if (!(text33 == "Wood"))
						{
							if (text33 == "Bronze")
							{
								val38.m_amountPerLevel = 3;
							}
						}
						else
						{
							val38.m_amountPerLevel = 1;
						}
					}
					break;
				}
				case "Recipe_AtgeirBronze":
				{
					Requirement[] resources30 = recipe.m_resources;
					foreach (Requirement val30 in resources30)
					{
						string name25 = ((Object)val30.m_resItem).name;
						string text25 = name25;
						if (!(text25 == "Wood"))
						{
							if (text25 == "LeatherScraps")
							{
								val30.m_amountPerLevel = 1;
							}
						}
						else
						{
							val30.m_amount = 8;
							val30.m_amountPerLevel = 2;
						}
					}
					break;
				}
				case "Recipe_ShieldBronzeBuckler":
				{
					Requirement[] resources22 = recipe.m_resources;
					foreach (Requirement val22 in resources22)
					{
						string name18 = ((Object)val22.m_resItem).name;
						string text18 = name18;
						if (text18 == "Bronze")
						{
							val22.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_PickaxeBronze":
				{
					Requirement[] resources14 = recipe.m_resources;
					foreach (Requirement val14 in resources14)
					{
						string name13 = ((Object)val14.m_resItem).name;
						string text13 = name13;
						if (text13 == "Bronze")
						{
							val14.m_amount = 7;
							val14.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArrowBronze":
				{
					Requirement[] resources6 = recipe.m_resources;
					foreach (Requirement val6 in resources6)
					{
						string name6 = ((Object)val6.m_resItem).name;
						string text6 = name6;
						if (text6 == "Wood")
						{
							val6.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_MaceIron":
				{
					Requirement[] resources76 = recipe.m_resources;
					foreach (Requirement val76 in resources76)
					{
						switch (((Object)val76.m_resItem).name)
						{
						case "Wood":
							val76.m_amountPerLevel = 2;
							break;
						case "Iron":
							val76.m_amount = 10;
							val76.m_amountPerLevel = 5;
							break;
						case "LeatherScraps":
							val76.m_amountPerLevel = 1;
							break;
						}
					}
					break;
				}
				case "Recipe_SledgeIron":
				{
					Requirement[] resources72 = recipe.m_resources;
					foreach (Requirement val72 in resources72)
					{
						string name62 = ((Object)val72.m_resItem).name;
						string text62 = name62;
						if (!(text62 == "Iron"))
						{
							if (text62 == "YmirRemains")
							{
								val72.m_amount = 6;
								val72.m_amountPerLevel = 0;
							}
						}
						else
						{
							val72.m_amount = 15;
							val72.m_amountPerLevel = 7;
						}
					}
					break;
				}
				case "Recipe_Battleaxe":
				{
					Requirement[] resources68 = recipe.m_resources;
					foreach (Requirement val68 in resources68)
					{
						switch (((Object)val68.m_resItem).name)
						{
						case "ElderBark":
							val68.m_amount = 20;
							break;
						case "Iron":
							val68.m_amount = 18;
							val68.m_amountPerLevel = 7;
							break;
						case "LeatherScraps":
							val68.m_amountPerLevel = 1;
							break;
						}
					}
					break;
				}
				case "Recipe_SwordIron":
				{
					Requirement[] resources64 = recipe.m_resources;
					foreach (Requirement val64 in resources64)
					{
						string name56 = ((Object)val64.m_resItem).name;
						string text56 = name56;
						if (!(text56 == "Wood"))
						{
							if (text56 == "Iron")
							{
								val64.m_amount = 10;
								val64.m_amountPerLevel = 5;
							}
						}
						else
						{
							val64.m_amountPerLevel = 2;
						}
					}
					break;
				}
				case "Recipe_AxeIron":
				{
					Requirement[] resources60 = recipe.m_resources;
					foreach (Requirement val60 in resources60)
					{
						switch (((Object)val60.m_resItem).name)
						{
						case "Wood":
							val60.m_amountPerLevel = 2;
							break;
						case "Iron":
							val60.m_amount = 10;
							val60.m_amountPerLevel = 5;
							break;
						case "LeatherScraps":
							val60.m_amountPerLevel = 2;
							break;
						}
					}
					break;
				}
				case "Recipe_AtgeirIron":
				{
					Requirement[] resources56 = recipe.m_resources;
					foreach (Requirement val56 in resources56)
					{
						string name50 = ((Object)val56.m_resItem).name;
						string text50 = name50;
						if (!(text50 == "Wood"))
						{
							if (text50 == "Iron")
							{
								val56.m_amount = 15;
								val56.m_amountPerLevel = 7;
							}
						}
						else
						{
							val56.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_BowHuntsman":
				{
					Requirement[] resources52 = recipe.m_resources;
					foreach (Requirement val52 in resources52)
					{
						string name47 = ((Object)val52.m_resItem).name;
						string text47 = name47;
						if (text47 == "Iron")
						{
							val52.m_amount = 10;
							val52.m_amountPerLevel = 5;
						}
					}
					break;
				}
				case "Recipe_ShieldIronBuckler":
				{
					Requirement[] resources48 = recipe.m_resources;
					foreach (Requirement val48 in resources48)
					{
						string name43 = ((Object)val48.m_resItem).name;
						string text43 = name43;
						if (text43 == "Iron")
						{
							val48.m_amount = 6;
							val48.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_PickaxeIron":
				{
					Requirement[] resources44 = recipe.m_resources;
					foreach (Requirement val44 in resources44)
					{
						string name39 = ((Object)val44.m_resItem).name;
						string text39 = name39;
						if (text39 == "Iron")
						{
							val44.m_amount = 10;
							val44.m_amountPerLevel = 5;
						}
					}
					break;
				}
				case "Recipe_ArrowIron":
				{
					Requirement[] resources40 = recipe.m_resources;
					foreach (Requirement val40 in resources40)
					{
						string name35 = ((Object)val40.m_resItem).name;
						string text35 = name35;
						if (text35 == "Wood")
						{
							val40.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_KnifeSilver":
				{
					Requirement[] resources36 = recipe.m_resources;
					foreach (Requirement val36 in resources36)
					{
						string name31 = ((Object)val36.m_resItem).name;
						string text31 = name31;
						if (text31 == "Silver")
						{
							val36.m_amount = 7;
							val36.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_MaceSilver":
				{
					Requirement[] resources32 = recipe.m_resources;
					foreach (Requirement val32 in resources32)
					{
						string name27 = ((Object)val32.m_resItem).name;
						string text27 = name27;
						if (!(text27 == "ElderBark"))
						{
							if (text27 == "Silver")
							{
								val32.m_amount = 20;
								val32.m_amountPerLevel = 7;
							}
						}
						else
						{
							val32.m_amount = 15;
							val32.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_SwordSilver":
				{
					Requirement[] resources28 = recipe.m_resources;
					foreach (Requirement val28 in resources28)
					{
						switch (((Object)val28.m_resItem).name)
						{
						case "Wood":
							val28.m_amount = 15;
							val28.m_amountPerLevel = 3;
							break;
						case "Silver":
							val28.m_amount = 20;
							val28.m_amountPerLevel = 7;
							break;
						case "LeatherScraps":
							val28.m_amount = 5;
							break;
						case "Iron":
							val28.m_amount = 3;
							val28.m_amountPerLevel = 1;
							break;
						}
					}
					break;
				}
				case "Recipe_BowDraugrFang":
				{
					Requirement[] resources24 = recipe.m_resources;
					foreach (Requirement val24 in resources24)
					{
						string name20 = ((Object)val24.m_resItem).name;
						string text20 = name20;
						if (!(text20 == "Silver"))
						{
							if (text20 == "Guck")
							{
								val24.m_amount = 7;
							}
						}
						else
						{
							val24.m_amount = 10;
							val24.m_amountPerLevel = 5;
						}
					}
					break;
				}
				case "Recipe_Battleaxe_Crystal":
				{
					Requirement[] resources20 = recipe.m_resources;
					foreach (Requirement val20 in resources20)
					{
						string name17 = ((Object)val20.m_resItem).name;
						string text17 = name17;
						if (!(text17 == "Silver"))
						{
							if (text17 == "Crystal")
							{
								val20.m_amount = 3;
								val20.m_amountPerLevel = 1;
							}
						}
						else
						{
							val20.m_amount = 15;
							val20.m_amountPerLevel = 7;
						}
					}
					break;
				}
				case "Recipe_ArrowObsidian":
				{
					Requirement[] resources16 = recipe.m_resources;
					foreach (Requirement val16 in resources16)
					{
						string name15 = ((Object)val16.m_resItem).name;
						string text15 = name15;
						if (!(text15 == "Wood"))
						{
							if (text15 == "Obsidian")
							{
								val16.m_amount = 3;
							}
						}
						else
						{
							val16.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_ArrowFrost":
				{
					Requirement[] resources12 = recipe.m_resources;
					foreach (Requirement val12 in resources12)
					{
						string name12 = ((Object)val12.m_resItem).name;
						string text12 = name12;
						if (!(text12 == "Wood"))
						{
							if (text12 == "Obsidian")
							{
								val12.m_amount = 3;
							}
						}
						else
						{
							val12.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_ArrowPoison":
				{
					Requirement[] resources8 = recipe.m_resources;
					foreach (Requirement val8 in resources8)
					{
						string name8 = ((Object)val8.m_resItem).name;
						string text8 = name8;
						if (!(text8 == "Wood"))
						{
							if (text8 == "Obsidian")
							{
								val8.m_amount = 3;
							}
						}
						else
						{
							val8.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_ArrowSilver":
				{
					Requirement[] resources4 = recipe.m_resources;
					foreach (Requirement val4 in resources4)
					{
						string name4 = ((Object)val4.m_resItem).name;
						string text4 = name4;
						if (text4 == "Wood")
						{
							val4.m_amount = 5;
						}
					}
					break;
				}
				case "Recipe_KnifeChitin":
				{
					Requirement[] resources77 = recipe.m_resources;
					foreach (Requirement val77 in resources77)
					{
						switch (((Object)val77.m_resItem).name)
						{
						case "FineWood":
							val77.m_amountPerLevel = 2;
							break;
						case "Chitin":
							val77.m_amount = 10;
							val77.m_amountPerLevel = 5;
							break;
						case "LeatherScraps":
							val77.m_amountPerLevel = 1;
							break;
						}
					}
					break;
				}
				case "Recipe_SpearChitin":
				{
					Requirement[] resources75 = recipe.m_resources;
					foreach (Requirement val75 in resources75)
					{
						string name65 = ((Object)val75.m_resItem).name;
						string text65 = name65;
						if (text65 == "Chitin")
						{
							val75.m_amount = 15;
						}
					}
					break;
				}
				case "Recipe_ShieldSerpentscale":
				{
					Requirement[] resources73 = recipe.m_resources;
					foreach (Requirement val73 in resources73)
					{
						string name63 = ((Object)val73.m_resItem).name;
						string text63 = name63;
						if (!(text63 == "FineWood"))
						{
							if (text63 == "Iron")
							{
								val73.m_amount = 3;
								val73.m_amountPerLevel = 1;
							}
						}
						else
						{
							val73.m_amount = 20;
						}
					}
					break;
				}
				case "Recipe_MaceNeedle":
				{
					Requirement[] resources71 = recipe.m_resources;
					foreach (Requirement val71 in resources71)
					{
						switch (((Object)val71.m_resItem).name)
						{
						case "FineWood":
							val71.m_amount = 4;
							val71.m_amountPerLevel = 2;
							break;
						case "Iron":
							val71.m_amount = 10;
							break;
						case "LinenThread":
							val71.m_amount = 5;
							val71.m_amountPerLevel = 5;
							break;
						}
					}
					break;
				}
				case "Recipe_KnifeBlackmetal":
				{
					Requirement[] resources69 = recipe.m_resources;
					foreach (Requirement val69 in resources69)
					{
						string name60 = ((Object)val69.m_resItem).name;
						string text60 = name60;
						if (text60 == "FineWood")
						{
							val69.m_amountPerLevel = 1;
						}
					}
					break;
				}
				case "Recipe_SwordBlackmetal":
				{
					Requirement[] resources67 = recipe.m_resources;
					foreach (Requirement val67 in resources67)
					{
						string name59 = ((Object)val67.m_resItem).name;
						string text59 = name59;
						if (!(text59 == "FineWood"))
						{
							if (text59 == "BlackMetal")
							{
								val67.m_amount = 10;
								val67.m_amountPerLevel = 5;
							}
						}
						else
						{
							val67.m_amount = 3;
							val67.m_amountPerLevel = 2;
						}
					}
					break;
				}
				case "Recipe_AtgeirBlackmetal":
				{
					Requirement[] resources65 = recipe.m_resources;
					foreach (Requirement val65 in resources65)
					{
						string name57 = ((Object)val65.m_resItem).name;
						string text57 = name57;
						if (!(text57 == "FineWood"))
						{
							if (text57 == "BlackMetal")
							{
								val65.m_amount = 15;
								val65.m_amountPerLevel = 7;
							}
						}
						else
						{
							val65.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_AxeBlackMetal":
				{
					Requirement[] resources63 = recipe.m_resources;
					foreach (Requirement val63 in resources63)
					{
						string name55 = ((Object)val63.m_resItem).name;
						string text55 = name55;
						if (!(text55 == "FineWood"))
						{
							if (text55 == "BlackMetal")
							{
								val63.m_amount = 10;
								val63.m_amountPerLevel = 5;
							}
						}
						else
						{
							val63.m_amountPerLevel = 2;
						}
					}
					break;
				}
				case "Recipe_ShieldBlackmetal":
				{
					Requirement[] resources61 = recipe.m_resources;
					foreach (Requirement val61 in resources61)
					{
						string name54 = ((Object)val61.m_resItem).name;
						string text54 = name54;
						if (text54 == "Chain")
						{
							val61.m_amountPerLevel = 0;
						}
					}
					break;
				}
				case "Recipe_ShieldBlackmetalTower":
				{
					Requirement[] resources59 = recipe.m_resources;
					foreach (Requirement val59 in resources59)
					{
						string name53 = ((Object)val59.m_resItem).name;
						string text53 = name53;
						if (text53 == "Chain")
						{
							val59.m_amount = 6;
							val59.m_amountPerLevel = 0;
						}
					}
					break;
				}
				case "Recipe_ArrowNeedle":
				{
					Requirement[] resources57 = recipe.m_resources;
					foreach (Requirement val57 in resources57)
					{
						string name51 = ((Object)val57.m_resItem).name;
						string text51 = name51;
						if (text51 == "Needle")
						{
							val57.m_amount = 3;
						}
					}
					break;
				}
				case "Recipe_ArmorRagsChest":
				{
					Requirement[] resources55 = recipe.m_resources;
					foreach (Requirement val55 in resources55)
					{
						string name49 = ((Object)val55.m_resItem).name;
						string text49 = name49;
						if (text49 == "LeatherScraps")
						{
							val55.m_amount = 6;
							val55.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorRagsLegs":
				{
					Requirement[] resources53 = recipe.m_resources;
					foreach (Requirement val53 in resources53)
					{
						string name48 = ((Object)val53.m_resItem).name;
						string text48 = name48;
						if (text48 == "LeatherScraps")
						{
							val53.m_amount = 6;
							val53.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_HelmetLeather":
				{
					Requirement[] resources51 = recipe.m_resources;
					foreach (Requirement val51 in resources51)
					{
						string name46 = ((Object)val51.m_resItem).name;
						string text46 = name46;
						if (!(text46 == "DeerHide"))
						{
							if (text46 == "BoneFragments")
							{
								val51.m_amountPerLevel = 4;
							}
						}
						else
						{
							val51.m_amountPerLevel = 5;
						}
					}
					break;
				}
				case "Recipe_ArmorLeatherChest":
				{
					Requirement[] resources49 = recipe.m_resources;
					foreach (Requirement val49 in resources49)
					{
						string name44 = ((Object)val49.m_resItem).name;
						string text44 = name44;
						if (!(text44 == "DeerHide"))
						{
							if (text44 == "BoneFragments")
							{
								val49.m_amountPerLevel = 4;
							}
						}
						else
						{
							val49.m_amountPerLevel = 5;
						}
					}
					break;
				}
				case "Recipe_ArmorLeatherLegs":
				{
					Requirement[] resources47 = recipe.m_resources;
					foreach (Requirement val47 in resources47)
					{
						string name42 = ((Object)val47.m_resItem).name;
						string text42 = name42;
						if (!(text42 == "DeerHide"))
						{
							if (text42 == "BoneFragments")
							{
								val47.m_amountPerLevel = 4;
							}
						}
						else
						{
							val47.m_amountPerLevel = 5;
						}
					}
					break;
				}
				case "Recipe_CapeDeerHide":
				{
					Requirement[] resources45 = recipe.m_resources;
					foreach (Requirement val45 in resources45)
					{
						string name40 = ((Object)val45.m_resItem).name;
						string text40 = name40;
						if (!(text40 == "DeerHide"))
						{
							if (text40 == "BoneFragments")
							{
								val45.m_amount = 0;
								val45.m_amountPerLevel = 2;
							}
						}
						else
						{
							val45.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_HelmetTrollLeather":
				{
					Requirement[] resources43 = recipe.m_resources;
					foreach (Requirement val43 in resources43)
					{
						string name38 = ((Object)val43.m_resItem).name;
						string text38 = name38;
						if (!(text38 == "TrollHide"))
						{
							if (text38 == "BoneFragments")
							{
								val43.m_amount = 0;
								val43.m_amountPerLevel = 0;
							}
						}
						else
						{
							val43.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_ArmorTrollLeatherChest":
				{
					Requirement[] resources41 = recipe.m_resources;
					foreach (Requirement val41 in resources41)
					{
						string name36 = ((Object)val41.m_resItem).name;
						string text36 = name36;
						if (text36 == "TrollHide")
						{
							val41.m_amount = 6;
							val41.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_ArmorTrollLeatherLegs":
				{
					Requirement[] resources39 = recipe.m_resources;
					foreach (Requirement val39 in resources39)
					{
						string name34 = ((Object)val39.m_resItem).name;
						string text34 = name34;
						if (text34 == "TrollHide")
						{
							val39.m_amount = 6;
							val39.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_CapeTrollHide":
				{
					Requirement[] resources37 = recipe.m_resources;
					foreach (Requirement val37 in resources37)
					{
						string name32 = ((Object)val37.m_resItem).name;
						string text32 = name32;
						if (!(text32 == "TrollHide"))
						{
							if (text32 == "BoneFragments")
							{
								val37.m_amount = 5;
								val37.m_amountPerLevel = 3;
							}
						}
						else
						{
							val37.m_amount = 4;
							val37.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_HelmetRoot":
				{
					Requirement[] resources35 = recipe.m_resources;
					foreach (Requirement val35 in resources35)
					{
						string name30 = ((Object)val35.m_resItem).name;
						string text30 = name30;
						if (text30 == "ElderBark")
						{
							val35.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorRootChest":
				{
					Requirement[] resources33 = recipe.m_resources;
					foreach (Requirement val33 in resources33)
					{
						string name28 = ((Object)val33.m_resItem).name;
						string text28 = name28;
						if (text28 == "ElderBark")
						{
							val33.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorRootLegs":
				{
					Requirement[] resources31 = recipe.m_resources;
					foreach (Requirement val31 in resources31)
					{
						string name26 = ((Object)val31.m_resItem).name;
						string text26 = name26;
						if (text26 == "ElderBark")
						{
							val31.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_HelmetIron":
				{
					Requirement[] resources29 = recipe.m_resources;
					foreach (Requirement val29 in resources29)
					{
						string name24 = ((Object)val29.m_resItem).name;
						string text24 = name24;
						if (text24 == "Iron")
						{
							val29.m_amount = 10;
							val29.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorIronChest":
				{
					Requirement[] resources27 = recipe.m_resources;
					foreach (Requirement val27 in resources27)
					{
						string name23 = ((Object)val27.m_resItem).name;
						string text23 = name23;
						if (text23 == "Iron")
						{
							val27.m_amount = 10;
							val27.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorIronLegs":
				{
					Requirement[] resources25 = recipe.m_resources;
					foreach (Requirement val25 in resources25)
					{
						string name21 = ((Object)val25.m_resItem).name;
						string text21 = name21;
						if (text21 == "Iron")
						{
							val25.m_amount = 10;
							val25.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_HelmetFenrir":
				{
					Requirement[] resources23 = recipe.m_resources;
					foreach (Requirement val23 in resources23)
					{
						string name19 = ((Object)val23.m_resItem).name;
						string text19 = name19;
						if (!(text19 == "WolfHairBundle"))
						{
							if (text19 == "WolfPelt")
							{
								val23.m_amount = 3;
								val23.m_amountPerLevel = 1;
							}
						}
						else
						{
							val23.m_amount = 10;
							val23.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorFenrirChest":
				{
					Requirement[] resources21 = recipe.m_resources;
					foreach (Requirement val21 in resources21)
					{
						switch (((Object)val21.m_resItem).name)
						{
						case "WolfHairBundle":
							val21.m_amount = 10;
							val21.m_amountPerLevel = 4;
							break;
						case "WolfPelt":
							val21.m_amount = 4;
							val21.m_amountPerLevel = 2;
							break;
						case "LeatherScraps":
							val21.m_amount = 7;
							val21.m_amountPerLevel = 3;
							break;
						}
					}
					break;
				}
				case "Recipe_ArmorFenrirLegs":
				{
					Requirement[] resources19 = recipe.m_resources;
					foreach (Requirement val19 in resources19)
					{
						switch (((Object)val19.m_resItem).name)
						{
						case "WolfHairBundle":
							val19.m_amount = 10;
							val19.m_amountPerLevel = 4;
							break;
						case "WolfPelt":
							val19.m_amount = 4;
							val19.m_amountPerLevel = 2;
							break;
						case "LeatherScraps":
							val19.m_amount = 7;
							val19.m_amountPerLevel = 3;
							break;
						}
					}
					break;
				}
				case "Recipe_HelmetDrake":
				{
					Requirement[] resources17 = recipe.m_resources;
					foreach (Requirement val17 in resources17)
					{
						switch (((Object)val17.m_resItem).name)
						{
						case "Silver":
							val17.m_amount = 10;
							val17.m_amountPerLevel = 4;
							break;
						case "WolfPelt":
							val17.m_amountPerLevel = 1;
							break;
						case "TrophyHatchling":
							val17.m_amount = 1;
							break;
						}
					}
					break;
				}
				case "Recipe_ArmorWolfChest":
				{
					Requirement[] resources15 = recipe.m_resources;
					foreach (Requirement val15 in resources15)
					{
						string name14 = ((Object)val15.m_resItem).name;
						string text14 = name14;
						if (!(text14 == "Silver"))
						{
							if (text14 == "WolfPelt")
							{
								val15.m_amountPerLevel = 1;
							}
						}
						else
						{
							val15.m_amount = 10;
							val15.m_amountPerLevel = 4;
						}
					}
					break;
				}
				case "Recipe_ArmorWolfLegs":
				{
					Requirement[] resources13 = recipe.m_resources;
					foreach (Requirement val13 in resources13)
					{
						switch (((Object)val13.m_resItem).name)
						{
						case "Silver":
							val13.m_amount = 10;
							val13.m_amountPerLevel = 4;
							break;
						case "WolfPelt":
							val13.m_amountPerLevel = 1;
							break;
						case "WolfFang":
							val13.m_amountPerLevel = 0;
							break;
						}
					}
					break;
				}
				case "Recipe_CapeWolf":
				{
					Requirement[] resources11 = recipe.m_resources;
					foreach (Requirement val11 in resources11)
					{
						string name11 = ((Object)val11.m_resItem).name;
						string text11 = name11;
						if (!(text11 == "Silver"))
						{
							if (text11 == "WolfPelt")
							{
								val11.m_amount = 5;
								val11.m_amountPerLevel = 1;
							}
						}
						else
						{
							val11.m_amount = 2;
							val11.m_amountPerLevel = 1;
						}
					}
					break;
				}
				case "Recipe_HelmetPadded":
				{
					Requirement[] resources9 = recipe.m_resources;
					foreach (Requirement val9 in resources9)
					{
						string name9 = ((Object)val9.m_resItem).name;
						string text9 = name9;
						if (text9 == "Iron")
						{
							val9.m_amount = 5;
							val9.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_ArmorPaddedCuirass":
				{
					Requirement[] resources7 = recipe.m_resources;
					foreach (Requirement val7 in resources7)
					{
						string name7 = ((Object)val7.m_resItem).name;
						string text7 = name7;
						if (text7 == "Iron")
						{
							val7.m_amount = 5;
							val7.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_ArmorPaddedGreaves":
				{
					Requirement[] resources5 = recipe.m_resources;
					foreach (Requirement val5 in resources5)
					{
						string name5 = ((Object)val5.m_resItem).name;
						string text5 = name5;
						if (text5 == "Iron")
						{
							val5.m_amount = 5;
							val5.m_amountPerLevel = 3;
						}
					}
					break;
				}
				case "Recipe_CapeLinen":
				{
					Requirement[] resources3 = recipe.m_resources;
					foreach (Requirement val3 in resources3)
					{
						string name3 = ((Object)val3.m_resItem).name;
						string text3 = name3;
						if (text3 == "LinenThread")
						{
							val3.m_amount = 10;
							val3.m_amountPerLevel = 2;
						}
					}
					break;
				}
				case "Recipe_CapeLox":
				{
					Requirement[] resources = recipe.m_resources;
					foreach (Requirement val in resources)
					{
						string name = ((Object)val.m_resItem).name;
						string text = name;
						if (text == "LoxPelt")
						{
							val.m_amount = 5;
						}
					}
					break;
				}
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class BronzeCrafting_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			if (!doubleBronzeEnabled)
			{
				return;
			}
			bool flag = false;
			bool flag2 = false;
			foreach (Recipe recipe in __instance.m_recipes)
			{
				string text = ((object)recipe).ToString();
				string text2 = text;
				if (!(text2 == "Recipe_Bronze (Recipe)"))
				{
					if (text2 == "Recipe_Bronze5 (Recipe)" && doubleBronzeEnabled)
					{
						recipe.m_amount = 10;
						flag2 = true;
					}
				}
				else if (doubleBronzeEnabled)
				{
					recipe.m_amount = 2;
					flag = true;
				}
				if (flag && flag2)
				{
					break;
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class AlternateGearRecipes_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			if (!altGearRecipesEnabled)
			{
				return;
			}
			ItemDrop resItem = new ItemDrop();
			ItemDrop resItem2 = new ItemDrop();
			ItemDrop resItem3 = new ItemDrop();
			ItemDrop resItem4 = new ItemDrop();
			ItemDrop resItem5 = new ItemDrop();
			ItemDrop resItem6 = new ItemDrop();
			bool flag = false;
			bool flag2 = false;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			bool flag6 = false;
			foreach (Recipe recipe in __instance.m_recipes)
			{
				Requirement[] resources = recipe.m_resources;
				foreach (Requirement val in resources)
				{
					if (flag && flag2 && flag3 && flag4 && flag5 && flag6)
					{
						break;
					}
					switch (((Object)val.m_resItem).name)
					{
					case "LeatherScraps":
						resItem = val.m_resItem;
						flag = true;
						break;
					case "FineWood":
						resItem2 = val.m_resItem;
						flag2 = true;
						break;
					case "Obsidian":
						resItem3 = val.m_resItem;
						flag3 = true;
						break;
					case "Chitin":
						resItem4 = val.m_resItem;
						flag4 = true;
						break;
					case "BlackMetal":
						resItem5 = val.m_resItem;
						flag5 = true;
						break;
					case "WolfFang":
						resItem6 = val.m_resItem;
						flag6 = true;
						break;
					}
				}
			}
			foreach (Recipe recipe2 in __instance.m_recipes)
			{
				switch (((Object)recipe2).name)
				{
				case "Recipe_Club":
				{
					Requirement[] resources9 = recipe2.m_resources;
					foreach (Requirement val9 in resources9)
					{
						string name8 = ((Object)val9.m_resItem).name;
						string text8 = name8;
						if (text8 == "BoneFragments")
						{
							val9.m_resItem = resItem;
						}
					}
					break;
				}
				case "Recipe_KnifeCopper":
				{
					Requirement[] resources13 = recipe2.m_resources;
					foreach (Requirement val13 in resources13)
					{
						string name12 = ((Object)val13.m_resItem).name;
						string text12 = name12;
						if (text12 == "GreydwarfEye")
						{
							val13.m_amountPerLevel = 2;
							val13.m_resItem = resItem;
						}
					}
					break;
				}
				case "Recipe_KnifeSilver":
				{
					Requirement[] resources5 = recipe2.m_resources;
					foreach (Requirement val5 in resources5)
					{
						string name4 = ((Object)val5.m_resItem).name;
						string text4 = name4;
						if (!(text4 == "Wood"))
						{
							if (text4 == "Iron")
							{
								val5.m_resItem = resItem3;
							}
						}
						else
						{
							val5.m_resItem = resItem2;
						}
					}
					break;
				}
				case "Recipe_SwordSilver":
				{
					Requirement[] resources11 = recipe2.m_resources;
					foreach (Requirement val11 in resources11)
					{
						string name10 = ((Object)val11.m_resItem).name;
						string text10 = name10;
						if (!(text10 == "Wood"))
						{
							if (text10 == "Iron")
							{
								val11.m_amount = 4;
								val11.m_amountPerLevel = 2;
								val11.m_resItem = resItem3;
							}
						}
						else
						{
							val11.m_amount = 10;
							val11.m_amountPerLevel = 2;
							val11.m_resItem = resItem2;
						}
					}
					break;
				}
				case "Recipe_ShieldSerpentscale":
				{
					Requirement[] resources7 = recipe2.m_resources;
					foreach (Requirement val7 in resources7)
					{
						string name6 = ((Object)val7.m_resItem).name;
						string text6 = name6;
						if (text6 == "Iron")
						{
							val7.m_resItem = resItem4;
						}
					}
					break;
				}
				case "Recipe_MaceNeedle":
				{
					Requirement[] resources3 = recipe2.m_resources;
					foreach (Requirement val3 in resources3)
					{
						string name2 = ((Object)val3.m_resItem).name;
						string text2 = name2;
						if (text2 == "Iron")
						{
							val3.m_resItem = resItem5;
						}
					}
					break;
				}
				case "Recipe_ArmorWolfChest":
				{
					Requirement[] resources12 = recipe2.m_resources;
					foreach (Requirement val12 in resources12)
					{
						string name11 = ((Object)val12.m_resItem).name;
						string text11 = name11;
						if (text11 == "Chain")
						{
							val12.m_amount = 3;
							val12.m_resItem = resItem6;
						}
					}
					break;
				}
				case "Recipe_HelmetPadded":
				{
					Requirement[] resources10 = recipe2.m_resources;
					foreach (Requirement val10 in resources10)
					{
						string name9 = ((Object)val10.m_resItem).name;
						string text9 = name9;
						if (text9 == "Iron")
						{
							val10.m_resItem = resItem5;
						}
					}
					break;
				}
				case "Recipe_ArmorPaddedCuirass":
				{
					Requirement[] resources8 = recipe2.m_resources;
					foreach (Requirement val8 in resources8)
					{
						string name7 = ((Object)val8.m_resItem).name;
						string text7 = name7;
						if (text7 == "Iron")
						{
							val8.m_resItem = resItem5;
						}
					}
					break;
				}
				case "Recipe_ArmorPaddedGreaves":
				{
					Requirement[] resources6 = recipe2.m_resources;
					foreach (Requirement val6 in resources6)
					{
						string name5 = ((Object)val6.m_resItem).name;
						string text5 = name5;
						if (text5 == "Iron")
						{
							val6.m_resItem = resItem5;
						}
					}
					break;
				}
				case "Recipe_CapeLinen":
				{
					Requirement[] resources4 = recipe2.m_resources;
					foreach (Requirement val4 in resources4)
					{
						string name3 = ((Object)val4.m_resItem).name;
						string text3 = name3;
						if (text3 == "Silver")
						{
							val4.m_resItem = resItem5;
						}
					}
					break;
				}
				case "Recipe_CapeLox":
				{
					Requirement[] resources2 = recipe2.m_resources;
					foreach (Requirement val2 in resources2)
					{
						string name = ((Object)val2.m_resItem).name;
						string text = name;
						if (text == "Silver")
						{
							val2.m_resItem = resItem5;
						}
					}
					break;
				}
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class AlternateLinenAndLoxCape_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			if (!altLinenCapeEnabled)
			{
				return;
			}
			ItemDrop resItem = new ItemDrop();
			ItemDrop resItem2 = new ItemDrop();
			foreach (Recipe recipe in __instance.m_recipes)
			{
				Requirement[] resources = recipe.m_resources;
				foreach (Requirement val in resources)
				{
					string name = ((Object)val.m_resItem).name;
					string text = name;
					if (!(text == "DeerHide"))
					{
						if (text == "Iron")
						{
							resItem2 = val.m_resItem;
						}
					}
					else
					{
						resItem = val.m_resItem;
					}
				}
			}
			foreach (Recipe recipe2 in __instance.m_recipes)
			{
				string name2 = ((Object)recipe2).name;
				string text2 = name2;
				if (!(text2 == "Recipe_CapeLinen"))
				{
					continue;
				}
				Requirement[] resources2 = recipe2.m_resources;
				foreach (Requirement val2 in resources2)
				{
					switch (((Object)val2.m_resItem).name)
					{
					case "LinenThread":
						val2.m_amount = 5;
						val2.m_amountPerLevel = 2;
						val2.m_resItem = resItem;
						break;
					case "Silver":
					case "BlackMetal":
						val2.m_amount = 1;
						val2.m_amountPerLevel = 0;
						val2.m_resItem = resItem2;
						break;
					}
				}
			}
			ItemType[] array = (ItemType[])Enum.GetValues(typeof(ItemType));
			ItemType val3 = (ItemType)0;
			ItemType[] array2 = array;
			for (int k = 0; k < array2.Length; k++)
			{
				ItemType val4 = array2[k];
				if (((object)(ItemType)(ref val4)).ToString() == "Shoulder")
				{
					val3 = val4;
				}
			}
			List<ItemDrop> allItems = __instance.GetAllItems(val3, "");
			foreach (ItemDrop item2 in allItems)
			{
				string name3 = ((Object)item2).name;
				string text3 = name3;
				if (text3 == "CapeLinen" || text3 == "CapeLox")
				{
					DamageModPair item = default(DamageModPair);
					item.m_modifier = (DamageModifier)1;
					item.m_type = (DamageType)256;
					if (!item2.m_itemData.m_shared.m_damageModifiers.Contains(item))
					{
						item2.m_itemData.m_shared.m_damageModifiers.Add(item);
					}
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class ForsakenPowers_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			if (!altForsakenPowersEnabled)
			{
				return;
			}
			foreach (StatusEffect statusEffect in __instance.m_StatusEffects)
			{
				if (((Object)statusEffect).name.StartsWith("GP_"))
				{
					statusEffect.m_ttl = 600f;
					statusEffect.m_cooldown = 900f;
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class GearSpeed_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			if (!altGearSpeedModifiersEnabled)
			{
				return;
			}
			ItemType[] array = (ItemType[])Enum.GetValues(typeof(ItemType));
			ItemType val = (ItemType)0;
			ItemType val2 = (ItemType)0;
			ItemType val3 = (ItemType)0;
			ItemType[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				ItemType val4 = array2[i];
				if (((object)(ItemType)(ref val4)).ToString() == "Chest")
				{
					val = val4;
				}
				if (((object)(ItemType)(ref val4)).ToString() == "Legs")
				{
					val2 = val4;
				}
				if (((object)(ItemType)(ref val4)).ToString() == "Helmet")
				{
					val3 = val4;
				}
			}
			List<ItemDrop> allItems = __instance.GetAllItems(val, "");
			List<ItemDrop> allItems2 = __instance.GetAllItems(val2, "");
			List<ItemDrop> allItems3 = __instance.GetAllItems(val3, "");
			foreach (ItemDrop item in allItems)
			{
				switch (((Object)item).name)
				{
				case "ArmorIronChest":
				case "ArmorWolfChest":
				case "ArmorBronzeChest":
				case "ArmorPaddedCuirass":
					item.m_itemData.m_shared.m_movementModifier = 0f;
					break;
				case "ArmorTrollLeatherChest":
				case "ArmorFenringChest":
					item.m_itemData.m_shared.m_movementModifier = 0.05f;
					break;
				case "ArmorRootChest":
					item.m_itemData.m_shared.m_movementModifier = 0.03f;
					break;
				}
			}
			foreach (ItemDrop item2 in allItems2)
			{
				switch (((Object)item2).name)
				{
				case "ArmorIronLegs":
				case "ArmorWolfLegs":
				case "ArmorBronzeLegs":
				case "ArmorPaddedGreaves":
					item2.m_itemData.m_shared.m_movementModifier = 0f;
					break;
				case "ArmorTrollLeatherLegs":
				case "ArmorFenringLegs":
					item2.m_itemData.m_shared.m_movementModifier = 0.05f;
					break;
				case "ArmorRootLegs":
					item2.m_itemData.m_shared.m_movementModifier = 0.03f;
					break;
				}
			}
			foreach (ItemDrop item3 in allItems3)
			{
				string name = ((Object)item3).name;
				string text = name;
				if (text == "HelmetFenring")
				{
					item3.m_itemData.m_shared.m_movementModifier = 0.05f;
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class WeaponAndShieldSpeed_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			//IL_0024: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if (!altWSSpeedModifiersEnabled)
			{
				return;
			}
			ItemType[] array = (ItemType[])Enum.GetValues(typeof(ItemType));
			ItemType val = (ItemType)0;
			ItemType val2 = (ItemType)0;
			ItemType[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				ItemType val3 = array2[i];
				if (((object)(ItemType)(ref val3)).ToString() == "TwoHandedWeapon")
				{
					val = val3;
				}
				if (((object)(ItemType)(ref val3)).ToString() == "Shield")
				{
					val2 = val3;
				}
			}
			List<ItemDrop> allItems = __instance.GetAllItems(val, "");
			List<ItemDrop> allItems2 = __instance.GetAllItems(val2, "");
			foreach (ItemDrop item in allItems)
			{
				string name = ((Object)item).name;
				string text = name;
				if (text == "Battleaxe" || text == "BattleaxeCrystal")
				{
					item.m_itemData.m_shared.m_movementModifier = -0.05f;
				}
			}
			foreach (ItemDrop item2 in allItems2)
			{
				switch (((Object)item2).name)
				{
				case "ShieldBlackmetalTower":
				case "ShieldBoneTower":
				case "ShieldIronTower":
				case "ShieldWoodTower":
					item2.m_itemData.m_shared.m_movementModifier = -0.1f;
					break;
				case "ShieldSerpentscale":
					item2.m_itemData.m_shared.m_movementModifier = -0.05f;
					break;
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class MetalWeight_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			//IL_0024: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			if (!lighterMetalWeightEnabled)
			{
				return;
			}
			ItemType[] array = (ItemType[])Enum.GetValues(typeof(ItemType));
			ItemType val = (ItemType)0;
			ItemType[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				ItemType val2 = array2[i];
				if (((object)(ItemType)(ref val2)).ToString() == "Material")
				{
					val = val2;
					break;
				}
			}
			List<ItemDrop> allItems = __instance.GetAllItems(val, "");
			float num = 0f;
			foreach (ItemDrop item in allItems)
			{
				string name = ((Object)item).name;
				string text = name;
				if (text == "TinOre")
				{
					num = item.m_itemData.m_shared.m_weight;
				}
				if (num != 0f)
				{
					break;
				}
			}
			foreach (ItemDrop item2 in allItems)
			{
				switch (((Object)item2).name)
				{
				case "CopperOre":
				case "IronScrap":
				case "SilverOre":
				case "Bronze":
				case "Copper":
				case "Silver":
				case "IronOre":
				case "Iron":
				case "BlackMetalScrap":
				case "BlackMetal":
					item2.m_itemData.m_shared.m_weight = num;
					break;
				}
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class OthersSection_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			if (!otherEnabled)
			{
				return;
			}
			foreach (Recipe recipe in __instance.m_recipes)
			{
				string name = ((Object)recipe).name;
				string text = name;
				if (text == "Recipe_Tankard")
				{
					recipe.m_resources[0].m_amount = 2;
				}
			}
		}
	}

	[HarmonyPatch(typeof(PieceTable), "UpdateAvailable")]
	private class CheaperBuildPieces_Patch
	{
		private static void Prefix(ref List<GameObject> ___m_pieces)
		{
			if (!cheaperBuildPiecesEnabled)
			{
				return;
			}
			foreach (GameObject ___m_piece in ___m_pieces)
			{
				Piece component = ___m_piece.GetComponent<Piece>();
				switch (((Object)___m_piece).name)
				{
				case "piece_cookingstation_iron":
					component.m_resources[0].m_amount = 2;
					component.m_resources[1].m_amount = 2;
					break;
				case "itemstand":
				case "itemstandh":
					component.m_resources[0].m_amount = 2;
					break;
				case "blastfurnace":
					component.m_resources[2].m_amount = 5;
					break;
				case "piece_oven":
					component.m_resources[0].m_amount = 5;
					break;
				case "forge_ext3":
					component.m_resources[0].m_amount = 15;
					break;
				case "forge_ext4":
					component.m_resources[0].m_amount = 7;
					break;
				case "forge_ext5":
					component.m_resources[0].m_amount = 10;
					break;
				case "forge_ext6":
					component.m_resources[0].m_amount = 5;
					break;
				case "wood_window":
					component.m_resources[0].m_amount = 2;
					break;
				case "darkwood_gate":
					component.m_resources[1].m_amount = 3;
					break;
				case "iron_grate":
					component.m_resources[0].m_amount = 3;
					break;
				case "piece_chest":
					component.m_resources[1].m_amount = 1;
					break;
				case "piece_chest_private":
					component.m_resources[1].m_amount = 4;
					break;
				case "piece_chest_blackmetal":
					component.m_resources[2].m_amount = 4;
					break;
				case "piece_brazierceiling01":
					component.m_resources[0].m_amount = 3;
					break;
				case "portal_wood":
					component.m_resources[1].m_amount = 10;
					break;
				case "rug_deer":
				case "rug_wolf":
				case "rug_fur":
					component.m_resources[0].m_amount = 3;
					break;
				case "piece_banner01":
				case "piece_banner02":
				case "piece_banner03":
				case "piece_banner04":
				case "piece_banner05":
				case "piece_banner06":
				case "piece_banner07":
					component.m_resources[0].m_amount = 5;
					break;
				case "fermenter":
					component.m_resources[0].m_amount = 15;
					break;
				case "piece_bathtub":
					component.m_resources[2].m_amount = 5;
					break;
				case "crystal_wall_1x1":
					component.m_resources[0].m_amount = 1;
					break;
				case "incinerator":
					component.m_resources[0].m_amount = 5;
					break;
				case "stone_wall_1x1":
					component.m_resources[0].m_amount = 2;
					break;
				case "stone_wall_2x1":
					component.m_resources[0].m_amount = 3;
					break;
				case "stone_pillar":
					component.m_resources[0].m_amount = 3;
					break;
				case "stone_arch":
					component.m_resources[0].m_amount = 3;
					break;
				case "stone_floor_2x2":
					component.m_resources[0].m_amount = 4;
					break;
				case "stone_stair":
					component.m_resources[0].m_amount = 3;
					break;
				}
			}
		}
	}

	[HarmonyPatch(typeof(PieceTable), "UpdateAvailable")]
	private class AlternateBuildPiecesMaterials_Patch
	{
		private static void Prefix(ref List<GameObject> ___m_pieces)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			if (!altBuildPiecesMaterialsEnabled)
			{
				return;
			}
			ItemDrop resItem = new ItemDrop();
			ItemDrop resItem2 = new ItemDrop();
			bool flag = false;
			bool flag2 = false;
			foreach (GameObject ___m_piece in ___m_pieces)
			{
				if (flag && flag2)
				{
					break;
				}
				Piece component = ___m_piece.GetComponent<Piece>();
				string name = ((Object)___m_piece).name;
				string text = name;
				if (!(text == "coal_pile"))
				{
					if (text == "piece_chest_blackmetal")
					{
						resItem2 = component.m_resources[2].m_resItem;
						flag2 = true;
					}
				}
				else
				{
					resItem = component.m_resources[0].m_resItem;
					flag = true;
				}
			}
			foreach (GameObject ___m_piece2 in ___m_pieces)
			{
				Piece component2 = ___m_piece2.GetComponent<Piece>();
				switch (((Object)___m_piece2).name)
				{
				case "piece_workbench_ext4":
					component2.m_resources[2].m_resItem = resItem;
					break;
				case "darkwood_gate":
					component2.m_resources[1].m_resItem = resItem2;
					break;
				case "piece_bathtub":
					component2.m_resources[2].m_resItem = resItem2;
					break;
				}
			}
		}
	}

	[HarmonyPatch(typeof(MenuScene), "Awake")]
	private class AlternateMenuScene_Patch
	{
		private static void Prefix(ref float ___m_windIntensity, ref Vector3 ___m_windDir, ref Color ___m_ambientLightColor)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (altMenuSceneEnabled)
			{
				___m_windIntensity = 0.8f;
				___m_windDir = Vector3.right;
				___m_ambientLightColor = Color.clear;
			}
		}
	}

	[HarmonyPatch(typeof(Character), "Awake")]
	private class FasterCharacterSpeed_Patch
	{
		private static void Prefix(ref float ___m_crouchSpeed, ref float ___m_walkSpeed, ref float ___m_speed, ref float ___m_swimSpeed)
		{
			if (fasterCharacterSpeedEnabled)
			{
				___m_crouchSpeed = 2.2f;
				___m_walkSpeed = 2.5f;
				___m_speed = 5f;
				___m_swimSpeed = 2.2f;
			}
		}
	}

	[HarmonyPatch(typeof(Player), "Awake")]
	private class LargerPickupArea_Patch
	{
		private static void Prefix(ref float ___m_autoPickupRange)
		{
			if (largerPickupAreaEnabled)
			{
				___m_autoPickupRange = 3f;
			}
		}
	}

	[HarmonyPatch(typeof(Skills), "Awake")]
	private class NoSkilllLowerOnDeath_Patch
	{
		private static void Prefix(ref float ___m_DeathLowerFactor)
		{
			if (noSkillLowerOnDeathEnabled)
			{
				___m_DeathLowerFactor = 0f;
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class AlternateStatusEffects_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			if (!altStatusEffectsEnabled)
			{
				return;
			}
			foreach (StatusEffect statusEffect in __instance.m_StatusEffects)
			{
				if (((Object)statusEffect).name.StartsWith("Potion_health") || ((Object)statusEffect).name.StartsWith("Potion_stamina") || ((Object)statusEffect).name == "Wet")
				{
					statusEffect.m_ttl = 60f;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Minimap), "UpdateExplore")]
	private class LargerBoatExploreRadius_Patch
	{
		private static void Prefix(ref float ___m_exploreRadius)
		{
			if (largerBoatExploreRadiusEnabled)
			{
				if (Object.op_Implicit((Object)(object)Ship.GetLocalShip()) && Ship.GetLocalShip().HasPlayerOnboard())
				{
					___m_exploreRadius = 100f;
				}
				else
				{
					___m_exploreRadius = 50f;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Player), "Update")]
	private class ShowInventoryWeight_Patch
	{
		private static void Prefix(ref Player ___m_localPlayer)
		{
			if (showInventoryWeight && Object.op_Implicit((Object)(object)___m_localPlayer))
			{
				currentWeight = ((Humanoid)___m_localPlayer).GetInventory().GetTotalWeight();
				maxWeight = ___m_localPlayer.GetMaxCarryWeight();
			}
		}
	}

	[HarmonyPatch(typeof(Player), "Update")]
	private class ShowInventorySlots_Patch
	{
		private static void Prefix(ref Player ___m_localPlayer)
		{
			if (showInventorySlots && Object.op_Implicit((Object)(object)___m_localPlayer))
			{
				freeSlots = ((Humanoid)___m_localPlayer).GetInventory().GetEmptySlots();
				freeSlotsPercent = ((Humanoid)___m_localPlayer).GetInventory().SlotsUsedPercentage();
			}
		}
	}

	[HarmonyPatch(typeof(Ship), "GetSpeed")]
	private class ShowBoatSpeed_Patch
	{
		private static void Prefix(Ship __instance, ref Rigidbody ___m_body)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (showBoatSpeed)
			{
				if (Object.op_Implicit((Object)(object)__instance) && __instance.HasPlayerOnboard())
				{
					boatSpeed = Vector3.Dot(___m_body.velocity, ((Component)__instance).transform.forward);
				}
				if (Traverse.Create((object)__instance).Method("HaveControllingPlayer", Array.Empty<object>()).GetValue<bool>())
				{
					showBoatSpeedUI = true;
				}
				else
				{
					showBoatSpeedUI = false;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Player), "UseStamina")]
	private class LessStaminaUsage_Patch
	{
		private static void Prefix(ref float v)
		{
			if (lessStaminaUsageEnabled)
			{
				v *= 0.85f;
			}
		}
	}

	[HarmonyPatch(typeof(Minimap), "UpdateBiome")]
	private class MoveBiomeMinimapText_Patch
	{
		private static void Prefix(ref Text ___m_biomeNameSmall, ref Player player)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (smartBiomeEnabled && showUI)
			{
				((Behaviour)___m_biomeNameSmall).enabled = false;
				Biome currentBiome = player.GetCurrentBiome();
				MarsarahMod.currentBiome = ((object)(Biome)(ref currentBiome)).ToString();
				playerArmor = ((Character)player).GetBodyArmor();
			}
			else
			{
				((Behaviour)___m_biomeNameSmall).enabled = true;
			}
		}
	}

	[HarmonyPatch(typeof(InventoryGui), "UpdateRecipeList")]
	private class CraftingRecipesReorder_Patch
	{
		private static void Prefix(ref List<Recipe> recipes)
		{
			if (!craftingRecipesReorderEnabled)
			{
				return;
			}
			List<Recipe> list = new List<Recipe>();
			List<Recipe> list2 = new List<Recipe>();
			List<Recipe> list3 = new List<Recipe>();
			List<Recipe> list4 = new List<Recipe>();
			List<Recipe> list5 = new List<Recipe>();
			List<Recipe> list6 = new List<Recipe>();
			List<Recipe> list7 = new List<Recipe>();
			List<Recipe> list8 = new List<Recipe>();
			List<Recipe> list9 = new List<Recipe>();
			List<Recipe> list10 = new List<Recipe>();
			List<Recipe> list11 = new List<Recipe>();
			List<Recipe> list12 = new List<Recipe>();
			List<Recipe> list13 = new List<Recipe>();
			List<Recipe> list14 = new List<Recipe>();
			List<Recipe> list15 = new List<Recipe>();
			List<Recipe> list16 = new List<Recipe>();
			List<Recipe> list17 = new List<Recipe>();
			List<Recipe> list18 = new List<Recipe>();
			List<Recipe> list19 = new List<Recipe>();
			List<Recipe> list20 = new List<Recipe>();
			List<Recipe> list21 = new List<Recipe>();
			List<Recipe> list22 = new List<Recipe>();
			foreach (Recipe recipe in recipes)
			{
				switch (((object)(ItemType)(ref recipe.m_item.m_itemData.m_shared.m_itemType)).ToString())
				{
				case "Helmet":
					if (((Object)recipe).name == "Recipe_HelmetLeather")
					{
						list2.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetTrollLeather")
					{
						list3.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetBronze")
					{
						list4.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetRoot")
					{
						list5.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetIron")
					{
						list6.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetFenrir")
					{
						list7.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetDrake")
					{
						list8.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_HelmetPadded")
					{
						list9.Add(recipe);
					}
					else
					{
						list10.Add(recipe);
					}
					break;
				case "Chest":
					if (((Object)recipe).name == "Recipe_ArmorRagsChest")
					{
						list.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorLeatherChest")
					{
						list2.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorTrollLeatherChest")
					{
						list3.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorBronzeChest")
					{
						list4.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorRootChest")
					{
						list5.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorIronChest")
					{
						list6.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorFenrirChest")
					{
						list7.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorWolfChest")
					{
						list8.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorPaddedCuirass")
					{
						list9.Add(recipe);
					}
					else
					{
						list11.Add(recipe);
					}
					break;
				case "Legs":
					if (((Object)recipe).name == "Recipe_ArmorRagsLegs")
					{
						list.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorLeatherLegs")
					{
						list2.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorTrollLeatherLegs")
					{
						list3.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorBronzeLegs")
					{
						list4.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorRootLegs")
					{
						list5.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorIronLegs")
					{
						list6.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorFenrirLegs")
					{
						list7.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorWolfLegs")
					{
						list8.Add(recipe);
					}
					else if (((Object)recipe).name == "Recipe_ArmorPaddedGreaves")
					{
						list9.Add(recipe);
					}
					else
					{
						list12.Add(recipe);
					}
					break;
				case "Shoulder":
					list13.Add(recipe);
					break;
				case "OneHandedWeapon":
					list14.Add(recipe);
					break;
				case "TwoHandedWeapon":
					list15.Add(recipe);
					break;
				case "Shield":
					list16.Add(recipe);
					break;
				case "Bow":
					list17.Add(recipe);
					break;
				case "Ammo":
					list18.Add(recipe);
					break;
				case "Tool":
					list19.Add(recipe);
					break;
				case "Torch":
					list20.Add(recipe);
					break;
				case "Misc":
					list21.Add(recipe);
					break;
				default:
					list22.Add(recipe);
					break;
				}
			}
			recipes.Clear();
			foreach (Recipe item in list22)
			{
				recipes.Add(item);
			}
			foreach (Recipe item2 in list19)
			{
				recipes.Add(item2);
			}
			foreach (Recipe item3 in list20)
			{
				recipes.Add(item3);
			}
			foreach (Recipe item4 in list)
			{
				recipes.Add(item4);
			}
			foreach (Recipe item5 in list2)
			{
				recipes.Add(item5);
			}
			foreach (Recipe item6 in list3)
			{
				recipes.Add(item6);
			}
			foreach (Recipe item7 in list4)
			{
				recipes.Add(item7);
			}
			foreach (Recipe item8 in list5)
			{
				recipes.Add(item8);
			}
			foreach (Recipe item9 in list6)
			{
				recipes.Add(item9);
			}
			foreach (Recipe item10 in list7)
			{
				recipes.Add(item10);
			}
			foreach (Recipe item11 in list8)
			{
				recipes.Add(item11);
			}
			foreach (Recipe item12 in list9)
			{
				recipes.Add(item12);
			}
			foreach (Recipe item13 in list10)
			{
				recipes.Add(item13);
			}
			foreach (Recipe item14 in list11)
			{
				recipes.Add(item14);
			}
			foreach (Recipe item15 in list12)
			{
				recipes.Add(item15);
			}
			foreach (Recipe item16 in list13)
			{
				recipes.Add(item16);
			}
			foreach (Recipe item17 in list14)
			{
				recipes.Add(item17);
			}
			foreach (Recipe item18 in list15)
			{
				recipes.Add(item18);
			}
			foreach (Recipe item19 in list16)
			{
				recipes.Add(item19);
			}
			foreach (Recipe item20 in list17)
			{
				recipes.Add(item20);
			}
			foreach (Recipe item21 in list18)
			{
				recipes.Add(item21);
			}
			foreach (Recipe item22 in list21)
			{
				recipes.Add(item22);
			}
		}
	}

	[HarmonyPatch(typeof(Hud), "Awake")]
	public static class MarsarahMod_HUD_Awake_Patch
	{
		public static void Postfix(Hud __instance)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Expected O, but got Unknown
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0416: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Expected O, but got Unknown
			//IL_0654: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Expected O, but got Unknown
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0920: Unknown result type (might be due to invalid IL or missing references)
			//IL_0927: Expected O, but got Unknown
			//IL_095d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0974: Unknown result type (might be due to invalid IL or missing references)
			//IL_098b: 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_09ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b3: Expected O, but got Unknown
			//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a13: Expected O, but got Unknown
			//IL_0a45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b56: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0726: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0766: Expected O, but got Unknown
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Expected O, but got Unknown
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0803: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbf: Expected O, but got Unknown
			//IL_0bf5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4b: Expected O, but got Unknown
			//IL_0c7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ceb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d02: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)__instance) && (showInventoryWeight || showInventorySlots))
			{
				int fontSize = 16;
				string UITextFontName5 = "AveriaSansLibre-Bold";
				float num = 115f;
				float num2 = 30f;
				GameObject val = new GameObject("InventoryArea");
				val.layer = 5;
				val.transform.SetParent(((Component)__instance.m_healthPanel).transform);
				RectTransform val2 = val.AddComponent<RectTransform>();
				val2.anchorMin = new Vector2(1f, 1f);
				val2.anchorMax = new Vector2(1f, 1f);
				val2.anchoredPosition = new Vector2(-45f, -230f);
				val2.sizeDelta = new Vector2(num, num2);
				Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
				inventoryAreaBackground = val.AddComponent<Image>();
				((Graphic)inventoryAreaBackground).color = new Color(0f, 0f, 0f, 0.4f);
				inventoryAreaBackground.sprite = sprite;
				inventoryAreaBackground.type = (Type)1;
				((Behaviour)inventoryAreaBackground).enabled = showUI;
				if (showInventoryWeight)
				{
					GameObject val3 = new GameObject("WeightText");
					val3.layer = 5;
					val3.transform.SetParent(val.transform);
					RectTransform val4 = val3.AddComponent<RectTransform>();
					val4.anchoredPosition = new Vector2(showInventorySlots ? 5f : 0f, 0f);
					val4.sizeDelta = new Vector2(num, num2);
					UIWeightText = val3.AddComponent<Text>();
					((Graphic)UIWeightText).color = Color.green;
					UIWeightText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName5));
					UIWeightText.fontSize = fontSize;
					UIWeightText.alignment = (TextAnchor)(showInventorySlots ? 3 : 4);
					Outline val5 = val3.AddComponent<Outline>();
					((Shadow)val5).effectColor = Color.black;
					((Shadow)val5).effectDistance = new Vector2(1f, -1f);
					((Shadow)val5).useGraphicAlpha = true;
					((MonoBehaviour)val5).useGUILayout = true;
				}
				if (showInventorySlots)
				{
					GameObject val6 = new GameObject("SlotText");
					val6.layer = 5;
					val6.transform.SetParent(val.transform);
					RectTransform val7 = val6.AddComponent<RectTransform>();
					val7.anchoredPosition = new Vector2(showInventoryWeight ? (-5f) : 0f, 0f);
					val7.sizeDelta = new Vector2(num, num2);
					UISlotText = val6.AddComponent<Text>();
					((Graphic)UISlotText).color = Color.green;
					UISlotText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName5));
					UISlotText.fontSize = fontSize;
					UISlotText.alignment = (TextAnchor)(showInventoryWeight ? 5 : 4);
					Outline val8 = val6.AddComponent<Outline>();
					((Shadow)val8).effectColor = Color.black;
					((Shadow)val8).effectDistance = new Vector2(1f, -1f);
					((Shadow)val8).useGraphicAlpha = true;
					((MonoBehaviour)val8).useGUILayout = true;
				}
			}
			if (Object.op_Implicit((Object)(object)__instance) && showEnemyDetector)
			{
				int fontSize2 = 16;
				string UITextFontName4 = "AveriaSansLibre-Bold";
				float num3 = 100f;
				float num4 = 30f;
				GameObject val9 = new GameObject("EnemyArea");
				val9.layer = 5;
				val9.transform.SetParent(((Component)__instance.m_healthPanel).transform);
				RectTransform val10 = val9.AddComponent<RectTransform>();
				val10.anchorMin = new Vector2(1f, 1f);
				val10.anchorMax = new Vector2(1f, 1f);
				val10.anchoredPosition = new Vector2((showInventorySlots || showInventoryWeight) ? 70f : (-40f), -230f);
				val10.sizeDelta = new Vector2(num3, num4);
				Sprite sprite2 = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
				enemyAreaBackground = val9.AddComponent<Image>();
				((Graphic)enemyAreaBackground).color = new Color(0f, 0f, 0f, 0.4f);
				enemyAreaBackground.sprite = sprite2;
				enemyAreaBackground.type = (Type)1;
				((Behaviour)enemyAreaBackground).enabled = showUI;
				GameObject val11 = new GameObject("EnemyText");
				val11.layer = 5;
				val11.transform.SetParent(val9.transform);
				RectTransform val12 = val11.AddComponent<RectTransform>();
				val12.anchoredPosition = new Vector2(0f, 0f);
				val12.sizeDelta = new Vector2(num3, num4);
				UIEnemyText = val11.AddComponent<Text>();
				((Graphic)UIEnemyText).color = Color.white;
				UIEnemyText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName4));
				UIEnemyText.fontSize = fontSize2;
				UIEnemyText.alignment = (TextAnchor)4;
				Outline val13 = val11.AddComponent<Outline>();
				((Shadow)val13).effectColor = Color.black;
				((Shadow)val13).effectDistance = new Vector2(1f, -1f);
				((Shadow)val13).useGraphicAlpha = true;
				((MonoBehaviour)val13).useGUILayout = true;
			}
			if (Object.op_Implicit((Object)(object)__instance) && showBoatSpeed)
			{
				int fontSize3 = 16;
				string UITextFontName3 = "AveriaSansLibre-Bold";
				float num5 = 155f;
				float num6 = 30f;
				GameObject val14 = new GameObject("BoatArea");
				val14.layer = 5;
				val14.transform.SetParent(((Component)__instance.m_healthPanel).transform);
				RectTransform val15 = val14.AddComponent<RectTransform>();
				val15.anchorMin = new Vector2(1f, 1f);
				val15.anchorMax = new Vector2(1f, 1f);
				val15.anchoredPosition = new Vector2(((showInventorySlots || showInventoryWeight) && showEnemyDetector) ? 203f : ((showInventorySlots || showInventoryWeight || showEnemyDetector) ? 100f : (-40f)), -230f);
				val15.sizeDelta = new Vector2(num5, num6);
				Sprite sprite3 = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
				boatAreaBackground = val14.AddComponent<Image>();
				((Graphic)boatAreaBackground).color = new Color(0f, 0f, 0f, 0.4f);
				boatAreaBackground.sprite = sprite3;
				boatAreaBackground.type = (Type)1;
				((Behaviour)boatAreaBackground).enabled = showUI;
				GameObject val16 = new GameObject("BoatTextTitle");
				val16.layer = 5;
				val16.transform.SetParent(val14.transform);
				RectTransform val17 = val16.AddComponent<RectTransform>();
				val17.anchoredPosition = new Vector2(-25f, 0f);
				val17.sizeDelta = new Vector2(num5, num6);
				GameObject val18 = new GameObject("BoatText");
				val18.layer = 5;
				val18.transform.SetParent(val14.transform);
				RectTransform val19 = val18.AddComponent<RectTransform>();
				val19.anchoredPosition = new Vector2(45f, 0f);
				val19.sizeDelta = new Vector2(num5, num6);
				UIBoatTextTitle = val16.AddComponent<Text>();
				UIBoatTextTitle.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName3));
				UIBoatTextTitle.fontSize = fontSize3;
				UIBoatTextTitle.alignment = (TextAnchor)4;
				UIBoatText = val18.AddComponent<Text>();
				UIBoatText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName3));
				UIBoatText.fontSize = fontSize3;
				UIBoatText.alignment = (TextAnchor)4;
				Outline val20 = val18.AddComponent<Outline>();
				((Shadow)val20).effectColor = Color.black;
				((Shadow)val20).effectDistance = new Vector2(1f, -1f);
				((Shadow)val20).useGraphicAlpha = true;
				((MonoBehaviour)val20).useGUILayout = true;
			}
			if (Object.op_Implicit((Object)(object)__instance) && showTimeAndDay)
			{
				int fontSize4 = 16;
				string UITextFontName2 = "AveriaSansLibre-Bold";
				float num7 = 200f;
				float num8 = 30f;
				GameObject val21 = new GameObject("TimeArea");
				val21.layer = 5;
				val21.transform.SetParent(__instance.m_rootObject.transform);
				RectTransform val22 = val21.AddComponent<RectTransform>();
				val22.anchorMin = new Vector2(1f, 1f);
				val22.anchorMax = new Vector2(1f, 1f);
				val22.anchoredPosition = new Vector2(-140f, -25f);
				val22.sizeDelta = new Vector2(num7, num8);
				GameObject val23 = new GameObject("TimeText");
				val23.layer = 5;
				val23.transform.SetParent(val21.transform);
				RectTransform val24 = val23.AddComponent<RectTransform>();
				val24.anchoredPosition = new Vector2(40f, 0f);
				val24.sizeDelta = new Vector2(num7 / 2f, num8);
				GameObject val25 = new GameObject("BiomeText");
				val25.layer = 5;
				val25.transform.SetParent(val21.transform);
				RectTransform val26 = val25.AddComponent<RectTransform>();
				val26.anchoredPosition = new Vector2(-40f, 0f);
				val26.sizeDelta = new Vector2(num7 / 2f, num8);
				UITimeText = val23.AddComponent<Text>();
				UITimeText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName2));
				UITimeText.fontSize = fontSize4;
				UITimeText.alignment = (TextAnchor)5;
				UIDayText = val25.AddComponent<Text>();
				UIDayText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName2));
				UIDayText.fontSize = fontSize4;
				UIDayText.alignment = (TextAnchor)3;
				Outline val27 = val23.AddComponent<Outline>();
				((Shadow)val27).effectColor = Color.black;
				((Shadow)val27).effectDistance = new Vector2(1f, -1f);
				((Shadow)val27).useGraphicAlpha = true;
				((MonoBehaviour)val27).useGUILayout = true;
				Outline val28 = val25.AddComponent<Outline>();
				((Shadow)val28).effectColor = Color.black;
				((Shadow)val28).effectDistance = new Vector2(1f, -1f);
				((Shadow)val28).useGraphicAlpha = true;
				((MonoBehaviour)val28).useGUILayout = true;
			}
			if (Object.op_Implicit((Object)(object)__instance) && smartBiomeEnabled)
			{
				int fontSize5 = 16;
				string UITextFontName = "AveriaSansLibre-Bold";
				float num9 = 150f;
				float num10 = 30f;
				GameObject val29 = new GameObject("BiomeArea");
				val29.layer = 5;
				val29.transform.SetParent(__instance.m_rootObject.transform);
				RectTransform val30 = val29.AddComponent<RectTransform>();
				val30.anchorMin = new Vector2(1f, 1f);
				val30.anchorMax = new Vector2(1f, 1f);
				val30.anchoredPosition = new Vector2(-125f, -55f);
				val30.sizeDelta = new Vector2(num9, num10);
				GameObject val31 = new GameObject("BiomeText");
				val31.layer = 5;
				val31.transform.SetParent(val29.transform);
				RectTransform val32 = val31.AddComponent<RectTransform>();
				val32.anchoredPosition = new Vector2(0f, 0f);
				val32.sizeDelta = new Vector2(num9, num10);
				UIBiomeText = val31.AddComponent<Text>();
				UIBiomeText.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font tempFont) => ((Object)tempFont).name == UITextFontName));
				UIBiomeText.fontSize = fontSize5;
				UIBiomeText.alignment = (TextAnchor)5;
				Outline val33 = val31.AddComponent<Outline>();
				((Shadow)val33).effectColor = Color.black;
				((Shadow)val33).effectDistance = new Vector2(1f, -1f);
				((Shadow)val33).useGraphicAlpha = true;
				((MonoBehaviour)val33).useGUILayout = true;
			}
			if (Object.op_Implicit((Object)(object)__instance) && altLoadingTipsEnabled)
			{
				List<string> list = new List<string>
				{
					"Weapons and armor can be crafted and upgraded using Workbenches or Forges.", "Eating food increases your health and stamina pools. Try to balance your three food slots accordingly.", "Crafting stations can be upgraded by building upgrade parts in their proximity.", "There are four principal crafting types: woodworking, masonry, smithing, and cooking.", "Enemies won't spawn near player built structures (e.g., crafting tables, camp fires, etc.)", "Sitting is the safest way to travel while on a boat.", "Upon your arrival in Valheim, try to find stones and branches on the ground to build your first weapon.", "Venturing outside at night is more dangerous. Be prepared if you plan to go out during that time.", "Hunting deer with a ranged weapon provides a good source of meat and skin.", "Build a rudimentary shelter as soon as possible, to refuge during your first nights. It can be used as a temporary home until you find a good spot for a better one.",
					"Different enemies are resistant to different damage types. If you see grey damage indicators when attacking, try changing the weapon.", "Claiming a bed after building it will set your spawn point to its location when dying.", "Attacking with knives and bows while sneaking confers a large damage bonus.", "Birds are a good source of feathers. They will stay close to the ground while the weather is bad.", "Weapons, armor, and tools can be repaired for free at a Workbench or Forge by interacting with the hammer icon while crafting.", "If you can't harvest a resource, try to build better tools.", "Being rested helps to regenerate stamina and health faster. Build a fire under a shelter to rest.", "Yellow damage numbers indicate a weakness, grey numbers indicate a resistance, white numbers indicate normal damage.", "Use the hoe in combination with the pickaxe to flatten the ground. This will make it much easier to construct buildings.", "Build a cart to haul heavy goods over longer distances. Carts cannot go through portals.",
					"Boats are controlled by interacting with the steering oar. Depending on the weather, boats will be faster while using the paddle instead of the sails.", "Defeating a Forsaken will drop items that will give you a general idea of what to do next.", "Cooking meat over a fire or eating fruit is a good way to get fed. Later on, they can be cooked using a cauldron.", "You can filter map pins by type by right clicking on them (or pressing DPad Right) on the bottom right of the map.", "If no arrow has been manually selected when using a bow, arrows are automatically selected in ascending order beginning from the leftmost column and going right.", "Build a Fermenter to craft different potions from base meads. The right potion used at the right time and place can be the difference between life and death.", "When setting up a bigger home, separating crafting stations and storage items in different buildings can make things less clustered.", "If there is not enough space in your shelter, try stacking storage chests on top of each other by creating shelves.", "Killing bee nests can provide the means to make your own honey.", "Always save the riches you find (e.g., coins, rubys, etc.) You will need them one day.",
					"The more comfort items are installed in your home (e.g., fire, rugs, furniture, etc), the longer the rested bonus will be.", "When fighting a Forsaken, make sure you bring your best gear, food, and potions.", "All build pieces require a certain crafting station nearby (e.g., Workbench, Forge, Stonecutter). If you build outside their range, either move them closer or build new ones.", "Building paths and roads can make carying material with a cart a lot easier.", "Item stacks can be split using SHIFT + Left Click in chests or inventory.", "Item stacks can be fully transferred to/from containers by dragging or pressing CTRL + Left Click.", "If you run out of stamina while swimming, you will drown.", "The HUD can be toggled with the CTRL + F3 keys.", "Parying with a shield or weapon means blocking at the very last moment of an enemy attack before hitting you. If done right, the enemy will be staggered.", "Don't be afraid to retreat from a fight. It is better to come back to it prepared than naked.",
					"Sheathing or unsheathing equipped weapons and shields can be done by pressing R. Walking and runnng with unsheathed weapons will slow you down.", "Old buildings can be found throughout Valheim. They can be either renovated for shelter, or torn down for resources.", "Some animals can be tamed.", "When building a fresh shelter or home, start by building the outline with beams and poles first, then fill with walls, floors, and roofs."
				};
				loadingTipString = list[Random.Range(0, list.Count)];
			}
		}
	}

	[HarmonyPatch(typeof(Hud), "Update")]
	public static class MarsarahMod_HUD_Update_Patch
	{
		public static void Postfix(Hud __instance)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: 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_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0784: Unknown result type (might be due to invalid IL or missing references)
			//IL_065d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: 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_07b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ae: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)__instance) && showInventoryWeight)
			{
				((Behaviour)UIWeightText).enabled = showUI;
				((Behaviour)inventoryAreaBackground).enabled = showUI;
				if (showUI)
				{
					float num = currentWeight * 100f / maxWeight;
					if (num < 33f)
					{
						((Graphic)UIWeightText).color = Color.green;
					}
					else if (num < 66f)
					{
						((Graphic)UIWeightText).color = Color.yellow;
					}
					else if (num < 100f)
					{
						((Graphic)UIWeightText).color = new Color(1f, 0.549019f, 0f);
					}
					else
					{
						((Graphic)UIWeightText).color = Color.red;
					}
					UIWeightText.text = currentWeight.ToString("0.0") + "/" + maxWeight.ToString("0");
				}
			}
			if (Object.op_Implicit((Object)(object)__instance) && showInventorySlots)
			{
				((Behaviour)UISlotText).enabled = showUI;
				((Behaviour)inventoryAreaBackground).enabled = showUI;
				if (showUI)
				{
					if (freeSlotsPercent < 33f)
					{
						((Graphic)UISlotText).color = Color.green;
					}
					else if (freeSlotsPercent < 66f)
					{
						((Graphic)UISlotText).color = Color.yellow;
					}
					else if (freeSlotsPercent < 100f)
					{
						((Graphic)UISlotText).color = new Color(1f, 0.549019f, 0f);
					}
					else
					{
						((Graphic)UISlotText).color = Color.red;
					}
					UISlotText.text = "(" + freeSlots + ")";
				}
			}
			if (Object.op_Implicit((Object)(object)__instance) && showBoatSpeed)
			{
				((Behaviour)UIBoatText).enabled = showBoatSpeedUI && showUI;
				((Behaviour)UIBoatTextTitle).enabled = showBoatSpeedUI && showUI;
				((Behaviour)boatAreaBackground).enabled = showBoatSpeedUI && showUI;
				if (showBoatSpeedUI && showUI)
				{
					if (boatSpeed < 2.5f)
					{
						((Graphic)UIBoatText).color = Color.red;
					}
					else if (boatSpeed < 5f)
					{
						((Graphic)UIBoatText).color = new Color(1f, 0.549019f, 0f);
					}
					else if (boatSpeed < 7.5f)
					{
						((Graphic)UIBoatText).color = Color.yellow;
					}
					else
					{
						((Graphic)UIBoatText).color = Color.green;
					}
					UIBoatTextTitle.text = "Boat speed";
					UIBoatText.text = ((boatSpeed > 0f) ? ("F " + boatSpeed.ToString("0.00")) : ("R " + Math.Abs(boatSpeed).ToString("0.00")));
				}
			}
			if (Object.op_Implicit((Object)(object)__instance) && showTimeAndDay)
			{
				((Behaviour)UITimeText).enabled = showUI;
				((Behaviour)UIDayText).enabled = showUI;
				if (showUI)
				{
					switch (dayString)
					{
					case "Night":
						((Graphic)UITimeText).color = Color.red;
						break;
					case "Dawn":
					case "Dusk":
						((Graphic)UITimeText).color = new Color(1f, 0.549019f, 0f);
						break;
					case "Evening":
					case "Morning":
						((Graphic)UITimeText).color = Color.yellow;
						break;
					case "Day":
					case "Afternoon":
						((Graphic)UITimeText).color = Color.green;
						break;
					default:
						((Graphic)UITimeText).color = Color.white;
						break;
					}
					((Graphic)UIDayText).color = Color.white;
					UITimeText.text = dayString;
					UIDayText.text = "Day " + currentDay;
				}
			}
			if (Object.op_Implicit((Object)(object)__instance) && showTimeAndDay)
			{
				((Behaviour)UIBiomeText).enabled = showUI;
				if (showUI)
				{
					if (currentBiome != "" && biomeArmorsDict.ContainsKey(currentBiome))
					{
						float num2 = biomeArmorsDict[currentBiome]._min;
						float num3 = biomeArmorsDict[currentBiome]._max;
						float num4 = num3 - num2;
						float num5 = playerArmor - num2;
						float num6 = num5 * 100f / num4;
						if (num6 < 0f)
						{
							((Graphic)UIBiomeText).color = new Color(0.298039f, 0f, 0.6f);
						}
						else if (num6 < 25f)
						{
							((Graphic)UIBiomeText).color = Color.red;
						}
						else if (num6 < 75f)
						{
							((Graphic)UIBiomeText).color = new Color(1f, 0.549019f, 0f);
						}
						else if (num6 < 100f)
						{
							((Graphic)UIBiomeText).color = Color.yellow;
						}
						else
						{
							((Graphic)UIBiomeText).color = Color.green;
						}
					}
					else
					{
						((Graphic)UIBiomeText).color = Color.white;
					}
					UIBiomeText.text = ((currentBiome == "BlackForest") ? "Black forest" : currentBiome);
				}
			}
			if (!Object.op_Implicit((Object)(object)__instance) || !showEnemyDetector)
			{
				return;
			}
			((Behaviour)UIEnemyText).enabled = showUI;
			((Behaviour)enemyAreaBackground).enabled = showUI;
			if (showUI)
			{
				if (numEnemies < 3)
				{
					((Graphic)UIEnemyText).color = Color.green;
				}
				else if (numEnemies < 5)
				{
					((Graphic)UIEnemyText).color = Color.yellow;
				}
				else if (numEnemies < 7)
				{
					((Graphic)UIEnemyText).color = new Color(1f, 0.549019f, 0f);
				}
				else
				{
					((Graphic)UIEnemyText).color = Color.red;
				}
				UIEnemyText.text = "Enemies " + numEnemies;
			}
		}
	}

	[HarmonyPatch(typeof(Hud), "UpdateBlackScreen")]
	private class ExtraLoadingTipsUpdate_Patch
	{
		private static void Postfix(Hud __instance)
		{
			if (Object.op_Implicit((Object)(object)__instance) && altLoadingTipsEnabled)
			{
				__instance.m_loadingTip.text = loadingTipString;
			}
		}
	}

	[HarmonyPatch(typeof(ObjectDB), "Awake")]
	private class MoreFoodCookingStacks_Patch
	{
		private static void Prefix(ref ObjectDB __instance)
		{
			if (!moreFoodCookingStacksEnabled)
			{
				return;
			}
			foreach (Recipe recipe in __instance.m_recipes)
			{
				switch (((Object)recipe).name)
				{
				case "Recipe_QueensJam":
					recipe.m_resources[0].m_amount = 5;
					recipe.m_resources[1].m_amount = 5;
					break;
				case "Recipe_TurnipStew":
					recipe.m_amount = 2;
					break;
				case "Recipe_Blacksoup":
					recipe.m_resources[0].m_amount = 2;
					recipe.m_resources[1].m_amount = 2;
					recipe.m_resources[2].m_amount = 2;
					recipe.m_amount = 2;
					break;
				case "Recipe_CarrotSoup":
					recipe.m_amount = 2;
					break;
				case "Recipe_DeerStew":
					recipe.m_resources[0].m_amount = 2;
					recipe.m_resources[1].m_amount = 2;
					recipe.m_resources[2].m_amount = 2;
					recipe.m_amount = 2;
					break;
				case "Recipe_ShocklateSmoothie":
					recipe.m_amount = 2;
					break;
				case "Recipe_MinceMeatSauce":
					recipe.m_resources[0].m_amount = 2;
					recipe.m_resources[1].m_amount = 2;
					recipe.m_resources[2].m_amount = 2;
					recipe.m_amount = 2;
					break;
				}
			}
		}
	}

	private readonly Harmony harmony = new Harmony("marsarah.MarsarahMod");

	private static ConfigFile config;

	private static bool modEnabled;

	private static bool cheaperGearEnabled;

	private static bool doubleBronzeEnabled;

	private static bool altGearRecipesEnabled;

	private static bool altLinenCapeEnabled;

	private static bool altGearSpeedModifiersEnabled;

	private static bool altWSSpeedModifiersEnabled;

	private static bool cheaperBuildPiecesEnabled;

	private static bool altBuildPiecesMaterialsEnabled;

	private static bool altMenuSceneEnabled;

	private static bool altForsakenPowersEnabled;

	private static bool fasterCharacterSpeedEnabled;

	private static bool lighterMetalWeightEnabled;

	private static bool largerPickupAreaEnabled;

	private static bool noSkillLowerOnDeathEnabled;

	private static bool altStatusEffectsEnabled;

	private static bool largerBoatExploreRadiusEnabled;

	private static bool showInventoryWeight;

	private static bool showInventorySlots;

	private static bool showBoatSpeed;

	private static bool lessStaminaUsageEnabled;

	private static bool showTimeAndDay;

	private static bool timeFormat24H;

	private static bool smartBiomeEnabled;

	private static bool altLoadingTipsEnabled;

	private static bool showEnemyDetector;

	private static bool craftingRecipesReorderEnabled;

	private static bool moreFoodCookingStacksEnabled;

	private static bool moreHPWithArmorEnabled;

	private static bool otherEnabled;

	private static float currentWeight;

	private static float maxWeight;

	private static float freeSlots;

	private static float freeSlotsPercent;

	private static float boatSpeed;

	private static bool showBoatSpeedUI = false;

	private static string dayString;

	private static string currentBiome = "";

	private static float playerArmor;

	private static string loadingTipString;

	private static int numEnemies = 0;

	private static bool showUI = true;

	private static int currentDay = 0;

	private float minBaseHP;

	private float maxBaseHP;

	private float minArmor;

	private float maxArmor;

	private static Dictionary<string, BiomeArmors> biomeArmorsDict = new Dictionary<string, BiomeArmors>();

	private static Text UIWeightText;

	private static Text UISlotText;

	private static Text UIBoatText;

	priv