Decompiled source of OnlyDogsSpawn v1.0.1

OnlyDogsSpawn.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("OnlyDogsSpawn")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Only eyeless dogs spawn outside")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+7c9599c8e55bc4e2d38fe5258c1495b77883a4c7")]
[assembly: AssemblyProduct("OnlyDogsSpawn")]
[assembly: AssemblyTitle("OnlyDogsSpawn")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.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 OnlyDogsSpawn
{
	[BepInPlugin("Alphonso.OnlyDogsSpawn", "OnlyDogsSpawn", "1.0.1")]
	public class OnlyDogsSpawn : BaseUnityPlugin
	{
		public static bool loaded;

		private const string modGUID = "Alphonso.OnlyDogsSpawn";

		private const string modName = "OnlyDogsSpawn";

		private const string modVersion = "1.0.1";

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

		private static OnlyDogsSpawn Instance;

		public static ManualLogSource mls;

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

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

		public const string PLUGIN_NAME = "OnlyDogsSpawn";

		public const string PLUGIN_VERSION = "1.0.1";
	}
}