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 On.RoR2;
using R2API.Utils;
using RoR2;
using UnityEngine;
using UnityEngine.Networking;
[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("Dragonyck")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InstantTeleporter")]
[assembly: AssemblyTitle("InstantTeleporter")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace InstantTeleporter;
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.InstantTeleporter", "InstantTeleporter", "1.1.2")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class InstantTeleporter : BaseUnityPlugin
{
public const string MODUID = "com.Dragonyck.InstantTeleporter";
public static ConfigEntry<bool> faster;
public static ConfigEntry<float> fasterValue;
public void Awake()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
//IL_0030: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
//IL_0060: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
fasterValue = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Teleport Speed Percentage", "Speed"), 100f, new ConfigDescription("Only works if Faster Teleporter is enabled. Base value (100) is 100% faster.", (AcceptableValueBase)null, Array.Empty<object>()));
faster = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Enable Faster Teleporter", "Enable"), false, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
TeleporterInteraction.FixedUpdate += new hook_FixedUpdate(TeleporterInteraction_FixedUpdate);
}
private void TeleporterInteraction_FixedUpdate(orig_FixedUpdate orig, TeleporterInteraction self)
{
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self) && self.chargePercent > 0 && self.monstersCleared && NetworkServer.active)
{
if (!faster.Value)
{
self.holdoutZoneController.charge = 1f;
}
if (faster.Value && self.holdoutZoneController.isAnyoneCharging)
{
int num = HoldoutZoneController.CountLivingPlayers(self.holdoutZoneController.chargingTeam);
int num2 = HoldoutZoneController.CountPlayersInRadius(self.holdoutZoneController, ((Component)self.holdoutZoneController).transform.position, self.holdoutZoneController.currentRadius * self.holdoutZoneController.currentRadius, self.holdoutZoneController.chargingTeam);
float baseChargeDuration = self.holdoutZoneController.baseChargeDuration;
float num3 = ((!self.holdoutZoneController.isAnyoneCharging || num <= 0) ? (0f - self.holdoutZoneController.dischargeRate) : (Mathf.Pow((float)num2 / (float)num, self.holdoutZoneController.playerCountScaling) / baseChargeDuration));
self.holdoutZoneController.charge = Mathf.Clamp01(self.holdoutZoneController.charge + num3 * Time.fixedDeltaTime * (fasterValue.Value / 100f));
}
}
}
}