Decompiled source of OnlyBrackenSpawn v1.0.0

OnlyBrackenSpawn.dll

Decompiled a year ago
using System;
using System.Diagnostics;
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 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("OnlyBrackenSpawn")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Only Bracken spawn inside")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+01b394e4b1134bf202c88ba7ed9f8846a6aa4808")]
[assembly: AssemblyProduct("OnlyBrackenSpawn")]
[assembly: AssemblyTitle("OnlyBrackenSpawn")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace OnlyBrackenSpawn
{
	[BepInPlugin("Alphonso.OnlyBrackenSpawn", "OnlyBrackenSpawn", "1.0.0")]
	public class OnlyBrackenSpawn : BaseUnityPlugin
	{
		public static bool loaded;

		private const string modGUID = "Alphonso.OnlyBrackenSpawn";

		private const string modName = "OnlyBrackenSpawn";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Alphonso.OnlyBrackenSpawn");

		private static OnlyBrackenSpawn Instance;

		public static ManualLogSource mls;

		private void Awake()
		{
			mls = Logger.CreateLogSource("OnlyBrackenSpawn");
			mls.LogInfo((object)"Loaded OnlyBrackenSpawn and applying patches.");
			harmony.PatchAll(typeof(OnlyBrackenSpawn));
			mls = ((BaseUnityPlugin)this).Logger;
		}

		[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
		[HarmonyPrefix]
		private static bool Only_Bracken_Spawn(ref SelectableLevel newLevel)
		{
			foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
			{
				enemy.rarity = 0;
				if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<FlowermanAI>() != (Object)null)
				{
					enemy.rarity = 999;
				}
			}
			return true;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "OnlyBrackenSpawn";

		public const string PLUGIN_NAME = "OnlyBrackenSpawn";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}