Decompiled source of LethalPopsiclesPlus v0.1.7

Lethal Popsicles Plus/LethalPopsicles.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;

[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: AssemblyCompany("LethalPopsicles")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LethalPopsicles")]
[assembly: AssemblyTitle("LethalPopsicles")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace LethalPopsicles
{
	[BepInPlugin("Doot.lethalPopsiclesPlus", "Lethal Popsicles+", "0.1.7")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "Doot.lethalPopsiclesPlus";

		public const string NAME = "Lethal Popsicles+";

		public const string VERSION = "0.1.7";

		public static Plugin? instance;

		public static ManualLogSource mls;

		public static UnlockablesList unlockablesList;

		public static TerminalNode patoJrUnlockableInfo;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = Logger.CreateLogSource("Doot.lethalPopsiclesPlus");
			mls.LogInfo((object)"test mod awake");
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lethalpopsicles");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			string[] assetPaths = new string[11]
			{
				"Assets/LethalPopsicles/TaffyPopsicleItem.asset", "Assets/LethalPopsicles/DootPopsicleItem.asset", "Assets/LethalPopsicles/SlugPopsicleItem.asset", "Assets/LethalPopsicles/JalPopsicleItem.asset", "Assets/LethalPopsicles/NoyaPopsicleItem.asset", "Assets/LethalPopsicles/KleggPopsicleItem.asset", "Assets/LethalPopsicles/NENTOYAPopsicleItem.asset", "Assets/LethalPopsicles/PatoPopsicleItem.asset", "Assets/LethalPopsicles/SharkcicleItem.asset", "Assets/LethalPopsicles/PatoJrItem.asset",
				"Assets/LethalPopsicles/DokiPopsicle.asset"
			};
			int[] array = new int[11]
			{
				15, 15, 15, 15, 15, 15, 15, 15, 15, 5,
				15
			};
			unlockablesList = val.LoadAsset<UnlockablesList>("Assets/LethalPopsicles/Unlockables.asset");
			patoJrUnlockableInfo = val.LoadAsset<TerminalNode>("Assets/LethalPopsicles/PatoJrUnlockableInfo.asset");
			Item[] array2 = Plugin.LoadAssets<Item>(val, assetPaths);
			if (array2.Any((Item item) => (Object)(object)item == (Object)null))
			{
				mls.LogError((object)"Failed to load prefab(s)");
			}
			else
			{
				for (int i = 0; i < array2.Length; i++)
				{
					Items.RegisterScrap(array2[i], array[i], (LevelTypes)(-1));
					Utilities.FixMixerGroups(array2[i].spawnPrefab);
					NetworkPrefabs.RegisterNetworkPrefab(array2[i].spawnPrefab);
				}
			}
			if (unlockablesList.unlockables[0] == null)
			{
				mls.LogError((object)"Unlockables list was not found.");
			}
			else
			{
				Unlockables.RegisterUnlockable(unlockablesList.unlockables[0], (StoreType)2, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 10);
				NetworkPrefabs.RegisterNetworkPrefab(unlockablesList.unlockables[0].prefabObject);
			}
			mls.LogInfo((object)"YIPPEEEEEE!!!!!");
			mls.LogInfo((object)"LEthalPopsucles loadsd");
		}

		public static T[] LoadAssets<T>(AssetBundle bundle, string[] assetPaths) where T : Object
		{
			T[] array = new T[assetPaths.Length];
			for (int i = 0; i < assetPaths.Length; i++)
			{
				array[i] = bundle.LoadAsset<T>(assetPaths[i]);
			}
			return array;
		}
	}
}