Decompiled source of MoreMonstersOld v1.0.0

MoreMonsters.dll

Decompiled a year ago
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 UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MoreMonsters")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MoreMonsters")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aa6861f1-1ec5-446c-b28c-3f2b07cd05f8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MoreMonsters;

[BepInPlugin("Quokka.MoreMonsters", "MoreMonsters", "1.0.0")]
public class MoreMonstersBase : BaseUnityPlugin
{
	private const string modGUID = "Quokka.MoreMonsters";

	private const string modName = "MoreMonsters";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("Quokka.MoreMonsters");

	private static MoreMonstersBase Instance;

	public static ManualLogSource mls;

	private static RoundManager currentRound;

	public static bool firstTier;

	public static bool secondTier;

	public static bool thirdTier;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = Logger.CreateLogSource("Quokka.MoreMonsters");
		harmony.PatchAll(typeof(MoreMonstersBase));
	}

	[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
	[HarmonyPostfix]
	private static void ModifyLevel(ref SelectableLevel newLevel)
	{
		currentRound = RoundManager.Instance;
	}

	[HarmonyPatch(typeof(RoundManager), "SpawnInsideEnemiesFromVentsIfReady")]
	[HarmonyPostfix]
	private static void SpawnInsideEnemiesFromVentsIfReadyPatch()
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		currentRound = RoundManager.Instance;
		currentRound.timeScript.globalTimeSpeedMultiplier = 1f;
		currentRound.currentLevel.maxEnemyPowerCount = 250;
		int connectedPlayersAmount = currentRound.playersManager.connectedPlayersAmount;
		int num = (int)(0.75 * (double)connectedPlayersAmount);
		if (connectedPlayersAmount < 4)
		{
			num = 6;
		}
		for (int i = 0; i < currentRound.allEnemyVents.Length; i++)
		{
			if (currentRound.currentEnemySpawnIndex < num && currentRound.timeScript.currentDayTime / currentRound.timeScript.totalTime > 0.185f)
			{
				Vector3 position = currentRound.allEnemyVents[i].floorNode.position;
				float y = currentRound.allEnemyVents[i].floorNode.eulerAngles.y;
				int j;
				for (j = (i * (int)currentRound.timeScript.currentDayTime + 19 * (i + 3)) % 8; currentRound.currentLevel.Enemies[j].enemyType.numberSpawned > 4; j++)
				{
				}
				currentRound.SpawnEnemyOnServer(position, y, j);
				RoundManager obj = currentRound;
				obj.currentEnemySpawnIndex++;
				EnemyType enemyType = currentRound.currentLevel.Enemies[j].enemyType;
				enemyType.numberSpawned++;
				if (currentRound.valueOfFoundScrapItems > (int)(0.25 * (double)currentRound.totalScrapValueInLevel) && !firstTier)
				{
					num++;
					firstTier = true;
				}
				if (currentRound.valueOfFoundScrapItems > (int)(0.5 * (double)currentRound.totalScrapValueInLevel) && !secondTier)
				{
					num++;
					secondTier = true;
				}
				if (currentRound.valueOfFoundScrapItems > (int)(0.75 * (double)currentRound.totalScrapValueInLevel) && !thirdTier)
				{
					num++;
					thirdTier = true;
				}
			}
		}
	}
}