Decompiled source of AtomizeEverything v1.2.0

AtomizeEverything.dll

Decompiled 2 years 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 AtomizeEverything.Patches;
using BepInEx;
using HarmonyLib;
using LethalTerminalExtender.Patches;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("AtomizeEverything")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Atomizes Everything with one command")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AtomizeEverything")]
[assembly: AssemblyTitle("AtomizeEverything")]
[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 AtomizeEverything
{
	[BepInPlugin("AtomizeEverything", "AtomizeEverything", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static RoundManager currentRound;

		internal static SelectableLevel currentLevel;

		internal static EnemyVent[] currentLevelVents;

		private readonly Harmony harmony = new Harmony("AtomizeEverything");

		private void Awake()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin AtomizeEverything is loaded!");
			TerminalExtenderUtils.addQuickCommand("holocaust", "Palić czarne szmaty. Amen.", false, (Action<Terminal, TerminalNode>)delegate
			{
				harmony.PatchAll(typeof(AtomizeEverything.Patches.Patches));
				string text = "";
				EnemyAI[] array = Object.FindObjectsOfType<EnemyAI>();
				foreach (EnemyAI val in array)
				{
					try
					{
						GameObject gameObject = ((Component)val).gameObject;
						text += ((object)gameObject).ToString();
						val.KillEnemy(false);
						Object.Destroy((Object)(object)gameObject);
					}
					catch (Exception ex)
					{
						Console.WriteLine(ex.ToString());
					}
				}
				HUDManager.Instance.DisplayTip("Objects", text, false, false, "LC_Tip1");
			});
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "AtomizeEverything";

		public const string PLUGIN_NAME = "AtomizeEverything";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace AtomizeEverything.Patches
{
	internal class Patches
	{
		[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
		[HarmonyPostfix]
		private static void UpdateNewInfo(ref EnemyVent[] ___allEnemyVents, ref SelectableLevel ___currentLevel)
		{
			Plugin.currentLevel = ___currentLevel;
			Plugin.currentLevelVents = ___allEnemyVents;
		}

		[HarmonyPatch(typeof(RoundManager), "AdvanceHourAndSpawnNewBatchOfEnemies")]
		[HarmonyPrefix]
		private static void UpdateCurrentLevelInfo(ref EnemyVent[] ___allEnemyVents, ref SelectableLevel ___currentLevel)
		{
			Plugin.currentLevel = ___currentLevel;
			Plugin.currentLevelVents = ___allEnemyVents;
		}

		[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
		[HarmonyPrefix]
		private static void getRoundInfo(ref SelectableLevel newLevel)
		{
			Plugin.currentRound = RoundManager.Instance;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}