Decompiled source of LunarsAreForever v1.0.1

LunarsAreForever/LunarsAreForever.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HG;
using RoR2;

[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 = "")]
[assembly: AssemblyCompany("LunarsAreForever")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LunarsAreForever")]
[assembly: AssemblyTitle("LunarsAreForever")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LunarsAreForever;

internal static class Log
{
	private static ManualLogSource _logSource;

	internal static void Init(ManualLogSource logSource)
	{
		_logSource = logSource;
	}

	internal static void Debug(object data)
	{
		_logSource.LogDebug(data);
	}

	internal static void Error(object data)
	{
		_logSource.LogError(data);
	}

	internal static void Fatal(object data)
	{
		_logSource.LogFatal(data);
	}

	internal static void Info(object data)
	{
		_logSource.LogInfo(data);
	}

	internal static void Message(object data)
	{
		_logSource.LogMessage(data);
	}

	internal static void Warning(object data)
	{
		_logSource.LogWarning(data);
	}
}
[BepInPlugin("Samuel17.LunarsAreForever", "LunarsAreForever", "1.0.1")]
public class Main : BaseUnityPlugin
{
	public void Awake()
	{
		Log.Init(((BaseUnityPlugin)this).Logger);
		((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)NoTemporaryLunars);
	}

	private void NoTemporaryLunars()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Invalid comparison between Unknown and I4
		Enumerator<ItemDef> enumerator = ItemCatalog.allItemDefs.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				ItemDef current = enumerator.Current;
				if ((int)current.tier == 3 && current.ContainsTag((ItemTag)31))
				{
					current.tags = current.tags.RemoveFromArray((ItemTag)31);
					Log.Message("Removed CanBeTemporary tag from " + current.nameToken + ".");
				}
			}
		}
		finally
		{
			((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
		}
	}
}
public static class Utils
{
	public static T[] AddToArray<T>(this T[] array, params T[] items)
	{
		return (array ?? Enumerable.Empty<T>()).Concat(items).ToArray();
	}

	public static T[] RemoveFromArray<T>(this T[] array, params T[] items)
	{
		return (array ?? Enumerable.Empty<T>()).Except(items).ToArray();
	}
}