Decompiled source of TonyPizzaScrap v0.1.5

tonypizzascrap.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
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("AigisToaster")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AigisToaster")]
[assembly: AssemblyTitle("AigisToaster")]
[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 TonyPizzaScrap
{
	[BepInPlugin("TonyPizza.TonyPizzaScrap", "TonyPizzaScrap", "0.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "TonyPizza.TonyPizzaScrap";

		private const string NAME = "TonyPizzaScrap";

		private const string VERSION = "0.0.1";

		public static Plugin instance;

		private void Awake()
		{
			instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "tonyscrapexport");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			if ((Object)(object)val == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load asset bundle at " + text));
				return;
			}
			string[] array = new string[22]
			{
				"Assets/Scrap/Lays Stax/LaysStaxItem.asset", "Assets/Scrap/AsukaPlush/AsukaPlushie.asset", "Assets/Scrap/AigisToaster/AigisToasterExport.asset", "Assets/Scrap/LegoVaderPen/DarthvaderPen/VaderPen.asset", "Assets/Scrap/XenosagaFreaks/XenosagaFreaksExport.asset", "Assets/Scrap/MvC2 Dreamcast/MvC2DCExport.asset", "Assets/Scrap/Click/ClickScrap.asset", "Assets/Scrap/Infinity Eggs/Infinity Eggs/InfinityEggScript.asset", "Assets/Scrap/Bingus/bingusscrap.asset", "Assets/Scrap/MvC2 Arcade/MvC2Arcade.asset",
				"Assets/Scrap/BaconEggCheese/BaconEggCheeseExport.asset", "Assets/Scrap/WaddleDee/WaddleDeeExport.asset", "Assets/Scrap/Pizza Slice/Pizza Slice/PizzaSliceExport.asset", "Assets/Scrap/MouseTrap/MouseTrapExport.asset", "Assets/Scrap/Pringles/PringlesItem.asset", "Assets/Scrap/XC2 Game/XC2Export.asset", "Assets/Scrap/Bug/BugItem.asset", "Assets/Scrap/SF6/SF6.asset", "Assets/Scrap/Jeep 1/JeepScrap.asset", "Assets/Scrap/Bingus/bingusscrap.asset",
				"Assets/Scrap/Teddie Scrap/Bear Suit/TeddieScrapExport.asset", "Assets/Scrap/Pac-Man/PacManItem.asset"
			};
			string[] array2 = array;
			foreach (string text2 in array2)
			{
				Item val2 = val.LoadAsset<Item>(text2);
				if ((Object)(object)val2 == (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to load Item at " + text2));
					continue;
				}
				int value = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap Rarities", val2.itemName.Replace(" ", "_"), 35, "Rarity of " + val2.itemName + " (higher = spawns more often)").Value;
				NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
				Utilities.FixMixerGroups(val2.spawnPrefab);
				Items.RegisterScrap(val2, value, (LevelTypes)(-1));
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"Registered scrap: {val2.itemName} (rarity {value})");
			}
		}
	}
}