Decompiled source of TeleporterLoopSpeedUp v1.0.2

TeleLoopSpeedUp.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using On.RoR2;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;

[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 = ".NET Standard 2.1")]
[assembly: AssemblyCompany("TeleLoopSpeedUp")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+de8c26ffd894c7fd9befc27cc90f022ab217da42")]
[assembly: AssemblyProduct("TeleLoopSpeedUp")]
[assembly: AssemblyTitle("TeleLoopSpeedUp")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TeleLoopSpeedUp;

[BepInPlugin("sylvie.TeleLoopSpeedUp", "TeleLoopSpeedUp", "1.0.2")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public sealed class TeleLoopSpeedUp : BaseUnityPlugin
{
	private static float perLoopMultiplier = 2f;

	private void Awake()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Expected O, but got Unknown
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Expected O, but got Unknown
		ConfigEntry<float> val = ((BaseUnityPlugin)this).Config.Bind<float>("Teleporter Speed Up Per Loop", "Multiplier", perLoopMultiplier, "Exponentional Teleporter speedup multiplier.");
		ModSettingsManager.AddOption((BaseOption)new StepSliderOption(val, new StepSliderConfig
		{
			min = 1f,
			max = 5f,
			increment = 0.1f,
			FormatString = "{0:0.00}"
		}));
		HoldoutZoneController.OnEnable += new hook_OnEnable(HoldoutZoneController_OnEnable);
	}

	private static void HoldoutZoneController_OnEnable(orig_OnEnable orig, HoldoutZoneController self)
	{
		if (!Object.op_Implicit((Object)(object)Run.instance))
		{
			orig.Invoke(self);
			return;
		}
		self.baseChargeDuration /= Mathf.Pow(perLoopMultiplier, (float)Run.instance.loopClearCount);
		orig.Invoke(self);
	}
}