Decompiled source of StageTweaker v1.0.0

AphelianPodFix.dll

Decompiled 5 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("AphelianPodFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AphelianPodFix")]
[assembly: AssemblyTitle("AphelianPodFix")]
[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 StageTweaker
{
	[BepInPlugin("Tully_Vin.StageTweaker", "StageTweaker", "1.0.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "Tully_Vin.StageTweaker";

		public const string PluginAuthor = "Tully_Vin";

		public const string PluginName = "StageTweaker";

		public const string PluginVersion = "1.0.0";

		public static readonly Lazy<DirectorCardCategorySelection> _plainsInteractables = new Lazy<DirectorCardCategorySelection>((Func<DirectorCardCategorySelection>)(() => Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/golemplains/dccsGolemplainsInteractablesDLC1.asset").WaitForCompletion()));

		private static DirectorCardCategorySelection plainsInteractables = _plainsInteractables.Value;

		public static readonly Lazy<DirectorCardCategorySelection> _verdantInteractables = new Lazy<DirectorCardCategorySelection>((Func<DirectorCardCategorySelection>)(() => Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/CU8/lakes/dccsLakesInteractables.asset").WaitForCompletion()));

		private static DirectorCardCategorySelection verdantInteractables = _verdantInteractables.Value;

		public static readonly Lazy<DirectorCardCategorySelection> _aphelianInteractables = new Lazy<DirectorCardCategorySelection>((Func<DirectorCardCategorySelection>)(() => Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/ancientloft/dccsAncientLoftInteractablesDLC1.asset").WaitForCompletion()));

		private static DirectorCardCategorySelection aphelianInteractables = _aphelianInteractables.Value;

		private Category voidStuff = default(Category);

		public void Awake()
		{
			RemoveAphelianChest();
			LoadVradle();
			AddVerdantVoidStuff();
		}

		private void LoadVradle()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < plainsInteractables.categories.Length; i++)
			{
				Category val = plainsInteractables.categories[i];
				if (val.name == "Void Stuff")
				{
					voidStuff = val;
				}
			}
		}

		private void RemoveAphelianChest()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < aphelianInteractables.categories.Length; i++)
			{
				Category val = aphelianInteractables.categories[i];
				if (!(val.name == "Chests"))
				{
					continue;
				}
				List<DirectorCard> list = new List<DirectorCard>();
				DirectorCard[] cards = val.cards;
				foreach (DirectorCard val2 in cards)
				{
					if (((Object)val2.spawnCard).name != "iscLunarChest")
					{
						list.Add(val2);
					}
				}
				aphelianInteractables.categories[i].cards = list.ToArray();
			}
		}

		private void AddVerdantVoidStuff()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			List<Category> list = new List<Category>();
			Category[] categories = verdantInteractables.categories;
			foreach (Category val in categories)
			{
				list.Add(val);
				Debug.Log((object)(val.name + " added to categories"));
			}
			list.Add(voidStuff);
			Debug.Log((object)"void stuff added to categories");
			verdantInteractables.categories = list.ToArray();
			Debug.Log((object)"Categories overwritten");
		}
	}
}