Decompiled source of NoFoxMod v1.0.1

NoFoxMod.dll

Decompiled 3 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using TestMod.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ClassLibrary1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassLibrary1")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0a164a77-b539-4063-b68b-3341f0194610")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TestMod
{
	[BepInPlugin("NoFox", "No Fox Mod", "1.0.0")]
	public class NoOldBird : BaseUnityPlugin
	{
		private static ManualLogSource mls;

		private const string modGUID = "NoFox";

		private const string modName = "No Fox Mod";

		private const string modVersion = "1.0.0";

		private void Awake()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			mls = Logger.CreateLogSource("NoFoxMod");
			mls.LogInfo((object)"The No Fox mod has awaken");
			new Harmony("NoFoxMod").PatchAll(typeof(NoWolfAtLoadPatch));
		}
	}
}
namespace TestMod.Patches
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class NoWolfAtLoadPatch
	{
		private static ManualLogSource logger = Logger.CreateLogSource("NoFoxMod");

		[HarmonyPatch("LoadNewLevelWait")]
		[HarmonyPostfix]
		private static void RemoveOldBirdBeforePatch(ref SelectableLevel ___currentLevel)
		{
			if ((Object)(object)___currentLevel == (Object)null)
			{
				logger.LogWarning((object)"currentLevel is null in RemoveOldBirdBeforePatch");
				return;
			}
			List<SpawnableEnemyWithRarity> outsideEnemies = ___currentLevel.OutsideEnemies;
			SpawnableEnemyWithRarity val = null;
			foreach (SpawnableEnemyWithRarity item in outsideEnemies)
			{
				if (item.enemyType.enemyName == "BushWolfEnemy")
				{
					val = item;
				}
			}
			if (val != null)
			{
				outsideEnemies.Remove(val);
				logger.LogInfo((object)"Wolf was yeeted.");
			}
		}
	}
}