Decompiled source of NotPortal v1.0.0

NotPortal.dll

Decompiled 12 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using RoR2;
using UnityEngine;

[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("NotPortal")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NotPortal")]
[assembly: AssemblyTitle("NotPortal")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 NotPortal
{
	[BepInPlugin("NotPortal", "NotPortal", "1.0.0")]
	public class NotPortalPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "NotPortal";

		public const string PluginName = "NotPortal";

		public const string PluginVersion = "1.0.0";

		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			BossGroup.onBossGroupDefeatedServer += OnBossGroupDefeatedServer;
		}

		private void OnDestroy()
		{
			BossGroup.onBossGroupDefeatedServer -= OnBossGroupDefeatedServer;
		}

		private static void OnBossGroupDefeatedServer(BossGroup bossGroup)
		{
			TeleporterInteraction val = default(TeleporterInteraction);
			if (Object.op_Implicit((Object)(object)bossGroup) && ((Component)bossGroup).TryGetComponent<TeleporterInteraction>(ref val) && val.isCharging)
			{
				HoldoutZoneController holdoutZoneController = val.holdoutZoneController;
				if (Object.op_Implicit((Object)(object)holdoutZoneController) && !holdoutZoneController.isFullyCharged)
				{
					int num = (int)(holdoutZoneController.charge * 100f);
					holdoutZoneController.FullyChargeHoldoutZone();
					Log.LogInfo((object)$"Teleporter boss defeated at {num}% charge, teleporter fully charged.");
				}
			}
		}
	}
}