Decompiled source of MoreLethalScraps v1.1.1

MoreLethalScraps/MoreLethalScraps.dll

Decompiled 2 months ago
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.Configuration;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LethalLib.Modules;
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 = "")]
[assembly: AssemblyCompany("MoreLethalScraps")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Add common lethal comapny monster or anything in the game as scraps items")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.1")]
[assembly: AssemblyProduct("MoreLethalScraps")]
[assembly: AssemblyTitle("MoreLethalScraps")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.1.0")]
[module: UnverifiableCode]
namespace MoreLethalScraps;

[BepInPlugin("wexop.moreLethalScraps", "MoreLethalScraps", "1.1.1")]
[BepInDependency("evaisa.lethallib", "0.15.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
	private const string GUID = "wexop.moreLethalScraps";

	private const string NAME = "MoreLethalScraps";

	private const string VERSION = "1.1.1";

	public static Plugin instance;

	private void Awake()
	{
		instance = this;
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps starting....");
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "morelethalscraps");
		AssetBundle val = AssetBundle.LoadFromFile(text);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps bundle found !");
		string text2 = "The chance of finding an object, 0 is null 100 is a lot. Common game craps items are between 0 and 100 Warning: restart the game for the change to take effect.";
		Item val2 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/DogScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
		Utilities.FixMixerGroups(val2.spawnPrefab);
		ConfigEntry<int> val3 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "DogToy All moons", 50, text2);
		CreateSliderScrap(val3);
		ConfigEntry<int> val4 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "DogToy Assurance and Offense moons", 70, text2);
		CreateSliderScrap(val4);
		Items.RegisterScrap(val2, val4.Value, (LevelTypes)8);
		Items.RegisterScrap(val2, val4.Value, (LevelTypes)32);
		Items.RegisterScrap(val2, val3.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - DogToy ready !");
		Item val5 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/BrakkenScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
		Utilities.FixMixerGroups(val5.spawnPrefab);
		ConfigEntry<int> val6 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "BrackenToy All moons", 20, text2);
		CreateSliderScrap(val6);
		ConfigEntry<int> val7 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "BrackenToy March and Vow moons", 45, text2);
		CreateSliderScrap(val7);
		Items.RegisterScrap(val5, val7.Value, (LevelTypes)64);
		Items.RegisterScrap(val5, val7.Value, (LevelTypes)16);
		Items.RegisterScrap(val5, val6.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - BrakkenToy ready !");
		Item val8 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/FireExitScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab);
		Utilities.FixMixerGroups(val8.spawnPrefab);
		ConfigEntry<int> val9 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "FireExitToy All moons", 90, text2);
		CreateSliderScrap(val9);
		Items.RegisterScrap(val8, val9.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - FireExitToy ready !");
		Item val10 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/GoldenFireExitScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab);
		Utilities.FixMixerGroups(val10.spawnPrefab);
		ConfigEntry<int> val11 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "GoldenFireExitToy All moons", 5, text2);
		CreateSliderScrap(val11);
		Items.RegisterScrap(val10, val11.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - GoldenFireExitToy ready !");
		Item val12 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/NutCrackerScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val12.spawnPrefab);
		Utilities.FixMixerGroups(val12.spawnPrefab);
		ConfigEntry<int> val13 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "NutCrackerToy All moons", 15, text2);
		CreateSliderScrap(val13);
		ConfigEntry<int> val14 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "NutCrackerToy Rend, Dine and Titan moons", 25, text2);
		CreateSliderScrap(val14);
		Items.RegisterScrap(val12, val14.Value, (LevelTypes)128);
		Items.RegisterScrap(val12, val14.Value, (LevelTypes)256);
		Items.RegisterScrap(val12, val14.Value, (LevelTypes)512);
		Items.RegisterScrap(val12, val13.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - NutCrackerToy ready !");
		Item val15 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/GiantScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val15.spawnPrefab);
		Utilities.FixMixerGroups(val15.spawnPrefab);
		ConfigEntry<int> val16 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "GiantToy All moons", 25, text2);
		CreateSliderScrap(val16);
		ConfigEntry<int> val17 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "GiantToy March, Vow and Adamance moons", 40, text2);
		CreateSliderScrap(val17);
		Items.RegisterScrap(val15, val17.Value, (LevelTypes)16);
		Items.RegisterScrap(val15, val17.Value, (LevelTypes)64);
		Items.RegisterScrap(val15, val17.Value, (LevelTypes)1, new string[1] { "Adamance" });
		Items.RegisterScrap(val15, val16.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - GiantToy ready !");
		Item val18 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/OldBirdScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val18.spawnPrefab);
		Utilities.FixMixerGroups(val18.spawnPrefab);
		ConfigEntry<int> val19 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "OldBirdToy All moons", 20, text2);
		CreateSliderScrap(val19);
		ConfigEntry<int> val20 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "OldBirdToy Rend, Dine and Titan moons", 35, text2);
		CreateSliderScrap(val20);
		ConfigEntry<int> val21 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "OldBirdToy Embrion moon", 100, text2);
		CreateSliderScrap(val21);
		Items.RegisterScrap(val18, val20.Value, (LevelTypes)128);
		Items.RegisterScrap(val18, val20.Value, (LevelTypes)256);
		Items.RegisterScrap(val18, val20.Value, (LevelTypes)512);
		Items.RegisterScrap(val18, val21.Value, (LevelTypes)1, new string[1] { "Embrion" });
		Items.RegisterScrap(val18, val19.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - OldBirdToy ready !");
		Item val22 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/BlobScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val22.spawnPrefab);
		Utilities.FixMixerGroups(val22.spawnPrefab);
		ConfigEntry<int> val23 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "BlobToy All moons", 25, text2);
		CreateSliderScrap(val23);
		Items.RegisterScrap(val22, val23.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - BlobToy ready !");
		Item val24 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/BugScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val24.spawnPrefab);
		Utilities.FixMixerGroups(val24.spawnPrefab);
		ConfigEntry<int> val25 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "BugToy All moons", 60, text2);
		CreateSliderScrap(val25);
		Items.RegisterScrap(val24, val25.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - BugToy ready !");
		Item val26 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/CoilHeadScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val26.spawnPrefab);
		Utilities.FixMixerGroups(val26.spawnPrefab);
		ConfigEntry<int> val27 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "CoilHeadToy All moons", 12, text2);
		CreateSliderScrap(val27);
		ConfigEntry<int> val28 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "CoilHeadToy Rend, Dine and Titan moons", 18, text2);
		CreateSliderScrap(val28);
		Items.RegisterScrap(val26, val28.Value, (LevelTypes)512);
		Items.RegisterScrap(val26, val28.Value, (LevelTypes)256);
		Items.RegisterScrap(val26, val28.Value, (LevelTypes)128);
		Items.RegisterScrap(val26, val27.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - CoilHeadToy ready !");
		Item val29 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/JesterScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val29.spawnPrefab);
		Utilities.FixMixerGroups(val29.spawnPrefab);
		ConfigEntry<int> val30 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "JesterToy All moons", 10, text2);
		CreateSliderScrap(val30);
		ConfigEntry<int> val31 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "JesterToy Rend, Dine and Titan moons", 15, text2);
		CreateSliderScrap(val31);
		Items.RegisterScrap(val29, val31.Value, (LevelTypes)512);
		Items.RegisterScrap(val29, val31.Value, (LevelTypes)256);
		Items.RegisterScrap(val29, val31.Value, (LevelTypes)128);
		Items.RegisterScrap(val29, val30.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - JesterToy ready !");
		Item val32 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/MoreLethalScraps/LittleGirlScrap.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val32.spawnPrefab);
		Utilities.FixMixerGroups(val32.spawnPrefab);
		ConfigEntry<int> val33 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "LittleGirlToy All moons", 8, text2);
		CreateSliderScrap(val33);
		ConfigEntry<int> val34 = ((BaseUnityPlugin)this).Config.Bind<int>("ScrapsRarity", "LittleGirlToy Rend, Dine and Titan moons", 13, text2);
		CreateSliderScrap(val34);
		Items.RegisterScrap(val32, val34.Value, (LevelTypes)512);
		Items.RegisterScrap(val32, val34.Value, (LevelTypes)256);
		Items.RegisterScrap(val32, val34.Value, (LevelTypes)128);
		Items.RegisterScrap(val32, val33.Value, (LevelTypes)(-1));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps - LittleGirlToy ready !");
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "wexop.moreLethalScraps");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreLethalScraps is patched!");
	}

	private void CreateSliderScrap(ConfigEntry<int> configEntry)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Expected O, but got Unknown
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		//IL_001d: Expected O, but got Unknown
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		IntSliderOptions val = new IntSliderOptions();
		((BaseRangeOptions<int>)val).Min = 0;
		((BaseRangeOptions<int>)val).Max = 100;
		IntSliderConfigItem val2 = new IntSliderConfigItem(configEntry, val);
		LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "MoreLethalScraps";

	public const string PLUGIN_NAME = "MoreLethalScraps";

	public const string PLUGIN_VERSION = "1.1.1";
}