Decompiled source of More CG Enemies v1.0.1

MoreCGEnemies.dll

Decompiled 4 months 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 HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.AddressableAssets;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("MoreCGEnemies")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyProduct("MoreCGEnemies")]
[assembly: AssemblyTitle("MoreCGEnemies")]
[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 MoreCGEnemies
{
	public static class Extensions
	{
		public static void AddToArray<T>(ref T[] array, int index, params T[] objs)
		{
			T[] array2 = new T[Math.Max(index, array.Length) + objs.Length];
			Array.Copy(array, array2, Math.Min(index, array.Length));
			Array.Copy(objs, 0, array2, index, objs.Length);
			Array.Copy(array, index, array2, index + objs.Length, array.Length - index);
			array = array2;
		}
	}
	[HarmonyPatch(typeof(EndlessGrid))]
	public static class EndlessGridPatch
	{
		public static bool injected;

		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void Start(PrefabDatabase ___prefabs)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			if (!injected)
			{
				EndlessEnemy val = ScriptableObject.CreateInstance<EndlessEnemy>();
				((Object)val).name = "CentaurRocketLauncherEndlessData";
				val.enemyType = (EnemyType)35;
				val.prefab = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Enemies/CentaurRocketLauncherStand.prefab").WaitForCompletion();
				val.prefab.transform.position = Vector2.op_Implicit(Vector2.zero);
				val.spawnCost = 30;
				val.spawnWave = 20;
				val.costIncreasePerSpawn = 15;
				EndlessEnemy val2 = ScriptableObject.CreateInstance<EndlessEnemy>();
				((Object)val2).name = "CentaurMortarEndlessData";
				val2.enemyType = (EnemyType)35;
				val2.prefab = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Enemies/CentaurMortar.prefab").WaitForCompletion();
				val2.prefab.transform.position = Vector2.op_Implicit(Vector2.zero);
				val2.spawnCost = 20;
				val2.spawnWave = 15;
				val2.costIncreasePerSpawn = 10;
				EndlessEnemy val3 = ScriptableObject.CreateInstance<EndlessEnemy>();
				((Object)val3).name = "CentaurTowerEndlessData";
				val3.enemyType = (EnemyType)35;
				val3.prefab = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Enemies/CentaurTower.prefab").WaitForCompletion();
				val3.prefab.transform.position = Vector2.op_Implicit(Vector2.zero);
				val3.spawnCost = 25;
				val3.spawnWave = 15;
				val3.costIncreasePerSpawn = 20;
				Extensions.AddToArray(ref ___prefabs.projectileEnemies, ___prefabs.projectileEnemies.Length, val, val2, val3);
				injected = true;
			}
		}
	}
	[BepInPlugin("MoreCGEnemies", "MoreCGEnemies", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("MoreCGEnemies.harmony").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin MoreCGEnemies is loaded!");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "MoreCGEnemies";

		public const string PLUGIN_NAME = "MoreCGEnemies";

		public const string PLUGIN_VERSION = "1.0.1";
	}
}