Decompiled source of LanternOfSouls v1.2.1

LanternOfSoulsMod.dll

Decompiled 14 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("LanternOfSoulsMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LanternOfSoulsMod")]
[assembly: AssemblyCopyright("Copyright ©  2019")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f858e18f-53af-4faf-8564-65f5e8389750")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LanternOfSoulsMod;

[HarmonyPatch(typeof(CharacterEquipment), "GetEquipmentDamageResistance")]
public class CharacterEquipment_GetEquipmentDamageResistance
{
	[HarmonyPostfix]
	public static void Postfix(ref float __result, CharacterEquipment __instance, Types _type)
	{
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		EquipmentSlot[] equipmentSlots = __instance.EquipmentSlots;
		for (int i = 0; i < equipmentSlots.Length; i++)
		{
			if (!__instance.HasItemEquipped(i) || equipmentSlots[i].EquippedItem is Weapon)
			{
				continue;
			}
			Equipment equippedItem = equipmentSlots[i].EquippedItem;
			if (!(equippedItem is Bag) || !((Bag)equippedItem).HasLanternSlot)
			{
				continue;
			}
			BagSlotVisual[] visualSlots = ((Bag)equippedItem).VisualSlots;
			BagSlotVisual val = null;
			for (int j = 0; j < visualSlots.Length; j++)
			{
				if (UnityEngineExtensions.Contains<BagCategorySlotType>(visualSlots[j].AuthorizedTypes, (BagCategorySlotType)3))
				{
					val = visualSlots[j];
					if ((Object)(object)val.DisplayedItem != (Object)null && val.DisplayedItem.ItemIDString == "5100080")
					{
						__result += ((Equipment)val.DisplayedItem).GetDamageResistance(_type);
					}
				}
			}
		}
	}
}
[BepInPlugin("com.cayub.LanternOfSoulsBackpackMod", "Lantern of Souls Backpack Mod", "1.2")]
public class LanternOfSoulsBackpackMod : BaseUnityPlugin
{
	private const string ID = "com.cayub.LanternOfSoulsBackpackMod";

	private const string NAME = "Lantern of Souls Backpack Mod";

	private const string VERSION = "1.2";

	internal void Awake()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		((BaseUnityPlugin)this).Logger.Log((LogLevel)8, (object)"Activating Lantern of Souls Mod");
		Harmony val = new Harmony("com.cayub.LanternOfSoulsBackpackMod");
		val.PatchAll(Assembly.GetExecutingAssembly());
		((BaseUnityPlugin)this).Logger.Log((LogLevel)8, (object)"Lantern of Souls Mod is Activated");
	}
}