Decompiled source of StageOneOrb v1.1.0

StageOneOrb.dll

Decompiled 2 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 BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RoR2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("StageOneOrb")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StageOneOrb")]
[assembly: AssemblyTitle("StageOneOrb")]
[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 StageOneOrb
{
	[BepInPlugin("Vulf.StageOneOrb", "StageOneOrb", "1.1.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "Vulf.StageOneOrb";

		public const string PluginAuthor = "Vulf";

		public const string PluginName = "StageOneOrb";

		public const string PluginVersion = "1.1.0";

		public static ConfigEntry<bool> DisplayBramText { get; set; }

		public void Awake()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			DisplayBramText = ((BaseUnityPlugin)this).Config.Bind<bool>("Cosmetic", "DisplayBramText", true, "At the start of stage 1, the message \"Hi bram :)\" is outputted in the chat. bram is my friend I made this mod for. It shouldn't be an issue but if it is bothering you it can be prevented from showing up by setting this to false");
			TeleporterInteraction.Start += new hook_Start(OnTeleporterInteractionStart);
		}

		private void OnTeleporterInteractionStart(orig_Start orig, TeleporterInteraction self)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Run.instance.stageClearCount != 0)
			{
				return;
			}
			TeleporterInteraction.instance.shouldAttemptToSpawnShopPortal = true;
			PortalStatueBehavior[] array = Object.FindObjectsOfType<PortalStatueBehavior>();
			PurchaseInteraction val2 = default(PurchaseInteraction);
			foreach (PortalStatueBehavior val in array)
			{
				if ((int)val.portalType == 0 && ((Component)val).TryGetComponent<PurchaseInteraction>(ref val2))
				{
					val2.Networkavailable = false;
				}
			}
			if (DisplayBramText.Value)
			{
				Chat.AddMessage("Hi bram :)");
			}
		}
	}
}