Decompiled source of Item Furniture MelanieMelicious v0.1.1

MelanieMeliciousFurniture.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
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;
		}
	}
}
public class SpawnTest : MonoBehaviour
{
	public Item spawnItem;

	public int maxItem = 1;

	private int currentItem;

	private void Awake()
	{
		currentItem = 0;
	}

	private void Update()
	{
		if (StartOfRound.Instance.shipHasLanded && currentItem <= maxItem && TimeOfDay.Instance.hour >= 4)
		{
			SpawnItem();
			currentItem++;
		}
		else if (StartOfRound.Instance.shipIsLeaving)
		{
			currentItem = 0;
		}
	}

	private void SpawnItem()
	{
		//IL_0012: 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)
		GameObject val = Object.Instantiate<GameObject>(spawnItem.spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation);
		val.GetComponent<NetworkObject>().Spawn(false);
	}
}
namespace CubeItem
{
	[BepInPlugin("MelanieMelicious.furniture", "Melanie Melicious - Furniture", "0.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.furniture";

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

		private const string VERSION = "0.0.1";

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

		public static Plugin instance;

		private void Awake()
		{
			instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melaniemeliciousfurniture");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			Item val2 = val.LoadAsset<Item>("Assets/MelanieMelicious.Mod/Item/Chair.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Utilities.FixMixerGroups(val2.spawnPrefab);
			TerminalNode val3 = ScriptableObject.CreateInstance<TerminalNode>();
			val3.clearPreviousText = true;
			val3.displayText = "do you not know what a chair is wtf !!\n\n";
			Items.RegisterShopItem(val2, (TerminalNode)null, (TerminalNode)null, val3, 30);
			Item val4 = val.LoadAsset<Item>("Assets/MelanieMelicious.Mod/Item/Stool.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
			Utilities.FixMixerGroups(val4.spawnPrefab);
			Items.RegisterShopItem(val4, 25);
			Item val5 = val.LoadAsset<Item>("Assets/MelanieMelicious.Mod/Item/Bin0.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
			Utilities.FixMixerGroups(val5.spawnPrefab);
			Items.RegisterShopItem(val5, 20);
			UnlockablesList val6 = val.LoadAsset<UnlockablesList>("Assets/MelanieMelicious.Mod/ShipObject/ShipObject.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[0].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[0], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 120);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[1].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[1], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 120);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[2].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[2], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 200);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[3].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[3], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 80);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[4].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[4], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 100);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[5].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[5], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 80);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[6].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[6], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 60);
			NetworkPrefabs.RegisterNetworkPrefab(val6.unlockables[7].prefabObject);
			Unlockables.RegisterUnlockable(val6.unlockables[7], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, 60);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"MelanieMelicious loaded!\nhi friend\n   ##     ##\n  ###    ###\n ###    ###\n ###    ###\n###    ###\n##     ##\n##     ##\n\n  #\n  #  #\n   ##");
		}
	}
}