Decompiled source of Melanie Interiors MelanieMelicious v1.1.0

MelanieMeliciousInterior.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
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(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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;
		}
	}
}
internal static class MelanieInteriorConfig
{
	internal enum items
	{
		Enable,
		NoPickup,
		Disable
	}

	internal static ConfigEntry<items> item0;

	internal static ConfigEntry<items> item1;

	internal static ConfigEntry<items> item2;

	internal static ConfigEntry<items> item3;

	internal static ConfigEntry<items> item4;

	internal static ConfigEntry<items> item5;

	internal static ConfigEntry<int> item0Min;

	internal static ConfigEntry<int> item0Max;

	internal static ConfigEntry<int> item2Min;

	internal static ConfigEntry<int> item2Max;

	internal static ConfigEntry<int> item3Min;

	internal static ConfigEntry<int> item3Max;

	internal static ConfigEntry<int> item4Min;

	internal static ConfigEntry<int> item4Max;

	internal static ConfigEntry<int> item5Min;

	internal static ConfigEntry<int> item5Max;

	internal static ConfigEntry<bool> item0Hand;

	internal static ConfigEntry<bool> item1Hand;

	internal static ConfigEntry<bool> item2Hand;

	internal static ConfigEntry<bool> item3Hand;

	internal static ConfigEntry<bool> item4Hand;

	internal static ConfigEntry<bool> item5Hand;

	internal static void SetupConfig(ConfigFile config)
	{
		item0 = config.Bind<items>("Item Toggle", "Paintings", items.Enable, "Toggle if paintings are enabled, can be picked up, or disabled entirely.");
		item1 = config.Bind<items>("Item Toggle", "Fossils", items.Enable, "Toggle if fossils are enabled, can be picked up, or disabled entirely.");
		item2 = config.Bind<items>("Item Toggle", "Plushies", items.Enable, "Toggle if plushies are enabled, can be picked up, or disabled entirely.");
		item3 = config.Bind<items>("Item Toggle", "Relics", items.Enable, "Toggle if puzzle relics are enabled, can be picked up, or disabled entirely.");
		item4 = config.Bind<items>("Item Toggle", "Body Bags", items.Enable, "Toggle if body bags are enabled, can be picked up, or disabled entirely.");
		item5 = config.Bind<items>("Item Toggle", "Small Bones", items.Enable, "Toggle if small bones (not fossils) are enabled, can be picked up, or disabled entirely.");
		item0Min = config.Bind<int>("Item Values", "Painting Minimum Value", 10, "Modify minimum values of paintings.");
		item0Max = config.Bind<int>("Item Values", "Painting Maximum Value", 20, "Modify maximum values of paintings.");
		item2Min = config.Bind<int>("Item Values", "Plushie Minimum Value", 20, "Modify minimum values of plushie.");
		item2Max = config.Bind<int>("Item Values", "Plushie Maximum Value", 30, "Modify maximum values of plushie.");
		item3Min = config.Bind<int>("Item Values", "Relic Minimum Value", 35, "Modify minimum values of relics.");
		item3Max = config.Bind<int>("Item Values", "Relic Maximum Value", 55, "Modify maximum values of relics.");
		item4Min = config.Bind<int>("Item Values", "Body Bag Minimum Value", 10, "Modify minimum values of body bags.");
		item4Max = config.Bind<int>("Item Values", "Body Bag Maximum Value", 20, "Modify maximum values of body bags.");
		item5Min = config.Bind<int>("Item Values", "Small Bone Minimum Value", 5, "Modify minimum values of small bones.");
		item5Max = config.Bind<int>("Item Values", "Small Bone Maximum Value", 10, "Modify maximum values of small bones.");
		item0Hand = config.Bind<bool>("Item Holding", "Paintings 2-Handed", true, "Modify if paintings are 2-handed.");
		item2Hand = config.Bind<bool>("Item Holding", "Plushies 2-Handed", false, "Modify if plushies are 2-handed.");
		item3Hand = config.Bind<bool>("Item Holding", "Relics 2-Handed", false, "Modify if relics are 2-handed.");
		item4Hand = config.Bind<bool>("Item Holding", "Body Bags 2-Handed", true, "Modify if body bags are 2-handed.");
		item5Hand = config.Bind<bool>("Item Holding", "Small Bones 2-Handed", false, "Modify if small bones are 2-handed.");
	}
}
public class RemoveItem : MonoBehaviour
{
	public char item;

	private void Awake()
	{
		try
		{
			switch (item)
			{
			case '0':
				if (MelanieInteriorConfig.item0.Value == MelanieInteriorConfig.items.NoPickup)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<GrabbableObject>());
					break;
				}
				if (MelanieInteriorConfig.item0.Value == MelanieInteriorConfig.items.Disable)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
					break;
				}
				((Component)this).gameObject.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieInteriorConfig.item0Min.Value, MelanieInteriorConfig.item0Max.Value));
				((Component)this).gameObject.GetComponent<GrabbableObject>().itemProperties.twoHanded = MelanieInteriorConfig.item0Hand.Value;
				break;
			case '1':
				if (MelanieInteriorConfig.item1.Value == MelanieInteriorConfig.items.NoPickup)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<GrabbableObject>());
				}
				else if (MelanieInteriorConfig.item1.Value == MelanieInteriorConfig.items.Disable)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
				break;
			case '2':
				if (MelanieInteriorConfig.item2.Value == MelanieInteriorConfig.items.NoPickup)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<GrabbableObject>());
					break;
				}
				if (MelanieInteriorConfig.item2.Value == MelanieInteriorConfig.items.Disable)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
					break;
				}
				((Component)this).gameObject.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieInteriorConfig.item2Min.Value, MelanieInteriorConfig.item2Max.Value));
				((Component)this).gameObject.GetComponent<GrabbableObject>().itemProperties.twoHanded = MelanieInteriorConfig.item2Hand.Value;
				break;
			case '3':
				if (MelanieInteriorConfig.item3.Value == MelanieInteriorConfig.items.NoPickup)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<GrabbableObject>());
					break;
				}
				if (MelanieInteriorConfig.item3.Value == MelanieInteriorConfig.items.Disable)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
					break;
				}
				((Component)this).gameObject.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieInteriorConfig.item3Min.Value, MelanieInteriorConfig.item3Max.Value));
				((Component)this).gameObject.GetComponent<GrabbableObject>().itemProperties.twoHanded = MelanieInteriorConfig.item3Hand.Value;
				break;
			case '4':
				if (MelanieInteriorConfig.item4.Value == MelanieInteriorConfig.items.NoPickup)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<GrabbableObject>());
					break;
				}
				if (MelanieInteriorConfig.item4.Value == MelanieInteriorConfig.items.Disable)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
					break;
				}
				((Component)this).gameObject.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieInteriorConfig.item4Min.Value, MelanieInteriorConfig.item4Max.Value));
				((Component)this).gameObject.GetComponent<GrabbableObject>().itemProperties.twoHanded = MelanieInteriorConfig.item4Hand.Value;
				break;
			case '5':
				if (MelanieInteriorConfig.item5.Value == MelanieInteriorConfig.items.NoPickup)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<GrabbableObject>());
					break;
				}
				if (MelanieInteriorConfig.item5.Value == MelanieInteriorConfig.items.Disable)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
					break;
				}
				((Component)this).gameObject.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieInteriorConfig.item5Min.Value, MelanieInteriorConfig.item5Max.Value));
				((Component)this).gameObject.GetComponent<GrabbableObject>().itemProperties.twoHanded = MelanieInteriorConfig.item5Hand.Value;
				break;
			}
		}
		catch
		{
		}
	}
}
namespace MelanieMeliciousFurniturePack0
{
	[BepInPlugin("MelanieMelicious.interior0", "Melanie Melicious - Interiors", "1.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.interior0";

		private const string NAME = "Melanie Melicious - Interiors";

		private const string VERSION = "1.1.0";

		private readonly Harmony harmony = new Harmony("MelanieMelicious.interior0");

		public static ManualLogSource mls;

		public static Plugin instance;

		private void Awake()
		{
			MelanieInteriorConfig.SetupConfig(((BaseUnityPlugin)this).Config);
		}
	}
}