Decompiled source of RepoWeaponLab v0.1.14

BepInEx\plugins\RepoWeaponLab\RepoWeaponLab.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;

[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("RepoWeaponLab")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Starter BepInEx weapon mod for R.E.P.O.")]
[assembly: AssemblyFileVersion("0.1.14.0")]
[assembly: AssemblyInformationalVersion("0.1.14")]
[assembly: AssemblyProduct("RepoWeaponLab")]
[assembly: AssemblyTitle("RepoWeaponLab")]
[assembly: AssemblyVersion("0.1.14.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 RepoWeaponLab
{
	[BepInPlugin("com.amgru.repoweaponlab", "RepoWeaponLab", "0.1.13")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "com.amgru.repoweaponlab";

		public const string PluginName = "RepoWeaponLab";

		public const string PluginVersion = "0.1.13";

		internal static ConfigEntry<bool> ModEnabled = null;

		internal static ConfigEntry<float> DamageMultiplier = null;

		internal static ConfigEntry<float> DurabilityMultiplier = null;

		internal static ConfigEntry<float> GunBatteryDrainMultiplier = null;

		internal static ConfigEntry<float> GunCooldownMultiplier = null;

		internal static ConfigEntry<float> GunRecoilMultiplier = null;

		internal static ConfigEntry<int> ExtraBulletsPerShot = null;

		internal static ConfigEntry<float> MeleeSwingForceMultiplier = null;

		private Harmony? harmony;

		internal static string PluginDirectory { get; private set; } = string.Empty;


		private void Awake()
		{
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? string.Empty;
			ModEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Turns RepoWeaponLab changes on or off.");
			DamageMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Weapons", "DamageMultiplier", 1f, "Multiplier applied by weapon damage patches. 1.0 keeps vanilla damage.");
			DurabilityMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Weapons", "DurabilityMultiplier", 1f, "Multiplier applied by weapon durability patches. 1.0 keeps vanilla durability.");
			GunBatteryDrainMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Guns", "BatteryDrainMultiplier", 1f, "Multiplier for battery drained per gun shot. Lower values make guns last longer.");
			GunCooldownMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Guns", "CooldownMultiplier", 1f, "Multiplier for gun reload/cooldown time. Lower values make guns fire faster.");
			GunRecoilMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Guns", "RecoilMultiplier", 1f, "Multiplier for gun recoil force.");
			ExtraBulletsPerShot = ((BaseUnityPlugin)this).Config.Bind<int>("Guns", "ExtraBulletsPerShot", 0, "Adds this many extra raycast bullets to each gun shot.");
			MeleeSwingForceMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Melee", "SwingForceMultiplier", 1f, "Multiplier for scroll-wheel melee swing force.");
			harmony = new Harmony("com.amgru.repoweaponlab");
			harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0} loaded. Enabled={1}", "RepoWeaponLab", ModEnabled.Value));
		}

		private void OnDestroy()
		{
			Harmony? obj = harmony;
			if (obj != null)
			{
				obj.UnpatchSelf();
			}
		}
	}
}
namespace RepoWeaponLab.Patches
{
	[HarmonyPatch(typeof(SemiFunc), "DebugTester")]
	internal static class DebugTesterNullGuardPatch
	{
		private static Exception? Finalizer(Exception? __exception)
		{
			if (__exception is NullReferenceException)
			{
				return null;
			}
			return __exception;
		}
	}
	internal enum LightsaberVariant
	{
		None,
		Stun,
		Core,
		Volatile,
		NullG,
		Rift
	}
	internal static class LightsaberAbilities
	{
		private static readonly Dictionary<int, float> HitCooldowns = new Dictionary<int, float>();

		private static readonly Dictionary<int, float> PlayerHitCooldowns = new Dictionary<int, float>();

		private static readonly Dictionary<int, FloppyBladeState> FloppyStates = new Dictionary<int, FloppyBladeState>();

		private static readonly Dictionary<int, float> FloppyImpactPulses = new Dictionary<int, float>();

		private static readonly Dictionary<int, LightsaberVariant> VariantCache = new Dictionary<int, LightsaberVariant>();

		private static readonly Dictionary<int, float> ContactScanCooldowns = new Dictionary<int, float>();

		private static readonly HashSet<int> ScanSeenEnemies = new HashSet<int>();

		private static readonly HashSet<int> ScanSeenPlayers = new HashSet<int>();

		private static readonly Collider[] OverlapBuffer = (Collider[])(object)new Collider[64];

		private static readonly FieldInfo EnemyHasHealthField = AccessTools.Field(typeof(Enemy), "HasHealth");

		private static readonly FieldInfo EnemyHealthField = AccessTools.Field(typeof(Enemy), "Health");

		private static readonly FieldInfo EnemyHasRigidbodyField = AccessTools.Field(typeof(Enemy), "HasRigidbody");

		private static readonly FieldInfo EnemyRigidbodyField = AccessTools.Field(typeof(Enemy), "Rigidbody");

		private static readonly FieldInfo EnemyRbField = AccessTools.Field(typeof(EnemyRigidbody), "rb");

		private static readonly FieldInfo EnemyPhysGrabObjectField = AccessTools.Field(typeof(EnemyRigidbody), "physGrabObject");

		private static readonly FieldInfo PlayerTumbleField = AccessTools.Field(typeof(PlayerAvatar), "tumble");

		private static readonly FieldInfo PlayerTumblePhysGrabObjectField = AccessTools.Field(typeof(PlayerTumble), "physGrabObject");

		private static readonly FieldInfo PlayerIsLocalField = AccessTools.Field(typeof(PlayerAvatar), "isLocal");

		private static readonly FieldInfo PlayerClientPositionField = AccessTools.Field(typeof(PlayerAvatar), "clientPosition");

		private static readonly FieldInfo PlayerClientPositionCurrentField = AccessTools.Field(typeof(PlayerAvatar), "clientPositionCurrent");

		private static readonly FieldInfo PlayerVisualPositionField = AccessTools.Field(typeof(PlayerAvatarVisuals), "visualPosition");

		internal static LightsaberVariant GetVariant(HurtCollider hurtCollider)
		{
			return GetVariant(((Component)hurtCollider).gameObject, ((Object)((Component)hurtCollider).transform.root).name);
		}

		internal static LightsaberVariant GetVariant(GameObject source, string fallbackName)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			int instanceID = ((Object)source).GetInstanceID();
			if (VariantCache.TryGetValue(instanceID, out var value))
			{
				return value;
			}
			ItemAttributes componentInParent = source.GetComponentInParent<ItemAttributes>();
			string text = componentInParent?.item?.itemName ?? fallbackName;
			bool flag = !string.IsNullOrEmpty(componentInParent?.item?.itemName);
			string name = ((Object)source.transform.root).name;
			Scene scene = source.scene;
			string text2 = (((Scene)(ref scene)).IsValid() ? ((Object)source).name : string.Empty);
			string text3 = text.ToLowerInvariant();
			text3 = text3 + " " + name.ToLowerInvariant() + " " + text2.ToLowerInvariant();
			if (!text3.Contains("lightsaber"))
			{
				if (flag)
				{
					VariantCache[instanceID] = LightsaberVariant.None;
				}
				return LightsaberVariant.None;
			}
			if (text3.Contains("floppy") || text3.Contains("stun"))
			{
				VariantCache[instanceID] = LightsaberVariant.Stun;
				return LightsaberVariant.Stun;
			}
			if (text3.Contains("volatile"))
			{
				VariantCache[instanceID] = LightsaberVariant.Volatile;
				return LightsaberVariant.Volatile;
			}
			if (text3.Contains("null-g") || text3.Contains("null g") || text3.Contains("null_g"))
			{
				VariantCache[instanceID] = LightsaberVariant.NullG;
				return LightsaberVariant.NullG;
			}
			if (text3.Contains("rift") || text3.Contains("void") || text3.Contains("teleport"))
			{
				VariantCache[instanceID] = LightsaberVariant.Rift;
				return LightsaberVariant.Rift;
			}
			VariantCache[instanceID] = LightsaberVariant.Core;
			return LightsaberVariant.Core;
		}

		internal static void OnEnemyHit(HurtCollider hurtCollider, Enemy enemy)
		{
			if (!Plugin.ModEnabled.Value || (Object)(object)enemy == (Object)null || !Object.op_Implicit((Object)(object)enemy) || !SemiFunc.IsMasterClientOrSingleplayer())
			{
				return;
			}
			LightsaberVariant variant = GetVariant(hurtCollider);
			if (variant == LightsaberVariant.None || variant == LightsaberVariant.Core || !IsSaberAbilityArmed(hurtCollider))
			{
				return;
			}
			int key = (((Object)enemy).GetInstanceID() * 397) ^ (int)variant;
			if (!HitCooldowns.TryGetValue(key, out var value) || !(Time.time < value))
			{
				HitCooldowns[key] = Time.time + 0.35f;
				switch (variant)
				{
				case LightsaberVariant.Stun:
					PulseFloppyBlade(hurtCollider);
					break;
				case LightsaberVariant.Volatile:
					Explode(hurtCollider, enemy);
					break;
				case LightsaberVariant.NullG:
					ApplyNullGravity(hurtCollider, enemy);
					break;
				case LightsaberVariant.Rift:
					TeleportEnemy(hurtCollider, enemy);
					break;
				case LightsaberVariant.Core:
					break;
				}
			}
		}

		internal static void OnPlayerHit(HurtCollider hurtCollider, PlayerAvatar player)
		{
			if (!Plugin.ModEnabled.Value || (Object)(object)player == (Object)null || !Object.op_Implicit((Object)(object)player))
			{
				return;
			}
			LightsaberVariant variant = GetVariant(hurtCollider);
			if ((variant != LightsaberVariant.Rift && variant != LightsaberVariant.Stun) || !IsSaberAbilityArmed(hurtCollider))
			{
				return;
			}
			int key = (((Object)player).GetInstanceID() * 397) ^ (int)variant;
			if (!PlayerHitCooldowns.TryGetValue(key, out var value) || !(Time.time < value))
			{
				PlayerHitCooldowns[key] = Time.time + 1f;
				if (variant == LightsaberVariant.Stun)
				{
					PulseFloppyBlade(hurtCollider);
				}
				else
				{
					TeleportPlayer(player);
				}
			}
		}

		internal static void OnPhysGrabObjectUpdate(PhysGrabObject physGrabObject)
		{
			if (!Plugin.ModEnabled.Value || (Object)(object)physGrabObject == (Object)null || !Object.op_Implicit((Object)(object)physGrabObject))
			{
				return;
			}
			LightsaberVariant variant = GetVariant(((Component)physGrabObject).gameObject, ((Object)physGrabObject).name);
			bool flag = IsSaberAbilityArmed(physGrabObject);
			switch (variant)
			{
			case LightsaberVariant.Stun:
				AnimateFloppyBlade(physGrabObject);
				break;
			case LightsaberVariant.Rift:
				if (flag)
				{
					TryRiftContactScan(physGrabObject);
				}
				break;
			case LightsaberVariant.NullG:
				if (flag)
				{
					TryNullGContactScan(physGrabObject);
				}
				if (physGrabObject.playerGrabbing == null || physGrabObject.playerGrabbing.Count == 0)
				{
					break;
				}
				physGrabObject.OverrideZeroGravity(0.15f);
				physGrabObject.OverrideDrag(0.15f, 0.15f);
				physGrabObject.OverrideAngularDrag(0.15f, 0.15f);
				{
					foreach (PhysGrabber item in physGrabObject.playerGrabbing)
					{
						if (!((Object)(object)item == (Object)null) && !((Object)(object)item.playerAvatar == (Object)null))
						{
							ApplyPlayerNullGravity(item.playerAvatar);
						}
					}
					break;
				}
			}
		}

		internal static bool ShouldAllowSaberHurt(HurtCollider hurtCollider)
		{
			if (GetVariant(hurtCollider) != 0)
			{
				return IsSaberAbilityArmed(hurtCollider);
			}
			return true;
		}

		private static bool IsSaberAbilityArmed(HurtCollider hurtCollider)
		{
			if ((Object)(object)hurtCollider == (Object)null || !Object.op_Implicit((Object)(object)hurtCollider) || !((Component)hurtCollider).gameObject.activeInHierarchy)
			{
				return false;
			}
			PhysGrabObject componentInParent = ((Component)hurtCollider).GetComponentInParent<PhysGrabObject>();
			if ((Object)(object)componentInParent != (Object)null)
			{
				return IsSaberAbilityArmed(componentInParent);
			}
			return false;
		}

		private static bool IsSaberAbilityArmed(PhysGrabObject physGrabObject)
		{
			if ((Object)(object)physGrabObject == (Object)null || !Object.op_Implicit((Object)(object)physGrabObject))
			{
				return false;
			}
			ItemMelee component = ((Component)physGrabObject).GetComponent<ItemMelee>();
			if ((Object)(object)component == (Object)null || !Object.op_Implicit((Object)(object)component) || !component.IsSwinging())
			{
				return false;
			}
			HurtCollider[] componentsInChildren = ((Component)physGrabObject).GetComponentsInChildren<HurtCollider>(false);
			foreach (HurtCollider val in componentsInChildren)
			{
				if ((Object)(object)val != (Object)null && ((Component)val).gameObject.activeInHierarchy && GetVariant(val) != 0)
				{
					return true;
				}
			}
			return false;
		}

		private static void AnimateFloppyBlade(PhysGrabObject physGrabObject)
		{
			int instanceID = ((Object)physGrabObject).GetInstanceID();
			if (!FloppyStates.TryGetValue(instanceID, out FloppyBladeState value) || !value.IsValid)
			{
				value = FloppyBladeState.Create(((Component)physGrabObject).transform);
				FloppyStates[instanceID] = value;
			}
			float num = 0f;
			if (FloppyImpactPulses.TryGetValue(instanceID, out var value2))
			{
				num = Mathf.Clamp01((value2 - Time.time) / 0.35f);
				if (num <= 0f)
				{
					FloppyImpactPulses.Remove(instanceID);
				}
			}
			value.Update(physGrabObject, num);
		}

		private static void PulseFloppyBlade(HurtCollider hurtCollider)
		{
			PhysGrabObject componentInParent = ((Component)hurtCollider).GetComponentInParent<PhysGrabObject>();
			if (!((Object)(object)componentInParent == (Object)null))
			{
				FloppyImpactPulses[((Object)componentInParent).GetInstanceID()] = Time.time + 0.35f;
			}
		}

		private static void TryNullGContactScan(PhysGrabObject physGrabObject)
		{
			if (!SemiFunc.IsMasterClientOrSingleplayer())
			{
				return;
			}
			int key = (((Object)physGrabObject).GetInstanceID() * 397) ^ 4;
			if (ContactScanCooldowns.TryGetValue(key, out var value) && Time.time < value)
			{
				return;
			}
			ContactScanCooldowns[key] = Time.time + 0.08f;
			HurtCollider[] componentsInChildren = ((Component)physGrabObject).GetComponentsInChildren<HurtCollider>(false);
			foreach (HurtCollider val in componentsInChildren)
			{
				if ((Object)(object)val == (Object)null || !((Component)val).gameObject.activeInHierarchy || GetVariant(val) != LightsaberVariant.NullG)
				{
					continue;
				}
				int hurtColliderOverlaps = GetHurtColliderOverlaps(val);
				for (int j = 0; j < hurtColliderOverlaps; j++)
				{
					Collider val2 = OverlapBuffer[j];
					Enemy val3 = (((Object)(object)val2 != (Object)null) ? FindEnemy(val2) : null);
					if (!((Object)(object)val3 == (Object)null) && Object.op_Implicit((Object)(object)val3))
					{
						int key2 = (((Object)val3).GetInstanceID() * 397) ^ 4;
						if (!HitCooldowns.TryGetValue(key2, out var value2) || !(Time.time < value2))
						{
							HitCooldowns[key2] = Time.time + 0.35f;
							ApplyNullGravity(val, val3);
						}
					}
				}
			}
		}

		private static void TryRiftContactScan(PhysGrabObject physGrabObject)
		{
			if (!SemiFunc.IsMasterClientOrSingleplayer())
			{
				return;
			}
			int key = (((Object)physGrabObject).GetInstanceID() * 397) ^ 5;
			if (ContactScanCooldowns.TryGetValue(key, out var value) && Time.time < value)
			{
				return;
			}
			ContactScanCooldowns[key] = Time.time + 0.08f;
			HurtCollider[] componentsInChildren = ((Component)physGrabObject).GetComponentsInChildren<HurtCollider>(false);
			if (componentsInChildren.Length == 0)
			{
				return;
			}
			ScanSeenEnemies.Clear();
			ScanSeenPlayers.Clear();
			HurtCollider[] array = componentsInChildren;
			foreach (HurtCollider val in array)
			{
				if ((Object)(object)val == (Object)null || !((Component)val).gameObject.activeInHierarchy || GetVariant(val) != LightsaberVariant.Rift)
				{
					continue;
				}
				int hurtColliderOverlaps = GetHurtColliderOverlaps(val);
				for (int j = 0; j < hurtColliderOverlaps; j++)
				{
					Collider val2 = OverlapBuffer[j];
					if ((Object)(object)val2 == (Object)null)
					{
						continue;
					}
					Enemy val3 = FindEnemy(val2);
					if ((Object)(object)val3 != (Object)null && Object.op_Implicit((Object)(object)val3))
					{
						int instanceID = ((Object)val3).GetInstanceID();
						if (ScanSeenEnemies.Add(instanceID))
						{
							TeleportRiftEnemyFallback(val, val3);
						}
					}
					PlayerAvatar val4 = FindPlayer(val2);
					if ((Object)(object)val4 != (Object)null && Object.op_Implicit((Object)(object)val4) && ScanSeenPlayers.Add(((Object)val4).GetInstanceID()) && !val.ignorePlayers.Contains(val4))
					{
						OnPlayerHit(val, val4);
					}
				}
			}
		}

		private static int GetHurtColliderOverlaps(HurtCollider hurtCollider)
		{
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0081: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			BoxCollider component = ((Component)hurtCollider).GetComponent<BoxCollider>();
			if ((Object)(object)component != (Object)null && ((Collider)component).enabled)
			{
				Vector3 val = ((Component)hurtCollider).transform.TransformPoint(component.center);
				Vector3 val2 = Vector3.Scale(((Component)hurtCollider).transform.lossyScale, component.size);
				return Physics.OverlapBoxNonAlloc(val, val2 * 0.5f, OverlapBuffer, ((Component)hurtCollider).transform.rotation, -1, (QueryTriggerInteraction)2);
			}
			SphereCollider component2 = ((Component)hurtCollider).GetComponent<SphereCollider>();
			if ((Object)(object)component2 != (Object)null && ((Collider)component2).enabled)
			{
				float num = ((Component)hurtCollider).transform.lossyScale.x * component2.radius;
				Bounds bounds = ((Collider)component2).bounds;
				return Physics.OverlapSphereNonAlloc(((Bounds)(ref bounds)).center, num, OverlapBuffer, -1, (QueryTriggerInteraction)2);
			}
			return Physics.OverlapSphereNonAlloc(((Component)hurtCollider).transform.position, 1f, OverlapBuffer, -1, (QueryTriggerInteraction)2);
		}

		private static Enemy? FindEnemy(Collider collider)
		{
			Enemy componentInParent = ((Component)collider).GetComponentInParent<Enemy>();
			if ((Object)(object)componentInParent != (Object)null && Object.op_Implicit((Object)(object)componentInParent))
			{
				return componentInParent;
			}
			EnemyRigidbody componentInParent2 = ((Component)collider).GetComponentInParent<EnemyRigidbody>();
			if ((Object)(object)componentInParent2 != (Object)null && (Object)(object)componentInParent2.enemy != (Object)null && Object.op_Implicit((Object)(object)componentInParent2.enemy))
			{
				return componentInParent2.enemy;
			}
			if (!((Object)(object)collider.attachedRigidbody != (Object)null))
			{
				return null;
			}
			return ((Component)collider.attachedRigidbody).GetComponent<EnemyRigidbody>()?.enemy;
		}

		private static PlayerAvatar? FindPlayer(Collider collider)
		{
			PlayerAvatar componentInParent = ((Component)collider).GetComponentInParent<PlayerAvatar>();
			if ((Object)(object)componentInParent != (Object)null && Object.op_Implicit((Object)(object)componentInParent))
			{
				return componentInParent;
			}
			if (!((Object)(object)collider.attachedRigidbody != (Object)null))
			{
				return null;
			}
			return ((Component)collider.attachedRigidbody).GetComponentInParent<PlayerAvatar>();
		}

		private static void Explode(HurtCollider hurtCollider, Enemy enemy)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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_0028: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = (Object.op_Implicit((Object)(object)enemy.CenterTransform) ? enemy.CenterTransform.position : ((Component)enemy).transform.position);
			ApplyExplosiveKnockback(hurtCollider, enemy, val, 9.5f, 82f);
			SpawnVolatileExplosionVfx(val);
			DamageEnemy(hurtCollider, enemy, 115);
			ApplyAreaExplosiveDamageAndKnockback(hurtCollider, val, 9.5f, 95);
		}

		private static void ApplyAreaExplosiveDamageAndKnockback(HurtCollider hurtCollider, Vector3 position, float radius, int damage)
		{
			//IL_0000: 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)
			Collider[] array = Physics.OverlapSphere(position, radius, -1, (QueryTriggerInteraction)2);
			HashSet<int> hashSet = new HashSet<int>();
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				if (!((Object)(object)val == (Object)null))
				{
					Enemy val2 = FindEnemy(val);
					if (!((Object)(object)val2 == (Object)null) && Object.op_Implicit((Object)(object)val2) && hashSet.Add(((Object)val2).GetInstanceID()))
					{
						ApplyExplosiveKnockback(hurtCollider, val2, position, radius, 58f);
						DamageEnemy(hurtCollider, val2, damage);
					}
				}
			}
		}

		private static void ApplyExplosiveKnockback(HurtCollider hurtCollider, Enemy enemy, Vector3? explosionPosition = null, float radius = 3.5f, float impulse = 34f)
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			object value = EnemyHasRigidbodyField.GetValue(enemy);
			if (!(value is bool) || !(bool)value)
			{
				return;
			}
			object? value2 = EnemyRigidbodyField.GetValue(enemy);
			EnemyRigidbody val = (EnemyRigidbody)((value2 is EnemyRigidbody) ? value2 : null);
			if (val == null || (Object)(object)val == (Object)null)
			{
				return;
			}
			object? value3 = EnemyRbField.GetValue(val);
			Rigidbody val2 = (Rigidbody)((value3 is Rigidbody) ? value3 : null);
			if (!((Object)(object)val2 == (Object)null))
			{
				Vector3 val3 = (Vector3)(((??)explosionPosition) ?? ((Component)hurtCollider).transform.position);
				Vector3 val4 = ((Component)enemy).transform.position - val3;
				Vector3 val5 = ((Vector3)(ref val4)).normalized;
				if (((Vector3)(ref val5)).sqrMagnitude < 0.01f)
				{
					val5 = ((Component)hurtCollider).transform.forward;
				}
				float num = Vector3.Distance(((Component)enemy).transform.position, val3);
				float num2 = Mathf.Lerp(1f, 0.35f, Mathf.Clamp01(num / radius));
				val.DisableFollowPosition(1.15f, 18f);
				val.DisableFollowRotation(1.15f, 18f);
				val4 = val5 + Vector3.up * 1.35f;
				val2.AddForce(((Vector3)(ref val4)).normalized * (impulse * num2), (ForceMode)1);
				val2.AddTorque(Random.insideUnitSphere * (30f * num2), (ForceMode)1);
			}
		}

		private static void ApplyNullGravity(HurtCollider hurtCollider, Enemy enemy)
		{
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_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)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: 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_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			object value = EnemyHasRigidbodyField.GetValue(enemy);
			if (!(value is bool) || !(bool)value)
			{
				return;
			}
			object? value2 = EnemyRigidbodyField.GetValue(enemy);
			EnemyRigidbody val = (EnemyRigidbody)((value2 is EnemyRigidbody) ? value2 : null);
			if (val == null || (Object)(object)val == (Object)null)
			{
				return;
			}
			val.DeactivateCustomGravity(2.8f);
			val.OverrideFollowPositionGravityDisable(2.8f);
			val.DisableFollowPosition(1.4f, 3f);
			val.DisableFollowRotation(1.4f, 3f);
			object? value3 = EnemyPhysGrabObjectField.GetValue(val);
			PhysGrabObject val2 = (PhysGrabObject)((value3 is PhysGrabObject) ? value3 : null);
			if ((Object)(object)val2 != (Object)null)
			{
				val2.OverrideZeroGravity(2.8f);
				val2.OverrideDrag(0.25f, 2.8f);
				val2.OverrideAngularDrag(0.25f, 2.8f);
			}
			object? value4 = EnemyRbField.GetValue(val);
			Rigidbody val3 = (Rigidbody)((value4 is Rigidbody) ? value4 : null);
			if (!((Object)(object)val3 == (Object)null))
			{
				Vector3 position = ((Component)hurtCollider).transform.position;
				Vector3 val4 = ((Component)enemy).transform.position - position;
				Vector3 val5 = ((Vector3)(ref val4)).normalized;
				if (((Vector3)(ref val5)).sqrMagnitude < 0.01f)
				{
					val5 = Vector3.up;
				}
				val4 = val5 + Vector3.up * 1.2f;
				val3.AddForce(((Vector3)(ref val4)).normalized * 16f, (ForceMode)1);
				val3.AddTorque(Random.insideUnitSphere * 8f, (ForceMode)1);
			}
		}

		private static void ApplyPlayerNullGravity(PlayerAvatar player)
		{
			object? value = PlayerTumbleField.GetValue(player);
			PlayerTumble val = (PlayerTumble)((value is PlayerTumble) ? value : null);
			PhysGrabObject val2 = (PhysGrabObject)(((Object)(object)val != (Object)null) ? /*isinst with value type is only supported in some contexts*/: null);
			if (!((Object)(object)val2 == (Object)null))
			{
				val2.OverrideZeroGravity(0.2f);
				val2.OverrideDrag(0.2f, 0.2f);
				val2.OverrideAngularDrag(0.2f, 0.2f);
				object value2 = PlayerIsLocalField.GetValue(player);
				bool flag = default(bool);
				int num;
				if (value2 is bool)
				{
					flag = (bool)value2;
					num = 1;
				}
				else
				{
					num = 0;
				}
				if (((uint)num & (flag ? 1u : 0u)) != 0 && (Object)(object)PlayerController.instance != (Object)null)
				{
					PlayerController.instance.AntiGravity(0.2f);
				}
			}
		}

		private static void TeleportEnemy(HurtCollider hurtCollider, Enemy enemy)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = (Object.op_Implicit((Object)(object)enemy.CenterTransform) ? enemy.CenterTransform.position : ((Component)enemy).transform.position);
			SpawnRiftPoof(val);
			if ((Object)(object)enemy.TeleportToPoint(8f, 80f) != (Object)null)
			{
				ApplyRiftExitImpulse(hurtCollider, enemy, val);
				SpawnRiftPoof(Object.op_Implicit((Object)(object)enemy.CenterTransform) ? enemy.CenterTransform.position : ((Component)enemy).transform.position);
				return;
			}
			Vector3 val2 = FindTeleportPosition(((Component)enemy).transform.position);
			if (val2 != Vector3.zero)
			{
				enemy.EnemyTeleported(val2);
				ApplyRiftExitImpulse(hurtCollider, enemy, val);
				SpawnRiftPoof(val2);
			}
			else
			{
				enemy.TeleportToPoint(0f, 999f);
				ApplyRiftExitImpulse(hurtCollider, enemy, val);
				SpawnRiftPoof(Object.op_Implicit((Object)(object)enemy.CenterTransform) ? enemy.CenterTransform.position : ((Component)enemy).transform.position);
			}
		}

		private static void TeleportRiftEnemy(HurtCollider hurtCollider, Enemy enemy)
		{
			int key = (((Object)enemy).GetInstanceID() * 397) ^ 5;
			if (!HitCooldowns.TryGetValue(key, out var value) || !(Time.time < value))
			{
				HitCooldowns[key] = Time.time + Mathf.Max(0.35f, hurtCollider.enemyDamageCooldown);
				DamageEnemy(hurtCollider, enemy, 95);
				TeleportEnemy(hurtCollider, enemy);
			}
		}

		private static void TeleportRiftEnemyFallback(HurtCollider hurtCollider, Enemy enemy)
		{
			int key = (((Object)enemy).GetInstanceID() * 397) ^ 5;
			if (!HitCooldowns.TryGetValue(key, out var value) || !(Time.time < value))
			{
				HitCooldowns[key] = Time.time + Mathf.Max(0.35f, hurtCollider.enemyDamageCooldown);
				DamageEnemy(hurtCollider, enemy, 95);
				TeleportEnemy(hurtCollider, enemy);
			}
		}

		private static void DamageEnemy(HurtCollider hurtCollider, Enemy enemy, int minimumDamage = 0)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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)
			int num = Mathf.Max(hurtCollider.enemyDamage, minimumDamage);
			if (num <= 0)
			{
				return;
			}
			object value = EnemyHasHealthField.GetValue(enemy);
			if (!(value is bool) || !(bool)value)
			{
				return;
			}
			object? value2 = EnemyHealthField.GetValue(enemy);
			EnemyHealth val = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null);
			if (val != null && !((Object)(object)val == (Object)null))
			{
				Vector3 val2 = ((Component)enemy).transform.position - ((Component)hurtCollider).transform.position;
				Vector3 val3 = ((Vector3)(ref val2)).normalized;
				if (((Vector3)(ref val3)).sqrMagnitude < 0.01f)
				{
					val3 = ((Component)hurtCollider).transform.forward;
				}
				val.Hurt(num, val3);
			}
		}

		private static void TeleportPlayer(PlayerAvatar player)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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)
			//IL_0012: 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_002a: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0092: 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_00ef: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = FindTeleportPosition(((Component)player).transform.position);
			if (!(val == Vector3.zero))
			{
				Quaternion rotation = ((Component)player).transform.rotation;
				object? value = PlayerTumbleField.GetValue(player);
				PlayerTumble val2 = (PlayerTumble)((value is PlayerTumble) ? value : null);
				PhysGrabObject val3 = (PhysGrabObject)(((Object)(object)val2 != (Object)null) ? /*isinst with value type is only supported in some contexts*/: null);
				if ((Object)(object)val3 != (Object)null)
				{
					val3.Teleport(val, rotation);
				}
				SpawnRiftPoof(((Component)player).transform.position);
				((Component)player).transform.position = val;
				PlayerClientPositionCurrentField?.SetValue(player, val);
				PlayerClientPositionField?.SetValue(player, val);
				if ((Object)(object)player.playerAvatarVisuals != (Object)null)
				{
					((Component)player.playerAvatarVisuals).transform.position = val;
					PlayerVisualPositionField?.SetValue(player.playerAvatarVisuals, val);
				}
				SpawnRiftPoof(val);
			}
		}

		private static void SpawnRiftPoof(Vector3 position)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//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_0080: 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_008b: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			Color val = default(Color);
			((Color)(ref val))..ctor(0.72f, 0.05f, 1f);
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.28f, 0.05f, 0.75f);
			SpawnSaberFlash(position + Vector3.up * 0.35f, val, 1.35f, 0.34f, 0.95f);
			SpawnSaberFlash(position + Vector3.up * 0.45f, val2, 0.85f, 0.26f, 0.45f);
			SpawnRiftSmoke(position + Vector3.up * 0.35f, val, val2);
		}

		private static void SpawnVolatileExplosionVfx(Vector3 position)
		{
			//IL_0042: 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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_005a: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			Color orange = default(Color);
			((Color)(ref orange))..ctor(1f, 0.32f, 0.02f);
			Color yellow = default(Color);
			((Color)(ref yellow))..ctor(1f, 0.88f, 0.12f);
			Color ember = default(Color);
			((Color)(ref ember))..ctor(1f, 0.12f, 0.02f);
			SpawnVolatileChainBurst(position, Vector3.zero, 0f, 1.35f, orange, yellow, ember);
			SpawnVolatileChainBurst(position, new Vector3(1.15f, 0f, 0.35f), 0.08f, 0.95f, orange, yellow, ember);
			SpawnVolatileChainBurst(position, new Vector3(-0.9f, 0f, 0.85f), 0.16f, 1.05f, orange, yellow, ember);
			SpawnVolatileChainBurst(position, new Vector3(0.45f, 0f, -1.2f), 0.24f, 0.85f, orange, yellow, ember);
		}

		private static void SpawnVolatileChainBurst(Vector3 origin, Vector3 offset, float delay, float scale, Color orange, Color yellow, Color ember)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_0027: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("RepoWeaponLab Volatile Chain Burst");
			val.transform.position = origin + offset;
			val.AddComponent<VolatileChainBurstVfx>().Initialize(delay, scale, orange, yellow, ember);
		}

		internal static void SpawnVolatileBurst(Vector3 position, float scale, Color startColor, Color endColor)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00b4: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("RepoWeaponLab Volatile Burst");
			val.transform.position = position;
			ParticleSystem val2 = val.AddComponent<ParticleSystem>();
			MainModule main = val2.main;
			((MainModule)(ref main)).duration = 0.52f;
			((MainModule)(ref main)).loop = false;
			((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.28f * scale, 0.68f * scale);
			((MainModule)(ref main)).startSpeed = new MinMaxCurve(3.2f * scale, 7.8f * scale);
			((MainModule)(ref main)).startSize = new MinMaxCurve(0.08f * scale, 0.34f * scale);
			((MainModule)(ref main)).startColor = new MinMaxGradient(startColor, endColor);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0.25f);
			EmissionModule emission = val2.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1]
			{
				new Burst(0f, (short)Mathf.RoundToInt(82f * scale))
			});
			ShapeModule shape = val2.shape;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0;
			((ShapeModule)(ref shape)).radius = 0.28f * scale;
			ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val3 = new Gradient();
			val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[3]
			{
				new GradientColorKey(endColor, 0f),
				new GradientColorKey(startColor, 0.45f),
				new GradientColorKey(new Color(0.35f, 0.05f, 0f), 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
			{
				new GradientAlphaKey(1f, 0f),
				new GradientAlphaKey(0.75f, 0.35f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3);
			ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>();
			((Renderer)component).material = CreateFlashMaterial(endColor);
			component.renderMode = (ParticleSystemRenderMode)0;
			((Renderer)component).sortingOrder = 30;
			Object.Destroy((Object)(object)val, 1.35f * scale);
		}

		internal static void SpawnVolatileSmokePlume(Vector3 position, float scale)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Expected O, but got Unknown
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("RepoWeaponLab Volatile Smoke Plume");
			val.transform.position = position;
			ParticleSystem val2 = val.AddComponent<ParticleSystem>();
			MainModule main = val2.main;
			((MainModule)(ref main)).duration = 0.95f;
			((MainModule)(ref main)).loop = false;
			((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.85f * scale, 1.45f * scale);
			((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.75f * scale, 1.85f * scale);
			((MainModule)(ref main)).startSize = new MinMaxCurve(0.34f * scale, 0.95f * scale);
			((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.18f, 0.16f, 0.14f, 0.82f), new Color(0.55f, 0.5f, 0.43f, 0.62f));
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.08f);
			EmissionModule emission = val2.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1]
			{
				new Burst(0f, (short)Mathf.RoundToInt(42f * scale))
			});
			ShapeModule shape = val2.shape;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4;
			((ShapeModule)(ref shape)).angle = 18f;
			((ShapeModule)(ref shape)).radius = 0.18f * scale;
			((ShapeModule)(ref shape)).position = Vector3.up * 0.12f * scale;
			VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(1.2f * scale, 3.1f * scale);
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).radial = new MinMaxCurve(0.08f * scale, 0.55f * scale);
			SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime;
			((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true;
			((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3]
			{
				new Keyframe(0f, 0.35f),
				new Keyframe(0.35f, 1.45f),
				new Keyframe(1f, 2.25f)
			}));
			ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val3 = new Gradient();
			val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[3]
			{
				new GradientColorKey(new Color(0.28f, 0.24f, 0.2f), 0f),
				new GradientColorKey(new Color(0.5f, 0.46f, 0.4f), 0.45f),
				new GradientColorKey(new Color(0.12f, 0.11f, 0.1f), 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
			{
				new GradientAlphaKey(0.78f, 0f),
				new GradientAlphaKey(0.55f, 0.45f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3);
			ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>();
			((Renderer)component).material = CreateFlashMaterial(new Color(0.42f, 0.38f, 0.32f, 0.62f));
			component.renderMode = (ParticleSystemRenderMode)0;
			((Renderer)component).sortingOrder = 18;
			Object.Destroy((Object)(object)val, 2.2f * scale);
		}

		private static void ApplyRiftExitImpulse(HurtCollider hurtCollider, Enemy enemy, Vector3 origin)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			object value = EnemyHasRigidbodyField.GetValue(enemy);
			if (!(value is bool) || !(bool)value)
			{
				return;
			}
			object? value2 = EnemyRigidbodyField.GetValue(enemy);
			EnemyRigidbody val = (EnemyRigidbody)((value2 is EnemyRigidbody) ? value2 : null);
			if (val == null || (Object)(object)val == (Object)null)
			{
				return;
			}
			object? value3 = EnemyRbField.GetValue(val);
			Rigidbody val2 = (Rigidbody)((value3 is Rigidbody) ? value3 : null);
			if (!((Object)(object)val2 == (Object)null))
			{
				Vector3 val3 = ((Component)enemy).transform.position - origin;
				Vector3 val4 = ((Vector3)(ref val3)).normalized;
				if (((Vector3)(ref val4)).sqrMagnitude < 0.01f)
				{
					val4 = ((Component)hurtCollider).transform.forward;
				}
				val.DisableFollowPosition(0.45f, 4f);
				val.DisableFollowRotation(0.45f, 4f);
				val3 = val4 + Vector3.up * 0.8f;
				val2.AddForce(((Vector3)(ref val3)).normalized * 10f, (ForceMode)1);
			}
		}

		private static void SpawnRiftSmoke(Vector3 position, Color startColor, Color endColor)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: 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_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			//IL_0134: 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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("RepoWeaponLab Rift Smoke");
			val.transform.position = position;
			ParticleSystem val2 = val.AddComponent<ParticleSystem>();
			MainModule main = val2.main;
			((MainModule)(ref main)).duration = 0.55f;
			((MainModule)(ref main)).loop = false;
			((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.32f, 0.7f);
			((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.7f, 2.1f);
			((MainModule)(ref main)).startSize = new MinMaxCurve(0.18f, 0.55f);
			((MainModule)(ref main)).startColor = new MinMaxGradient(startColor, endColor);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			EmissionModule emission = val2.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1]
			{
				new Burst(0f, (short)34)
			});
			ShapeModule shape = val2.shape;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0;
			((ShapeModule)(ref shape)).radius = 0.22f;
			VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(0.55f, 1.45f);
			ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val3 = new Gradient();
			val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(startColor, 0f),
				new GradientColorKey(endColor, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
			{
				new GradientAlphaKey(0.85f, 0f),
				new GradientAlphaKey(0.35f, 0.45f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3);
			ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>();
			((Renderer)component).material = CreateFlashMaterial(startColor);
			component.renderMode = (ParticleSystemRenderMode)0;
			((Renderer)component).sortingOrder = 20;
			Object.Destroy((Object)(object)val, 1.2f);
		}

		internal static void SpawnSaberFlash(Vector3 position, Color color, float radius, float duration, float lightIntensity)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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)
			GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0);
			((Object)obj).name = "RepoWeaponLab Saber Flash";
			obj.transform.position = position;
			obj.transform.localScale = Vector3.one * 0.08f;
			Collider component = obj.GetComponent<Collider>();
			if ((Object)(object)component != (Object)null)
			{
				Object.Destroy((Object)(object)component);
			}
			Renderer component2 = obj.GetComponent<Renderer>();
			if ((Object)(object)component2 != (Object)null)
			{
				component2.material = CreateFlashMaterial(color);
			}
			Light obj2 = obj.AddComponent<Light>();
			obj2.type = (LightType)2;
			obj2.color = color;
			obj2.range = radius * 2.6f;
			obj2.intensity = lightIntensity;
			obj.AddComponent<SaberFlashVfx>().Initialize(radius, duration, lightIntensity);
		}

		private static Material CreateFlashMaterial(Color color)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			Material val = new Material(Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color") ?? Shader.Find("Standard"));
			val.color = new Color(color.r, color.g, color.b, 0.62f);
			val.SetColor("_Color", val.color);
			return val;
		}

		private static Vector3 FindTeleportPosition(Vector3 origin)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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)
			Vector3 val = SemiFunc.EnemyRoamFindPoint(origin);
			if (val != Vector3.zero)
			{
				return val + Vector3.up * 0.2f;
			}
			LevelPoint val2 = SemiFunc.LevelPointGet(origin, 0f, 999f);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return Vector3.zero;
			}
			return ((Component)val2).transform.position + Vector3.up * 0.2f;
		}
	}
	internal sealed class SaberFlashVfx : MonoBehaviour
	{
		private float radius;

		private float duration;

		private float lightIntensity;

		private float age;

		private Renderer? rendererComponent;

		private Light? lightComponent;

		internal void Initialize(float radius, float duration, float lightIntensity)
		{
			this.radius = Mathf.Max(0.1f, radius);
			this.duration = Mathf.Max(0.05f, duration);
			this.lightIntensity = Mathf.Max(0f, lightIntensity);
			rendererComponent = ((Component)this).GetComponent<Renderer>();
			lightComponent = ((Component)this).GetComponent<Light>();
		}

		private void Update()
		{
			//IL_0049: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			age += Time.deltaTime;
			float num = Mathf.Clamp01(age / duration);
			float num2 = 1f - (1f - num) * (1f - num);
			float num3 = 1f - num;
			((Component)this).transform.localScale = Vector3.one * Mathf.Lerp(0.08f, radius, num2);
			if ((Object)(object)rendererComponent != (Object)null)
			{
				Color color = rendererComponent.material.color;
				color.a = num3 * 0.62f;
				rendererComponent.material.color = color;
			}
			if ((Object)(object)lightComponent != (Object)null)
			{
				lightComponent.intensity = lightIntensity * num3;
			}
			if (age >= duration)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	internal sealed class VolatileChainBurstVfx : MonoBehaviour
	{
		private float delay;

		private float scale;

		private float age;

		private Color orange;

		private Color yellow;

		private Color ember;

		private bool spawned;

		internal void Initialize(float delay, float scale, Color orange, Color yellow, Color ember)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			this.delay = Mathf.Max(0f, delay);
			this.scale = Mathf.Max(0.1f, scale);
			this.orange = orange;
			this.yellow = yellow;
			this.ember = ember;
		}

		private void Update()
		{
			//IL_0042: 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_0049: 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_0071: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: 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)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			if (spawned)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			age += Time.deltaTime;
			if (!(age < delay))
			{
				spawned = true;
				Vector3 position = ((Component)this).transform.position;
				LightsaberAbilities.SpawnSaberFlash(position, orange, 3.9f * scale, 0.52f, 3.4f * scale);
				LightsaberAbilities.SpawnSaberFlash(position + Vector3.up * 0.16f * scale, yellow, 2.35f * scale, 0.34f, 2.35f * scale);
				LightsaberAbilities.SpawnSaberFlash(position + Vector3.up * 0.38f * scale, ember, 1.45f * scale, 0.42f, 1.2f * scale);
				LightsaberAbilities.SpawnVolatileBurst(position + Vector3.up * 0.25f * scale, scale, orange, yellow);
				LightsaberAbilities.SpawnVolatileSmokePlume(position + Vector3.up * 0.08f * scale, scale);
			}
		}
	}
	internal sealed class FloppyBladeState
	{
		private readonly struct BladeAnchor
		{
			internal Vector3 Position { get; }

			internal int Index { get; }

			internal string Name { get; }

			internal BladeAnchor(Vector3 position, int index, string name)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				Position = position;
				Index = index;
				Name = name;
			}
		}

		private const int SegmentCount = 14;

		private const int RenderSamplesPerSegment = 4;

		private readonly LineRenderer renderer;

		private readonly Vector3[] restPositions;

		private readonly Vector3[] positions;

		private readonly Vector3[] velocities;

		private readonly Vector3[] renderPositions;

		private readonly float segmentLength;

		private readonly Transform? hurtRotation;

		private readonly Quaternion hurtRotationOriginal;

		private readonly Vector3 hurtPositionOriginal;

		private Vector3 previousRootPosition;

		private Vector3 previousLocalVelocity;

		private Vector3 previousBend;

		private bool hasPreviousRootPosition;

		internal bool IsValid => (Object)(object)renderer != (Object)null;

		private FloppyBladeState(LineRenderer renderer, Vector3[] restPositions, Transform? hurtRotation)
		{
			//IL_0054: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			this.renderer = renderer;
			this.restPositions = restPositions;
			positions = (Vector3[])(object)new Vector3[restPositions.Length];
			velocities = (Vector3[])(object)new Vector3[restPositions.Length];
			renderPositions = (Vector3[])(object)new Vector3[(restPositions.Length - 1) * 4 + 1];
			restPositions.CopyTo(positions, 0);
			segmentLength = Vector3.Distance(restPositions[0], restPositions[^1]) / (float)Mathf.Max(1, restPositions.Length - 1);
			this.hurtRotation = hurtRotation;
			if ((Object)(object)hurtRotation != (Object)null)
			{
				hurtRotationOriginal = hurtRotation.localRotation;
				hurtPositionOriginal = hurtRotation.localPosition;
			}
		}

		internal static FloppyBladeState Create(Transform root)
		{
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: 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_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: 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_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: 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)
			List<BladeAnchor> list = new List<BladeAnchor>();
			Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren<Transform>(true);
			foreach (Transform val in componentsInChildren)
			{
				string text = ((Object)val).name.ToLowerInvariant();
				if (text.Contains("stun_blade"))
				{
					DisableRenderers(val);
					int num = ParseBladeIndex(text);
					if (num >= 0 && !text.Contains("joint") && !text.Contains("reference"))
					{
						list.Add(new BladeAnchor(root.InverseTransformPoint(val.position), num, ((Object)val).name));
					}
				}
			}
			list.Sort(delegate(BladeAnchor left, BladeAnchor right)
			{
				int num3 = left.Index.CompareTo(right.Index);
				return (num3 != 0) ? num3 : string.CompareOrdinal(left.Name, right.Name);
			});
			Vector3 val2 = (Vector3)((list.Count > 0) ? list[0].Position : new Vector3(0f, 0f, 0.15f));
			Vector3 val3;
			if (list.Count <= 1)
			{
				val3 = val2 + Vector3.forward * 1.45f;
			}
			else
			{
				val3 = list[list.Count - 1].Position;
			}
			Vector3 val4 = val3;
			if (Vector3.Distance(val2, val4) < 0.35f)
			{
				val4 = val2 + Vector3.forward * 1.45f;
			}
			Vector3 val5 = val4 - val2;
			Vector3 normalized = ((Vector3)(ref val5)).normalized;
			val2 -= normalized * 0.18f;
			Vector3[] array = (Vector3[])(object)new Vector3[14];
			for (int j = 0; j < array.Length; j++)
			{
				float num2 = (float)j / (float)(array.Length - 1);
				array[j] = Vector3.Lerp(val2, val4, num2);
			}
			LineRenderer obj = CreateRenderer(root);
			obj.positionCount = (array.Length - 1) * 4 + 1;
			FloppyBladeState floppyBladeState = new FloppyBladeState(obj, array, FindChild(root, "Hurt Collider Rotation"));
			floppyBladeState.UpdateRenderer();
			return floppyBladeState;
		}

		internal void Update(PhysGrabObject physGrabObject, float impactPulse)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00aa: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_00e3: 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_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: 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)
			//IL_01b4: 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_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: 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_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: 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_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0547: Unknown result type (might be due to invalid IL or missing references)
			//IL_0557: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			bool flag = physGrabObject.playerGrabbing != null && physGrabObject.playerGrabbing.Count > 0;
			if ((Object)(object)physGrabObject.rb != (Object)null)
			{
				Vector3 velocity = physGrabObject.rb.velocity;
				_ = ((Vector3)(ref velocity)).magnitude;
			}
			if (!hasPreviousRootPosition)
			{
				previousRootPosition = ((Component)physGrabObject).transform.position;
				hasPreviousRootPosition = true;
			}
			Vector3 val = ((Component)physGrabObject).transform.position - previousRootPosition;
			previousRootPosition = ((Component)physGrabObject).transform.position;
			float num = Mathf.Max(Time.deltaTime, 0.001f);
			Vector3 val2 = ((Component)physGrabObject).transform.InverseTransformDirection(val / num);
			Vector3 val3 = (val2 - previousLocalVelocity) / num;
			previousLocalVelocity = Vector3.Lerp(previousLocalVelocity, val2, num * 10f);
			Vector3 val4 = (((Object)(object)physGrabObject.rb != (Object)null) ? ((Component)physGrabObject).transform.InverseTransformDirection(physGrabObject.rb.angularVelocity) : Vector3.zero);
			float num2 = Mathf.Clamp01(((Vector3)(ref val2)).magnitude * 0.18f + ((Vector3)(ref val4)).magnitude * 0.14f + ((Vector3)(ref val3)).magnitude * 0.0025f + impactPulse);
			Vector3 val5 = default(Vector3);
			((Vector3)(ref val5))..ctor(Mathf.Clamp((0f - val3.x) * 0.0045f + (0f - val2.x) * 0.22f + (0f - val4.y) * 0.18f, -0.48f, 0.48f), Mathf.Clamp((0f - Mathf.Abs(((Vector3)(ref val2)).magnitude)) * 0.035f + (0f - Mathf.Abs(val4.x)) * 0.025f, -0.26f, 0.02f), Mathf.Clamp((0f - val3.z) * 0.0025f + (0f - val2.z) * 0.11f + val4.x * 0.14f, -0.42f, 0.42f));
			if (!flag)
			{
				val5 *= 0.35f;
			}
			previousBend = Vector3.Lerp(previousBend, val5, num * Mathf.Lerp(4f, 14f, num2));
			positions[0] = restPositions[0];
			velocities[0] = Vector3.zero;
			for (int i = 1; i < positions.Length; i++)
			{
				float num3 = (float)i / (float)(positions.Length - 1);
				float num4 = num3 * num3;
				float num5 = (flag ? 0.045f : 0.075f) * num4;
				float num6 = impactPulse * Mathf.Sin(num3 * MathF.PI) * 0.24f;
				Vector3 val6 = (restPositions[i] + new Vector3(previousBend.x * num4 + num6 * 0.45f, 0f - num5 + previousBend.y * num4 - impactPulse * 0.05f * num4, previousBend.z * num4 - num6 * num4) - positions[i]) * Mathf.Lerp(42f, 95f, num2);
				ref Vector3 reference = ref velocities[i];
				reference += val6 * num;
				ref Vector3 reference2 = ref velocities[i];
				reference2 *= Mathf.Exp((0f - Mathf.Lerp(7.5f, 3.2f, num2)) * num);
				ref Vector3 reference3 = ref positions[i];
				reference3 += velocities[i] * num;
			}
			for (int j = 0; j < 3; j++)
			{
				positions[0] = restPositions[0];
				for (int k = 1; k < positions.Length; k++)
				{
					Vector3 val7 = positions[k] - positions[k - 1];
					if (((Vector3)(ref val7)).sqrMagnitude < 0.0001f)
					{
						val7 = restPositions[k] - restPositions[k - 1];
					}
					positions[k] = positions[k - 1] + ((Vector3)(ref val7)).normalized * segmentLength;
				}
			}
			SmoothSharpBends();
			UpdateRenderer();
			if ((Object)(object)hurtRotation != (Object)null)
			{
				Vector3 val8 = positions[^1] - restPositions[^1];
				hurtRotation.localRotation = Quaternion.Slerp(hurtRotation.localRotation, hurtRotationOriginal * Quaternion.Euler(Mathf.Clamp((0f - val8.y) * 22f - impactPulse * 9f, -16f, 16f), Mathf.Clamp(val8.x * 20f, -14f, 14f), Mathf.Clamp(val8.z * 10f, -8f, 8f)), Time.deltaTime * 12f);
				hurtRotation.localPosition = Vector3.Lerp(hurtRotation.localPosition, hurtPositionOriginal + new Vector3(val8.x * 0.08f, -0.03f - impactPulse * 0.025f, val8.z * 0.08f), Time.deltaTime * 12f);
			}
		}

		private void SmoothSharpBends()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: 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_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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 1; i < positions.Length - 1; i++)
			{
				float num = (float)i / (float)(positions.Length - 1);
				float num2 = Mathf.Lerp(0.08f, 0.22f, num);
				Vector3 val = (positions[i - 1] + positions[i + 1]) * 0.5f;
				positions[i] = Vector3.Lerp(positions[i], val, num2);
			}
			positions[0] = restPositions[0];
		}

		private void UpdateRenderer()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			//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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			for (int i = 0; i < positions.Length - 1; i++)
			{
				Vector3 p = positions[Mathf.Max(i - 1, 0)];
				Vector3 p2 = positions[i];
				Vector3 p3 = positions[i + 1];
				Vector3 p4 = positions[Mathf.Min(i + 2, positions.Length - 1)];
				for (int j = 0; j < 4; j++)
				{
					float t = (float)j / 4f;
					renderPositions[num++] = CatmullRom(p, p2, p3, p4, t);
				}
			}
			renderPositions[renderPositions.Length - 1] = positions[^1];
			renderer.SetPositions(renderPositions);
		}

		private static Vector3 CatmullRom(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_0043: 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)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_005e: 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_0065: 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_006f: 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_007a: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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)
			float num = t * t;
			float num2 = num * t;
			return 0.5f * (2f * p1 + (-p0 + p2) * t + (2f * p0 - 5f * p1 + 4f * p2 - p3) * num + (-p0 + 3f * p1 - 3f * p2 + p3) * num2);
		}

		private static LineRenderer CreateRenderer(Transform root)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_005b: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or mi