Decompiled source of V1Entity v0.2.1

V1Entity.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Nyxpiri.ULTRAKILL.NyxLib;
using Nyxpiri.ULTRAKILL.NyxLib.Assets;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.InputSystem;
using UnityEngine.UI;

[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: AssemblyVersion("0.0.0.0")]
namespace Nyxpiri.ULTRAKILL.V1Entity;

internal static class Log
{
	private static ManualLogSource _logger;

	public static void Initialize(ManualLogSource logger)
	{
		Assert.IsNull((object)_logger, "Log.Initialize called when _logger wasn't null?");
		_logger = logger;
	}

	public static void Fatal(object data)
	{
		_logger.LogFatal(data);
	}

	public static void Error(object data)
	{
		_logger.LogError(data);
	}

	public static void Warning(object data)
	{
		_logger.LogWarning(data);
	}

	public static void Message(object data)
	{
		_logger.LogMessage(data);
	}

	public static void Info(object data)
	{
		_logger.LogInfo(data);
	}

	public static void Debug(object data)
	{
		_logger.LogDebug(data);
	}
}
public class FistAltParent : MonoBehaviour
{
	public List<GameObject> Arms = new List<GameObject>();

	internal void ClearArms()
	{
		foreach (GameObject arm in Arms)
		{
			Object.Destroy((Object)(object)arm);
		}
		Arms.Clear();
	}
}
[HarmonyPatch(typeof(HudController), "Update")]
public static class HudControllerUpdatePatch
{
	public static bool Prefix(HudController __instance)
	{
		return true;
	}

	public static void Postfix(HudController __instance)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			((Graphic)__instance.fistFill).color = Color.Lerp(((Graphic)__instance.fistFill).color, Color.white, NyxMath.NormalizeToRange(MonoSingleton<WeaponCharges>.Instance.punchStamina, 2f, 2.75f));
		}
	}
}
[HarmonyPatch(typeof(Punch), "OnEnable")]
internal static class PunchOnEnablePatch
{
	public static void Prefix(Punch __instance)
	{
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			MultiFistController.EnsureInitialization();
			((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().PrePunchEnable(__instance);
		}
	}

	public static void Postfix(Punch __instance)
	{
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().PostPunchEnable(__instance);
		}
	}
}
[HarmonyPatch(typeof(HookArm), "Cancel")]
public static class HookArmCancelPatch
{
	public static bool Prefix(HookArm __instance)
	{
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return true;
		}
		if (PunchStartPatch.Active)
		{
			return false;
		}
		return true;
	}

	public static void Postfix(HookArm __instance)
	{
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
		}
	}
}
[HarmonyPatch(typeof(Punch), "PunchStart")]
internal static class PunchStartPatch
{
	public static FieldAccess<Punch, float> cooldownCostFA = new FieldAccess<Punch, float>("cooldownCost", BindingFlags.Instance | BindingFlags.NonPublic);

	public static bool Active = false;

	public static bool Prefix(Punch __instance)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		Active = true;
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return true;
		}
		MultiFistController.EnsureInitialization();
		if ((Object)(object)MonoSingleton<FistControl>.Instance.currentPunch != (Object)(object)__instance)
		{
			return false;
		}
		float num = (((int)__instance.type == 0) ? Options.FeedbackerStaminaCostScalar.Value : Options.KnuckleblasterStaminaCostScalar.Value);
		int dualWieldCount = MonoSingleton<GunControl>.Instance.dualWieldCount;
		if (dualWieldCount > 0)
		{
			for (int i = 0; i < dualWieldCount; i++)
			{
				num *= Options.DualWieldStaminaCostScalar.Value;
			}
		}
		if (__instance.ready)
		{
			WeaponCharges instance = MonoSingleton<WeaponCharges>.Instance;
			instance.punchStamina += cooldownCostFA.GetValue(__instance) * (1f - num) * 0.5f;
		}
		((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().PrePunch(__instance);
		PunchDurationTracker orAddComponent = ComponentExtensions.GetOrAddComponent<PunchDurationTracker>((Component)(object)__instance);
		orAddComponent.Reset();
		PunchParryProjectilePatch.CanAwardParryGain = true;
		return true;
	}

	public static void Postfix(Punch __instance)
	{
		Active = false;
	}
}
[HarmonyPatch(typeof(FistControl), "ScrollArm")]
public static class FistControlScrollArmPatch
{
	public static TimeSince LastSwapToFeedbacker = TimeSince.op_Implicit(0f);

	public static bool Prefix(FistControl __instance)
	{
		return true;
	}

	public static void Postfix(FistControl __instance)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		Punch currentPunch = __instance.currentPunch;
		if (!((Object)(object)currentPunch == (Object)null) && (int)currentPunch.type == 0 && Options.FeedbackerPunchOnSwapIfBlasting.Value)
		{
			if ((double)TimeSince.op_Implicit(PunchBlastCheckPatch.LastBlast) < 0.3)
			{
				V1Entity.Punch(__instance, MonoSingleton<InputManager>.Instance.InputSource.ChangeFist.Action);
			}
			LastSwapToFeedbacker = TimeSince.op_Implicit(0f);
		}
	}
}
[HarmonyPatch(typeof(Punch), "BlastCheck")]
public static class PunchBlastCheckPatch
{
	public static TimeSince LastBlast = TimeSince.op_Implicit(0f);

	public static bool Prefix(Punch __instance)
	{
		return true;
	}

	public static void Postfix(Punch __instance)
	{
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01da: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Invalid comparison between Unknown and I4
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity") || !__instance.heldAction.IsPressed())
		{
			return;
		}
		try
		{
			Transform val = ((Component)__instance).transform.Find("Armature/clavicle/wrist/hand/barrel.1/ShootPoint");
			GameObject val2 = Object.Instantiate<GameObject>(Gear.CoreEject.DirectPrefab.GetComponent<Shotgun>().muzzleFlash, val.position, ((Component)MonoSingleton<CameraController>.Instance).transform.rotation);
			val2.transform.SetParent(val, true);
			Transform transform = val2.transform;
			transform.localScale *= 0.5f;
			ScaleNFade component = val2.GetComponent<ScaleNFade>();
			component.ChangeFadeSpeed(component.fadeSpeed * 0.2f);
			component.ChangeScaleSpeed(component.scaleSpeed * 0.2f);
			if (TimeSince.op_Implicit(LastBlast) < Options.DoubleBlastBoostWindow.Value)
			{
				NewMovement instance = MonoSingleton<NewMovement>.Instance;
				Vector3 val3 = -((Component)MonoSingleton<CameraController>.Instance).transform.forward;
				Vector3 velocity = instance.rb.velocity;
				Vector3 val4 = Vector3.Project(velocity, PhysicsExtensions.GetGravityDirection(instance.rb));
				Vector3 val5 = Vector3.ProjectOnPlane(velocity, PhysicsExtensions.GetGravityDirection(instance.rb));
				val5 += Vector3.ProjectOnPlane(val3, PhysicsExtensions.GetGravityDirection(instance.rb)) * Options.DoubleBlastBoostSpeedHorizontal.Value;
				val4 = Vector3.Project(val3, PhysicsExtensions.GetGravityDirection(instance.rb)) * Options.DoubleBlastBoostSpeedVertical.Value;
				val4 = Vector3.Project(Vector3.Lerp(velocity, velocity - NyxMath.CoincidentProject(velocity, val3), 0.87f) * 0.667f + ((Vector3)(ref val4)).normalized * ((Vector3)(ref val4)).magnitude, PhysicsExtensions.GetGravityDirection(instance.rb));
				val4 -= NyxMath.CoincidentProject(val4, -val3);
				Vector3 velocity2 = val5 + val4;
				instance.rb.velocity = velocity2;
			}
			LastBlast = TimeSince.op_Implicit(0f);
			if ((double)TimeSince.op_Implicit(FistControlScrollArmPatch.LastSwapToFeedbacker) < 0.08)
			{
				Punch currentPunch = MonoSingleton<FistControl>.Instance.currentPunch;
				if (currentPunch != null && (int)currentPunch.type == 0)
				{
					V1Entity.Punch(MonoSingleton<FistControl>.Instance, MonoSingleton<InputManager>.Instance.InputSource.ChangeFist.Action);
				}
			}
		}
		catch (Exception arg)
		{
			Log.Error($"try failed! {arg}");
		}
	}
}
[HarmonyPatch(typeof(Punch), "Parry")]
public static class PunchParryPatch
{
	public static bool Prefix(Punch __instance, bool hook = false, EnemyIdentifier eid = null, string customParryText = "")
	{
		return true;
	}

	public static void Postfix(Punch __instance, bool hook = false, EnemyIdentifier eid = null, string customParryText = "")
	{
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity") || !((Object)(object)eid != (Object)null))
		{
			return;
		}
		int dualWieldCount = MonoSingleton<GunControl>.Instance.dualWieldCount;
		float num = Options.ParryMeleeArmStaminaGain.Value;
		if (dualWieldCount > 0)
		{
			for (int i = 0; i < dualWieldCount; i++)
			{
				num *= Options.DualWieldMeleeParryStaminaGainScalar.Value;
			}
		}
		WeaponCharges instance = MonoSingleton<WeaponCharges>.Instance;
		instance.punchStamina += num;
	}
}
public class MultiFistController : MonoBehaviour
{
	[HarmonyPatch(typeof(FistControl), "Start")]
	public static class FistControlStartPatch
	{
		public static bool Prefix(FistControl __instance)
		{
			if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				return true;
			}
			EnsureInitialization();
			return true;
		}

		public static void Postfix(FistControl __instance)
		{
		}
	}

	[HarmonyPatch(typeof(FistControl), "ResetFists")]
	public static class FistControlResetFistsPatch
	{
		public static bool Prefix(FistControl __instance)
		{
			if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				return true;
			}
			((Component)__instance).GetComponent<MultiFistController>()?.PreResetFists();
			return true;
		}

		public static void Postfix(FistControl __instance)
		{
			if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				EnsureInitialization();
				((Component)__instance).GetComponent<MultiFistController>()?.PostResetFists();
			}
		}
	}

	[HarmonyPatch(typeof(FistControl), "ArmChange")]
	public static class FistControlArmChangePatch
	{
		public static bool Prefix(FistControl __instance)
		{
			return true;
		}

		public static void Postfix(FistControl __instance)
		{
			if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				EnsureInitialization();
				((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().PostArmChange();
			}
		}
	}

	[HarmonyPatch(typeof(WeaponCharges), "Charge")]
	public static class WeaponChargesChargePatch
	{
		private static float initialPunchStamina;

		public static bool Prefix(WeaponCharges __instance, float amount)
		{
			initialPunchStamina = __instance.punchStamina;
			return true;
		}

		public static void Postfix(WeaponCharges __instance, float amount)
		{
			if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				return;
			}
			float num = __instance.punchStamina - initialPunchStamina;
			int dualWieldCount = MonoSingleton<GunControl>.Instance.dualWieldCount;
			float num2 = 1f;
			if (dualWieldCount > 0)
			{
				for (int i = 0; i < dualWieldCount; i++)
				{
					num2 *= Options.DualWieldStaminaRegenScalar.Value;
				}
			}
			__instance.punchStamina = initialPunchStamina;
			__instance.punchStamina += num * (Options.ArmStaminaRegenScalar.Value * num2);
			if (__instance.punchStamina > 2f)
			{
				__instance.punchStamina = Mathf.MoveTowards(__instance.punchStamina, 2f, amount * 1.25f * (Options.ArmStaminaRegenScalar.Value * num2) * Options.PunchOverchargeDecayRate.Value);
			}
		}
	}

	[HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")]
	public static class EnemyIdentifierDeliverDamagePatch
	{
		public static void Prefix(EnemyIdentifier __instance)
		{
			if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity") && __instance.hitter == "punch")
			{
				((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().PrePunchEnemy(__instance);
			}
		}

		public static void Postfix(EnemyIdentifier __instance)
		{
			if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity") && __instance.hitter == "punch")
			{
				((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().PunchedEnemy(__instance);
			}
		}
	}

	public int CurrentParentIdx = 0;

	private bool punchingEnemyDead = false;

	public EnemyIdentifier PunchComboEid;

	public TimeSince TimeSinceLastComboPunch;

	public int PunchCombo = 0;

	public List<FistAltParent> AltParents = new List<FistAltParent>();

	public static FieldAccess<FistControl, List<GameObject>> spawnedArmsFA = new FieldAccess<FistControl, List<GameObject>>("spawnedArms", BindingFlags.Instance | BindingFlags.NonPublic);

	public static FieldAccess<FistControl, int> currentOrderNumFA = new FieldAccess<FistControl, int>("currentOrderNum", BindingFlags.Instance | BindingFlags.NonPublic);

	public float LastPunchTimestamp = 0f;

	public TimeSince TimeSinceLastPunch = TimeSince.op_Implicit(0f);

	public Punch LastPunch;

	public float LastPunchDelay = 0f;

	private bool NoWeaponed = false;

	public static FieldAccess<HookArm, bool> forcingFistControlFA = new FieldAccess<HookArm, bool>("forcingFistControl", BindingFlags.Instance | BindingFlags.NonPublic);

	public static GameObject PrimeBlastWave = null;

	[SerializeField]
	private ItemIdentifier _tempHeldObject = null;

	[SerializeField]
	private List<GameObject> baseArms = new List<GameObject>();

	[SerializeField]
	private List<GameObject> allArms = new List<GameObject>();

	public static FistControl fc => MonoSingleton<FistControl>.Instance;

	public int NumArmParents => AltParents.Count + 1;

	public static List<GameObject> SpawnedArms => spawnedArmsFA.GetValue(fc);

	public static int currentOrderNum => currentOrderNumFA.GetValue(fc);

	public ItemIdentifier HeldObject => MonoSingleton<FistControl>.Instance.heldObject;

	public static MultiFistController Instance { get; private set; }

	private void PrePunchEnemy(EnemyIdentifier eid)
	{
		punchingEnemyDead = eid.dead;
	}

	private void PunchedEnemy(EnemyIdentifier eid)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity") || punchingEnemyDead)
		{
			return;
		}
		if ((Object)(object)PunchComboEid == (Object)(object)eid && TimeSince.op_Implicit(TimeSinceLastComboPunch) < Options.PunchComboDecayTime.Value)
		{
			PunchCombo++;
		}
		else
		{
			PunchComboEid = eid;
			PunchCombo = 1;
		}
		bool flag = false;
		if (PunchCombo >= Options.FlamingComboThreshold.Value)
		{
			eid.StartBurning(1f * (float)PunchCombo - (float)(Options.FlamingComboThreshold.Value - 1));
			flag = true;
		}
		if (PunchCombo > 1)
		{
			string text = "<color=#ffffff>";
			if (PunchCombo >= 3)
			{
				text = "<color=#e56638>";
			}
			text = ((!flag) ? text : "<color=#f32109>");
			if (Options.RudeComboStyleBonus.Value)
			{
				MonoSingleton<StyleHUD>.Instance.AddPoints(10 * Math.Clamp(PunchCombo, 0, 5), text + "RUDE COMBO</color>", (GameObject)null, eid, PunchCombo, "", "");
			}
		}
		if (PunchCombo > 2)
		{
			eid.hitter = "";
			eid.DeliverDamage(((Component)eid).gameObject, Vector3.zero, Vector3.zero, (float)Math.Clamp(PunchCombo, 0, Options.DamageBoostMaxCombo.Value) * Options.DamageBoostPerCombo.Value, false, 0f, (GameObject)null, false, false);
			eid.hitter = "punch";
		}
		if (eid.dead && PunchCombo > 1 && Options.DismantledStyleBonus.Value)
		{
			MonoSingleton<StyleHUD>.Instance.AddPoints(20, "<color=#f3cc09>DISMANTLED</color>", (GameObject)null, (EnemyIdentifier)null, -1, "", "");
		}
		TimeSinceLastComboPunch = TimeSince.op_Implicit(0f);
	}

	private void PostArmChange()
	{
	}

	protected void Awake()
	{
		AddAltParent();
	}

	private void AddAltParent()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: 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_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject($"AltParent_{AltParents.Count}");
		val.transform.parent = ((Component)this).transform;
		int num = (AltParents.Count + 1) / 2 - 1;
		Vector3 val2 = ((num % 2 == 0) ? Vector3.down : Vector3.up);
		float num2 = 0.25f * (float)(num / 2 + 1);
		if (num == -1)
		{
			num2 = 0f;
		}
		bool flag = AltParents.Count % 2 == 0;
		val.transform.localPosition = val2 * num2;
		if (num >= 0)
		{
			Transform transform = val.transform;
			transform.localPosition += (flag ? (Vector3.right * 0.3f) : (Vector3.left * 0.3f));
		}
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = (flag ? new Vector3(-1f, 1f, 1f) : new Vector3(1f, 1f, 1f));
		AltParents.Add(val.AddComponent<FistAltParent>());
		MonoSingleton<FistControl>.Instance.ResetFists();
	}

	private void RemoveAltParent()
	{
		int index = AltParents.Count - 1;
		FistAltParent fistAltParent = AltParents[index];
		((Component)MonoSingleton<HookArm>.Instance).transform.SetParent(((Component)this).transform, false);
		AltParents.RemoveAt(index);
		SetCurrentParent(0);
		RefreshArmActiveness(SpawnedArms);
		foreach (GameObject arm in fistAltParent.Arms)
		{
			allArms.Remove(arm);
		}
		Object.Destroy((Object)(object)((Component)fistAltParent).gameObject);
		if ((Object)(object)HeldObject != (Object)null)
		{
			((Component)HeldObject).transform.SetParent(((Component)this).transform);
			ResetAllHeldState();
			MonoSingleton<FistControl>.Instance.currentPunch.ForceHold(HeldObject);
		}
	}

	protected void Update()
	{
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Invalid comparison between Unknown and I4
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Invalid comparison between Unknown and I4
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity") || MonoSingleton<OptionsManager>.Instance.paused)
		{
			return;
		}
		Punch val = default(Punch);
		foreach (GameObject spawnedArm in SpawnedArms)
		{
			float num = Mathf.Clamp01(NyxMath.InverseNormalizeToRange(LastPunchDelay, 0f, 0.5f)) * 5f;
			if (!spawnedArm.TryGetComponent<Punch>(ref val) || ((int)val.type == 1 && !Options.KnuckleblasterAnimSpeedMatchPunchRate.Value))
			{
				continue;
			}
			Animator componentInChildren = spawnedArm.GetComponentInChildren<Animator>();
			if ((Object)(object)componentInChildren == (Object)null)
			{
				continue;
			}
			PunchDurationTracker orAddComponent = ComponentExtensions.GetOrAddComponent<PunchDurationTracker>((Component)(object)val);
			float num2 = num * Time.unscaledDeltaTime * Mathf.Clamp01(NyxMath.InverseNormalizeToRange(Time.timeScale, 0f, 1f));
			if ((int)val.type == 1)
			{
				if (Options.KnuckleblasterAnimSpeedUpPreventBlast.Value)
				{
					num2 = Mathf.Clamp(num2, 0f, Mathf.Max(0.3f - orAddComponent.TotalTime, 0f));
				}
				componentInChildren.Update(num2);
				orAddComponent.AddedTime += num2;
			}
			else
			{
				componentInChildren.Update(num2);
			}
		}
		if (((Behaviour)MonoSingleton<HookArm>.Instance).enabled && forcingFistControlFA.GetValue(MonoSingleton<HookArm>.Instance) && !MonoSingleton<FistControl>.Instance.currentPunch.holding && (Object)(object)HeldObject != (Object)null)
		{
			ResetAllHeldState();
			MonoSingleton<FistControl>.Instance.currentPunch.ForceHold(HeldObject);
		}
		int dualWieldCount = MonoSingleton<GunControl>.Instance.dualWieldCount;
		for (int i = AltParents.Count - 1; i < dualWieldCount; i++)
		{
			AddAltParent();
		}
		while (AltParents.Count - 1 > dualWieldCount)
		{
			RemoveAltParent();
		}
		if (MonoSingleton<InputManager>.Instance.InputSource.Hook.WasPerformedThisFrame)
		{
			if ((double)TimeSince.op_Implicit(TimeSinceLastPunch) < 0.5)
			{
				((Component)MonoSingleton<HookArm>.Instance).transform.SetParent(GetArmParentForIdx(CurrentParentIdx).transform, false);
			}
			else
			{
				((Component)MonoSingleton<HookArm>.Instance).transform.SetParent(GetArmParentForIdx((CurrentParentIdx + 1) % NumArmParents).transform, false);
			}
		}
	}

	public GameObject GetArmParentForIdx(int idx)
	{
		if (idx == 0)
		{
			return ((Component)this).gameObject;
		}
		return ((Component)AltParents[idx - 1]).gameObject;
	}

	private void PreResetFists()
	{
		if ((Object)(object)HeldObject != (Object)null)
		{
			((Component)HeldObject).transform.SetParent(((Component)this).transform);
		}
		foreach (FistAltParent altParent in AltParents)
		{
			altParent.ClearArms();
		}
		for (int i = 0; i < Mathf.Min(baseArms.Count, SpawnedArms.Count); i++)
		{
			SpawnedArms[i] = baseArms[i];
		}
		allArms.Clear();
		baseArms.Clear();
	}

	private void PostResetFists()
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Invalid comparison between Unknown and I4
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		List<GameObject> value = spawnedArmsFA.GetValue(fc);
		Punch val = default(Punch);
		foreach (GameObject item in value)
		{
			if (item.TryGetComponent<Punch>(ref val) && (int)val.type == 1)
			{
				if ((Object)(object)PrimeBlastWave == (Object)null)
				{
					PrimeBlastWave = Object.Instantiate<GameObject>(val.blastWave, AssetsRoot.Holder);
					PrimeBlastWave.AddComponent<PrimeBlastWave>();
					PrimeBlastWave.AddComponent<ExplosionRoot>();
				}
				val.blastWave = PrimeBlastWave;
			}
			foreach (FistAltParent altParent in AltParents)
			{
				GameObject val2 = Object.Instantiate<GameObject>(item, ((Component)altParent).transform);
				val2.transform.localPosition = item.transform.localPosition;
				val2.transform.localRotation = item.transform.localRotation;
				val2.transform.localScale = item.transform.localScale;
				altParent.Arms.Add(val2);
				allArms.Add(val2);
			}
			baseArms.Add(item);
			allArms.Add(item);
		}
	}

	internal void PrePunch(Punch p)
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			List<GameObject> value = spawnedArmsFA.GetValue(fc);
			CycleArms();
			RefreshArmActiveness(SpawnedArms, deactivate: false);
			LastPunchDelay = Time.unscaledTime - LastPunchTimestamp;
			LastPunchTimestamp = Time.unscaledTime;
			TimeSinceLastPunch = TimeSince.op_Implicit(0f);
			LastPunch = p;
			if ((Object)(object)HeldObject != (Object)null)
			{
				ResetAllHeldState();
				p.ForceHold(HeldObject);
			}
		}
	}

	private void CycleArms()
	{
		List<GameObject> value = spawnedArmsFA.GetValue(fc);
		int num = Math.Clamp(CurrentParentIdx, 0, NumArmParents - 1);
		num = (CurrentParentIdx + 1) % (AltParents.Count + 1);
		SetCurrentParent(num);
	}

	private void SetCurrentParent(int idx)
	{
		CurrentParentIdx = idx;
		List<GameObject> spawnedArms = SpawnedArms;
		if (CurrentParentIdx == 0)
		{
			for (int i = 0; i < spawnedArms.Count; i++)
			{
				spawnedArms[i] = baseArms[i];
				Assert.IsNotNull((Object)(object)spawnedArms[i], "");
			}
		}
		else
		{
			int index = CurrentParentIdx - 1;
			for (int j = 0; j < spawnedArms.Count; j++)
			{
				spawnedArms[j] = AltParents[index].Arms[j];
			}
		}
		MonoSingleton<FistControl>.Instance.currentPunch = spawnedArms[currentOrderNum].GetComponent<Punch>();
	}

	private void ResetAllHeldState()
	{
		allArms.ForEach(delegate(GameObject go)
		{
			Punch val = default(Punch);
			if (go.TryGetComponent<Punch>(ref val) && val.holding)
			{
				val.ResetHeldState();
				val.heldItem = null;
			}
		});
	}

	public static void RefreshArmActiveness(List<GameObject> spawnedArms, bool deactivate = true)
	{
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		Punch val = default(Punch);
		foreach (GameObject spawnedArm in spawnedArms)
		{
			if ((Object)(object)MonoSingleton<FistControl>.Instance.currentArmObject == (Object)(object)spawnedArm)
			{
				spawnedArm.SetActive(true);
			}
			else if (spawnedArm.TryGetComponent<Punch>(ref val) && deactivate)
			{
				spawnedArm.SetActive(false);
			}
		}
	}

	internal void ReadyArm(FistType? filterToType = null)
	{
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		List<GameObject> value = spawnedArmsFA.GetValue(fc);
		foreach (GameObject item in value)
		{
			if (item.activeInHierarchy)
			{
				Punch component = item.GetComponent<Punch>();
				if (!((Object)(object)component == (Object)null) && filterToType.HasValue && component.type == filterToType.Value)
				{
					component.ready = true;
				}
			}
		}
	}

	internal static void EnsureInitialization()
	{
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity") && !((Object)(object)MonoSingleton<FistControl>.Instance == (Object)null) && !((Object)(object)((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>() != (Object)null))
		{
			Instance = ((Component)MonoSingleton<FistControl>.Instance).gameObject.AddComponent<MultiFistController>();
			MonoSingleton<FistControl>.Instance.ResetFists();
		}
	}

	internal void PrePunchEnable(Punch p)
	{
		_tempHeldObject = MonoSingleton<FistControl>.Instance.heldObject;
		MonoSingleton<FistControl>.Instance.heldObject = null;
	}

	internal void PostPunchEnable(Punch p)
	{
		MonoSingleton<FistControl>.Instance.heldObject = _tempHeldObject;
		if (!p.holding)
		{
			return;
		}
		allArms.ForEach(delegate(GameObject go)
		{
			Punch val = default(Punch);
			if (go.TryGetComponent<Punch>(ref val) && !((Object)(object)val == (Object)(object)p) && val.holding)
			{
				val.ResetHeldState();
				val.heldItem = null;
			}
		});
	}
}
public static class Options
{
	private static ConfigFile _config;

	private static ConfigFileManager _configFileManager;

	public static ConfigEntry<bool> BindPunchToScroll { get; private set; }

	public static ConfigEntry<bool> EnforceWeaponless { get; private set; }

	public static ConfigEntry<bool> AutoRefreshFeedbacker { get; private set; }

	public static ConfigEntry<bool> AutoRefreshKnuckleblaster { get; private set; }

	public static ConfigEntry<bool> DismantledStyleBonus { get; private set; }

	public static ConfigEntry<bool> RudeComboStyleBonus { get; private set; }

	public static ConfigEntry<int> FlamingComboThreshold { get; private set; }

	public static ConfigEntry<float> PunchComboDecayTime { get; private set; }

	public static ConfigEntry<int> DamageBoostMaxCombo { get; private set; }

	public static ConfigEntry<float> DamageBoostPerCombo { get; private set; }

	public static ConfigEntry<int> SuperParryThreshold { get; private set; }

	public static ConfigEntry<int> ULTRAParryThreshold { get; private set; }

	public static ConfigEntry<int> ULTRANukeParryThreshold { get; private set; }

	public static ConfigEntry<int> PlayerBulletParryThresholdAdd { get; private set; }

	public static ConfigEntry<float> FeedbackerStaminaCostScalar { get; private set; }

	public static ConfigEntry<float> KnuckleblasterStaminaCostScalar { get; private set; }

	public static ConfigEntry<float> ParryPlayerProjectileArmStaminaGain { get; private set; }

	public static ConfigEntry<float> ParryProjectileArmStaminaGain { get; private set; }

	public static ConfigEntry<float> ParryMeleeArmStaminaGain { get; private set; }

	public static ConfigEntry<float> ArmStaminaRegenScalar { get; private set; }

	public static ConfigEntry<float> PunchOverchargeDecayRate { get; private set; }

	public static ConfigEntry<float> DualWieldStaminaCostScalar { get; private set; }

	public static ConfigEntry<float> DualWieldProjectileParryStaminaGainScalar { get; private set; }

	public static ConfigEntry<float> DualWieldMeleeParryStaminaGainScalar { get; private set; }

	public static ConfigEntry<float> DualWieldStaminaRegenScalar { get; private set; }

	public static ConfigEntry<int> NumKnuckleblasterShockwaveBullets { get; private set; }

	public static ConfigEntry<float> KnuckleblasterShockwaveBulletSpread { get; private set; }

	public static ConfigEntry<float> KnuckleblasterShockwaveSizeScalar { get; private set; }

	public static ConfigEntry<float> KnuckleblasterShockwaveDamageScalar { get; private set; }

	public static ConfigEntry<float> DoubleBlastBoostWindow { get; private set; }

	public static ConfigEntry<float> DoubleBlastBoostSpeedVertical { get; private set; }

	public static ConfigEntry<float> DoubleBlastBoostSpeedHorizontal { get; private set; }

	public static ConfigEntry<bool> KnuckleblasterAnimSpeedMatchPunchRate { get; private set; }

	public static ConfigEntry<bool> KnuckleblasterAnimSpeedUpPreventBlast { get; private set; }

	public static ConfigEntry<float> WhipdashWindow { get; private set; }

	public static ConfigEntry<float> WhipdashDuration { get; private set; }

	public static ConfigEntry<float> WhipdashSpeedScale { get; private set; }

	public static ConfigEntry<float> WhipdashMinDistance { get; private set; }

	public static ConfigEntry<float> WhipdashSpeedCancelScale { get; private set; }

	public static ConfigEntry<float> WhipdashStaminaCost { get; private set; }

	public static ConfigEntry<bool> OuchieShockwaveEnabled { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveSpeed { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveDamage { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveMaxSize { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveRequiredAirTime { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveAirTimeMax { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveDamageMax { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveSizeMax { get; private set; }

	public static ConfigEntry<float> OuchieShockwaveRequiredFallTime { get; private set; }

	public static ConfigEntry<bool> FeedbackerPunchOnSwapIfBlasting { get; private set; }

	public static ConfigEntry<float> FeedbackerULTRAPunchRate { get; private set; }

	public static ConfigEntry<float> KnuckleBlasterULTRAPunchRate { get; private set; }

	public static ConfigEntry<float> ULTRAPunchRateVariance { get; private set; }

	internal static void Initialize(BaseUnityPlugin plugin)
	{
		Assert.IsNotNull((Object)(object)plugin, "");
		_config = plugin.Config;
		_configFileManager = ((Component)plugin).gameObject.AddComponent<ConfigFileManager>();
		_configFileManager.Initialize(_config);
		ConfigFileManager configFileManager = _configFileManager;
		configFileManager.OnReload = (Action)Delegate.Combine(configFileManager.OnReload, new Action(Reload));
		FeedbackerPunchOnSwapIfBlasting = _config.Bind<bool>("Controls", "FeedbackerPunchOnSwapIfBlasting", true, "Makes it so when you punch with the knuckleblaster and fire the blastwave/pellets, if you also swap to the feedbacker it'll automatically punch without further input. This allows arm swap control users to p-boost.");
		FeedbackerULTRAPunchRate = _config.Bind<float>("ULTRAPunch", "FeedbackerULTRAPunchRate", 10f, "Set the amount of punches to be thrown per second when using ULTRAPunch with the Feedbacker (bindable in in-game settings)");
		KnuckleBlasterULTRAPunchRate = _config.Bind<float>("ULTRAPunch", "KnuckleblasterULTRAPunchRate", 6f, "Set the amount of punches to be thrown per second when using ULTRAPunch with the Knuckleblaster (bindable in in-game settings)");
		ULTRAPunchRateVariance = _config.Bind<float>("ULTRAPunch", "ULTRAPunchRateVariance", 0f, "Random variance for ULTRAPunch");
		DismantledStyleBonus = _config.Bind<bool>("Combos", "EnableDismantledStyleBonus", true, "Enables or disables the Dismantled style bonus");
		RudeComboStyleBonus = _config.Bind<bool>("Combos", "EnableRudeComboStyleBonus", true, "Enables or disables the Rude Combo style bonuses");
		DamageBoostMaxCombo = _config.Bind<int>("Combos", "DamageBoostMaxCombo", 10, "");
		DamageBoostPerCombo = _config.Bind<float>("Combos", "DamageBoostPerCombo", 0.15f, "");
		FlamingComboThreshold = _config.Bind<int>("Combos", "FlamingComboThreshold", 4, "");
		PunchComboDecayTime = _config.Bind<float>("Combos", "PunchComboTimer", 0.25f, "");
		AutoRefreshFeedbacker = _config.Bind<bool>("Cooldowns", "DisableFeedbackerArmCooldown", true, "Disables the very brief cooldown on each individual arm. Doesn't effect arm exhaustion.");
		AutoRefreshKnuckleblaster = _config.Bind<bool>("Cooldowns", "DisableKnuckleblasterArmCooldown", false, "Disables the very brief cooldown on each individual arm. Doesn't effect arm exhaustion.");
		FeedbackerStaminaCostScalar = _config.Bind<float>("Cooldowns", "FeedbackerStaminaCostScalar", 0.33f, "Scales the amount of arm stamina to be lost by punching with the Feedbacker. Aka arm exhaustion.");
		KnuckleblasterStaminaCostScalar = _config.Bind<float>("Cooldowns", "KnuckleblasterStaminaCostScalar", 0.34f, "Scales the amount of arm stamina to be lost by punching with the Knuckleblaster. Aka arm exhaustion.");
		ParryPlayerProjectileArmStaminaGain = _config.Bind<float>("Cooldowns", "ParryPlayerProjectileArmStaminaGain", 0.08f, "How much arm stamina to gain from parrying a player projectile");
		ParryProjectileArmStaminaGain = _config.Bind<float>("Cooldowns", "ParryProjectileArmStaminaGain", 0.2f, "How much arm stamina to gain from parrying a projectile");
		ParryMeleeArmStaminaGain = _config.Bind<float>("Cooldowns", "ParryMeleeArmStaminaGain", 1.1f, "How much arm stamina to gain from parrying an enemy directly");
		ArmStaminaRegenScalar = _config.Bind<float>("Cooldowns", "ArmStaminaRegenScalar", 0.4f, "How much arm stamina to gain from parrying a projectile");
		PunchOverchargeDecayRate = _config.Bind<float>("Cooldowns", "PunchStaminaOverchargeDecayRate", 0.5f, "When arm stamina is overcharged, how quickly it should decay back to a normal state");
		DualWieldStaminaCostScalar = _config.Bind<float>("Cooldowns", "DualWieldStaminaCostScalar", 0.6f, "Scales the stamina *cost* of punches by this amount for each dual wield pickup you get.");
		DualWieldProjectileParryStaminaGainScalar = _config.Bind<float>("Cooldowns", "DualWieldProjectileParryStaminaGainScalar", 0.6f, "Scales the stamina gain of projectile parries by this amount for each dual wield pickup you get.");
		DualWieldMeleeParryStaminaGainScalar = _config.Bind<float>("Cooldowns", "DualWieldMeleeParryStaminaGainScalar", 0.6f, "Scales the stamina gain of melee parries by this amount for each dual wield pickup you get.");
		DualWieldStaminaRegenScalar = _config.Bind<float>("Cooldowns", "DualWieldStaminaRegenScalar", 1f, "Scales the arm stamina regen by this amount for each dual wield pickup you get.");
		OuchieShockwaveEnabled = _config.Bind<bool>("SlamShockwave", "GroundSlamOuchieShockwaveEnabled", true, "");
		OuchieShockwaveSpeed = _config.Bind<float>("SlamShockwave", "GroundSlamOuchieShockwaveSpeed", 100f, "");
		OuchieShockwaveRequiredAirTime = _config.Bind<float>("SlamShockwave", "OuchieShockwaveRequiredAirTime", 0.65f, "");
		OuchieShockwaveAirTimeMax = _config.Bind<float>("SlamShockwave", "OuchieShockwaveAirTimeMax", 3f, "");
		OuchieShockwaveDamageMax = _config.Bind<float>("SlamShockwave", "OuchieShockwaveDamageMax", 2.5f, "");
		OuchieShockwaveSizeMax = _config.Bind<float>("SlamShockwave", "OuchieShockwaveMaxSizeMax", 0.45f, "");
		OuchieShockwaveRequiredFallTime = _config.Bind<float>("SlamShockwave", "OuchieShockwaveRequiredFallTime", 0.02f, "");
		OuchieShockwaveDamage = _config.Bind<float>("SlamShockwave", "GroundSlamOuchieShockwaveDamage", 1.5f, "");
		OuchieShockwaveMaxSize = _config.Bind<float>("SlamShockwave", "GroundSlamOuchieShockwaveMaxSize", 0.25f, "");
		PlayerBulletParryThresholdAdd = _config.Bind<int>("Parrying", "PlayerBulletParryThresholdAdd", 1, "");
		SuperParryThreshold = _config.Bind<int>("Parrying", "SuperParryThreshold", 2, "");
		ULTRAParryThreshold = _config.Bind<int>("Parrying", "ULTRAParryThreshold", 3, "");
		ULTRANukeParryThreshold = _config.Bind<int>("Parrying", "ULTRANukeParryThreshold", 4, "");
		NumKnuckleblasterShockwaveBullets = _config.Bind<int>("Knuckleblaster", "NumKnuckleblasterShockwaveBullets", 16, "");
		KnuckleblasterShockwaveBulletSpread = _config.Bind<float>("Knuckleblaster", "KnuckleblasterShockwaveBulletSpread", 20f, "");
		KnuckleblasterShockwaveSizeScalar = _config.Bind<float>("Knuckleblaster", "KnuckleblasterShockwaveSizeScalar", 1f, "");
		KnuckleblasterShockwaveDamageScalar = _config.Bind<float>("Knuckleblaster", "KnuckleblasterShockwaveDamageScalar", 1.5f, "");
		DoubleBlastBoostWindow = _config.Bind<float>("Knuckleblaster", "KnuckleblasterDoubleBlastBoostWindow", 0.3f, "");
		DoubleBlastBoostSpeedVertical = _config.Bind<float>("Knuckleblaster", "KnuckleblasterDoubleBlastBoostSpeedVertical", 42f, "");
		DoubleBlastBoostSpeedHorizontal = _config.Bind<float>("Knuckleblaster", "KnuckleblasterDoubleBlastBoostSpeedHorizontal", 26f, "");
		KnuckleblasterAnimSpeedMatchPunchRate = _config.Bind<bool>("KnuckleBlaster", "KnuckleblasterAnimSpeedMatchPunchRate", true, "If enabled, the animation for the Knuckleblaster will speed up to match the rate at which you are punching, during hitstop.");
		KnuckleblasterAnimSpeedUpPreventBlast = _config.Bind<bool>("KnuckleBlaster", "KnuckleblasterAnimSpeedUpPreventBlast", true, "");
		WhipdashWindow = _config.Bind<float>("Whiplash", "WhipdashWindow", 0.1f, "The amount of time before and after dashing or whiplash pulling in which you can still trigger a Whipdash (dash and whiplash pull at the same time)");
		WhipdashDuration = _config.Bind<float>("Whiplash", "WhipdashDuration", 0.4f, "The duration of a whipdash");
		WhipdashSpeedScale = _config.Bind<float>("Whiplash", "WhipdashSpeedScale", 3f, "How much extra speed a whipdash offers");
		WhipdashSpeedCancelScale = _config.Bind<float>("Whiplash", "WhipdashSpeedCancelScale", 0.66f, "How much of the extra whipdash speed is removed when doing a whipcancel");
		WhipdashStaminaCost = _config.Bind<float>("Whiplash", "WhipdashStaminaCost", 50f, "Additional stamina costed by whipdashing");
		WhipdashMinDistance = _config.Bind<float>("Whiplash", "WhipdashMinDistance", 8f, "Minimum distance for a whipdash to actually boost player momentum");
		BindPunchToScroll = _config.Bind<bool>("NotGonnaSugarCoatIt", "BindPunchToScroll", false, "");
	}

	private static void Reload()
	{
	}
}
public class PrimeBlastWave : MonoBehaviour
{
	protected void Start()
	{
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			ExplosionRoot component = ((Component)this).GetComponent<ExplosionRoot>();
			component.ScaleSize(Options.KnuckleblasterShockwaveSizeScalar.Value);
			component.ScaleSpeed(Options.KnuckleblasterShockwaveSizeScalar.Value);
			component.ScaleDamage(Options.KnuckleblasterShockwaveDamageScalar.Value);
			GameObject bullet = Gear.CoreEject.DirectPrefab.GetComponent<Shotgun>().bullet;
			Vector3 defaultPos = MonoSingleton<CameraController>.Instance.GetDefaultPos();
			CameraFrustumTargeter instance = MonoSingleton<CameraFrustumTargeter>.Instance;
			Vector3 val = ((Component)MonoSingleton<CameraController>.Instance).transform.forward;
			if ((Object)(object)instance.CurrentTarget != (Object)null && instance.IsAutoAimed)
			{
				val = NyxMath.Towards(defaultPos, instance.CurrentTargetAimPosition, default(Vector3));
			}
			PhysicsCastResult val2 = default(PhysicsCastResult);
			PortalTraversalV2[] array = default(PortalTraversalV2[]);
			PortalPhysicsV2.SphereCast(defaultPos, val, 0.4f, 0.1f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3)), ref val2, ref array, ref defaultPos, true, (QueryTriggerInteraction)0);
			for (int i = 0; i < Options.NumKnuckleblasterShockwaveBullets.Value; i++)
			{
				GameObject val3 = Object.Instantiate<GameObject>(bullet, defaultPos, Quaternion.LookRotation(val, ((Component)MonoSingleton<CameraController>.Instance).transform.up));
				float value = Options.KnuckleblasterShockwaveBulletSpread.Value;
				val3.transform.Rotate(Random.Range(0f - value, value), Random.Range(0f - value, value), Random.Range(0f - value, value));
			}
		}
	}
}
public class PlayerOuchieShockwave : MonoBehaviour
{
}
[HarmonyPatch(typeof(PhysicalShockwave), "CheckCollision")]
public static class PhysicalShockwaveCheckCollisionPatch
{
	private static Vector3 realScale;

	public static bool Prefix(PhysicalShockwave __instance)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return true;
		}
		if ((Object)(object)((Component)__instance).gameObject.GetComponent<PlayerOuchieShockwave>() == (Object)null)
		{
			return true;
		}
		realScale = ((Component)__instance).transform.localScale;
		((Component)__instance).transform.localScale = Vector3.one;
		return true;
	}

	public static void Postfix(PhysicalShockwave __instance)
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity") && !((Object)(object)((Component)__instance).gameObject.GetComponent<PlayerOuchieShockwave>() == (Object)null))
		{
			((Component)__instance).transform.localScale = realScale;
		}
	}
}
[HarmonyPatch(typeof(NewMovement), "FixedUpdate")]
public static class NewMovementFixedUpdatePatch
{
	public static float TimeSinceGrounded;

	public static bool Prefix(NewMovement __instance)
	{
		return true;
	}

	public static void Postfix(NewMovement __instance)
	{
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			if (!__instance.gc.onGround)
			{
				TimeSinceGrounded = Mathf.MoveTowards(TimeSinceGrounded, Options.OuchieShockwaveAirTimeMax.Value * 1.5f, Time.deltaTime);
			}
			else
			{
				TimeSinceGrounded = Mathf.MoveTowards(TimeSinceGrounded, 0f, Time.deltaTime * 1.5f);
			}
		}
	}
}
[HarmonyPatch(typeof(NewMovement), "TryStartSlam")]
public static class NewMovementTryStartSlamPatch
{
	public static TimeSince TimeSinceStartedSlam = TimeSince.op_Implicit(0f);

	public static bool WasSlamming = false;

	public static bool Prefix(NewMovement __instance)
	{
		WasSlamming = __instance.gc.heavyFall;
		return true;
	}

	public static void Postfix(NewMovement __instance)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity") && __instance.gc.heavyFall && !WasSlamming)
		{
			TimeSinceStartedSlam = TimeSince.op_Implicit(0f);
		}
	}
}
[HarmonyPatch(typeof(NewMovement), "LandingImpact")]
public static class NewMovementLandingImpactPatch
{
	private static TimeSince LastWave = TimeSince.op_Implicit(0f);

	public static bool Prefix(NewMovement __instance)
	{
		return true;
	}

	public static void Postfix(NewMovement __instance)
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity") && MonoSingleton<NewMovement>.Instance.stillHolding && Options.OuchieShockwaveEnabled.Value && !(Options.OuchieShockwaveRequiredFallTime.Value > TimeSince.op_Implicit(NewMovementTryStartSlamPatch.TimeSinceStartedSlam)) && !(Options.OuchieShockwaveRequiredAirTime.Value > NewMovementFixedUpdatePatch.TimeSinceGrounded))
		{
			float num = Mathf.Clamp01(NyxMath.NormalizeToRange(NewMovementFixedUpdatePatch.TimeSinceGrounded, Mathf.Lerp(Options.OuchieShockwaveRequiredAirTime.Value, Options.OuchieShockwaveAirTimeMax.Value, 0.25f), Options.OuchieShockwaveAirTimeMax.Value));
			NewMovementFixedUpdatePatch.TimeSinceGrounded = 0f;
			AssetReference stompWave = MonoSingleton<DefaultReferenceManager>.Instance.cerberus.GetComponentInChildren<StatueBoss>().stompWave;
			GameObject val = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(stompWave), ((Component)__instance.gc).transform.position, Quaternion.identity);
			PhysicalShockwave component = val.GetComponent<PhysicalShockwave>();
			val.AddComponent<PlayerOuchieShockwave>();
			component.enemy = false;
			component.hasHurtPlayer = true;
			component.ignorePlayerDash = false;
			component.noDamageToEnemy = false;
			component.enemyType = (EnemyType)10;
			component.speed = Options.OuchieShockwaveSpeed.Value * 0.75f;
			component.damage = (int)(Mathf.Lerp(Options.OuchieShockwaveDamage.Value, Options.OuchieShockwaveDamageMax.Value, num) * 10f);
			component.maxSize *= Mathf.Lerp(Options.OuchieShockwaveMaxSize.Value, Options.OuchieShockwaveSizeMax.Value, num) * 0.5f;
			LastWave = TimeSince.op_Implicit(0f);
		}
	}
}
[HarmonyPatch(typeof(Punch), "ActiveFrame")]
public static class PunchActiveFramePatch
{
	public static bool Prefix(Punch __instance, bool firstFrame)
	{
		return true;
	}

	public static void Postfix(Punch __instance, bool firstFrame)
	{
	}
}
[HarmonyPatch(typeof(Punch), "ParryProjectile")]
public static class PunchParryProjectilePatch
{
	public static bool CanAwardParryGain;

	public static GameObject UltraParriedExplosion;

	public static GameObject UltraParriedExplosionNuke;

	public static void Postfix(Punch __instance, Projectile proj)
	{
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Expected O, but got Unknown
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Expected O, but got Unknown
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		ParryCounter orAddComponent = ComponentExtensions.GetOrAddComponent<ParryCounter>((Component)(object)proj);
		orAddComponent.TimesParried++;
		int num = (proj.playerBullet ? Options.PlayerBulletParryThresholdAdd.Value : 0);
		if (orAddComponent.TimesParried > Options.ULTRANukeParryThreshold.Value + num - 1)
		{
			if ((Object)(object)UltraParriedExplosionNuke == (Object)null)
			{
				UltraParriedExplosionNuke = new GameObject("Nyxpiri_V1Entity_UltraParriedExplosionNuke");
				UltraParriedExplosionNuke.transform.parent = MonoSingleton<AssetsRoot>.Instance.AssetHolder.transform;
				ExplosionRoot val = Explosions.Super.Instantiate(true, UltraParriedExplosionNuke.transform);
				Explosions.Normal.Instantiate(true, UltraParriedExplosionNuke.transform);
				val.ScaleSize(2f);
				val.SetMaxPlayerDamageOverride(0);
			}
			proj.explosionEffect = UltraParriedExplosionNuke;
			Rigidbody component = ((Component)proj).GetComponent<Rigidbody>();
			component.collisionDetectionMode = (CollisionDetectionMode)1;
		}
		else if (orAddComponent.TimesParried > Options.ULTRAParryThreshold.Value + num - 1)
		{
			if ((Object)(object)UltraParriedExplosion == (Object)null)
			{
				UltraParriedExplosion = new GameObject("Nyxpiri_V1Entity_UltraParriedExplosion");
				UltraParriedExplosion.transform.parent = MonoSingleton<AssetsRoot>.Instance.AssetHolder.transform;
				ExplosionRoot val2 = Explosions.Super.Instantiate(true, UltraParriedExplosion.transform);
				Explosions.Normal.Instantiate(true, UltraParriedExplosion.transform);
			}
			proj.explosionEffect = UltraParriedExplosion;
			Rigidbody component2 = ((Component)proj).GetComponent<Rigidbody>();
			component2.collisionDetectionMode = (CollisionDetectionMode)1;
		}
		else if (orAddComponent.TimesParried > Options.SuperParryThreshold.Value + num - 1)
		{
			proj.explosionEffect = ((Component)Explosions.Super.DirectPrefab).gameObject;
			Rigidbody component3 = ((Component)proj).GetComponent<Rigidbody>();
			if ((Object)(object)component3 != (Object)null)
			{
				component3.collisionDetectionMode = (CollisionDetectionMode)1;
			}
		}
		if (!CanAwardParryGain)
		{
			return;
		}
		int dualWieldCount = MonoSingleton<GunControl>.Instance.dualWieldCount;
		float num2 = (proj.playerBullet ? Options.ParryPlayerProjectileArmStaminaGain.Value : Options.ParryProjectileArmStaminaGain.Value);
		if (dualWieldCount > 0)
		{
			for (int i = 0; i < dualWieldCount; i++)
			{
				num2 *= Options.DualWieldProjectileParryStaminaGainScalar.Value;
			}
		}
		WeaponCharges instance = MonoSingleton<WeaponCharges>.Instance;
		instance.punchStamina += num2;
		CanAwardParryGain = false;
	}
}
[HarmonyPatch(typeof(HookArm), "FixedUpdate")]
public static class HookArmFixedUpdatePatch
{
	private static bool WasBoosting = false;

	private static bool WasBeingPulled = false;

	public static TimeSince TimeSinceBoost = TimeSince.op_Implicit(0f);

	public static TimeSince TimeSinceStartedBeingPulled = TimeSince.op_Implicit(0f);

	private static bool Whipdashing = false;

	public static TimeSince TimeSinceWhipdashStart = TimeSince.op_Implicit(0f);

	private static MethodInfo GetTotalLineDistanceMI = typeof(HookArm).GetMethod("GetTotalLineDistance", BindingFlags.Instance | BindingFlags.NonPublic);

	public static bool Prefix(HookArm __instance)
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Invalid comparison between Unknown and I4
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: 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_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return true;
		}
		if (Whipdashing && (int)__instance.state == 0)
		{
			Rigidbody rb = MonoSingleton<NewMovement>.Instance.rb;
			Vector3 velocity = MonoSingleton<NewMovement>.Instance.rb.velocity;
			Vector3 val = ((Vector3)(ref velocity)).normalized * 60f * Options.WhipdashSpeedScale.Value;
			velocity = MonoSingleton<NewMovement>.Instance.rb.velocity;
			rb.velocity = Vector3.Lerp(val, ((Vector3)(ref velocity)).normalized * 60f, Options.WhipdashSpeedCancelScale.Value);
		}
		if (TimeSince.op_Implicit(TimeSinceWhipdashStart) > Options.WhipdashDuration.Value || (float)GetTotalLineDistanceMI.Invoke(MonoSingleton<HookArm>.Instance, null) < Options.WhipdashMinDistance.Value)
		{
			Whipdashing = false;
		}
		if (MonoSingleton<NewMovement>.Instance.boost != WasBoosting)
		{
			WasBoosting = MonoSingleton<NewMovement>.Instance.boost;
			if (WasBoosting)
			{
				TimeSinceBoost = TimeSince.op_Implicit(0f);
				if (TimeSince.op_Implicit(TimeSinceStartedBeingPulled) < Options.WhipdashWindow.Value && MonoSingleton<NewMovement>.Instance.boostCharge >= Options.WhipdashStaminaCost.Value)
				{
					Whipdash();
				}
			}
		}
		return true;
	}

	private static void Whipdash()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		Whipdashing = true;
		TimeSinceWhipdashStart = TimeSince.op_Implicit(0f);
		MonoSingleton<NewMovement>.Instance.boost = false;
		NewMovement instance = MonoSingleton<NewMovement>.Instance;
		instance.boostCharge -= Options.WhipdashStaminaCost.Value;
	}

	public static void Postfix(HookArm __instance)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		if (!MonoSingleton<HookArm>.Instance.beingPulled)
		{
			WasBeingPulled = false;
			return;
		}
		if (!WasBeingPulled)
		{
			TimeSinceStartedBeingPulled = TimeSince.op_Implicit(0f);
			if (TimeSince.op_Implicit(TimeSinceBoost) < Options.WhipdashWindow.Value && MonoSingleton<NewMovement>.Instance.boostCharge >= Options.WhipdashStaminaCost.Value)
			{
				Whipdash();
			}
		}
		WasBeingPulled = true;
		if ((!MonoSingleton<NewMovement>.Instance.boost || MonoSingleton<NewMovement>.Instance.sliding) && Whipdashing)
		{
			Rigidbody rb = MonoSingleton<NewMovement>.Instance.rb;
			rb.velocity *= Options.WhipdashSpeedScale.Value;
		}
	}
}
public class ParryCounter : MonoBehaviour
{
	public int TimesParried = 0;
}
public class PunchDurationTracker : MonoBehaviour
{
	public TimeSince PunchStart = TimeSince.op_Implicit(0f);

	public float AddedTime = 0f;

	public float TotalTime => TimeSince.op_Implicit(PunchStart) + AddedTime;

	public void Reset()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		PunchStart = TimeSince.op_Implicit(0f);
		AddedTime = 0f;
	}
}
public static class TimeHelper
{
	[HarmonyPatch(typeof(TimeController), "TrueStop")]
	public static class TimeControllerTrueStopPatch
	{
		public static bool Prefix(TimeController __instance)
		{
			LastHitStopTimestamp = Time.unscaledTimeAsDouble;
			return true;
		}

		public static void Postfix(TimeController __instance)
		{
		}
	}

	[HarmonyPatch(typeof(TimeController), "HitStop")]
	public static class TimeControllerHitStopPatch
	{
		public static bool Prefix(TimeController __instance)
		{
			LastHitStopTimestamp = Time.unscaledTimeAsDouble;
			return true;
		}

		public static void Postfix(TimeController __instance)
		{
		}
	}

	public static double LastHitStopTimestamp = 0.0;

	public static FieldAccess<TimeController, float> currentStopFA = new FieldAccess<TimeController, float>("currentStop", BindingFlags.Instance | BindingFlags.NonPublic);

	public static float TimeSinceLastHitStop => (float)(Time.unscaledTimeAsDouble - LastHitStopTimestamp);

	public static float currentStop => currentStopFA.GetValue(MonoSingleton<TimeController>.Instance);

	public static void RestoreTime()
	{
		MonoSingleton<TimeController>.Instance.RestoreTime();
		((MonoBehaviour)MonoSingleton<TimeController>.Instance).StopCoroutine("ContinueTime");
	}
}
[BepInPlugin("nyxpiri.ultrakill.v1-entity", "V1 Entity", "0.2.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInProcess("ULTRAKILL.exe")]
public class V1Entity : BaseUnityPlugin
{
	[HarmonyPatch(typeof(FistControl), "Update")]
	public static class FistControlUpdatePatch
	{
		public static bool Prefix(FistControl __instance)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				return true;
			}
			float punchStamina = MonoSingleton<WeaponCharges>.Instance.punchStamina;
			if (Cheats.Enabled && !MonoSingleton<OptionsManager>.Instance.paused && punchStamina > 1f)
			{
				MonoSingleton<FistControl>.Instance.fistCooldown = 0f;
				FistActions fist = MonoSingleton<InputManager>.Instance.InputSource.Actions.Fist;
				if (((FistActions)(ref fist)).PunchFeedbacker.WasPerformedThisFrame())
				{
					MultiFistController.RefreshArmActiveness(MultiFistController.SpawnedArms);
					PerhapsRefreshArm((FistType)0);
				}
				fist = MonoSingleton<InputManager>.Instance.InputSource.Actions.Fist;
				if (((FistActions)(ref fist)).PunchKnuckleblaster.WasPerformedThisFrame())
				{
					MultiFistController.RefreshArmActiveness(MultiFistController.SpawnedArms);
					PerhapsRefreshArm((FistType)1);
				}
				fist = MonoSingleton<InputManager>.Instance.InputSource.Actions.Fist;
				if (((FistActions)(ref fist)).Punch.WasPerformedThisFrame())
				{
					MultiFistController.RefreshArmActiveness(MultiFistController.SpawnedArms);
					PerhapsReadyArm();
				}
			}
			return true;
		}

		private static void PerhapsReadyArm()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Invalid comparison between Unknown and I4
			if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				GameObject currentArmObject = MonoSingleton<FistControl>.Instance.currentArmObject;
				Punch val = ((currentArmObject != null) ? currentArmObject.GetComponent<Punch>() : null);
				if (!((Object)(object)val != (Object)null) || (((int)val.type != 0 || Options.AutoRefreshFeedbacker.Value) && ((int)val.type != 1 || Options.AutoRefreshKnuckleblaster.Value)))
				{
					((Component)MonoSingleton<FistControl>.Instance).GetComponent<MultiFistController>().ReadyArm();
				}
			}
		}

		private static void PerhapsRefreshArm(FistType? fistType)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_006c: Invalid comparison between Unknown and I4
			if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
			{
				GameObject currentArmObject = MonoSingleton<FistControl>.Instance.currentArmObject;
				Punch val = ((currentArmObject != null) ? currentArmObject.GetComponent<Punch>() : null);
				FistType val2 = (FistType)0;
				if (fistType.HasValue)
				{
					val2 = fistType.Value;
				}
				else if ((Object)(object)val != (Object)null)
				{
					val2 = val.type;
				}
				if (((int)val2 != 0 || Options.AutoRefreshFeedbacker.Value) && ((int)val2 != 1 || Options.AutoRefreshKnuckleblaster.Value))
				{
					MonoSingleton<FistControl>.Instance.RefreshArm();
				}
			}
		}

		public static void Postfix(FistControl __instance)
		{
		}
	}

	public const string CheatID = "nyxpiri.v1-entity";

	private float punchTimer = 0f;

	private float randomTimerAdd = 0f;

	public InputAction ULTRAPunch { get; private set; }

	protected void Awake()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Expected O, but got Unknown
		Log.Initialize(((BaseUnityPlugin)this).Logger);
		Options.Initialize((BaseUnityPlugin)(object)this);
		Harmony.CreateAndPatchAll(((object)this).GetType().Assembly, (string)null);
		Input.CreateActions += (CreateActionsEventHandler)delegate(ActionCreator creator)
		{
			ULTRAPunch = creator.CreateInputAction("ULTRA Punch", ActionMaps.Fist, (InputActionType)1);
		};
		Cheats.ReadyForCheatRegistration += (ReadyForCheatRegistrationEventHandler)delegate(CheatsManager cheatManager)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			cheatManager.RegisterCheat((ICheat)new ToggleCheat("V1 Entity", "nyxpiri.v1-entity", (Action<ToggleCheat>)OnCheatDisable, (Action<ToggleCheat, CheatsManager>)OnCheatEnable), (string)null);
		};
	}

	private void OnCheatEnable(ToggleCheat cheat, CheatsManager manager)
	{
		MultiFistController.EnsureInitialization();
		FistControl instance = MonoSingleton<FistControl>.Instance;
		if (instance != null)
		{
			instance.ResetFists();
		}
	}

	private void OnCheatDisable(ToggleCheat cheat)
	{
	}

	protected void Start()
	{
	}

	protected void Update()
	{
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		if (Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			return;
		}
		FistControl instance = MonoSingleton<FistControl>.Instance;
		float num = MonoSingleton<WeaponCharges>.Instance?.punchStamina ?? 0f;
		InputAction uLTRAPunch = ULTRAPunch;
		if ((((uLTRAPunch != null) ? new bool?(uLTRAPunch.IsPressed()) : ((bool?)null)) ?? false) && (Object)(object)instance != (Object)null && (Object)(object)instance.currentPunch != (Object)null && num > 1f && !MonoSingleton<OptionsManager>.Instance.paused && !GameStateManager.Instance.PlayerInputLocked)
		{
			punchTimer += Time.unscaledDeltaTime;
			ConfigEntry<float> val = (((int)instance.currentPunch.type == 0) ? Options.FeedbackerULTRAPunchRate : Options.KnuckleBlasterULTRAPunchRate);
			if (punchTimer > 1f / (val.Value + randomTimerAdd))
			{
				Punch(instance, MonoSingleton<InputManager>.Instance.InputSource.Punch.Action);
				punchTimer = 0f;
				randomTimerAdd = Random.Range(Options.ULTRAPunchRateVariance.Value * -0.5f, Options.ULTRAPunchRateVariance.Value * 0.5f);
			}
			else if (ULTRAPunch.WasPerformedThisFrame())
			{
				Punch(instance, MonoSingleton<InputManager>.Instance.InputSource.Punch.Action);
			}
		}
		if (Options.BindPunchToScroll.Value && Mathf.Abs(Input.mouseScrollDelta.y) > 0.1f && num > 1f && !MonoSingleton<OptionsManager>.Instance.paused && !GameStateManager.Instance.PlayerInputLocked)
		{
			Punch(instance, MonoSingleton<InputManager>.Instance.InputSource.Punch.Action);
		}
	}

	public static void Punch(FistControl fc, InputAction heldAction)
	{
		if (!Cheats.IsCheatDisabled("nyxpiri.v1-entity"))
		{
			if (Options.AutoRefreshFeedbacker.Value)
			{
				fc.RefreshArm();
			}
			fc.currentPunch.heldAction = heldAction;
			fc.currentPunch.PunchStart();
		}
	}

	protected void FixedUpdate()
	{
	}

	protected void LateUpdate()
	{
	}
}