Decompiled source of RainrotElementFix v1.0.0

RainrotElementFix.dll

Decompiled 17 hours 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 HarmonyLib;
using Microsoft.CodeAnalysis;
using RainrotSharedUtils.Components;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RainrotElementFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RainrotElementFix")]
[assembly: AssemblyTitle("RainrotElementFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 RainrotElementFix
{
	[BepInPlugin("com.Personal.RainrotElementFix", "RainrotElementFix", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string guid = "com.Personal.RainrotElementFix";

		public const string modName = "RainrotElementFix";

		public const string version = "1.0.0";

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("com.Personal.RainrotElementFix").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"RainrotElementFix loaded. ElementCounter.ResetPowers patched.");
		}
	}
	[HarmonyPatch(typeof(ElementCounter), "ResetPowers")]
	internal static class ResetPowersPatch
	{
		private static bool Prefix(ref Dictionary<CounterElement, Power> map)
		{
			if (map == null || map.Count == 0)
			{
				return false;
			}
			CounterElement[] array = (CounterElement[])(object)new CounterElement[map.Count];
			map.Keys.CopyTo(array, 0);
			for (int i = 0; i < array.Length; i++)
			{
				map[array[i]] = (Power)0;
			}
			return false;
		}
	}
}