Decompiled source of TeleporterLoopSpeedUp v1.0.1

TeleLoopSpeedUp.dll

Decompiled 7 hours 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+902c09e2630a84c9c7a04f27a8806a1c49fbada3")]
[assembly: AssemblyProduct("TeleLoopSpeedUp")]
[assembly: AssemblyTitle("TeleLoopSpeedUp")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TeleLoopSpeedUp;

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

	private void Awake()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Expected O, but got Unknown
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Expected O, but got Unknown
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Expected O, but got Unknown
		ConfigEntry<float> config = ((BaseUnityPlugin)this).Config.Bind<float>("Teleporter Speed Up Per Loop", "Multiplier", perLoopMultiplier, "Exponentional Teleporter speedup multiplier.");
		perLoopMultiplier = config.Value;
		config.SettingChanged += delegate
		{
			perLoopMultiplier = config.Value;
		};
		ModSettingsManager.AddOption((BaseOption)new SliderOption(config, new SliderConfig
		{
			min = 1f,
			max = 5f,
			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);
	}
}