Decompiled source of JimbacalaItems v0.0.3

JimbaclaItems/JimbacalaItems.dll

Decompiled a month ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("JimbacalaItems")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JimbacalaItems")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("55cfc195-6941-4ccf-b996-fb75058f1546")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
public static class MoonHelper
{
	public static LevelTypes GetLevelTypesFromNames(params string[] moonNames)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: 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_023c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: 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_01ee: 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_01f5: 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_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: 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_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: 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_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: 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_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: 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_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		LevelTypes val = (LevelTypes)0;
		foreach (string text in moonNames)
		{
			switch (text.ToLowerInvariant())
			{
			case "experimentation":
				val = (LevelTypes)(val | 4);
				break;
			case "assurance":
				val = (LevelTypes)(val | 8);
				break;
			case "vow":
				val = (LevelTypes)(val | 0x10);
				break;
			case "march":
				val = (LevelTypes)(val | 0x40);
				break;
			case "offense":
				val = (LevelTypes)(val | 0x20);
				break;
			case "adamance":
				val = (LevelTypes)(val | 0x800);
				break;
			case "rend":
				val = (LevelTypes)(val | 0x80);
				break;
			case "dine":
				val = (LevelTypes)(val | 0x100);
				break;
			case "titan":
				val = (LevelTypes)(val | 0x200);
				break;
			case "embrion":
				val = (LevelTypes)(val | 0x2000);
				break;
			case "artifice":
				val = (LevelTypes)(val | 0x1000);
				break;
			default:
				Debug.LogWarning((object)("Unknown moon name: " + text));
				break;
			}
		}
		return val;
	}
}
namespace JimbacalaItems;

[BepInPlugin("Jimbacala.JimbacalaItems", "Jimbacala Items", "0.0.3")]
public class Plugin : BaseUnityPlugin
{
	private const string GUID = "Jimbacala.JimbacalaItems";

	private const string NAME = "Jimbacala Items";

	private const string VERSION = "0.0.3";

	private readonly Harmony harmony = new Harmony("Jimbacala.JimbacalaItems");

	public static Plugin instance;

	internal ManualLogSource mls;

	private void Awake()
	{
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		instance = this;
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "itemmod");
		AssetBundle val = AssetBundle.LoadFromFile(text);
		Item val2 = val.LoadAsset<Item>("Assets/MarrHead.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
		Utilities.FixMixerGroups(val2.spawnPrefab);
		string[] moonNames = new string[10] { "experimentation", "assurance", "vow", "offense", "adamance", "rend", "dine", "titan", "embrion", "artifice" };
		Items.RegisterScrap(val2, 50, MoonHelper.GetLevelTypesFromNames(moonNames));
		Items.RegisterScrap(val2, 80, (LevelTypes)64);
		Item val3 = val.LoadAsset<Item>("Assets/SKRoll.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
		Utilities.FixMixerGroups(val3.spawnPrefab);
		Items.RegisterScrap(val3, 80, (LevelTypes)(-1));
		Item val4 = val.LoadAsset<Item>("Assets/GabePill.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
		Utilities.FixMixerGroups(val4.spawnPrefab);
		Items.RegisterScrap(val4, 80, (LevelTypes)(-1));
		Item val5 = val.LoadAsset<Item>("Assets/DinglePainting.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
		Utilities.FixMixerGroups(val5.spawnPrefab);
		string[] moonNames2 = new string[8] { "experimentation", "assurance", "vow", "offense", "adamance", "rend", "embrion", "artifice" };
		Items.RegisterScrap(val5, 30, MoonHelper.GetLevelTypesFromNames(moonNames2));
		string[] moonNames3 = new string[3] { "rend", "dine", "titan" };
		Items.RegisterScrap(val5, 90, MoonHelper.GetLevelTypesFromNames(moonNames3));
		Item val6 = val.LoadAsset<Item>("Assets/MarrBall.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab);
		Utilities.FixMixerGroups(val6.spawnPrefab);
		Items.RegisterScrap(val6, 20, MoonHelper.GetLevelTypesFromNames(moonNames));
		Items.RegisterScrap(val6, 80, (LevelTypes)64);
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Jimbacala.JimbacalaItems");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Jimbacala Items Loaded");
	}
}