Decompiled source of SourceScrap v1.0.0

neppy.SourceScrap.dll

Decompiled 6 hours ago
using System;
using System.Collections.Generic;
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 BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using LobbyCompatibility.Attributes;
using Microsoft.CodeAnalysis;
using SourceScrap.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("neppy.SourceScrap")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("SourceScrap")]
[assembly: AssemblyTitle("neppy.SourceScrap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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.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;
		}
	}
	[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;
		}
	}
}
namespace SourceScrap
{
	[BepInPlugin("neppy.SourceScrap", "SourceScrap", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[LobbyCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class SourceScrap : BaseUnityPlugin
	{
		public static List<AudioClip> audioClips;

		public static SourceScrap Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "sourcescrap");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			string text2 = "Assets/SourceScrap/";
			audioClips = new List<AudioClip>
			{
				val.LoadAsset<AudioClip>(text2 + "concrete_impact_soft1.wav"),
				val.LoadAsset<AudioClip>(text2 + "concrete_impact_soft2.wav"),
				val.LoadAsset<AudioClip>(text2 + "flesh_squishy_impact_hard1.wav"),
				val.LoadAsset<AudioClip>(text2 + "flesh_squishy_impact_hard3.wav"),
				val.LoadAsset<AudioClip>(text2 + "metal_computer_impact_hard2.wav"),
				val.LoadAsset<AudioClip>(text2 + "metal_computer_impact_hard3.wav"),
				val.LoadAsset<AudioClip>(text2 + "metal_solid_impact_hard1.wav"),
				val.LoadAsset<AudioClip>(text2 + "metal_solid_impact_hard4.wav"),
				val.LoadAsset<AudioClip>(text2 + "metal_solid_impact_soft1.wav"),
				val.LoadAsset<AudioClip>(text2 + "metal_solid_impact_soft3.wav"),
				val.LoadAsset<AudioClip>(text2 + "plastic_box_impact_hard2.wav"),
				val.LoadAsset<AudioClip>(text2 + "plastic_box_impact_soft4.wav"),
				val.LoadAsset<AudioClip>(text2 + "wood_box_impact_hard2.wav"),
				val.LoadAsset<AudioClip>(text2 + "wood_box_impact_hard6.wav")
			};
			List<Scrap> list = new List<Scrap>
			{
				new Scrap("Bicycle", 0),
				new Scrap("BreenBust", 1),
				new Scrap("Bucket", 0),
				new Scrap("CarBattery", 0),
				new Scrap("CitizenRadio", 1),
				new Scrap("CombineMine", 2),
				new Scrap("CombineRifleAmmo", 2),
				new Scrap("CombineRollermine", 2),
				new Scrap("Computer", 1),
				new Scrap("ConcreteBlock", 0),
				new Scrap("ConsoleBox", 1),
				new Scrap("Cremator", 2),
				new Scrap("FoodPackage", 0),
				new Scrap("Fridge", 1),
				new Scrap("Gascan", 0),
				new Scrap("GnomeChompski", 0),
				new Scrap("HelicopterBomb", 2),
				new Scrap("HEVPlate", 2),
				new Scrap("Jar", 0),
				new Scrap("Keyboard", 1),
				new Scrap("MagnussonDevice", 2),
				new Scrap("Monitor", 1),
				new Scrap("PaintCan", 0),
				new Scrap("Pickaxe", 0),
				new Scrap("PlasticCrate", 0),
				new Scrap("PropellerEngine", 0),
				new Scrap("RavenholmSign", 1),
				new Scrap("TerracottaPot", 0),
				new Scrap("TickTacToe", 0),
				new Scrap("TrafficCone", 0),
				new Scrap("TrafficLight", 1),
				new Scrap("Watermelon", 0),
				new Scrap("WoodenCrate", 0)
			};
			Dictionary<LevelTypes, int>[] array = new Dictionary<LevelTypes, int>[3]
			{
				new Dictionary<LevelTypes, int>
				{
					{
						(LevelTypes)1,
						50
					},
					{
						(LevelTypes)4,
						50
					},
					{
						(LevelTypes)8,
						50
					},
					{
						(LevelTypes)16,
						50
					},
					{
						(LevelTypes)32,
						50
					},
					{
						(LevelTypes)64,
						50
					},
					{
						(LevelTypes)128,
						25
					},
					{
						(LevelTypes)256,
						25
					},
					{
						(LevelTypes)512,
						20
					},
					{
						(LevelTypes)2048,
						50
					},
					{
						(LevelTypes)4096,
						25
					},
					{
						(LevelTypes)8192,
						30
					},
					{
						(LevelTypes)15356,
						50
					},
					{
						(LevelTypes)1024,
						50
					},
					{
						(LevelTypes)(-1),
						50
					}
				},
				new Dictionary<LevelTypes, int>
				{
					{
						(LevelTypes)1,
						50
					},
					{
						(LevelTypes)4,
						25
					},
					{
						(LevelTypes)8,
						15
					},
					{
						(LevelTypes)16,
						20
					},
					{
						(LevelTypes)32,
						25
					},
					{
						(LevelTypes)64,
						30
					},
					{
						(LevelTypes)128,
						40
					},
					{
						(LevelTypes)256,
						40
					},
					{
						(LevelTypes)512,
						50
					},
					{
						(LevelTypes)2048,
						25
					},
					{
						(LevelTypes)4096,
						40
					},
					{
						(LevelTypes)8192,
						40
					},
					{
						(LevelTypes)15356,
						50
					},
					{
						(LevelTypes)1024,
						50
					},
					{
						(LevelTypes)(-1),
						50
					}
				},
				new Dictionary<LevelTypes, int>
				{
					{
						(LevelTypes)1,
						50
					},
					{
						(LevelTypes)4,
						5
					},
					{
						(LevelTypes)8,
						5
					},
					{
						(LevelTypes)16,
						10
					},
					{
						(LevelTypes)32,
						10
					},
					{
						(LevelTypes)64,
						10
					},
					{
						(LevelTypes)128,
						50
					},
					{
						(LevelTypes)256,
						50
					},
					{
						(LevelTypes)512,
						65
					},
					{
						(LevelTypes)2048,
						10
					},
					{
						(LevelTypes)4096,
						50
					},
					{
						(LevelTypes)8192,
						40
					},
					{
						(LevelTypes)15356,
						50
					},
					{
						(LevelTypes)1024,
						50
					},
					{
						(LevelTypes)(-1),
						50
					}
				}
			};
			Dictionary<string, int>[] array2 = new Dictionary<string, int>[1]
			{
				new Dictionary<string, int>
				{
					{ "Black MesaExtendedLevel", 100 },
					{ "XenExtendedLevel", 100 }
				}
			};
			foreach (Scrap item in list)
			{
				Item val2 = val.LoadAsset<Item>(text2 + item.asset + "/" + item.asset + ".asset");
				NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
				Utilities.FixMixerGroups(val2.spawnPrefab);
				Items.RegisterScrap(val2, array[item.rarity], array2[0]);
				Logger.LogInfo((object)("neppy.SourceScrap: Loaded " + val2.itemName + "."));
			}
			Logger.LogInfo((object)"neppy.SourceScrap v0.1.0 has loaded!");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "neppy.SourceScrap";

		public const string PLUGIN_NAME = "SourceScrap";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}
namespace SourceScrap.Utils
{
	public class Scrap
	{
		public string asset;

		public int rarity;

		public Scrap(string asset, int rarity)
		{
			this.asset = asset;
			this.rarity = rarity;
		}
	}
}