Decompiled source of LethalMinLibrary v2.1.1

NoteBoxz.LethalMinLibrary.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using NoteBoxz.LethalMinLibrary.NetcodePatcher;
using Unity.Netcode;
using UnityEditor;
using UnityEditor.AssetImporters;
using UnityEngine;
using UnityEngine.Video;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("NoteBoxz.LethalMinLibrary")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("2.1.1.0")]
[assembly: AssemblyInformationalVersion("2.1.1+6cc3df30c653f8165228f26d459e22beaf125245")]
[assembly: AssemblyProduct("LethalMinLibrary")]
[assembly: AssemblyTitle("NoteBoxz.LethalMinLibrary")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalMinLibrary
{
	public class LethalMinBundleContainer : ScriptableObject
	{
		[Serializable]
		public class AssetReference
		{
			public string name = "";

			public Object asset = null;
		}

		public string modName = "";

		public string modAuthor = "";

		public string modVersion = "";

		public string assetPath = "";

		public string bundleName = "";

		public string[] assetNames = new string[0];

		public LMLmodInfo modInfo = null;

		public List<AssetReference> assetReferences = new List<AssetReference>();

		public void AddAssetReference(string name, Object asset)
		{
			assetReferences.Add(new AssetReference
			{
				name = name,
				asset = asset
			});
		}
	}
	[Obsolete]
	public enum LibHazardType
	{
		Lethal,
		Poison,
		Fire,
		Electric,
		Water,
		Exsplosive,
		Spore,
		Crush
	}
	[Obsolete]
	public class OnionFuseRules : ScriptableObject
	{
		[Tooltip("An array of OnionType values representing the onions that can fuse together.")]
		public OnionType[]? CompatibleOnions;

		[Header("Not Implemented")]
		[Tooltip("An array of Texture2D objects representing the textures to be used for fusing onions. If this is null, the textures will be generated automatically.")]
		public Texture2D[]? FuseTextures;

		[Tooltip("Determines whether onions should fuse in order or not.")]
		public bool FuseInOrder;

		[Tooltip("Specifies whether Fuseion textures should be generated automatically.")]
		public bool GenerateFuseionTextures;

		[Tooltip("The main onion prefab to be instantiated when fusing occurs.")]
		public GameObject? MainOnionPrefab;

		[Tooltip("The path to the onion's mesh that will be replaced with the fused mesh.")]
		public string OnionMeshPath = "";

		[Tooltip("The fused onion meshes, (Note: The first mesh should be the 2 onion fused, the second should be the 3 onion fused, etc.)")]
		public GameObject[]? OnionMeshes;

		[HideInInspector]
		public bool HasBeenRegistered;

		[HideInInspector]
		public int FuseID;

		[HideInInspector]
		public string version = "0.2.22";

		public bool CanFuseWith(OnionType onion)
		{
			OnionType onion2 = onion;
			return Array.Exists(CompatibleOnions, (OnionType element) => (Object)(object)element == (Object)(object)onion2);
		}
	}
	[Obsolete]
	public class OnionType : ScriptableObject
	{
		[Header("Distinguishing Information")]
		[Tooltip("The onion's color")]
		public Color OnionColor;

		[Tooltip("The Onion's texture")]
		public Texture2D? OnionTexture;

		public Material? OnionMaterial;

		[Tooltip("The name of the onion's type.")]
		public string TypeName = "";

		[Tooltip("Set by mod, do not change.")]
		[HideInInspector]
		public int OnionTypeID;

		[Header("Onion Stats")]
		[Tooltip("The types of pikmin that the onion can hold.")]
		public PikminType[]? TypesCanHold;

		[Header("Spawning")]
		[Tooltip("Whether the onion should spawn in as an item.")]
		public bool SpawnInAsItem;

		[Tooltip("Whether the onion can create sprouts.")]
		public bool CanCreateSprouts = true;

		[Tooltip("The item mesh that the onion should spawn in as. (will be set to defult if empty)")]
		public GameObject? OnionItemMeshPrefab;

		[Header("Unused / Not Implemented")]
		[Tooltip("The onion's custom script")]
		public NetworkBehaviour[]? OnionScript;

		[Tooltip("The onion's icon")]
		public Sprite? OnionIcon;

		[Tooltip("Whether the onion can be fused with other onions.")]
		public bool CanBeFused;

		[Tooltip("The fuse rules for the onion.")]
		public OnionFuseRules? FuesingRules;

		[Tooltip("The onion's prefab. (will be set to defult if empty)")]
		public GameObject? OnionPrefab;

		[HideInInspector]
		public bool HasBeenRegistered;

		[HideInInspector]
		public string version = "0.2.22";
	}
	[Obsolete]
	public class PikminMeshRefernces : MonoBehaviour
	{
		public GameObject? PikminGlowRoot;

		[Tooltip("The Gameobjects of the pikmin's plants in the pikmin's prefab.")]
		public GameObject[]? PikminGrowthStagePlants;

		public Animator? PikminAnimator;
	}
	[Obsolete]
	public class PikminSoundPack : ScriptableObject
	{
		[Tooltip("The sound the pikmin plays before attacking")]
		public AudioClip[] AttackVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when spawned in")]
		public AudioClip[] BornVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays for exiting the onion")]
		public AudioClip[] ExitOnionVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays for entering the onion")]
		public AudioClip[] EnterOnionVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when it spots an item")]
		public AudioClip[] ItemNoticeVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when it dies")]
		public AudioClip[] GhostVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays while carrying an item")]
		public AudioClip[] CarryVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when losing their leader")]
		public AudioClip[] LostVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when they start carrying an item")]
		public AudioClip[] LiftVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when it gets hurt")]
		public AudioClip[] HurtVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when it gets Crushed")]
		public AudioClip[] CrushedVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when spotting a player")]
		public AudioClip[] NoticeVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when thrown")]
		public AudioClip[] ThrowVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays when being held by a player")]
		public AudioClip[] HoldVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("The sound the pikmin plays for compleating action")]
		public AudioClip[] YayVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("the sound that plays when a pikmin is poisoned")]
		public AudioClip[] CoughVoiceLine = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("the 'woosh' sound that plays when a pikmin is thrown, overridden by mod if left empty")]
		public AudioClip[] ThrowSFX = (AudioClip[])(object)new AudioClip[0];

		[Tooltip("the hit sound that plays when a pikmin lands a hit on an enemy, overridden by mod if left empty")]
		public AudioClip[] HitSFX = (AudioClip[])(object)new AudioClip[0];

		public bool FillEmptyWithDefault = false;
	}
	[Obsolete]
	public class PikminType : ScriptableObject
	{
		[Header("Distinguishing Information")]
		[Tooltip("The pikmin type's name")]
		public string PikminName = "";

		[Tooltip("The pikmin's color")]
		public Color PikminColor;

		[Tooltip("The pikmin's Secondary color")]
		public Color PikminColor2;

		[Tooltip("The pikmin's icon")]
		public Sprite? PikminIcon;

		[Tooltip("The pikmin's the Idle Glow Sprite")]
		public Sprite? PikminGlow;

		public bool ReplaceGlowFXwithDefult = true;

		public PikminMeshRefernces MeshRefernces = null;

		[Tooltip("The pikmin's custom AI scripts")]
		public NetworkBehaviour[]? PikminScripts;

		[Tooltip("In the pikmin's prefab.")]
		public GameObject? MeshPrefab;

		[Tooltip("If null, the sprout will use the mesh prefab")]
		public GameObject? SproutMeshPrefab;

		[Tooltip("Set by mod, do not change.")]
		[HideInInspector]
		public int PikminTypeID;

		[Tooltip("The pikmin's sound pack.")]
		public PikminSoundPack? soundPack;

		[Tooltip("The Audio Source that will override the Pikmin's regular Voice Audio Source. (Optional)")]
		public AudioSource? OverrideAudioSource;

		[Header("Pikmin Stats")]
		[Tooltip("The hazards the pikmin is resistant to")]
		public LibHazardType[] HazardsResistantTo = new LibHazardType[0];

		[Tooltip("Whether the pikmin can latch on to enemies")]
		public bool CanLatchOnToEnemies = true;

		[Tooltip("Whether the pikmin can carry items")]
		public bool CanCarryItems = true;

		[Tooltip("Whether the pikmin can attack without latching on")]
		public bool CanAttackWithoutLatchingOn = true;

		[Tooltip("The speeds of the pikmin at different growth stages")]
		public float[] Speeds = new float[3] { 2f, 5f, 9f };

		[Tooltip("The force with which the pikmin is thrown")]
		public float ThrowForce = 15f;

		[Tooltip("Multiplier for the pikmin's growth speed")]
		public float GrowSpeedMultipler = 1f;

		[Tooltip("Multiplier for the pikmin's throw force")]
		public float ThrowForceMultiplier = 1f;

		[Tooltip("Multiplier for the pikmin's damage")]
		public float DamageMultiplier = 1f;

		[Tooltip("Speed multipliers for different growth stages")]
		public float[] SpeedMultipliers = new float[3] { 1f, 1f, 1f };

		[Tooltip("The amount of damage the pikmin does when it attacks.")]
		public float DamageAmmount;

		[Tooltip("The amount of damage the pikmin does when it dies.")]
		public float DamageDeltUponDeath;

		[Tooltip("The ammount of distance between the pikmin and enemies where the enemy will be delt damage from the pikmin upon death.")]
		public float DeathDamageRange;

		[Tooltip("Normalizes the damage the pikmin does when it attacks, (i.e. 5 -> 0.05)")]
		public bool NormalizeDamage;

		[Tooltip("The pikmin's carry strength (i.e. one pikmin with the CarryStrength of 5 will count as 5 pikmin on the item)")]
		public int CarryStrength = 1;

		[Tooltip("The pikmin's carry speed")]
		public float CarrySpeed = 1f;

		[Tooltip("The ammount of distance the pikmin can detect items")]
		public float ItemDetectionRange = 5f;

		[Tooltip("The ammount of distance a Pikmin can hit enemies at.")]
		public float AttackRange = 1f;

		[Header("Spawning")]
		[Tooltip("Whether the pikmin can spawn in from Lethal Company's spawn system (Pikmin do not affect the power level)")]
		public bool SpawnsNaturally = true;

		[Tooltip("Whether the pikmin can spawn indoors")]
		public bool SpawnsIndoors;

		[Tooltip("Whether the pikmin can spawn outdoors")]
		public bool SpawnsOutdoors;

		[Tooltip("Whether the pikmin spawns as a sprout")]
		public bool SpawnsAsSprout;

		[Tooltip("Whether the pikmin uses a pikmin container")]
		public bool UsesPikminContainer;

		[Tooltip("The pikmin's favord moons, the pikmin will have a higher chance of spawning on these moons.")]
		public List<string> FavoredMoons = new List<string>();

		[Tooltip("The Pikmin's favored moon tags, the pikmin will have a higher chance of spawning on moons with these Lethal level Loader tags.")]
		public List<string> FavoredMoonTags = new List<string>();

		[Tooltip("Moon Names that Pikmin will avoid spawning on.")]
		public List<string> AvoidMoons = new List<string>();

		[Tooltip("The Pikmin's favored moon tags, the pikmin will have a lower chance of spawning on moons with these Lethal level Loader tags.")]
		public List<string> AvoidMoonTags = new List<string>();

		[Header("Other")]
		[Tooltip("Generates a configuration file for the pikmin type")]
		public bool GenerateConfigFile = true;

		[Tooltip("Whether the pikmin instantly enters the onion")]
		public bool InstaEnterOnion;

		[Tooltip("Multiplier for the pikmin's spawn chance")]
		public float SpawnChanceMultiplier = 1f;

		[Tooltip("To Prevent pikmin from instantly dropping the item right outside of the ship, this varible is used to delay the drop in the ship buffer.")]
		public float DropItemInShipBuffer = 1f;

		[Tooltip("Minimum knockback resistance")]
		public int MinKnockBackResistance;

		[Tooltip("Maximum knockback resistance")]
		public int MaxKnockBackResistance;

		[Tooltip("Material for the pikmin")]
		public Material? PikminMaterial;

		[Tooltip("Material for the pikmin sprout")]
		public Material? SproutMaterial;

		[Tooltip("The type of onion this pikmin targets")]
		public OnionType? TargetOnion;

		[Tooltip("The ammount of extra idle animations for the pikmin")]
		public int ExtraIdleAnimsCount = 0;

		[Tooltip("The amount of Yay animations for the pikmin")]
		public int YayAnimationsCount = 0;

		[Tooltip("The Attack animation for the pikmin")]
		public AnimationClip? AttackAnimation;

		[Tooltip("The Non-Latched Attack animation for the pikmin")]
		public AnimationClip? NonLatchAttackAnimation;

		[Tooltip("The frame of your Attack animaiton when the Pikmin should hit the enemy")]
		public int AttackAnimationHitFrame;

		[Tooltip("The frame of your Non-Latched Attack animaiton when the Pikmin should hit the enemy")]
		public int NonLatchAttackAnimationHitFrame;

		[Tooltip("The Pikmin's attack rate while latched onto an enemy in seconds (Set this to -1 if you have an animation)")]
		public float AttackRate = -1f;

		[Header("Beastiary")]
		[Tooltip("The Pikmin type's scientific name")]
		public string ScientificName = "Pikminus Pikminus";

		[Tooltip("The Pikmin type's beastiary segment")]
		[TextArea(2, 20)]
		public string beastiarySegment = "";

		[HideInInspector]
		public string version = "0.2.22";
	}
	[BepInPlugin("NoteBoxz.LethalMinLibrary", "LethalMinLibrary", "2.1.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class LethalMinLibrary : BaseUnityPlugin
	{
		public static LethalMinLibrary Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			Patch();
			NetcodePatcher();
			Logger.LogInfo((object)"NoteBoxz.LethalMinLibrary v2.1.1 has loaded!");
		}

		internal void NetcodePatcher()
		{
			Type[] typesWithErrorHandling = GetTypesWithErrorHandling();
			Type[] array = typesWithErrorHandling;
			foreach (Type type in array)
			{
				try
				{
					MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
					MethodInfo[] array2 = methods;
					foreach (MethodInfo methodInfo in array2)
					{
						try
						{
							object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
							if (customAttributes.Length != 0)
							{
								methodInfo.Invoke(null, null);
							}
						}
						catch (FileNotFoundException ex)
						{
							Logger.LogDebug((object)("Skipping method " + methodInfo.Name + " due to missing dependency: " + ex.Message));
						}
						catch (Exception ex2)
						{
							Logger.LogWarning((object)("Error processing method " + methodInfo.Name + ": " + ex2.Message));
						}
					}
				}
				catch (Exception ex3)
				{
					Logger.LogWarning((object)("Error processing type " + type.FullName + ": " + ex3.Message));
				}
			}
		}

		internal static void Patch()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony = new Harmony("NoteBoxz.LethalMinLibrary");
			}
			Logger.LogDebug((object)"Patching...");
			try
			{
				Type[] typesWithErrorHandling = GetTypesWithErrorHandling();
				Type[] array = typesWithErrorHandling;
				foreach (Type type in array)
				{
					if (type.Namespace == "LethalMinLibrary.Editor")
					{
						continue;
					}
					try
					{
						Harmony.PatchAll(type);
					}
					catch (Exception ex)
					{
						Logger.LogError((object)("Error patching type " + type.FullName + ": " + ex.Message));
						if (ex.InnerException != null)
						{
							Logger.LogError((object)("Inner exception: " + ex.InnerException.Message));
						}
					}
				}
			}
			catch (Exception ex2)
			{
				Logger.LogError((object)("Error during patching process: " + ex2.Message));
				if (ex2.InnerException != null)
				{
					Logger.LogError((object)("Inner exception: " + ex2.InnerException.Message));
				}
			}
			Logger.LogMessage((object)"LethalMin Library: Sending Library Patch Call to LethalMin...");
			try
			{
				Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "NoteBoxz.LethalMin");
				if (assembly == null)
				{
					Logger.LogError((object)"Could not find LethalMin assembly!");
					return;
				}
				Type type2 = assembly.GetType("LethalMin.LethalMin");
				if (type2 == null)
				{
					Logger.LogError((object)"Could not find LethalMin.LethalMin type!");
					return;
				}
				MethodInfo method = type2.GetMethod("PatchLibraryTypes", BindingFlags.Static | BindingFlags.Public);
				if (method == null)
				{
					Logger.LogError((object)"Could not find PatchLibraryTypes method!");
					return;
				}
				method.Invoke(null, null);
				Logger.LogInfo((object)"Successfully called PatchLibraryTypes via reflection");
			}
			catch (Exception ex3)
			{
				Logger.LogError((object)("Error calling LethalMin.PatchLibraryTypes: " + ex3.Message));
				if (ex3.InnerException != null)
				{
					Logger.LogError((object)("Inner exception: " + ex3.InnerException.Message));
				}
			}
			Logger.LogDebug((object)"Finished patching!");
		}

		internal static Type[] GetTypesWithErrorHandling()
		{
			try
			{
				return Assembly.GetExecutingAssembly().GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				if (Logger != null)
				{
					Logger.LogDebug((object)"ReflectionTypeLoadException caught while getting types. Some types will be skipped.");
				}
				Exception[] loaderExceptions = ex.LoaderExceptions;
				foreach (Exception ex2 in loaderExceptions)
				{
					if (Logger != null)
					{
						Logger.LogDebug((object)("Loader Exception: " + ex2.Message));
					}
					if (ex2 is FileNotFoundException ex3 && Logger != null)
					{
						Logger.LogDebug((object)("Could not load file: " + ex3.FileName));
					}
				}
				return ex.Types.Where((Type t) => t != null).ToArray();
			}
			catch (Exception arg)
			{
				if (Logger != null)
				{
					Logger.LogError((object)$"Unexpected error while getting types: {arg}");
				}
				return new Type[0];
			}
		}

		internal static void Unpatch()
		{
			Logger.LogDebug((object)"Unpatching...");
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			Logger.LogDebug((object)"Finished unpatching!");
		}
	}
	[Serializable]
	public struct GrowthStageStats
	{
		public float Speed;

		public float AttackStrength;

		public int CarryStrength;

		public GrowthStageStats()
		{
			Speed = 0f;
			AttackStrength = -1f;
			CarryStrength = -1;
		}
	}
	[AddComponentMenu("LethalMinLibrary/PikminItemSettings")]
	public class PikminItemSettings : ReplaceableComponet
	{
		[Tooltip("Leave at -1 to have the mod generate a default value for this item.")]
		public int CarryStrength = -1;

		public bool CanProduceSprouts = false;

		public bool OverrideGrabbableToEnemeis = false;

		public int SproutsToSpawn = 0;

		public float PerferedTypeMultipler = 1f;

		public bool DontParentWhenDropping = false;

		public bool ServerAuthParenting = false;

		public bool RouteToPlayer = false;

		public float RouteToPlayerStoppingDistance = 5f;

		public float RouteToPlayerDroppingDistance = 0f;

		public bool ChangeOwnershipOnCarry = true;

		public bool GrabableToPikmin = true;

		public bool DontInitalizeOnStartup = false;

		public LibPikminType PerferedType = null;

		public Collider OverrideGrabPostionColider = null;

		public List<Renderer> ExtraRenderers = new List<Renderer>();

		public override string componentName { get; } = "PikminItemSettings";

	}
	public enum LatchTriggerStateToSet
	{
		Attack,
		Stuck
	}
	public enum Pintent
	{
		Idle,
		RunTowards,
		StandingAttack,
		Attack,
		Waiting,
		Carry,
		LatchedOn,
		Leave,
		BeingHeld,
		Thrown,
		Dead,
		Knockedback,
		MoveableStuck,
		Panicing,
		Stuck,
		Fall
	}
	[AddComponentMenu("LethalMinLibrary/PikminLatchTrigger")]
	public class PikminLatchTrigger : ReplaceableComponet
	{
		[Tooltip("The state that the pikmin must be in to be landed on the latch trigger (Leave empty for any state)")]
		public List<Pintent> StateCondisions = new List<Pintent>();

		[Tooltip("The state that the pikmin will be switched to when landing on the trigger")]
		public LatchTriggerStateToSet StateToSet = LatchTriggerStateToSet.Stuck;

		[Tooltip("The max number of pikmin that can be on the trigger at once")]
		public int MaxAmmount = 100;

		[Tooltip("The time it takes for the pikmin to be killed, recomended for it to be higher than the time to escape varible")]
		public float KillTimer = -1f;

		[Tooltip("The ammount of time a player needs to whistle for a pikmin to escape (set to -255 to be unescapeable)")]
		public float WhistleTime = 0f;

		[Tooltip("Allow pikmin to latch on via OnCollisionEnter")]
		public bool AllowBaseLatchOn = true;

		[Tooltip("Incase you want the transform the pikmin latch to and the trigger be 2 differnt things.")]
		public Transform? OverrideLatchObject;

		[Tooltip("The Network Addon, needed if you don't have any other way of syncing pikmin latching onto the trigger")]
		public PikminLatchTriggerNetworkAddon networkAddon = null;

		public override string componentName { get; } = "PikminLatchTrigger";


		public override void Initialize()
		{
		}
	}
	[AddComponentMenu("LethalMinLibrary/PikminLatchTriggerNetworkAddon")]
	public class PikminLatchTriggerNetworkAddon : ReplaceableComponet
	{
		public PikminLatchTrigger MainTrigger = null;

		public override string componentName { get; } = "PikminLatchTriggerNetworkAddon";


		public override void Initialize()
		{
		}
	}
	public enum PikminHarmTriggerDeathType
	{
		Default,
		Zap,
		Squish
	}
	[AddComponentMenu("LethalMinLibrary/PikminDamageTrigger")]
	public class PikminDamageTrigger : ReplaceableComponet
	{
		public PikminHarmTriggerDeathType deathType = PikminHarmTriggerDeathType.Default;

		[Tooltip("If true, the pikmin will die instantly on hit.")]
		public bool InstaDeath = false;

		[Tooltip("If true, the pikmin will be destroyed on death. Causing the ghost to spawn instantly.")]
		public bool DestoryOnDeath = true;

		[Tooltip("The ammount of damage to deal to the pikmin on hit. (1 is basicly an insta-kill)")]
		public int DamageDelt = 1;

		[Tooltip("Leave empty to have all types be affected.")]
		public List<PikminHazard> HazardTypes = new List<PikminHazard>();

		public bool CallOnHazardResist = true;

		public bool DontKillInShip = false;

		public override string componentName { get; } = "PikminDamageTrigger";

	}
	public enum PikminEffectType
	{
		Paralized,
		Scatter
	}
	public enum PikminEffectMode
	{
		Persitant,
		Limited
	}
	[AddComponentMenu("LethalMinLibrary/PikminEffectTrigger")]
	public class PikminEffectTrigger : ReplaceableComponet
	{
		public float KillTimer = 5f;

		public PikminHazard HazardType = PikminHazard.Water;

		public PikminEffectMode Mode = PikminEffectMode.Persitant;

		public PikminEffectType EffectType = PikminEffectType.Paralized;

		public string OverridePanicAnim = "";

		public override string componentName { get; } = "PikminEffectTrigger";

	}
	public abstract class ReplaceableComponet : MonoBehaviour
	{
		public abstract string componentName { get; }

		public void Start()
		{
			Initialize();
		}

		public virtual void Initialize()
		{
		}
	}
	[CreateAssetMenu(fileName = "Library Mod Info", menuName = "LethalMin Library/Library Mod Info", order = 0)]
	public class LMLmodInfo : ScriptableObject
	{
		public string GUID = "AuthorName.ModName";

		public string ModName = "Untitled Mod";

		public string ModAuthor = "Unknown Author";

		public string ModDescription = "No description provided.";

		public string Version = "1.0.0";

		public List<LMLmodInfo> Dependencies = new List<LMLmodInfo>();

		public bool DontLoad = false;
	}
	[Serializable]
	public struct LMLdepedence
	{
		public LMLmodInfo ModInfo;

		public bool IsOptional;

		public LMLdepedence(LMLmodInfo modInfo, bool isOptional = false)
		{
			ModInfo = modInfo;
			IsOptional = isOptional;
		}
	}
	[CreateAssetMenu(fileName = "OnionFuseRules", menuName = "LethalMin Library/OnionFusingRules", order = 5)]
	public class LibOnionFuseRules : ScriptableObject
	{
		public LibOnionType[] OnionsToFuse = new LibOnionType[0];

		[Tooltip("To refernce vanilla onions, use: 'NoteBoxz.RedOnion' for example")]
		public string[] OnionReferncesToFuse = new string[0];

		[Tooltip("Set by mod, do not change.")]
		[HideInInspector]
		public int FuseRulesTypeID;

		public LMLmodInfo? ModInfo;

		public Object? ReplacementObject;
	}
	public abstract class BaseOnionFusionProperties : MonoBehaviour
	{
		public Renderer MainOnionRenderer = null;
	}
	public class OnionItemModelGeneration : MonoBehaviour
	{
		[Tooltip("The Onion Item's generation")]
		public PikminGeneration Generation = PikminGeneration.Pikmin4;

		[Tooltip("The main Onion's model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Onion's animator component")]
		public Animator Animator = null;

		[Tooltip("The Onion's main renderer")]
		public Renderer MainRenderer = null;
	}
	public class OnionItemModelRefernces : MonoBehaviour
	{
		[Tooltip("The different mesh refernces for other generations, if you don't have multiple generations, set this to empty")]
		public OnionItemModelGeneration[] Generations = new OnionItemModelGeneration[0];

		[Tooltip("The main Onion's model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Onion's animator component")]
		public Animator Animator = null;

		[Tooltip("The Onion's main renderer")]
		public Renderer MainRenderer = null;
	}
	public class OnionModelGeneration : MonoBehaviour
	{
		[Tooltip("The Onion's generation")]
		public PikminGeneration Generation = PikminGeneration.Pikmin4;

		[Tooltip("The main Onion's model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Onion's animator component")]
		public Animator Animator = null;

		[Tooltip("The postions where the onion spits out sprouts")]
		public Transform SproutSpawnPos = null;

		[Tooltip("The postions where item gets hovered into the onion")]
		public Transform ItemHoverPos = null;

		[Tooltip("The postions where Pikmin bring items to the onion")]
		public Transform ItemDropPos = null;

		[Tooltip("The onion's Beam (Must have a trigger colider!)")]
		public GameObject SummonBeam = null;

		[Tooltip("The climbing links the pikmin use when going in/out of the onion")]
		public List<PikminLinkAnimation> ClimbLinks = null;

		[Tooltip("The onion's sound pack")]
		public OnionSoundPack SoundPack = null;

		[Tooltip("The onion's triangle renderer")]
		public Renderer MainOnionRenderer = null;

		[Tooltip("The onion's fusion properties, this will be used to determine the fusion types for the onion")]
		public BaseOnionFusionProperties FusionProperties = null;
	}
	public class OnionModelRefernces : MonoBehaviour
	{
		[Tooltip("The different mesh refernces for other generations, if you don't have multiple generations, set this to empty")]
		public OnionModelGeneration[] Generations = new OnionModelGeneration[0];

		[Tooltip("The main Onion's model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Onion's animator component")]
		public Animator Animator = null;

		[Tooltip("The postions where the onion spits out sprouts")]
		public Transform SproutSpawnPos = null;

		[Tooltip("The postions where item gets hovered into the onion")]
		public Transform ItemHoverPos = null;

		[Tooltip("The postions where Pikmin bring items to the onion")]
		public Transform ItemDropPos = null;

		[Tooltip("The onion's Beam (Must have a trigger colider!)")]
		public GameObject SummonBeam = null;

		[Tooltip("The climbing links the pikmin use when going in/out of the onion")]
		public List<PikminLinkAnimation> ClimbLinks = null;

		[Tooltip("The onion's sound pack")]
		public OnionSoundPack SoundPack = null;

		[Tooltip("The onion's triangle renderer")]
		public Renderer MainOnionRenderer = null;

		[Tooltip("The onion's fusion properties, this will be used to determine the fusion types for the onion")]
		public BaseOnionFusionProperties FusionProperties = null;
	}
	public class OnionSoundPack : MonoBehaviour
	{
		public AudioClip MenuOpenSound = null;

		public AudioClip MenuCloseSound = null;

		public AudioClip MenuDenyUpSound = null;

		public AudioClip MenuDenyDownSound = null;

		public AudioClip MenuUpSound = null;

		public AudioClip MenuDownSound = null;

		public AudioClip MenuConfirmSound = null;

		public AudioClip FlyingInSound = null;

		public AudioClip LegsPopOutSound = null;

		public AudioClip LandSound = null;

		public AudioClip LegsPopInSound = null;

		public AudioClip FlyingOutSound = null;

		public AudioClip VacItemSound = null;

		public AudioClip SuckInItemSound = null;

		public AudioClip SproutSound = null;

		public AudioClip PlayerReviveSound = null;
	}
	public enum PathType
	{
		Linear,
		QuadraticBezier,
		CubicBezier
	}
	public class PikminLinkAnimation : MonoBehaviour
	{
		public Transform StartPoint = null;

		public Transform EndPoint = null;

		public Transform ControlPoint1 = null;

		public Transform ControlPoint2 = null;

		public PathType PathType = PathType.Linear;

		public float AnimSpeedMultiplier;

		public bool DrawCurveDetails = true;

		public Vector3 GetPointOnPath(float t)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			switch (PathType)
			{
			case PathType.Linear:
				return Vector3.Lerp(StartPoint.position, EndPoint.position, t);
			case PathType.QuadraticBezier:
				if ((Object)(object)ControlPoint1 == (Object)null)
				{
					return Vector3.Lerp(StartPoint.position, EndPoint.position, t);
				}
				return QuadraticBezier(StartPoint.position, ControlPoint1.position, EndPoint.position, t);
			case PathType.CubicBezier:
				if ((Object)(object)ControlPoint1 == (Object)null || (Object)(object)ControlPoint2 == (Object)null)
				{
					return Vector3.Lerp(StartPoint.position, EndPoint.position, t);
				}
				return CubicBezier(StartPoint.position, ControlPoint1.position, ControlPoint2.position, EndPoint.position, t);
			default:
				return Vector3.Lerp(StartPoint.position, EndPoint.position, t);
			}
		}

		public Quaternion GetRotationOnPath(float t)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			return Quaternion.Lerp(StartPoint.rotation, EndPoint.rotation, t);
		}

		private Vector3 QuadraticBezier(Vector3 p0, Vector3 p1, Vector3 p2, float t)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			float num = 1f - t;
			float num2 = t * t;
			float num3 = num * num;
			Vector3 val = num3 * p0;
			val += 2f * num * t * p1;
			return val + num2 * p2;
		}

		private Vector3 CubicBezier(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			float num = 1f - t;
			float num2 = t * t;
			float num3 = num * num;
			float num4 = num3 * num;
			float num5 = num2 * t;
			Vector3 val = num4 * p0;
			val += 3f * num3 * t * p1;
			val += 3f * num * num2 * p2;
			return val + num5 * p3;
		}

		private void OnDrawGizmos()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0054: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: 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_02a9: 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_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)StartPoint == (Object)null || (Object)(object)EndPoint == (Object)null)
			{
				return;
			}
			int num = 20;
			Vector3 val = StartPoint.position;
			Gizmos.color = Color.yellow;
			for (int i = 1; i <= num; i++)
			{
				float t = (float)i / (float)num;
				Vector3 pointOnPath = GetPointOnPath(t);
				Gizmos.DrawLine(val, pointOnPath);
				val = pointOnPath;
			}
			Gizmos.color = Color.green;
			Gizmos.DrawWireSphere(StartPoint.position, 0.3f);
			Gizmos.color = Color.red;
			Gizmos.DrawWireSphere(EndPoint.position, 0.3f);
			if (PathType != 0)
			{
				if ((Object)(object)ControlPoint1 != (Object)null)
				{
					Gizmos.color = Color.cyan;
					Gizmos.DrawWireSphere(ControlPoint1.position, 0.2f);
					Gizmos.DrawLine(StartPoint.position, ControlPoint1.position);
					Gizmos.DrawLine(EndPoint.position, ControlPoint1.position);
				}
				if (PathType == PathType.CubicBezier && (Object)(object)ControlPoint2 != (Object)null && (Object)(object)ControlPoint1 != (Object)null)
				{
					Gizmos.color = Color.magenta;
					Gizmos.DrawWireSphere(ControlPoint2.position, 0.2f);
					Gizmos.DrawLine(StartPoint.position, ControlPoint1.position);
					Gizmos.DrawLine(ControlPoint1.position, ControlPoint2.position);
					Gizmos.DrawLine(ControlPoint2.position, EndPoint.position);
				}
			}
			Vector3 pointOnPath2 = GetPointOnPath(0.5f);
			Vector3 val2 = GetPointOnPath(0.55f) - GetPointOnPath(0.45f);
			Vector3 normalized = ((Vector3)(ref val2)).normalized;
			float num2 = 0.5f;
			Gizmos.color = Color.yellow;
			Gizmos.DrawRay(pointOnPath2, normalized * num2);
			Gizmos.DrawRay(pointOnPath2 + normalized * num2, Quaternion.Euler(0f, 120f, 0f) * -normalized * (num2 * 0.5f));
			Gizmos.DrawRay(pointOnPath2 + normalized * num2, Quaternion.Euler(0f, -120f, 0f) * -normalized * (num2 * 0.5f));
			float t2 = Mathf.PingPong(Time.time * AnimSpeedMultiplier, 1f);
			Vector3 pointOnPath3 = GetPointOnPath(t2);
			Gizmos.color = Color.blue;
			Gizmos.DrawSphere(pointOnPath3, 0.2f);
			if (DrawCurveDetails && PathType != 0)
			{
				int num3 = 40;
				for (int j = 0; j <= num3; j++)
				{
					float num4 = (float)j / (float)num3;
					Vector3 pointOnPath4 = GetPointOnPath(num4);
					Gizmos.color = Color.Lerp(Color.green, Color.red, num4);
					Gizmos.DrawSphere(pointOnPath4, 0.05f);
				}
			}
		}
	}
	[CreateAssetMenu(fileName = "OnionType", menuName = "LethalMin Library/Onion Type", order = 4)]
	public class LibOnionType : ScriptableObject
	{
		[Header("Distinguishing Information")]
		[Tooltip("The onion's color")]
		public Color OnionColor = Color.gray;

		[Tooltip("The name of the onion's type.")]
		public string TypeName = "Untitled Onion";

		[Tooltip("The model that overrides the onion's defult model (will be set to defult if empty)")]
		public GameObject OnionOverrideModelPrefab = null;

		[Tooltip("The model that overrides the onion item's defult model. (will be set to defult if empty)")]
		public GameObject OnionItemOverrideModelPrefab = null;

		[Header("Onion Stats")]
		[Tooltip("The types of pikmin that the onion can hold.")]
		public LibPikminType[] TypesCanHold = null;

		[Tooltip("If set to false, Pikmin will not beable to bring back bodies to this onion.")]
		public bool CanCreateSprouts = true;

		[Header("Spawning")]
		[Tooltip("Spawns the onion indoors")]
		public bool SpawnsIndoors = true;

		[Tooltip("Spawns the onion outdoors")]
		public bool SpawnsOutdoors;

		[Tooltip("The minimum day this onion can spawn on. Set to -1 to spawn on day 1.")]
		public int SpawnAfterDay = -1;

		[Tooltip("Spawns on moons with a power level grater or equal to this")]
		public float PreferedPowerLevel = 0f;

		[Tooltip("The chance that this onion will spawn on a moon. (0-1)")]
		public float SpawnChanceMultiplier = 1f;

		[Tooltip("Activates the onion item when it is taken outside")]
		public bool ActivatesWhenBroughtOutside = true;

		[Tooltip("Activates when a player gets close to the onion")]
		public bool ActivatesWhenPlayerIsNear;

		[Tooltip("(Only works when ActivatesWhenPlayerIsNear is true) The distance from the player that the onion will activate at.")]
		[Range(0f, 100f)]
		public float ActivationDistance = 10f;

		[Tooltip("The amount of time it takes for the onion to actvate once an activation condistion has is true. (in seconds)")]
		public float ActivationTime = 5f;

		[Tooltip("Allows Pikmin Types that target this onion, that are not in the TypesCanHold array, to be added to the onion.")]
		public bool AllowPikminToBeAddedToOnion = true;

		[Tooltip("If set to false this onion will not beable to fuse with any other onion, even if it's in a fuse rule.")]
		public bool CanBeFusedWith = true;

		[Tooltip("Set by mod, do not change.")]
		[HideInInspector]
		public LibOnionFuseRules CurFueseRules = null;

		[Tooltip("Set by mod, do not change.")]
		[HideInInspector]
		public int OnionTypeID;

		public LMLmodInfo? ModInfo;

		public Object? ReplacementObject;
	}
	public struct PikAnimationState
	{
		public string name;

		public AnimationClip clip;

		public float TransitionDuration;

		public bool IsOneShot;

		public PikAnimationState(string name, AnimationClip clip, float transitionDuration)
		{
			IsOneShot = false;
			this.name = name;
			this.clip = clip;
			TransitionDuration = transitionDuration;
		}

		public PikAnimationState(AnimationClip clip)
		{
			IsOneShot = false;
			name = ((Object)clip).name;
			this.clip = clip;
			TransitionDuration = -1f;
		}
	}
	[CreateAssetMenu(fileName = "CustomPiklopediaEntry", menuName = "LethalMin Library/CustomPiklopediaEntry", order = 7)]
	public class LibPiklopediaEntry : ScriptableObject
	{
		[Tooltip("The Piklopedia entry name that will show on the Piklopedia page")]
		public string EntryName = "";

		[Tooltip("The terminal node for the piklopedia")]
		public TerminalNode PiklopediaNode = null;

		[Tooltip("The terminal keyword for the piklopedia (can be null)")]
		public TerminalKeyword? PiklopediaKeyword = null;

		[HideInInspector]
		public int PiklopediaID = -1;

		public LMLmodInfo? ModInfo;

		public Object? ReplacementObject;
	}
	[CreateAssetMenu(fileName = "PikminAnimationPack", menuName = "LethalMin Library/AnimationPack", order = 6)]
	public class LibPikminAnimationPack : ScriptableObject
	{
		public bool FillEmptyFields = false;

		public bool UseStateMachineForIdleAnims = false;

		public string IdleAnimStateMachineEntryName = "Entry";

		[Tooltip("(Not Required) If your model uses an AnimatorOverride Controller, assign it here.")]
		public AnimatorOverrideController? AnimatorOverrideController = null;

		public List<AnimationClip> EditorIdleAnim = new List<AnimationClip>();

		public List<AnimationClip> EditorOneShotIdleAnim = new List<AnimationClip>();

		public AnimationClip? EditorWalkingAnim = null;

		public AnimationClip? EditorCarryAnim = null;

		public AnimationClip? EditorNoticeAnim = null;

		public AnimationClip? EditorHoldAnim = null;

		public AnimationClip? EditorThrowAnim = null;

		public AnimationClip? EditorStandingAttackAnim = null;

		public AnimationClip? EditorLatchedAttackAnim = null;

		public AnimationClip? EditorKnockbackAnim = null;

		public AnimationClip? EditorLayingAnim = null;

		public AnimationClip? EditorGetUpAnim = null;

		public List<AnimationClip> EditorYayAnim = new List<AnimationClip>();

		public AnimationClip? EditorPluckedAnim = null;

		public List<AnimationClip> EditorMiscOneshotAnim = new List<AnimationClip>();

		public AnimationClip? EditorPosionFlopAnim = null;

		public AnimationClip? EditorDrowingAnim = null;

		public AnimationClip? EditorBurnAnim = null;

		public LMLmodInfo? ModInfo;

		public Object? ReplacementObject;
	}
	[RequireComponent(typeof(Animator))]
	public class PikminAnimatorController : MonoBehaviour
	{
		public class AnimationCondition
		{
			public Func<bool> EnterCondition { get; set; }

			public Func<bool> ExitCondition { get; set; }

			public AnimationClip Animation { get; set; }

			public int Priority { get; set; }

			public AnimationCondition(Func<bool> condition, AnimationClip animation, int priority)
			{
				EnterCondition = condition;
				ExitCondition = condition;
				Animation = animation;
				Priority = priority;
			}

			public AnimationCondition(Func<bool> enterCondition, Func<bool> exitCondition, AnimationClip animation, int priority)
			{
				EnterCondition = enterCondition;
				ExitCondition = exitCondition;
				Animation = animation;
				Priority = priority;
			}
		}

		public Animator animator = null;

		public (int, AnimationClip?) _currentState = default((int, AnimationClip));

		public LibPikminAnimationPack AnimPack = null;

		public List<PikAnimationState> AnimationStates = new List<PikAnimationState>();

		public AnimationClip? CurrentAnimation
		{
			get
			{
				AnimatorClipInfo[] currentAnimatorClipInfo = animator.GetCurrentAnimatorClipInfo(0);
				return (currentAnimatorClipInfo.Length != 0) ? ((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip : null;
			}
		}
	}
	public enum PikminGeneration
	{
		Pikmin1And2,
		Pikmin3,
		HeyPikmin,
		Pikmin4
	}
	public enum DisableablePikminGeneration
	{
		Any = -1,
		Pikmin1And2,
		Pikmin3,
		HeyPikmin,
		Pikmin4
	}
	[Serializable]
	public struct PikminGrowStage
	{
		[Tooltip("The stage of growth for the pikmin, 0 = leaf, 1 = bud, 2 = flower")]
		public float Speed;

		[Tooltip("Overrides the current attack strength If left at -1, it will not be applied")]
		public float AttackStrength;

		[Tooltip("Overrides the current carry strength If left at -1, it will not be applied")]
		public int CarryStrength;

		public PikminGrowStage(float speed, float attackStrength = -1f, int carryStrength = -1)
		{
			Speed = 3f;
			AttackStrength = -1f;
			CarryStrength = -1;
			Speed = speed;
			AttackStrength = attackStrength;
			CarryStrength = carryStrength;
		}
	}
	public enum PikminHazard
	{
		Fire,
		Water,
		Electricity,
		Poison,
		Crush,
		Bullet,
		Explosive,
		Spore,
		Stab,
		Sticky,
		None
	}
	public class PikminModelGeneration : MonoBehaviour
	{
		[Tooltip("The Pikmin's generation, if you don't have multiple generations, set this to Default.")]
		public PikminGeneration Generation = PikminGeneration.Pikmin4;

		[Tooltip("The main Pikmin model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Pikmin's animator component")]
		public Animator Animator = null;

		[Tooltip("The Pikmin's animator controller")]
		public PikminAnimatorController AnimatorController = null;

		[Tooltip("The top part of the Pikmin's sprout")]
		public GameObject SproutTop = null;

		[Tooltip("Starts from Least to Greatest (0 = leaf, 2 = flower)")]
		public List<GameObject> Plants = new List<GameObject>();

		[Tooltip("The Pikmin's big eyes gameobject from Hey! Pikmin")]
		public GameObject HeyPikminBigEyes = null;

		[Tooltip("(Optional) The audio sources that will override the Pikmin's voice")]
		public AudioSource? OverrideVoice;

		[Tooltip("(Optional) The audio sources that will override the Pikmin's SFX")]
		public AudioSource? OverrideSFX;

		[ContextMenu("Autofill")]
		public void Autofill()
		{
			if ((Object)(object)Animator == (Object)null)
			{
				Animator = ((Component)this).GetComponent<Animator>();
			}
			if ((Object)(object)AnimatorController == (Object)null)
			{
				AnimatorController = ((Component)this).GetComponent<PikminAnimatorController>();
			}
			if ((Object)(object)Model == (Object)null)
			{
				Model = ((Component)this).gameObject;
			}
			Plants.Clear();
			SearchChildrenRecursively(((Component)this).transform);
		}

		private void SearchChildrenRecursively(Transform parent)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			foreach (Transform item in parent)
			{
				Transform val = item;
				if (((Object)val).name == "H_j003" || ((Object)val).name == "loc_point_01")
				{
					SproutTop = ((Component)val).gameObject;
				}
				if (((Object)val).name == "piki_bigeye_0_0_node")
				{
					HeyPikminBigEyes = ((Component)val).gameObject;
				}
				if (((Object)val).name.ToLower().Contains("leaf"))
				{
					Plants.Add(((Component)val).gameObject);
				}
				if (((Object)val).name.ToLower().Contains("bud"))
				{
					Plants.Add(((Component)val).gameObject);
				}
				if (((Object)val).name.ToLower().Contains("flower"))
				{
					Plants.Add(((Component)val).gameObject);
				}
				SearchChildrenRecursively(val);
			}
		}
	}
	public class PikminModelRefernces : MonoBehaviour
	{
		[Tooltip("The different mesh refernces for other generations, if you don't have multiple generations, set this to empty")]
		public PikminModelGeneration[] Generations = new PikminModelGeneration[0];

		[Tooltip("The main Pikmin model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Pikmin's animator component")]
		public Animator Animator = null;

		[Tooltip("The Pikmin's animator controller")]
		public PikminAnimatorController AnimatorController = null;

		[Tooltip("The top part of the Pikmin's sprout")]
		public GameObject SproutTop = null;

		[Tooltip("Starts from Least to Greatest (0 = leaf, 2 = flower)")]
		public List<GameObject> Plants = new List<GameObject>();

		[Tooltip("The Pikmin's big eyes gameobject from Hey! Pikmin")]
		public GameObject HeyPikminBigEyes = null;

		[Tooltip("(Optional) The audio sources that will override the Pikmin's voice")]
		public AudioSource? OverrideVoice;

		[Tooltip("(Optional) The audio sources that will override the Pikmin's SFX")]
		public AudioSource? OverrideSFX;
	}
	[CreateAssetMenu(fileName = "PikminSoundPack", menuName = "LethalMin Library/Sound Pack", order = 2)]
	public class LibPikminSoundPack : ScriptableObject
	{
		public bool ReplaceEmptySFXWithDefault = true;

		public bool ReplaceEmptyVoiceWithDefault = false;

		[Tooltip("Make it so the sound pack will only be initalized once and not for every type that uses it. This is useful for sound packs that are used by multiple types.")]
		public bool IsDefaultSoundPack = false;

		[Tooltip("This is used to determine which Pikmin types can use this sound pack. If this is the defult sound pack, then keep this as 'Any'")]
		public DisableablePikminGeneration TargetGeneration = DisableablePikminGeneration.Any;

		public AudioClip[] BornVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] EnterOnionVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ExitOnionVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ObjectNoticeVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] LostVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] YayVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] IdleVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] NoticeVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] PrepareVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ThrownVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] AttackVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] KnockbackVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] GetUpVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ItemLiftVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ItemCarryVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] DrowningVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] HurtVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] CoughVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] BurnVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] CrushVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] JumpVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ChargeVoice = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] ThrownSound = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] HitSound = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] GhostSound = (AudioClip[])(object)new AudioClip[0];

		public AudioClip[] CrushSound = (AudioClip[])(object)new AudioClip[0];

		public LMLmodInfo? ModInfo;

		public Object? ReplacementObject;
	}
	[CreateAssetMenu(fileName = "PikminType", menuName = "LethalMin Library/Pikmin Type", order = 1)]
	public class LibPikminType : ScriptableObject
	{
		[Header("Pikmin Info")]
		[Tooltip("The name of the Pikmin Type")]
		public string PikminName = "Untitled Pikmin";

		[Tooltip("The main color of the Pikmin (Used for HUD)")]
		public Color PikminPrimaryColor = Color.white;

		[Tooltip("The secondary color of the Pikmin (Used for HUD)")]
		public Color PikminSecondaryColor = Color.gray;

		[Tooltip("The Pikmin's Icon that will show in the HUD")]
		public Sprite? PikminIcon;

		[Tooltip("The model prefab for the Pikmin")]
		public GameObject ModelPrefab = null;

		[Tooltip("The Main Model Refernces for the Pikmin This script should be attached to the model prefab")]
		public PikminModelRefernces modelRefernces = null;

		[Tooltip("The scriptable object that contains every sound for the pikmin type")]
		public LibPikminSoundPack SoundPack = null;

		[Tooltip("The different sound packs for other generations, if you don't have multiple generations, set this to empty")]
		public LibPikminSoundPack[] SoundPackGenerations = new LibPikminSoundPack[0];

		[Tooltip("The texture that overrides the pikmin ghost's model")]
		public Texture2D? PikminGhostOverrideTexture;

		[Tooltip("The frames for the animated pikmin ghost, if null, will use the default ghost texture")]
		public Texture2D[]? AnimatedPikminGhostTexture;

		[Tooltip("The number of frames the animated pikmin ghost will hold on each frame")]
		public int AnimatedPikminGhostFrameHold = 2;

		[Tooltip("The tiling for the pikmin ghost's texture")]
		public Vector2 OverrideGhostTextureTileing = new Vector2(1f, 1f);

		[Tooltip("The offset for the pikmin ghost's texture")]
		public Vector2 OverrideGhostTextureOffset = new Vector2(0f, 0f);

		[Tooltip("Whether to set the pikmin ghost's color to the pikmin's primary color")]
		public bool SetGhostColor = true;

		[Tooltip("The gameobject that overrides the pikmin ghost's model")]
		public GameObject? PikminGhostOverrideModel;

		[Tooltip("Prevents the pikmin from being registered, only set this to true if the type is unused or not ment to be registered")]
		public bool DisableRegistration = false;

		[Header("Sprout")]
		[Tooltip("The color the sprout plant uses")]
		public SproutPlantColor SproutPlantColor = SproutPlantColor.Default;

		[Tooltip("The material that overrides the pikmin ghost's sprout (Listed for each generation Pikmin1And2 = 0 Pikmin3 = 1 HeyPikmin = 2 Pikmin4 = 3, leave at 0 to for use any generation)")]
		public Material[]? PikminSproutOverrideMaterial;

		[Tooltip("If null, the sprout will use the mesh prefab")]
		public GameObject? SproutOverrideModel;

		[Tooltip("If the override material is null, the pikmin's sprout will just color it with the PikminPrimaryColor")]
		public bool SetColorOnSprout = true;

		[Tooltip("If you want the Pikmin's idle glow to be a differnt color than the PikminPrimaryColor")]
		public bool UseOverrideSproutGlowColor = false;

		[Tooltip("If you want the Pikmin's idle glow to be a differnt color than the PikminPrimaryColor (Make sure UseOverrideSproutGlowColor is true when using this)")]
		public Color OverrideSproutGlowColor = Color.white;

		[Header("Pikmin Stats")]
		[Tooltip("The Pikmin's HP")]
		public int HP = 1;

		[Tooltip("The Pikmin's growth stages, if empty, the pikmin will not have any growth stages")]
		public List<GrowthStageStats> GrowStages = new List<GrowthStageStats>();

		[Tooltip("The multiplier for the pikmin's growth speed (1 = no change, 2 = double speed)")]
		public float GrowSpeedMultiplier = 1f;

		[Tooltip("Only used if your type does not have any GrowStages")]
		public float DefaultSpeed = 1f;

		[Tooltip("How much faster the pikmin goes when running")]
		public float RunningSpeedMultiplier = 1.5f;

		[Tooltip("The pikmin's carry strength")]
		public int CarryStrength = 1;

		[Tooltip("You generally want all of these to be the same value")]
		public Vector3 ThrowForce = new Vector3(15f, 15f, 15f);

		[Tooltip("The hazards this Pikmin is resistant to")]
		public List<PikminHazard> HazardsResistantTo = new List<PikminHazard>();

		[Tooltip("The maximum distance the pikmin can detect items")]
		public float ItemDetectionRange = 5f;

		[Tooltip("Allows the pikmin type to latch onto objects")]
		public bool CanLatchOnToObjects = true;

		[Tooltip("Allows the pikmin type to jump and latch onto objects")]
		public bool CanJumpOntoObjects = true;

		[Tooltip("Allows the pikmin type to carry objects")]
		public bool CanCarryObjects = true;

		[Header("Attacking")]
		[Tooltip("The maximum distance the pikmin can detect and change enemies")]
		public float EnemyDetectionRange = 5f;

		[Tooltip("The pikmin's attack strength, will be normalizd (1 = 0.01)")]
		public float AttackStrength = 1f;

		[Tooltip("The speed at which the Pikmin type attacks at.")]
		public float AttackRate = 0.5f;

		[Tooltip("The range at which pikmin tpe can hit an enemy when not latched on")]
		public float AttackDistance = 0.5f;

		[Tooltip("The range at which the pikmin type will attempt to jump onto the enemy")]
		public float JumpLatchOnRange = 5f;

		[Tooltip("The damage the will be delt to enemies around the Pikmin Type when it dies, will be normalizd (1 = 0.01)")]
		public float DamageDeltUponDeath = 0f;

		[Tooltip("Enemies within this range will be delt the DamageDeltUponDeath ammount of damage when the pikmin type dies")]
		public float DeathDamageRange = 0f;

		[Tooltip("The ammount of damage delt on enemies the pikmin lands on, will be normalizd (1 = 0.01)")]
		public float DamageDeltUpLanding = 0f;

		[Tooltip("The odds of the pikmin being shooken off an enemy (1 = Wont be shooken off, 0 = Will be shooken off)")]
		public float ShakeEndurance = 0.75f;

		[Header("Spawning")]
		[Tooltip("Whether the pikmin can spawn in from Lethal Company's spawn system")]
		public bool SpawnsNaturally = true;

		[Tooltip("Whether the pikmin can spawn indoors")]
		public bool SpawnsIndoors;

		[Tooltip("Whether the pikmin can spawn outdoors")]
		public bool SpawnsOutdoors;

		[Tooltip("Whether the pikmin spawns as a sprout")]
		public bool SpawnsAsSprout;

		[Tooltip("Whether the pikmin uses the pikmin container")]
		public bool UsesPikminContainer;

		[Tooltip("The onion type that the pikmin will try to go to first when automatically leaving")]
		public LibOnionType? TargetOnion = null;

		[Tooltip("The day after which this pikmin type can start spawning in. Set to -1 to spawn on day 1.")]
		public int SpawnAfterDay = -1;

		[Tooltip("The pikmin's favord moons, the pikmin will have a higher chance of spawning on these moons.")]
		public List<string> FavoredMoons = new List<string>();

		[Tooltip("The Pikmin's favored moon tags, the pikmin will have a higher chance of spawning on moons with these Lethal level Loader tags.")]
		public List<string> FavoredMoonTags = new List<string>();

		[Tooltip("The Pikmin's favored weather, the pikmin will have a higher chance of spawning in these weathers.\r\n        None,\r\n        DustClouds,\r\n        Rainy,\r\n        Stormy,\r\n        Foggy,\r\n        Flooded,\r\n        Eclipsed")]
		public List<string> FavoredWeathers = new List<string>();

		[Tooltip("Multiplier for the pikmin's spawn chance when spawning on a favored moon")]
		public float SpawnChanceMultiplier = 2f;

		[Tooltip("Moon Names that Pikmin will haev a lower chance spawning on.")]
		public List<string> AvoidMoons = new List<string>();

		[Tooltip("The Pikmin's avoid moon tags, the pikmin will have a lower chance of spawning on moons with these Lethal level Loader tags.")]
		public List<string> AvoidMoonTags = new List<string>();

		[Tooltip("Multiplier for the pikmin's spawn chance when spawning on an AvoidedMoon")]
		public float SpawnChanceDemultiplier = 0.5f;

		[Header("Other")]
		[Tooltip("Generates a configuration file for the pikmin type")]
		public bool GenerateConfigFile = true;

		[Tooltip("Whether the pikmin instantly enters the onion")]
		public bool InstaEnterOnion;

		[Header("Piklopedia")]
		[Tooltip("Whether the pikmin type is in the Piklopedia")]
		public bool UsePiklopedia = true;

		[Tooltip("Puts the Pikmin Type's Piklopedia page in a more standardised format. If turned off: ScientificName and HelpfulLevel will not be used")]
		public bool UsePresetFormatting = true;

		public string HelpfulLevel = "50%";

		[Tooltip("The Pikmin type's scientific name")]
		public string ScientificName = "Pkminidae pikminus";

		[Tooltip("The Pikmin type's Piklopedia name (use - for spaces), leave empty to use the PikminName")]
		public string piklopediaName = "";

		[Tooltip("The Pikmin type's Piklopedia description")]
		[TextArea(4, 20)]
		public string piklopediaDescription = "";

		[Tooltip("The Pikmin type's Piklopedia page video that is played in the terminal")]
		public VideoClip? piklopediaVideo;

		[Header("Advanced Settings")]
		[Tooltip("Whether to cache plant object references or not. This will improve performance, but may cause issues if the plant changes between instances.")]
		public bool CachePlantObjectRefernces = true;

		[Tooltip("The pikmin's custom AI script that will override the default one, must be in prefab form")]
		public NetworkBehaviour CustomTypeScript = null;

		[HideInInspector]
		public int PikminTypeID = -1;

		public LMLmodInfo? ModInfo;

		public Object? ReplacementObject;

		public void OnEnable()
		{
		}
	}
	public enum SproutPlantColor
	{
		Default,
		Red,
		Purple,
		Yellow
	}
	public class SproutModelGeneration : MonoBehaviour
	{
		[Tooltip("The Sprout's generation, if you don't have multiple generations, set this to Default.")]
		public PikminGeneration Generation = PikminGeneration.Pikmin4;

		[Tooltip("The main Sprout's model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Sprout's animator component")]
		public Animator Animator = null;

		[Tooltip("The Sprout's main renderer component")]
		public Renderer MainRenderer = null;

		[Tooltip("Starts from Least to Greatest (0 = leaf, 2 = flower)")]
		public List<GameObject> Plants = new List<GameObject>();

		[Tooltip("0 = Default, 1 = Red, 2 = Purple, 3 = Yellow")]
		public List<Material> AltBudMaterials = new List<Material>();

		[Tooltip("0 = Default, 1 = Red, 2 = Purple, 3 = Yellow")]
		public List<Material> AltFlowerMaterials = new List<Material>();

		[Tooltip("The Sprout's bones for VR interaction")]
		public List<Transform> SproutBones = new List<Transform>();

		[Tooltip("The Sprout's bones for VR interaction (Colider not rendered)")]
		public GameObject SproutVRInteractableObject = null;
	}
	public class SproutModelRefences : MonoBehaviour
	{
		[Tooltip("The different mesh refernces for other generations, if you don't have multiple generations, set this to empty")]
		public SproutModelGeneration[] Generations = new SproutModelGeneration[0];

		[Tooltip("The main Sprout's model for the current generation")]
		public GameObject Model = null;

		[Tooltip("The Sprout's animator component")]
		public Animator Animator = null;

		[Tooltip("The Sprout's main renderer component")]
		public Renderer MainRenderer = null;

		[Tooltip("Starts from Least to Greatest (0 = leaf, 2 = flower)")]
		public List<GameObject> Plants = new List<GameObject>();

		[Tooltip("0 = Default, 1 = Red, 2 = Purple, 3 = Yellow")]
		public List<Material> AltBudMaterials = new List<Material>();

		[Tooltip("0 = Default, 1 = Red, 2 = Purple, 3 = Yellow")]
		public List<Material> AltFlowerMaterials = new List<Material>();

		[Tooltip("The Sprout's bones for VR interaction")]
		public List<Transform> SproutBones = new List<Transform>();

		[Tooltip("The Sprout's bones for VR interaction (Colider not rendered)")]
		public GameObject SproutVRInteractableObject = null;
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "NoteBoxz.LethalMinLibrary";

		public const string PLUGIN_NAME = "LethalMinLibrary";

		public const string PLUGIN_VERSION = "2.1.1";
	}
}
namespace LethalMinLibrary.Editor
{
	[ScriptedImporter(1, "LethalMin")]
	public class LethalMinBundleImporter : ScriptedImporter
	{
		private Dictionary<string, Type> CachedTypeMap = null;

		public override void OnImportAsset(AssetImportContext ctx)
		{
			LethalMinBundleContainer lethalMinBundleContainer = ScriptableObject.CreateInstance<LethalMinBundleContainer>();
			lethalMinBundleContainer.assetPath = ctx.assetPath;
			AssetBundle val = AssetBundle.LoadFromFile(ctx.assetPath);
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)("Failed to load " + ctx.assetPath + " as an asset bundle"));
				return;
			}
			try
			{
				lethalMinBundleContainer.bundleName = Path.GetFileNameWithoutExtension(ctx.assetPath);
				string[] array = (lethalMinBundleContainer.assetNames = val.GetAllAssetNames());
				ctx.AddObjectToAsset("BundleContainer", (Object)(object)lethalMinBundleContainer);
				ctx.SetMainObject((Object)(object)lethalMinBundleContainer);
				Dictionary<string, Type> typeMap = BuildTypeMap();
				List<ScriptableObject> list = new List<ScriptableObject>();
				LMLmodInfo lMLmodInfo = null;
				string[] array2 = array;
				foreach (string text in array2)
				{
					if (text.Contains("LMLmodInfo") || Path.GetFileNameWithoutExtension(text).ToLower().Contains("modinfo"))
					{
						lMLmodInfo = LoadAndFixScriptableObject<LMLmodInfo>(val, text, typeMap);
						if ((Object)(object)lMLmodInfo != (Object)null)
						{
							Debug.Log((object)("Found mod info: " + lMLmodInfo.ModName + " by " + lMLmodInfo.ModAuthor));
							string text2 = "ModInfo_" + Path.GetFileNameWithoutExtension(text);
							ctx.AddObjectToAsset(text2, (Object)(object)lMLmodInfo);
							lethalMinBundleContainer.modInfo = lMLmodInfo;
							lethalMinBundleContainer.modName = lMLmodInfo.ModName;
							lethalMinBundleContainer.modAuthor = lMLmodInfo.ModAuthor;
							lethalMinBundleContainer.modVersion = lMLmodInfo.Version;
							lMLmodInfo.DontLoad = true;
							lethalMinBundleContainer.AddAssetReference(text2, (Object)(object)lMLmodInfo);
							break;
						}
					}
				}
				if ((Object)(object)lMLmodInfo == (Object)null)
				{
					Debug.Log((object)"No specific mod info found, loading all ScriptableObjects...");
					Dictionary<string, bool> dictionary = new Dictionary<string, bool>();
					string[] array3 = array;
					foreach (string text3 in array3)
					{
						ScriptableObject val2 = LoadAndFixScriptableObject<ScriptableObject>(val, text3, typeMap);
						if ((Object)(object)val2 != (Object)null)
						{
							string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(text3);
							string name = ((object)val2).GetType().Name;
							string text4 = $"{fileNameWithoutExtension}_{name}_{array.Length}_{dictionary.Count}";
							if (val2 is LMLmodInfo lMLmodInfo2 && (Object)(object)lethalMinBundleContainer.modInfo == (Object)null)
							{
								lethalMinBundleContainer.modInfo = lMLmodInfo2;
								lethalMinBundleContainer.modName = lMLmodInfo2.ModName;
								lethalMinBundleContainer.modAuthor = lMLmodInfo2.ModAuthor;
								lethalMinBundleContainer.modVersion = lMLmodInfo2.Version;
								lMLmodInfo2.DontLoad = true;
								lMLmodInfo = lMLmodInfo2;
								Debug.Log((object)("Found mod info via type check: " + lMLmodInfo2.ModName));
							}
							else
							{
								list.Add(val2);
							}
							ctx.AddObjectToAsset(text4, (Object)(object)val2);
							lethalMinBundleContainer.AddAssetReference(fileNameWithoutExtension, (Object)(object)val2);
							dictionary[text3] = true;
							Debug.Log((object)("Imported ScriptableObject: " + fileNameWithoutExtension + " (Type: " + name + ")"));
						}
					}
				}
				if ((Object)(object)lethalMinBundleContainer.modInfo == (Object)null)
				{
					Debug.LogWarning((object)"No mod info found in bundle, creating placeholder");
					LMLmodInfo lMLmodInfo3 = ScriptableObject.CreateInstance<LMLmodInfo>();
					((Object)lMLmodInfo3).name = lethalMinBundleContainer.bundleName + "_PlaceholderModInfo";
					lMLmodInfo3.ModName = lethalMinBundleContainer.bundleName;
					lMLmodInfo3.ModAuthor = "Unknown";
					lMLmodInfo3.Version = "1.0.0";
					lMLmodInfo3.DontLoad = true;
					ctx.AddObjectToAsset("PlaceholderModInfo", (Object)(object)lMLmodInfo3);
					lethalMinBundleContainer.modInfo = lMLmodInfo3;
					lethalMinBundleContainer.modName = lMLmodInfo3.ModName;
					lethalMinBundleContainer.modAuthor = lMLmodInfo3.ModAuthor;
					lethalMinBundleContainer.modVersion = lMLmodInfo3.Version;
					lethalMinBundleContainer.AddAssetReference("ModInfo", (Object)(object)lMLmodInfo3);
					lMLmodInfo = lMLmodInfo3;
				}
				foreach (ScriptableObject item in list)
				{
					TryAssignModInfoReference(item, lMLmodInfo);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error importing LethalMin bundle: " + ex.Message + "\n" + ex.StackTrace));
			}
			finally
			{
				val.Unload(false);
			}
		}

		private void TryAssignModInfoReference(ScriptableObject? asset, LMLmodInfo? modInfo)
		{
			if ((Object)(object)asset == (Object)null || (Object)(object)modInfo == (Object)null || (Object)(object)asset == (Object)(object)modInfo)
			{
				return;
			}
			FieldInfo[] fields = ((object)asset).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			FieldInfo[] array = fields;
			foreach (FieldInfo fieldInfo in array)
			{
				if (fieldInfo.Name == "ModInfo" && fieldInfo.FieldType.IsAssignableFrom(typeof(LMLmodInfo)))
				{
					fieldInfo.SetValue(asset, modInfo);
					Debug.Log((object)("Assigned ModInfo reference to " + ((Object)asset).name + "'s ModInfo field"));
				}
			}
		}

		private Dictionary<string, Type> BuildTypeMap()
		{
			if (CachedTypeMap != null && CachedTypeMap.Count > 0)
			{
				return CachedTypeMap;
			}
			Debug.Log((object)"Scanning assembly for ScriptableObject types...");
			Dictionary<string, Type> dictionary = new Dictionary<string, Type>();
			Type[] typesWithErrorHandling = LethalMinLibrary.GetTypesWithErrorHandling();
			Type[] array = typesWithErrorHandling;
			foreach (Type type in array)
			{
				if (type.IsSubclassOf(typeof(ScriptableObject)) || type == typeof(ScriptableObject))
				{
					string name = type.Name;
					if (!dictionary.ContainsKey(name))
					{
						Debug.Log((object)("Adding type to map: " + name));
						dictionary[name] = type;
					}
				}
			}
			CachedTypeMap = dictionary;
			Debug.Log((object)"Done Scanning assembly for ScriptableObject types!");
			return dictionary;
		}

		private T? LoadAndFixScriptableObject<T>(AssetBundle bundle, string assetName, Dictionary<string, Type> typeMap) where T : ScriptableObject
		{
			try
			{
				ScriptableObject val = bundle.LoadAsset<ScriptableObject>(assetName);
				if ((Object)(object)val == (Object)null)
				{
					return default(T);
				}
				string name = ((object)val).GetType().Name;
				Debug.Log((object)("Original asset type: " + name));
				if (!typeMap.TryGetValue(name, out Type value))
				{
					Debug.LogWarning((object)("No matching type found for " + name + " in local assembly"));
					return default(T);
				}
				if (!typeof(T).IsAssignableFrom(value))
				{
					Debug.LogWarning((object)("Type " + value.Name + " is not assignable to " + typeof(T).Name));
					return default(T);
				}
				ScriptableObject val2 = ScriptableObject.CreateInstance(value);
				((Object)val2).name = ((Object)val).name;
				EditorUtility.CopySerialized((Object)(object)val, (Object)(object)val2);
				Debug.Log((object)("Created new asset of type " + value.Name + " from " + name));
				return (T)(object)((val2 is T) ? val2 : null);
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error fixing script reference for " + assetName + ": " + ex.Message + "\n" + ex.StackTrace));
				return default(T);
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace NoteBoxz.LethalMinLibrary.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}