Decompiled source of RemoveGupsFromSkyMeadow v1.0.1

RemoveGupsFromSkyMeadow.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using RoR2;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RemoveGupsFromSkyMeadow")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RemoveGupsFromSkyMeadow")]
[assembly: AssemblyTitle("RemoveGupsFromSkyMeadow")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace RemoveGupsFromSkyMeadow
{
	[BepInPlugin("com.Moffein.RemoveGupsFromSkyMeadow", "RemoveGupsFromSkyMeadow", "1.0.1")]
	public class RemoveGupsFromSkyMeadow : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			CharacterSpawnCard toRemove = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/Gup/cscGupBody.asset").WaitForCompletion();
			RemoveGup(Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/skymeadow/dccsSkyMeadowMonsters.asset").WaitForCompletion(), toRemove);
			RemoveGup(Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/skymeadow/dccsSkyMeadowMonstersDLC1.asset").WaitForCompletion(), toRemove);
			RemoveGup(Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itskymeadow/dccsITSkyMeadowMonsters.asset").WaitForCompletion(), toRemove);
			RemoveGup(Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itskymeadow/dccsITSkyMeadowMonstersDLC2.asset").WaitForCompletion(), toRemove);
			RemoveGup(Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsSkyMeadowMonstersDLC2.asset").WaitForCompletion(), toRemove);
			RemoveGup(Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsSkyMeadowMonstersDLC2Only.asset").WaitForCompletion(), toRemove);
		}

		private void RemoveGup(DirectorCardCategorySelection dccs, CharacterSpawnCard toRemove)
		{
			CharacterSpawnCard toRemove2 = toRemove;
			int num = -1;
			for (int i = 0; i < dccs.categories.Length; i++)
			{
				if (string.CompareOrdinal(dccs.categories[i].name, "Minibosses") == 0)
				{
					num = i;
					break;
				}
			}
			if (num != -1 && dccs.categories[num].cards != null && dccs.categories[num].cards.Length != 0)
			{
				dccs.categories[num].cards = dccs.categories[num].cards.Where((DirectorCard dc) => (Object)(object)dc.spawnCard != (Object)(object)toRemove2).ToArray();
			}
		}
	}
}
namespace R2API.Utils
{
	[AttributeUsage(AttributeTargets.Assembly)]
	public class ManualNetworkRegistrationAttribute : Attribute
	{
	}
}