Decompiled source of AnnyPlushieScrap v1.0.2

annyplushie/AnnyPlushie.dll

Decompiled 11 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 BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
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("AnnyPlushie")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds a Anny Plushie into Lethal Company")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2")]
[assembly: AssemblyProduct("AnnyPlushie")]
[assembly: AssemblyTitle("AnnyPlushie")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.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;
		}
	}
}
namespace AnnyFumo
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "AnnyPlushie";

		public const string PLUGIN_NAME = "AnnyPlushie";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}
namespace AnnyFumoScrap
{
	[BepInPlugin("adesi.lc.annyscrap", "Anny Plushie Scrap", "1.0.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class FumoAnnyMod : BaseUnityPlugin
	{
		private const string modGUID = "adesi.lc.annyscrap";

		private const string modName = "Anny Plushie Scrap";

		private const string modVersion = "1.0.2";

		private readonly Harmony harmony = new Harmony("adesi.lc.annyscrap");

		private static FumoAnnyMod Instance;

		private ConfigEntry<int> configFumoRarity;

		internal ManualLogSource mls;

		public static AssetBundle AnnyAssets;

		private void Awake()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			AnnyAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "anny"));
			mls = Logger.CreateLogSource("adesi.lc.annyscrap");
			mls.LogInfo((object)"Anny has infiltrated your facilities...");
			harmony.PatchAll(typeof(FumoAnnyMod));
			configFumoRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FumoRarityAnny", 30, new ConfigDescription("How rare Fumo Annys are to find. Lower values mean Fumos spawn less often", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			Item val = AnnyAssets.LoadAsset<Item>("assets/annyfumo/annyfumo.asset");
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load Anny prefab.");
				return;
			}
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Items.RegisterScrap(val, configFumoRarity.Value, (LevelTypes)510);
		}
	}
}