Decompiled source of OllieMod v1.2.3

OllieMod.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.IO;
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 REPOLib;
using REPOLib.Modules;
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: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("azurei")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("OllieMod")]
[assembly: AssemblyTitle("OllieMod")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 OllieMod
{
	[BepInPlugin("azurei.OllieMod", "OllieMod", "1.2.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class OllieMod : BaseUnityPlugin
	{
		internal static OllieMod Instance { get; private set; }

		internal static ManualLogSource Logger => Instance._logger;

		private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;

		internal Harmony? Harmony { get; set; }

		private void Awake()
		{
			string text = Path.Combine(Paths.PluginPath, "azurei-OllieMod", "olliemodassets");
			BundleLoader.LoadBundle(text, (Action<AssetBundle>)delegate(AssetBundle assetBundle)
			{
				EnemySetup val = assetBundle.LoadAsset<EnemySetup>("Enemy Setup - Ceiling Dev");
				Enemies.RegisterEnemy(val);
				EnemySetup val2 = assetBundle.LoadAsset<EnemySetup>("Enemy Group - 4 Ceiling Devs");
				Enemies.RegisterEnemy(val2);
				EnemySetup val3 = assetBundle.LoadAsset<EnemySetup>("Enemy Setup - Labubu");
				Enemies.RegisterEnemy(val3);
				EnemySetup val4 = assetBundle.LoadAsset<EnemySetup>("Enemy Group - 10 Labubus");
				Enemies.RegisterEnemy(val4);
				GameObject val5 = assetBundle.LoadAsset<GameObject>("Enemy - Labubu Director");
				GameObject val6 = Object.Instantiate<GameObject>(val5);
				EnemySetup val7 = assetBundle.LoadAsset<EnemySetup>("Enemy Setup - Ollie");
				Enemies.RegisterEnemy(val7);
				EnemySetup val8 = assetBundle.LoadAsset<EnemySetup>("Enemy Group - 3 Ollies");
				Enemies.RegisterEnemy(val8);
			}, false);
			Patch();
		}

		internal void Patch()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0026: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
				Harmony val2 = val;
				Harmony = val;
			}
			Harmony.PatchAll();
		}

		internal void Unpatch()
		{
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		private void Update()
		{
		}
	}
	[HarmonyPatch(typeof(EnemyDirector), "AmountSetup")]
	public static class Patch
	{
		[HarmonyPrefix]
		public static void Prefix(EnemyDirector __instance)
		{
			__instance.enemiesDifficulty1.RemoveAll((EnemySetup obj) => (Object)(object)obj != (Object)null && (((Object)obj).name == "Enemy - Gnome" || ((Object)obj).name == "Enemy - Ceiling Eye"));
			__instance.enemiesDifficulty2.RemoveAll((EnemySetup obj) => (Object)(object)obj != (Object)null && ((Object)obj).name == "Enemy - Bowtie");
		}
	}
}