Decompiled source of PalaeoFluff v0.67.2

BepInEx/plugins/palaeo-fluff/palaeo-fluff.dll

Decompiled a day 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 LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;
using palaeo-fluff.NetcodePatcher;

[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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("palaeo-fluff")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0.1+f794acb6934da814505555e1ddf55f186ac2000a")]
[assembly: AssemblyProduct("palaeo-fluff")]
[assembly: AssemblyTitle("palaeo-fluff")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
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 flib
{
	[BepInPlugin("flib-palaeo-fluff", "palaeo-fluff", "0.62.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string PLUGIN_GUID = "flib-palaeo-fluff";

		public const string PLUGIN_NAME = "palaeo-fluff";

		public const string PLUGIN_VERSION = "0.62.1";

		public static AssetBundle Assets;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"flib-palaeo-fluff started.");
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			Assets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "palaeo-fluff"));
			if ((Object)(object)Assets == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load custom assets.");
				return;
			}
			LoadScrapAsset("Assets/Prefabs/dolly_base.asset", 10);
			LoadScrapAsset("Assets/Prefabs/dolly_jumbo.asset", 3);
			LoadScrapAsset("Assets/Prefabs/dolly_scarf1.asset", 10);
			LoadScrapAsset("Assets/Prefabs/dolly_scarf2.asset", 10);
			LoadScrapAsset("Assets/Prefabs/dolly_hat1.asset", 10);
			LoadScrapAsset("Assets/Prefabs/dolly_hat2.asset", 10);
			LoadScrapAsset("Assets/Prefabs/dolly_ross.asset", 15);
			LoadScrapAsset("Assets/Prefabs/dolly_santa.asset", 15);
			if (DateTime.Now.Month == 12)
			{
				LoadScrapAsset("Assets/Prefabs/dolly_spom.asset", 90);
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"flib-palaeo-fluff loaded.");
		}

		private void LoadScrapAsset(string assetName, int spawnRate)
		{
			Item val = Assets.LoadAsset<Item>(assetName);
			if ((Object)(object)val == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load item '" + assetName + "'"));
				return;
			}
			Utilities.FixMixerGroups(val.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Items.RegisterScrap(val, spawnRate, (LevelTypes)(-1));
			((BaseUnityPlugin)this).Logger.LogInfo((object)$"Loaded item '{assetName}' ({val.itemName}) @ spawnrate {spawnRate}%");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "palaeo-fluff";

		public const string PLUGIN_NAME = "palaeo-fluff";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace palaeo-fluff.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}