Decompiled source of VanillaVoid v1.5.13

vanillaVoid.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.DeepVoidPortalBattery;
using EntityStates.Mage.Weapon;
using HarmonyLib;
using IL.EntityStates.DeepVoidPortalBattery;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Mage.Weapon;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Skills;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.ExpansionManagement;
using RoR2.Hologram;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using vanillaVoid.Equipment;
using vanillaVoid.Interactables;
using vanillaVoid.Items;
using vanillaVoid.Misc;
using vanillaVoid.Utils;
using vanillaVoid.Utils.Components;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("vanillaVoid")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("vanillaVoid")]
[assembly: AssemblyTitle("vanillaVoid")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace vanillaVoid
{
	[BepInPlugin("com.Zenithrium.vanillaVoid", "vanillaVoid", "1.5.13")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class vanillaVoidPlugin : BaseUnityPlugin
	{
		public class ExeToken : MonoBehaviour
		{
		}

		public class LotusBodyToken : MonoBehaviour
		{
			public CharacterBody body;

			public TemporaryOverlay overlay;

			public float coeff;

			public Material material;

			public Material matInstance;

			public float duration;

			public void Begin()
			{
				//IL_0017: 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)
				Texture val = MainAssets.LoadAsset<Texture>("texRampIce4.png");
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/matSlow80Debuff.mat").WaitForCompletion();
				matInstance = Object.Instantiate<Material>(material);
				matInstance.SetFloat("_Boost", matInstance.GetFloat("_Boost") - coeff * 2f);
				matInstance.SetTexture("_RemapTex", val);
				overlay = ((Component)body.modelLocator.modelTransform).gameObject.AddComponent<TemporaryOverlay>();
				overlay.duration = duration;
				overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0.5f);
				overlay.animateShaderAlpha = true;
				overlay.destroyComponentOnEnd = true;
				overlay.originalMaterial = matInstance;
				overlay.AddToCharacerModel(((Component)body.modelLocator.modelTransform).GetComponent<CharacterModel>());
			}

			public void End()
			{
				overlay.RemoveFromCharacterModel();
			}

			private void FixedUpdate()
			{
				matInstance.SetFloat("_Boost", 1f - coeff);
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_GetLocalizedStringByToken <>9__45_0;

			public static Func<Type, bool> <>9__45_1;

			public static Func<Type, bool> <>9__45_2;

			public static Func<Type, bool> <>9__45_3;

			internal string <Awake>b__45_0(orig_GetLocalizedStringByToken orig, Language self, string token)
			{
				//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_0024: Invalid comparison between Unknown and I4
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				if (ItemBase.TokenToVoidPair.ContainsKey(token))
				{
					ItemIndex val = ItemCatalog.FindItemIndex(ItemBase.TokenToVoidPair[token]);
					if ((int)val != -1)
					{
						return orig.Invoke(self, token).Replace("{CORRUPTION}", MiscUtils.GetPlural(orig.Invoke(self, ItemCatalog.GetItemDef(val).nameToken)));
					}
				}
				return orig.Invoke(self, token);
			}

			internal bool <Awake>b__45_1(Type type)
			{
				return !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase));
			}

			internal bool <Awake>b__45_2(Type type)
			{
				return !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase));
			}

			internal bool <Awake>b__45_3(Type type)
			{
				return !type.IsAbstract && type.IsSubclassOf(typeof(InteractableBase));
			}
		}

		public const string ModGuid = "com.Zenithrium.vanillaVoid";

		public const string ModName = "vanillaVoid";

		public const string ModVer = "1.5.13";

		public static ExpansionDef sotvDLC;

		public static ExpansionDef sotvDLC2;

		public static AssetBundle MainAssets;

		public List<ItemBase> Items = new List<ItemBase>();

		public List<EquipmentBase> Equipments = new List<EquipmentBase>();

		public List<InteractableBase> Interactables = new List<InteractableBase>();

		public static ManualLogSource ModLogger;

		public static GameObject platformObject;

		public static GameObject portalObject;

		public static GameObject bladeObject;

		public static GameObject lotusObject;

		public static GameObject lotusPulse;

		public static GameObject lotusCollider;

		public static GameObject exhaustVFX;

		public Xoroshiro128Plus genericRng;

		public static ConfigEntry<bool> locusEarlyExit;

		public static ConfigEntry<bool> locusExit;

		public static ConfigEntry<int> LocusBonus;

		public static ConfigEntry<bool> lockVoidsBehindPair;

		public static ConfigEntry<bool> doVoidPickupBorders;

		public static ConfigEntry<bool> doVoidCommandVFX;

		public static ConfigEntry<int> LotusVariant;

		public static ConfigEntry<float> LotusDuration;

		public static ConfigEntry<float> LotusSlowPercent;

		private GameObject lotusEffect;

		private Vector3 heightAdjust = new Vector3(0f, 2.212f, 0f);

		private Vector3 heightAdjustPulse = new Vector3(0f, 2.5f, 0f);

		private float previousPulseFraction = 0f;

		private float currentCharge = 0f;

		private float secondsUntilBarrierAttempt = 0f;

		public float lotusTimer;

		private AnimationCurve speedCurve;

		private GameObject tier1Clone;

		private GameObject tier2Clone;

		private GameObject tier3Clone;

		private GameObject tier4Clone;

		private bool hasAdjustedTiers;

		private bool hasAddedCommand;

		private static readonly SphereSearch exeBladeSphereSearch = new SphereSearch();

		private static readonly List<HurtBox> exeBladeHurtBoxBuffer = new List<HurtBox>();

		private Vector3 teleporterPos;

		private GameObject tempLotusObject;

		private GameObject tempLotusCollider;

		private bool lotusSpawned = false;

		private bool isPrimoridal = false;

		private string teleporterName = "";

		public float slowCoeffValue = 1f;

		private bool voidfields = false;

		public static BuffDef lotusSlow { get; private set; }

		private void Awake()
		{
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: 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_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Expected O, but got Unknown
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Expected O, but got Unknown
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Expected O, but got Unknown
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Expected O, but got Unknown
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Expected O, but got Unknown
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Expected O, but got Unknown
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Expected O, but got Unknown
			//IL_05e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0604: Unknown result type (might be due to invalid IL or missing references)
			//IL_0609: Unknown result type (might be due to invalid IL or missing references)
			//IL_0624: Unknown result type (might be due to invalid IL or missing references)
			//IL_0629: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e2: Invalid comparison between Unknown and I4
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Unknown result type (might be due to invalid IL or missing references)
			//IL_0723: Invalid comparison between Unknown and I4
			locusExit = ((BaseUnityPlugin)this).Config.Bind<bool>("Tweaks: Void Locus", "Exit Portal", true, "If enabled, spawns a portal in the void locus letting you return to normal stages if you want to.");
			locusEarlyExit = ((BaseUnityPlugin)this).Config.Bind<bool>("Tweaks: Void Locus", "Early Exit Portal", false, "If enabled, spawns the exit portal in void locus immediately upon entering the stage. Requires the exit portal to actually be enabled.");
			LocusBonus = ((BaseUnityPlugin)this).Config.Bind<int>("Tweaks: Void Locus", "Locus Bonus Credits", 0, "If you want to make going to the void locus have a little more of a reward, increase this number. Should be increased in at least multiples of 50ish");
			lockVoidsBehindPair = ((BaseUnityPlugin)this).Config.Bind<bool>("Tweaks: Void Items", "Require Original Item Unlocked", true, "If enabled, makes it so void items are locked until the non-void pair is unlocked. Ex. Pluripotent is locked until the profile has unlocked Dios. Only applies to void items which do not already have unlocks, in the event a mod adds special unlocks for a void item.");
			doVoidPickupBorders = ((BaseUnityPlugin)this).Config.Bind<bool>("Tweaks: Void Items", "Improved Pickup Highlights", true, "If enabled, picking up a void item will show tier-appropriate item highlights rather the the default white highlights.");
			doVoidCommandVFX = ((BaseUnityPlugin)this).Config.Bind<bool>("Tweaks: Void Items", "Improved Command VFX", true, "If enabled, void command cubes will have appropriate void vfx in the style of typical command VFX based on the actual void item VFX.");
			string text = "Crystalline Lotus";
			LotusVariant = ((BaseUnityPlugin)this).Config.Bind<int>("Item: " + text, "Variant of Item", 0, "Adjust which version of " + text + " you'd prefer to use. Variant 0 releases slowing novas per pulse, which reduce enemy and projectile speed, while Variant 1 provides 50% barrier per pulse.");
			LotusDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Item: " + text, "Slow Duration", 30f, "Variant 0: Adjust how long the slow should last per pulse. A given slow is replaced by the next slow, so with enough lotuses, the full duration won't get used. However, increasing this also decreases the rate at which the slow fades.");
			LotusSlowPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Item: " + text, "Slow Percent", 0.075f, "Variant 0: Adjust the strongest slow percent (between 0 and 1). Increasing this also makes it so the slow 'feels' shorter, as high values (near 1) feel very minor. Note that this is inverted, where 0 = 100% slow and 1 = 0% slow.");
			ModLogger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
			new PatchClassProcessor(val, typeof(ModdedDamageColors)).Patch();
			sotvDLC = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion();
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("vanillaVoid.vanillavoidassets"))
			{
				MainAssets = AssetBundle.LoadFromStream(stream);
			}
			Swapallshaders(MainAssets);
			ContagiousItemManager.Init += new hook_Init(AddVoidItemsToDict);
			ItemCatalog.Init += new hook_Init(AddUnlocksToVoidItems);
			PrepWall.OnExit += new hook_OnExit(ExtExhaustIceWall);
			GenericSkill.DeductStock += new hook_DeductStock(ExtExhaustStock);
			SkillDef.OnExecute += new hook_OnExecute(ExtExecute);
			GlobalEventManager.onCharacterDeathGlobal += ExeBladeExtraDeath;
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddLotusOnPickup);
			HoldoutZoneController.UpdateHealingNovas += new hook_UpdateHealingNovas(CrystalLotusNova);
			SceneDirector.PlaceTeleporter += new hook_PlaceTeleporter(PrimoridalTeleporterCheck);
			Stage.onServerStageBegin += AddLocusStuff;
			VoidStageMissionController.OnBatteryActivated += new hook_OnBatteryActivated(SpawnLocusPortal);
			SceneDirector.onPrePopulateSceneServer += LocusDirectorHelp;
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(LotusSlowStatsHook);
			CharacterBody.FixedUpdate += new hook_FixedUpdate(LastTry);
			object obj = <>c.<>9__45_0;
			if (obj == null)
			{
				hook_GetLocalizedStringByToken val2 = delegate(orig_GetLocalizedStringByToken orig, Language self, string token)
				{
					//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_0024: Invalid comparison between Unknown and I4
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					if (ItemBase.TokenToVoidPair.ContainsKey(token))
					{
						ItemIndex val11 = ItemCatalog.FindItemIndex(ItemBase.TokenToVoidPair[token]);
						if ((int)val11 != -1)
						{
							return orig.Invoke(self, token).Replace("{CORRUPTION}", MiscUtils.GetPlural(orig.Invoke(self, ItemCatalog.GetItemDef(val11).nameToken)));
						}
					}
					return orig.Invoke(self, token);
				};
				<>c.<>9__45_0 = val2;
				obj = (object)val2;
			}
			Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj;
			bladeObject = MainAssets.LoadAsset<GameObject>("mdlBladeWorldObject.prefab");
			bladeObject.AddComponent<TeamFilter>();
			bladeObject.AddComponent<HealthComponent>();
			bladeObject.AddComponent<NetworkIdentity>();
			bladeObject.AddComponent<BoxCollider>();
			bladeObject.AddComponent<Rigidbody>();
			lotusObject = MainAssets.LoadAsset<GameObject>("mdlLotusWorldObject2.prefab");
			lotusObject.AddComponent<TeamFilter>();
			lotusObject.AddComponent<NetworkIdentity>();
			lotusCollider = MainAssets.LoadAsset<GameObject>("LotusTeleporterCollider.prefab");
			lotusCollider.AddComponent<TeamFilter>();
			lotusCollider.AddComponent<NetworkIdentity>();
			lotusCollider.AddComponent<BuffWard>();
			lotusCollider.AddComponent<SlowDownProjectiles>();
			exhaustVFX = MainAssets.LoadAsset<GameObject>("ExhaustVFX.prefab");
			EffectComponent val3 = exhaustVFX.AddComponent<EffectComponent>();
			val3.applyScale = true;
			VFXAttributes val4 = exhaustVFX.AddComponent<VFXAttributes>();
			val4.vfxIntensity = (VFXIntensity)0;
			val4.vfxPriority = (VFXPriority)0;
			DestroyOnTimer val5 = exhaustVFX.AddComponent<DestroyOnTimer>();
			val5.duration = 5f;
			ContentAddition.AddEffect(exhaustVFX);
			platformObject = MainAssets.LoadAsset<GameObject>("mdlPlatformSeparate.prefab");
			platformObject.AddComponent<NetworkIdentity>();
			SurfaceDefProvider val6 = platformObject.AddComponent<SurfaceDefProvider>();
			val6.surfaceDef = Addressables.LoadAssetAsync<SurfaceDef>((object)"RoR2/Base/Common/sdMetal.asset").WaitForCompletion();
			string text2 = "RoR2/DLC1/Common/matVoidmetalTrim.mat";
			MeshRenderer component = ((Component)platformObject.transform.Find("platformlower")).GetComponent<MeshRenderer>();
			MeshRenderer component2 = ((Component)platformObject.transform.Find("platformupper")).GetComponent<MeshRenderer>();
			((Renderer)component).material = Addressables.LoadAssetAsync<Material>((object)text2).WaitForCompletion();
			((Renderer)component2).material = Addressables.LoadAssetAsync<Material>((object)text2).WaitForCompletion();
			GameObject val7 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/PortalArena/PortalArena.prefab").WaitForCompletion();
			portalObject = PrefabAPI.InstantiateClone(val7, "LocusVoidPortal");
			Light componentInChildren = portalObject.GetComponentInChildren<Light>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				((Behaviour)componentInChildren).enabled = false;
			}
			PrefabAPI.RegisterNetworkPrefab(bladeObject);
			PrefabAPI.RegisterNetworkPrefab(lotusObject);
			PrefabAPI.RegisterNetworkPrefab(platformObject);
			string text3 = "RoR2/DLC1/VoidRaidCrab/VoidRaidCrabDeathPending.prefab";
			GameObject val8 = Addressables.LoadAssetAsync<GameObject>((object)text3).WaitForCompletion();
			lotusEffect = PrefabAPI.InstantiateClone(val8, "lotusEffect");
			lotusEffect.AddComponent<NetworkIdentity>();
			EffectComponent component3 = lotusEffect.GetComponent<EffectComponent>();
			if (Object.op_Implicit((Object)(object)component3))
			{
				component3.soundName = "";
			}
			DestroyOnTimer val9 = lotusEffect.AddComponent<DestroyOnTimer>();
			float duration = 1.15f;
			val9.duration = duration;
			ContentAddition.AddEffect(lotusEffect);
			speedCurve = new AnimationCurve();
			speedCurve.keys = (Keyframe[])(object)new Keyframe[3]
			{
				new Keyframe(0f, LotusSlowPercent.Value, 0.33f, 0.33f),
				new Keyframe(0.5f, 0.3f, 0.33f, 0.33f),
				new Keyframe(1f, 1f, 0.33f, 0.33f)
			};
			CreateLotusBuff();
			SetupVoidTierHighlights();
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type;
			List<Pair> list = new List<Pair>();
			foreach (Type item in enumerable)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item);
				if (!ValidateItem(itemBase, Items))
				{
					continue;
				}
				itemBase.Init(((BaseUnityPlugin)this).Config);
				ItemTag[] itemTags = itemBase.ItemTags;
				bool flag = true;
				bool flag2 = false;
				if ((int)itemBase.ItemDef.deprecatedTier == 5)
				{
					flag2 = true;
					flag = false;
				}
				string itemName = itemBase.ItemName;
				itemName = itemName.Replace("'", "");
				ItemTag[] array = itemTags;
				foreach (ItemTag val10 in array)
				{
					if ((int)val10 == 4)
					{
						flag2 = true;
						flag = false;
						break;
					}
				}
				if (!flag || ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + itemName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value)
				{
					itemBase.AIBlacklisted = true;
				}
			}
			IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
				select type;
			foreach (Type item2 in enumerable2)
			{
				EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item2);
				if (ValidateEquipment(equipmentBase, Equipments))
				{
					equipmentBase.Init(((BaseUnityPlugin)this).Config);
				}
			}
			IEnumerable<Type> enumerable3 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(InteractableBase))
				select type;
			foreach (Type item3 in enumerable3)
			{
				InteractableBase interactableBase = (InteractableBase)Activator.CreateInstance(item3);
				if (ValidateInteractable(interactableBase, Interactables))
				{
					interactableBase.Init(((BaseUnityPlugin)this).Config);
					ModLogger.LogInfo((object)("Interactable: " + interactableBase.InteractableName + " Initialized!"));
				}
			}
		}

		private void AddUnlocksToVoidItems(orig_Init orig)
		{
			//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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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)
			//IL_00ae: 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)
			orig.Invoke();
			if (!lockVoidsBehindPair.Value)
			{
				return;
			}
			Pair[] array = ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem];
			foreach (Pair val in array)
			{
				if ((Object)(object)val.itemDef1.unlockableDef != (Object)null && (Object)(object)val.itemDef2.unlockableDef == (Object)null)
				{
					Debug.Log((object)("Updating unlock condition for " + val.itemDef2.nameToken + " to " + val.itemDef1.nameToken + "'s."));
					val.itemDef2.unlockableDef = val.itemDef1.unlockableDef;
				}
			}
		}

		private void AddVoidItemsToDict(orig_Init orig)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			List<Pair> list = new List<Pair>();
			Debug.Log((object)"Adding VanillaVoid item transformations...");
			foreach (ItemBase item in Items)
			{
				if ((int)item.ItemDef.deprecatedTier != 5)
				{
					item.AddVoidPair(list);
				}
				else
				{
					Debug.Log((object)("Skipping " + item.ItemName));
				}
			}
			ItemRelationshipType contagiousItem = ItemRelationshipTypes.ContagiousItem;
			Debug.Log((object)contagiousItem);
			Pair[] first = ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem];
			ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = first.Union(list).ToArray();
			Debug.Log((object)"Finishing appending VanillaVoid item transformations.");
			orig.Invoke();
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			string text = item.ItemName.Replace("'", string.Empty);
			bool flag = false;
			if ((int)item.Tier == 5)
			{
				flag = true;
				item.AIBlacklisted = true;
			}
			else
			{
				flag = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + text, "Enable Item?", true, "Should this item appear in runs?").Value;
			}
			if (flag)
			{
				itemList.Add(item);
			}
			return flag;
		}

		public bool ValidateEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList)
		{
			if (((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + equipment.EquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value)
			{
				equipmentList.Add(equipment);
				return true;
			}
			return false;
		}

		public bool ValidateInteractable(InteractableBase interactable, List<InteractableBase> interactableList)
		{
			if (((BaseUnityPlugin)this).Config.Bind<bool>("Interactable: " + interactable.InteractableName, "Enable Interactable?", true, "Should this interactable appear in runs?").Value)
			{
				interactableList.Add(interactable);
				return true;
			}
			return false;
		}

		private void ExtExecute(orig_OnExecute orig, SkillDef self, GenericSkill skillSlot)
		{
			orig.Invoke(self, skillSlot);
			if (self.stockToConsume >= 1)
			{
				CharacterBody characterBody = skillSlot.characterBody;
				if (Object.op_Implicit((Object)(object)characterBody))
				{
					TryExhaust(characterBody, skillSlot);
				}
			}
		}

		private void ExtExhaustStock(orig_DeductStock orig, GenericSkill self, int count)
		{
			orig.Invoke(self, count);
			CharacterBody characterBody = self.characterBody;
			if (Object.op_Implicit((Object)(object)characterBody))
			{
				TryExhaust(characterBody, self);
			}
		}

		private void TryExhaust(CharacterBody body, GenericSkill skill)
		{
			int itemCount = body.inventory.GetItemCount(ItemBase<ExtraterrestrialExhaust>.instance.ItemDef);
			if (itemCount > 0 && skill.cooldownRemaining > 0f && skill.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME")
			{
				float baseRechargeInterval = skill.baseRechargeInterval;
				int missileCount = (int)Math.Ceiling(baseRechargeInterval / ItemBase<ExtraterrestrialExhaust>.instance.secondsPerRocket.Value);
				if (skill.skillDef.skillNameToken != "SKILL_LUNAR_PRIMARY_REPLACEMENT_NAME" && ItemBase<ExtraterrestrialExhaust>.instance.visionsNerf.Value)
				{
					missileCount = ((skill.stock % 2 != 0) ? 1 : 0);
				}
				((MonoBehaviour)this).StartCoroutine(delayedRockets(body, missileCount, itemCount));
			}
		}

		private void ExtExhaustIceWall(orig_OnExit orig, PrepWall self)
		{
			if (self.goodPlacement)
			{
				Inventory inventory = ((EntityState)self).characterBody.inventory;
				if (Object.op_Implicit((Object)(object)inventory))
				{
					int itemCount = ((EntityState)self).characterBody.inventory.GetItemCount(ItemBase<ExtraterrestrialExhaust>.instance.ItemDef);
					GenericSkill utilityBonusStockSkill = ((EntityState)self).skillLocator.utilityBonusStockSkill;
					if (itemCount > 0 && utilityBonusStockSkill.cooldownRemaining > 0f)
					{
						float baseRechargeInterval = utilityBonusStockSkill.baseRechargeInterval;
						int missileCount = (int)Math.Ceiling(baseRechargeInterval / ItemBase<ExtraterrestrialExhaust>.instance.secondsPerRocket.Value);
						((MonoBehaviour)this).StartCoroutine(delayedRockets(((EntityState)self).characterBody, missileCount, itemCount));
					}
				}
			}
			orig.Invoke(self);
		}

		private void ExtExhaustFireProjectile(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
		{
			int itemCount = self.inventory.GetItemCount(ItemBase<ExtraterrestrialExhaust>.instance.ItemDef);
			if (itemCount > 0 && skill.cooldownRemaining > 0f && skill.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME")
			{
				float baseRechargeInterval = skill.baseRechargeInterval;
				int missileCount = (int)Math.Ceiling(baseRechargeInterval / ItemBase<ExtraterrestrialExhaust>.instance.secondsPerRocket.Value);
				if (skill.skillDef.skillNameToken != "SKILL_LUNAR_PRIMARY_REPLACEMENT_NAME" && ItemBase<ExtraterrestrialExhaust>.instance.visionsNerf.Value)
				{
					missileCount = ((skill.stock % 2 != 0) ? 1 : 0);
				}
				((MonoBehaviour)this).StartCoroutine(delayedRockets(self, missileCount, itemCount));
			}
			orig.Invoke(self, skill);
		}

		private IEnumerator delayedRockets(CharacterBody player, int missileCount, int inventoryCount)
		{
			for (int i = 0; i < missileCount; i++)
			{
				yield return (object)new WaitForSeconds(0.1f);
				Vector3 Upwards = new Vector3((float)Random.Range(-10, 10), (float)(180 - Random.Range(-30, 30)), (float)Random.Range(-10, 10));
				Vector3 upTransform = new Vector3(0f, 1f, 0f);
				float rocketDamage = player.damage * ((ItemBase<ExtraterrestrialExhaust>.instance.rocketDamage.Value + ItemBase<ExtraterrestrialExhaust>.instance.rocketDamageStacking.Value * (float)(inventoryCount - 1)) / 100f);
				MissileUtils.FireMissile(player.corePosition + upTransform, player, default(ProcChainMask), (GameObject)null, rocketDamage, player.RollCrit(), ExtraterrestrialExhaust.RocketProjectile, (DamageColorIndex)3, Upwards, 10f, false);
			}
		}

		private void ExeBladeExtraDeath(DamageReport dmgReport)
		{
			//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_0104: 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_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)dmgReport.attacker) || !Object.op_Implicit((Object)(object)dmgReport.attackerBody) || !Object.op_Implicit((Object)(object)dmgReport.victim) || !Object.op_Implicit((Object)(object)dmgReport.victimBody) || !dmgReport.victimIsElite)
			{
				return;
			}
			ExeToken component = ((Component)dmgReport.victimBody).GetComponent<ExeToken>();
			if (Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			CharacterBody victimBody = dmgReport.victimBody;
			((Component)dmgReport.victimBody).gameObject.AddComponent<ExeToken>();
			CharacterBody attackerBody = dmgReport.attackerBody;
			if (Object.op_Implicit((Object)(object)attackerBody.inventory) && NetworkServer.active)
			{
				int itemCount = attackerBody.inventory.GetItemCount(ItemBase<ExeBlade>.instance.ItemDef);
				if (itemCount > 0)
				{
					Quaternion val = Quaternion.Euler(0f, 180f, 0f);
					GameObject val2 = Object.Instantiate<GameObject>(bladeObject, victimBody.corePosition, val);
					val2.GetComponent<TeamFilter>().teamIndex = attackerBody.teamComponent.teamIndex;
					val2.transform.position = victimBody.corePosition;
					NetworkServer.Spawn(val2);
					EffectData val3 = new EffectData
					{
						origin = victimBody.corePosition
					};
					val3.SetNetworkedObjectReference(val2);
					EffectManager.SpawnEffect(AssetReferences.executeEffectPrefab, val3, true);
					((MonoBehaviour)this).StartCoroutine(ExeBladeDelayedExecutions(itemCount, val2, dmgReport));
				}
			}
		}

		private IEnumerator ExeBladeDelayedExecutions(int bladeCount, GameObject bladeObject, DamageReport dmgReport)
		{
			bladeObject.AddComponent<ExeToken>();
			bladeObject.AddComponent<Rigidbody>();
			Rigidbody bladeRigid = bladeObject.GetComponent<Rigidbody>();
			BoxCollider bladeCollider = bladeObject.GetComponent<BoxCollider>();
			bladeRigid.drag = 0.5f;
			float randomHeight = Random.Range(2.45f, 2.95f);
			bladeCollider.size = new Vector3(0.1f, randomHeight, 0.1f);
			bladeRigid.constraints = (RigidbodyConstraints)122;
			float randomX = Random.Range(-20, 10);
			float randomY = Random.Range(0, 360);
			float randomZ = Random.Range(-20, 20);
			Quaternion rot = Quaternion.Euler(randomX, randomY, randomZ);
			bladeObject.transform.SetPositionAndRotation(bladeObject.transform.position, rot);
			float damage = dmgReport.damageInfo.damage;
			float cmbHP = dmgReport.victim.combinedHealth;
			HealthComponent bladeObjHPC = bladeObject.GetComponent<HealthComponent>();
			CharacterBody attackerBody = dmgReport.attackerBody;
			float effectiveRadius = ItemBase<ExeBlade>.instance.aoeRangeBaseExe.Value;
			float AOEDamageMult = ItemBase<ExeBlade>.instance.baseDamageAOEExe.Value;
			for (int i = 0; (float)i < (float)bladeCount * ItemBase<ExeBlade>.instance.additionalProcs.Value; i++)
			{
				if (!Object.op_Implicit((Object)(object)attackerBody))
				{
					continue;
				}
				yield return (object)new WaitForSeconds(ItemBase<ExeBlade>.instance.deathDelay.Value);
				DamageInfo damageInfoDeath = new DamageInfo
				{
					attacker = ((Component)attackerBody).gameObject,
					crit = attackerBody.RollCrit(),
					damage = 1f,
					position = bladeObject.transform.position,
					procCoefficient = ItemBase<ExeBlade>.instance.bladeCoefficient.Value,
					damageType = (DamageType)131072,
					damageColorIndex = (DamageColorIndex)0
				};
				DamageReport damageReport = new DamageReport(damageInfoDeath, bladeObjHPC, damage, cmbHP);
				GlobalEventManager.instance.OnCharacterDeath(damageReport);
				EffectData effectDataPulse = new EffectData
				{
					origin = bladeObject.transform.position
				};
				effectDataPulse.SetNetworkedObjectReference(bladeObject);
				if (ItemBase<ExeBlade>.instance.aoeRangeBaseExe.Value == 0f || ItemBase<ExeBlade>.instance.baseDamageAOEExe.Value == 0f)
				{
					continue;
				}
				EffectManager.SpawnEffect(AssetReferences.executeEffectPrefab, effectDataPulse, true);
				float AOEDamage = dmgReport.attackerBody.damage * AOEDamageMult;
				Vector3 corePosition = bladeObject.transform.position;
				exeBladeSphereSearch.origin = corePosition;
				exeBladeSphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
				exeBladeSphereSearch.radius = effectiveRadius;
				exeBladeSphereSearch.RefreshCandidates();
				exeBladeSphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(dmgReport.attackerBody.teamComponent.teamIndex));
				exeBladeSphereSearch.FilterCandidatesByDistinctHurtBoxEntities();
				exeBladeSphereSearch.OrderCandidatesByDistance();
				exeBladeSphereSearch.GetHurtBoxes(exeBladeHurtBoxBuffer);
				exeBladeSphereSearch.ClearCandidates();
				for (int j = 0; j < exeBladeHurtBoxBuffer.Count; j++)
				{
					HurtBox hurtBox = exeBladeHurtBoxBuffer[j];
					if (Object.op_Implicit((Object)(object)hurtBox.healthComponent) && Object.op_Implicit((Object)(object)hurtBox.healthComponent.body) && (Object)(object)hurtBox.healthComponent != (Object)(object)bladeObjHPC)
					{
						DamageInfo damageInfoAOE = new DamageInfo
						{
							attacker = ((Component)attackerBody).gameObject,
							crit = attackerBody.RollCrit(),
							damage = AOEDamage,
							position = corePosition,
							procCoefficient = ItemBase<ExeBlade>.instance.bladeCoefficient.Value,
							damageType = (DamageType)131072,
							damageColorIndex = (DamageColorIndex)3
						};
						hurtBox.healthComponent.TakeDamage(damageInfoAOE);
					}
				}
				exeBladeHurtBoxBuffer.Clear();
			}
			yield return (object)new WaitForSeconds(ItemBase<ExeBlade>.instance.additionalDuration.Value);
			EffectData effectData = new EffectData
			{
				origin = bladeObject.transform.position
			};
			effectData.SetNetworkedObjectReference(bladeObject);
			EffectManager.SpawnEffect(AssetReferences.permanentDebuffEffectPrefab, effectData, true);
			Object.Destroy((Object)(object)bladeObject);
		}

		private void PrimoridalTeleporterCheck(orig_PlaceTeleporter orig, SceneDirector self)
		{
			string baseSceneName = SceneCatalog.GetSceneDefForCurrentScene().baseSceneName;
			if (baseSceneName != "arena" && baseSceneName != "moon2" && baseSceneName != "voidstage" && baseSceneName != "voidraid" && baseSceneName != "artifactworld" && baseSceneName != "bazaar" && baseSceneName != "goldshores" && baseSceneName != "limbo" && baseSceneName != "mysteryspace" && baseSceneName != "itancientloft" && baseSceneName != "itdampcave" && baseSceneName != "itfrozenwall" && baseSceneName != "itgolemplains" && baseSceneName != "itgoolake" && baseSceneName != "itmoon" && baseSceneName != "itskymeadow")
			{
				voidfields = false;
				((MonoBehaviour)this).StartCoroutine(LotusDelayedPlacement(self));
			}
			else if (baseSceneName == "arena")
			{
				voidfields = true;
			}
			orig.Invoke(self);
		}

		private IEnumerator LotusDelayedPlacement(SceneDirector self)
		{
			yield return (object)new WaitForSeconds(4f);
			if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.teleporterSpawnCard))
			{
				yield break;
			}
			teleporterName = ((object)self.teleporterSpawnCard).ToString();
			lotusSpawned = false;
			teleporterPos = self.teleporterInstance.transform.position;
			int itemCount = 0;
			TeamIndex teamDex = (TeamIndex)0;
			foreach (PlayerCharacterMasterController player in PlayerCharacterMasterController.instances)
			{
				itemCount += player.master.inventory.GetItemCount(ItemBase<CrystalLotus>.instance.ItemDef);
				teamDex = player.master.teamIndex;
			}
			if (itemCount > 0)
			{
				teleporterPos = self.teleporterInstance.transform.position;
				if (teleporterName.Contains("iscLunarTeleporter"))
				{
					Vector3 celestialAdjust = new Vector3(0f, -0.65f, 0f);
					teleporterPos += celestialAdjust;
				}
				Quaternion rot = Quaternion.Euler(1.5266662f, 180f, 9.999999f);
				GameObject tempLotus = Object.Instantiate<GameObject>(lotusObject, teleporterPos, rot);
				tempLotus.GetComponent<TeamFilter>().teamIndex = teamDex;
				tempLotus.transform.position = teleporterPos + heightAdjust;
				NetworkServer.Spawn(tempLotus);
				tempLotusObject = tempLotus;
				lotusSpawned = true;
				EffectData effectData = new EffectData
				{
					origin = tempLotus.transform.position
				};
				effectData.SetNetworkedObjectReference(tempLotus.gameObject);
				EffectManager.SpawnEffect(AssetReferences.crowbarImpactEffectPrefab, effectData, true);
			}
			previousPulseFraction = 0f;
		}

		private void AddLotusOnEnter(SceneDirector obj)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_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_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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//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_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: 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_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Expected O, but got Unknown
			lotusSpawned = false;
			teleporterPos = obj.teleporterInstance.transform.position;
			previousPulseFraction = 0f;
			int num = 0;
			TeamIndex teamIndex = (TeamIndex)0;
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				num += instance.master.inventory.GetItemCount(ItemBase<CrystalLotus>.instance.ItemDef);
				teamIndex = instance.master.teamIndex;
			}
			if (num > 0)
			{
				teleporterPos = obj.teleporterInstance.transform.position;
				if (teleporterName.Contains("iscLunarTeleporter"))
				{
					Vector3 val = default(Vector3);
					((Vector3)(ref val))..ctor(0f, -0.65f, 0f);
					teleporterPos += val;
				}
				string baseSceneName = SceneCatalog.GetSceneDefForCurrentScene().baseSceneName;
				if (baseSceneName != "arena" && baseSceneName != "moon2" && baseSceneName != "voidstage" && baseSceneName != "voidraid" && baseSceneName != "artifactworld" && baseSceneName != "bazaar" && baseSceneName != "goldshores" && baseSceneName != "limbo" && baseSceneName != "mysteryspace" && baseSceneName != "itancientloft" && baseSceneName != "itdampcave" && baseSceneName != "itfrozenwall" && baseSceneName != "itgolemplains" && baseSceneName != "itgoolake" && baseSceneName != "itmoon" && baseSceneName != "itskymeadow")
				{
					Quaternion val2 = Quaternion.Euler(1.5266662f, 180f, 9.999999f);
					GameObject val3 = Object.Instantiate<GameObject>(lotusObject, teleporterPos, val2);
					val3.GetComponent<TeamFilter>().teamIndex = teamIndex;
					val3.transform.position = teleporterPos + heightAdjust;
					NetworkServer.Spawn(val3);
					tempLotusObject = val3;
					lotusSpawned = true;
					voidfields = false;
					EffectData val4 = new EffectData
					{
						origin = val3.transform.position
					};
					val4.SetNetworkedObjectReference(val3.gameObject);
					EffectManager.SpawnEffect(AssetReferences.crowbarImpactEffectPrefab, val4, true);
				}
				else if (baseSceneName == "arena")
				{
					voidfields = true;
				}
			}
		}

		private void AddLotusOnPickup(orig_OnInventoryChanged orig, CharacterBody self)
		{
			//IL_002b: 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_00c6: 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_00cd: 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_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: 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_0221: 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_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)self))
			{
				return;
			}
			orig.Invoke(self);
			if (lotusSpawned)
			{
				return;
			}
			int num = 0;
			TeamIndex teamIndex = (TeamIndex)0;
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				num += instance.master.inventory.GetItemCount(ItemBase<CrystalLotus>.instance.ItemDef);
				teamIndex = instance.master.teamIndex;
			}
			if (num > 0)
			{
				if (teleporterName.Contains("iscLunarTeleporter"))
				{
					Vector3 val = default(Vector3);
					((Vector3)(ref val))..ctor(0f, -0.65f, 0f);
					teleporterPos += val;
				}
				string baseSceneName = SceneCatalog.GetSceneDefForCurrentScene().baseSceneName;
				if (baseSceneName != "arena" && baseSceneName != "moon2" && baseSceneName != "voidstage" && baseSceneName != "voidraid" && baseSceneName != "artifactworld" && baseSceneName != "bazaar" && baseSceneName != "goldshores" && baseSceneName != "limbo" && baseSceneName != "mysteryspace" && baseSceneName != "itancientloft" && baseSceneName != "itdampcave" && baseSceneName != "itfrozenwall" && baseSceneName != "itgolemplains" && baseSceneName != "itgoolake" && baseSceneName != "itmoon" && baseSceneName != "itskymeadow")
				{
					Quaternion val2 = Quaternion.Euler(1.5266662f, 180f, 9.999999f);
					GameObject val3 = Object.Instantiate<GameObject>(lotusObject, teleporterPos, val2);
					val3.GetComponent<TeamFilter>().teamIndex = teamIndex;
					val3.transform.position = teleporterPos + heightAdjust;
					NetworkServer.Spawn(val3);
					tempLotusObject = val3;
					lotusSpawned = true;
					voidfields = false;
					EffectData val4 = new EffectData
					{
						origin = val3.transform.position
					};
					val4.SetNetworkedObjectReference(val3.gameObject);
					EffectManager.SpawnEffect(AssetReferences.crowbarImpactEffectPrefab, val4, true);
				}
				else if (baseSceneName == "arena")
				{
					voidfields = true;
				}
			}
		}

		private void CrystalLotusNova(orig_UpdateHealingNovas orig, HoldoutZoneController self, bool isCharging)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_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_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: 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_0128: 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_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			TeamIndex val = (TeamIndex)0;
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				num += instance.master.inventory.GetItemCount(ItemBase<CrystalLotus>.instance.ItemDef);
				val = instance.master.teamIndex;
			}
			if (slowCoeffValue < 1f)
			{
				lotusTimer += Time.fixedDeltaTime;
				slowCoeffValue = speedCurve.Evaluate(lotusTimer / LotusDuration.Value);
			}
			else
			{
				slowCoeffValue = 1f;
			}
			if (num > 0 && isCharging && NetworkServer.active && Time.fixedDeltaTime > 0f)
			{
				if (!Object.op_Implicit((Object)(object)tempLotusCollider))
				{
					Vector3 position = ((Component)self).gameObject.transform.position;
					tempLotusCollider = Object.Instantiate<GameObject>(lotusCollider, position, new Quaternion(0f, 0f, 0f, 0f));
					NetworkServer.Spawn(tempLotusCollider);
					TeamFilter component = tempLotusCollider.GetComponent<TeamFilter>();
					component.teamIndex = val;
					tempLotusCollider.layer = 12;
					TeamFilter component2 = tempLotusCollider.GetComponent<TeamFilter>();
					SlowDownProjectiles component3 = tempLotusCollider.GetComponent<SlowDownProjectiles>();
					component3.teamFilter = component2;
					BuffWard component4 = tempLotusCollider.GetComponent<BuffWard>();
					component4.radius = self.currentRadius;
					component4.buffDef = lotusSlow;
					component4.invertTeamFilter = true;
					((Behaviour)component4).enabled = false;
					component4.buffDuration = 1f;
				}
				else
				{
					Vector3 position2 = ((Component)self).gameObject.transform.position;
					tempLotusCollider.transform.position = position2;
				}
				SphereCollider component5 = tempLotusCollider.GetComponent<SphereCollider>();
				component5.radius = self.currentRadius;
				BuffWard component6 = tempLotusCollider.GetComponent<BuffWard>();
				component6.radius = self.currentRadius;
				SlowDownProjectiles component7 = tempLotusCollider.GetComponent<SlowDownProjectiles>();
				component7.slowDownCoefficient = slowCoeffValue;
				if (secondsUntilBarrierAttempt > 0f)
				{
					secondsUntilBarrierAttempt -= Time.fixedDeltaTime;
				}
				else
				{
					if (currentCharge > self.charge)
					{
						previousPulseFraction = 0f;
						currentCharge = self.charge;
					}
					if (self.charge >= 1f && LotusVariant.Value == 0 && Object.op_Implicit((Object)(object)tempLotusCollider))
					{
						((MonoBehaviour)this).StartCoroutine(SlowLotusDelayedEnd());
					}
					float num2 = CalcNextPulseFraction(num * (int)ItemBase<CrystalLotus>.instance.pulseCountStacking.Value, previousPulseFraction);
					currentCharge = self.charge;
					if (num2 <= currentCharge)
					{
						if (LotusVariant.Value == 1)
						{
							string text = "RoR2/Base/TPHealingNova/TeleporterHealNovaPulse.prefab";
							GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)text).WaitForCompletion();
							val2.GetComponent<TeamFilter>().teamIndex = val;
							NetworkServer.Spawn(val2);
							((MonoBehaviour)this).StartCoroutine(LotusDelayedBarrier(self, val));
						}
						else
						{
							((Behaviour)component6).enabled = true;
							lotusTimer = 0f;
							slowCoeffValue = speedCurve.Evaluate(lotusTimer / LotusDuration.Value);
							((MonoBehaviour)this).StartCoroutine(Lotus2ExplosionThing(((Component)self).gameObject));
						}
						previousPulseFraction = num2;
						secondsUntilBarrierAttempt = 1f;
						string text2 = "RoR2/DLC1/VoidSuppressor/SuppressorClapEffect.prefab";
						GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)text2).WaitForCompletion();
						EffectComponent component8 = val3.GetComponent<EffectComponent>();
						component8.applyScale = true;
						component8.referencedObject = val3;
						Transform transform = val3.transform;
						transform.localScale *= 4f;
						EffectManager.SimpleImpactEffect(val3, teleporterPos, new Vector3(0f, 0f, 0f), true);
					}
				}
			}
			orig.Invoke(self, isCharging);
		}

		private static float CalcNextPulseFraction(int itemCount, float prevPulseFraction)
		{
			float num = 1f / (float)(itemCount + 1);
			for (int i = 1; i <= itemCount; i++)
			{
				float num2 = (float)i * num;
				if (num2 > prevPulseFraction)
				{
					return num2;
				}
			}
			return 1.1f;
		}

		private IEnumerator LotusDelayedBarrier(HoldoutZoneController self, TeamIndex teamDex)
		{
			//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)
			yield return (object)new WaitForSeconds(0.5f);
			foreach (PlayerCharacterMasterController player in PlayerCharacterMasterController.instances)
			{
				if (self.IsBodyInChargingRadius(player.body) && player.body.teamComponent.teamIndex == teamDex && Object.op_Implicit((Object)(object)player.body.healthComponent))
				{
					player.body.healthComponent.AddBarrier(player.body.healthComponent.fullCombinedHealth * ItemBase<CrystalLotus>.instance.barrierAmount.Value);
				}
			}
		}

		private IEnumerator Lotus2ExplosionThing(GameObject gameobject)
		{
			uint soundID = Util.PlaySound("Play_voidRaid_death", gameobject);
			Vector3 pulsepos = ((!voidfields) ? (teleporterPos + heightAdjustPulse) : (gameobject.gameObject.transform.position + heightAdjustPulse / 2f));
			EffectManager.SimpleEffect(lotusEffect, pulsepos, new Quaternion(0f, 0f, 0f, 0f), true);
			yield return (object)new WaitForSeconds(1.15f);
			AkSoundEngine.StopPlayingID(soundID);
			string effect1 = "RoR2/DLC1/VoidSuppressor/SuppressorRetreatToShellEffect.prefab";
			GameObject effect1Prefab = Addressables.LoadAssetAsync<GameObject>((object)effect1).WaitForCompletion();
			EffectManager.SimpleImpactEffect(effect1Prefab, pulsepos, new Vector3(0f, 0f, 0f), true);
		}

		private IEnumerator SlowLotusDelayedEnd()
		{
			SlowDownProjectiles comp = tempLotusCollider.GetComponent<SlowDownProjectiles>();
			while (slowCoeffValue < 1f)
			{
				yield return 0.1f;
				slowCoeffValue += 0.0015f;
				comp.slowDownCoefficient = slowCoeffValue;
			}
			slowCoeffValue = 1f;
			comp.slowDownCoefficient = 1f;
		}

		private void LotusSlowStatsHook(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && sender.HasBuff(lotusSlow))
			{
				float num = 1f - slowCoeffValue;
				args.moveSpeedReductionMultAdd += num;
				args.attackSpeedMultAdd -= num / 2f;
			}
		}

		private void LastTry(orig_FixedUpdate orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (self.GetBuffCount(lotusSlow) > 0 && slowCoeffValue < 1f)
			{
				LotusBodyToken lotusBodyToken = ((Component)self).gameObject.GetComponent<LotusBodyToken>();
				if (!Object.op_Implicit((Object)(object)lotusBodyToken))
				{
					lotusBodyToken = ((Component)self).gameObject.AddComponent<LotusBodyToken>();
					lotusBodyToken.body = self;
					lotusBodyToken.coeff = slowCoeffValue;
					lotusBodyToken.duration = LotusDuration.Value;
					lotusBodyToken.Begin();
					return;
				}
				if (slowCoeffValue < lotusBodyToken.coeff)
				{
					lotusBodyToken.End();
					Object.Destroy((Object)(object)lotusBodyToken);
					int buffCount = self.GetBuffCount(lotusSlow);
					for (int i = 0; i < buffCount; i++)
					{
						self.RemoveOldestTimedBuff(lotusSlow);
					}
					lotusBodyToken = ((Component)self).gameObject.AddComponent<LotusBodyToken>();
					lotusBodyToken.body = self;
					lotusBodyToken.coeff = slowCoeffValue;
					lotusBodyToken.duration = LotusDuration.Value;
					lotusBodyToken.Begin();
				}
				lotusBodyToken.coeff = slowCoeffValue;
			}
			else if (slowCoeffValue >= 1f)
			{
				int buffCount2 = self.GetBuffCount(lotusSlow);
				for (int j = 0; j < buffCount2; j++)
				{
					self.RemoveOldestTimedBuff(lotusSlow);
				}
				LotusBodyToken component = ((Component)self).gameObject.GetComponent<LotusBodyToken>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.End();
					Object.Destroy((Object)(object)component);
				}
			}
		}

		public void SetupVoidTierHighlights()
		{
			//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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/HighlightTier1Item.prefab").WaitForCompletion();
			val.AddComponent<NetworkIdentity>();
			tier1Clone = PrefabAPI.InstantiateClone(val, "void1HighlightPrefab");
			HighlightRect component = tier1Clone.GetComponent<HighlightRect>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.highlightColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)25));
				component.cornerImage = MainAssets.LoadAsset<Sprite>("texUICornerTier1");
			}
			tier2Clone = PrefabAPI.InstantiateClone(val, "void2HighlightPrefab");
			HighlightRect component2 = tier2Clone.GetComponent<HighlightRect>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.highlightColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)25));
				component2.cornerImage = MainAssets.LoadAsset<Sprite>("texUICornerTier2");
			}
			tier3Clone = PrefabAPI.InstantiateClone(val, "void3HighlightPrefab");
			HighlightRect component3 = tier3Clone.GetComponent<HighlightRect>();
			if (Object.op_Implicit((Object)(object)component3))
			{
				component3.highlightColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)25));
				component3.cornerImage = MainAssets.LoadAsset<Sprite>("texUICornerTier3");
			}
			tier4Clone = PrefabAPI.InstantiateClone(val, "void4HighlightPrefab");
			HighlightRect component4 = tier4Clone.GetComponent<HighlightRect>();
			if (Object.op_Implicit((Object)(object)component4))
			{
				component4.highlightColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)25));
				component4.cornerImage = MainAssets.LoadAsset<Sprite>("texUICornerTier1");
			}
			hasAdjustedTiers = false;
			if (!doVoidCommandVFX.Value)
			{
				hasAddedCommand = true;
			}
			else
			{
				hasAddedCommand = false;
			}
		}

		public void ApplyTierHighlights()
		{
			if (!hasAdjustedTiers && doVoidPickupBorders.Value)
			{
				ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef((ItemTier)6);
				if (Object.op_Implicit((Object)(object)itemTierDef))
				{
					itemTierDef.highlightPrefab = tier1Clone;
				}
				ItemTierDef itemTierDef2 = ItemTierCatalog.GetItemTierDef((ItemTier)7);
				if (Object.op_Implicit((Object)(object)itemTierDef2))
				{
					itemTierDef2.highlightPrefab = tier2Clone;
				}
				ItemTierDef itemTierDef3 = ItemTierCatalog.GetItemTierDef((ItemTier)8);
				if (Object.op_Implicit((Object)(object)itemTierDef3))
				{
					itemTierDef3.highlightPrefab = tier3Clone;
				}
				ItemTierDef itemTierDef4 = ItemTierCatalog.GetItemTierDef((ItemTier)9);
				if (Object.op_Implicit((Object)(object)itemTierDef4))
				{
					itemTierDef4.highlightPrefab = tier4Clone;
				}
				hasAdjustedTiers = true;
			}
		}

		public void CreateLotusBuff()
		{
			//IL_0027: 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)
			Color buffColor = default(Color);
			((Color)(ref buffColor))..ctor(0.5215f, 0.3764f, 0.8549f);
			lotusSlow = ScriptableObject.CreateInstance<BuffDef>();
			lotusSlow.buffColor = buffColor;
			lotusSlow.canStack = false;
			lotusSlow.isDebuff = true;
			((Object)lotusSlow).name = "ZnVVlotusSlow";
			lotusSlow.iconSprite = MainAssets.LoadAsset<Sprite>("lotusSlow");
			ContentAddition.AddBuffDef(lotusSlow);
		}

		private void AddLocusStuff(Stage obj)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_00cd: 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_0111: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: 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_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			ApplyTierHighlights();
			if (!hasAddedCommand && doVoidCommandVFX.Value)
			{
				hasAddedCommand = true;
				GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Command/CommandCube.prefab").WaitForCompletion();
				GameObject val2 = MainAssets.LoadAsset<GameObject>("VoidSystem.prefab");
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.transform))
				{
					Transform val3 = val.transform.Find("PickupDisplay");
					if (Object.op_Implicit((Object)(object)val3))
					{
						ShakeEmitter val4 = val2.AddComponent<ShakeEmitter>();
						Wave wave = default(Wave);
						wave.amplitude = 1f;
						wave.frequency = 60f;
						wave.cycleOffset = 0f;
						val4.wave = wave;
						val4.shakeOnStart = true;
						val4.shakeOnEnable = false;
						val4.duration = 0.1f;
						val4.radius = 30f;
						val4.scaleShakeRadiusWithLocalScale = false;
						val4.amplitudeTimeDecay = true;
						Material item = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matTracerBright.mat").WaitForCompletion();
						Material material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGenericFlash.mat").WaitForCompletion();
						try
						{
							((Renderer)((Component)val2.transform.Find("Loops").Find("DistantSoftGlow")).gameObject.GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/matGlowItemPickup.mat").WaitForCompletion();
							ParticleSystemRenderer component = ((Component)val2.transform.Find("Loops").Find("Swirls")).gameObject.GetComponent<ParticleSystemRenderer>();
							if (Object.op_Implicit((Object)(object)component))
							{
								List<Material> list = new List<Material>();
								list.Add(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGlow2Soft.mat").WaitForCompletion());
								list.Add(item);
								RendererSetMaterialsExtension.SetMaterials((Renderer)(object)component, list);
							}
							((Renderer)((Component)val2.transform.Find("Loops").Find("Glowies")).gameObject.GetComponent<ParticleSystemRenderer>()).material = material;
							((Renderer)((Component)val2.transform.Find("Burst").Find("Vacuum Stars, Distortion")).gameObject.GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matInverseDistortion.mat").WaitForCompletion();
							ParticleSystemRenderer component2 = ((Component)val2.transform.Find("Burst").Find("Vacuum Stars, Trails")).gameObject.GetComponent<ParticleSystemRenderer>();
							if (Object.op_Implicit((Object)(object)component2))
							{
								List<Material> list2 = new List<Material>();
								list2.Add(item);
								list2.Add(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Nullifier/matNullifierStarTrail.mat").WaitForCompletion());
								RendererSetMaterialsExtension.SetMaterials((Renderer)(object)component2, list2);
							}
							((Renderer)((Component)val2.transform.Find("Burst").Find("Flash")).gameObject.GetComponent<ParticleSystemRenderer>()).material = material;
							((Renderer)((Component)val2.transform.Find("Burst").Find("Vacuum Radial")).gameObject.GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Nullifier/matNullifierStarPortalEdge.mat").WaitForCompletion();
							((Renderer)((Component)val2.transform.Find("HarshGlow")).gameObject.GetComponent<ParticleSystemRenderer>()).material = material;
							val2.gameObject.SetActive(false);
							val2.transform.SetParent(val3);
							((Component)val3).GetComponent<PickupDisplay>().voidParticleEffect = val2;
							val2.transform.position = new Vector3(0f, 0f, 0f);
						}
						catch (Exception ex)
						{
							Debug.Log((object)("VV Exception (Command VFX): " + ex));
						}
					}
				}
			}
			if ((Object)(object)obj.sceneDef == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("voidstage") && locusExit.Value)
			{
				if (locusEarlyExit.Value)
				{
					GameObject val5 = Object.Instantiate<GameObject>(portalObject, new Vector3(-37.5f, 19.5f, -284.05f), new Quaternion(0f, 70f, 0f, 0f));
					NetworkServer.Spawn(val5);
				}
				GameObject val6 = Object.Instantiate<GameObject>(platformObject, new Vector3(-37.5f, 15.25f, -273.5f), new Quaternion(0f, 0f, 0f, 0f));
				NetworkServer.Spawn(val6);
			}
		}

		private void SpawnLocusPortal(orig_OnBatteryActivated orig, VoidStageMissionController self)
		{
			//IL_0040: 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)
			orig.Invoke(self);
			if (self.numBatteriesActivated >= self.numBatteriesSpawned && !locusEarlyExit.Value)
			{
				GameObject val = Object.Instantiate<GameObject>(portalObject, new Vector3(-37.5f, 19.5f, -284.05f), new Quaternion(0f, 70f, 0f, 0f));
				NetworkServer.Spawn(val);
			}
		}

		private void LocusDirectorHelp(SceneDirector obj)
		{
			string baseSceneName = SceneCatalog.GetSceneDefForCurrentScene().baseSceneName;
			if (LocusBonus.Value > 0 && baseSceneName == "voidstage")
			{
				obj.interactableCredit += LocusBonus.Value;
			}
		}

		public void Swapallshaders(AssetBundle bundle)
		{
			Material[] array = bundle.LoadAllAssets<Material>();
			Material[] array2 = array;
			foreach (Material val in array2)
			{
				Debug.Log((object)("material: " + ((Object)val).name + " | with shader: " + ((Object)val.shader).name));
				switch (((Object)val.shader).name)
				{
				case "Stubbed Hopoo Games/Deferred/Standard":
					val.shader = Resources.Load<Shader>("shaders/deferred/hgstandard");
					break;
				case "Stubbed Hopoo Games/Deferred/Snow Topped":
					val.shader = Resources.Load<Shader>("shaders/deferred/hgsnowtopped");
					break;
				case "Stubbed Hopoo Games/FX/Cloud Remap":
					Debug.Log((object)("Switching material: " + ((Object)val).name));
					val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap");
					Debug.Log((object)("Swapped: " + (object)val.shader));
					break;
				case "Stubbed Hopoo Games/FX/Cloud Intersection Remap":
					val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap");
					break;
				case "Stubbed Hopoo Games/FX/Opaque Cloud Remap":
					val.shader = Resources.Load<Shader>("shaders/fx/hgopaquecloudremap");
					break;
				case "Stubbed Hopoo Games/FX/Distortion":
					val.shader = Resources.Load<Shader>("shaders/fx/hgdistortion");
					break;
				case "Stubbed Hopoo Games/FX/Solid Parallax":
					val.shader = Resources.Load<Shader>("shaders/fx/hgsolidparallax");
					break;
				case "Stubbed Hopoo Games/Environment/Distant Water":
					val.shader = Resources.Load<Shader>("shaders/environment/hgdistantwater");
					break;
				case "StubbedRoR2/Base/Shaders/HGCloudRemap":
					val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap");
					break;
				}
			}
		}
	}
}
namespace vanillaVoid.Utils
{
	public static class ItemHelpers
	{
		public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false)
		{
			//IL_0085: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			List<Renderer> list = new List<Renderer>();
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			if (componentsInChildren.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren);
			}
			SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>();
			if (componentsInChildren2.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2);
			}
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count];
			for (int i = 0; i < list.Count; i++)
			{
				if (debugmode)
				{
					MaterialControllerComponents.HGControllerFinder hGControllerFinder = ((Component)list[i]).gameObject.AddComponent<MaterialControllerComponents.HGControllerFinder>();
					hGControllerFinder.Renderer = list[i];
				}
				array[i] = new RendererInfo
				{
					defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material),
					renderer = list[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails)
		{
			string[] value = new string[19]
			{
				"<align=left>Estimated Delivery:<indent=70%>Sent To:</indent></align>",
				"<align=left>" + estimatedDelivery + "<indent=70%>" + sentTo + "</indent></align>",
				"",
				"<indent=1%><style=cIsDamage><size=125%><u>  Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</u></size></style></indent>",
				"",
				"<indent=2%>-Order: <style=cIsUtility>" + deviceName + "</style></indent>",
				"<indent=4%><style=cStack>Tracking Number:  " + trackingNumber + "</style></indent>",
				"",
				"<indent=2%>-Order Description: " + devicePickupDesc + "</indent>",
				"",
				"<indent=2%>-Shipping Method: <style=cIsHealth>" + shippingMethod + "</style></indent>",
				"",
				"",
				"",
				"<indent=2%>-Order Details: " + orderDetails + "</indent>",
				"",
				"",
				"",
				"<style=cStack>Delivery being brought to you by the brand new </style><style=cIsUtility>Orbital Drop-Crate System (TM)</style>. <style=cStack><u>No refunds.</u></style>"
			};
			return string.Join("\n", value);
		}

		public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration)
		{
			//IL_0039: 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)
			if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
			{
				return;
			}
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (buffDef.buffIndex == timedBuff.buffIndex)
				{
					timedBuff.timer = duration;
				}
			}
		}

		public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration)
		{
			//IL_003b: 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)
			if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
			{
				return;
			}
			int num = 0;
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (buffDef.buffIndex == timedBuff.buffIndex)
				{
					timedBuff.timer = taperStart + (float)num * taperDuration;
					num++;
				}
			}
		}

		public static void AddBuffAndDot(BuffDef buff, float duration, int stackCount, CharacterBody body)
		{
			//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_003b: Invalid comparison between Unknown and I4
			//IL_0075: 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)
			if (!NetworkServer.active)
			{
				return;
			}
			DotIndex val = (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff);
			for (int i = 0; i < stackCount; i++)
			{
				if ((int)val != -1)
				{
					DotController.InflictDot(((Component)body).gameObject, ((Component)body).gameObject, val, duration, 0.25f, (uint?)null);
				}
				else
				{
					body.AddTimedBuff(buff.buffIndex, duration);
				}
			}
		}

		public static DotIndex FindAssociatedDotForBuff(BuffDef buff)
		{
			//IL_0024: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			return (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff);
		}
	}
	public static class MathHelpers
	{
		public static string FloatToPercentageString(float number, float numberBase = 100f)
		{
			return (number * numberBase).ToString("##0") + "%";
		}

		public static Vector3 ClosestPointOnSphereToPoint(Vector3 origin, float radius, Vector3 targetPosition)
		{
			//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)
			//IL_0003: 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_0009: 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_000f: 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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = targetPosition - origin;
			val = Vector3.Normalize(val);
			val *= radius;
			return origin + val;
		}

		public static List<Vector3> DistributePointsEvenlyAroundSphere(int points, float radius, Vector3 origin)
		{
			//IL_0066: 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_0072: 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_007a: 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)
			List<Vector3> list = new List<Vector3>();
			double num = Math.PI * (3.0 - Math.Sqrt(5.0));
			for (int i = 0; i < points; i++)
			{
				int num2 = 1 - i / (points - 1) * 2;
				double num3 = Math.Sqrt(1 - num2 * num2);
				double num4 = num * (double)i;
				float num5 = (float)(Math.Cos(num4) * num3);
				float num6 = (float)(Math.Sin(num4) * num3);
				Vector3 val = origin + new Vector3(num5, (float)num2, num6);
				list.Add(val * radius);
			}
			return list;
		}

		public static List<Vector3> DistributePointsEvenlyAroundCircle(int points, float radius, Vector3 origin, float angleOffset = 0f)
		{
			//IL_002c: 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_0044: 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)
			List<Vector3> list = new List<Vector3>();
			Vector3 item = default(Vector3);
			for (int i = 0; i < points; i++)
			{
				double num = Math.PI * 2.0 / (double)points;
				double num2 = num * (double)i + (double)angleOffset;
				((Vector3)(ref item))..ctor((float)((double)radius * Math.Cos(num2) + (double)origin.x), origin.y, (float)((double)radius * Math.Sin(num2) + (double)origin.z));
				list.Add(item);
			}
			return list;
		}

		public static Vector3 GetPointOnUnitSphereCap(Quaternion targetDirection, float angle)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0034: 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_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			float num = Random.Range(0f, angle) * (MathF.PI / 180f);
			Vector2 insideUnitCircle = Random.insideUnitCircle;
			Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * Mathf.Sin(num);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(val.x, val.y, Mathf.Cos(num));
			return targetDirection * val2;
		}

		public static Vector3 GetPointOnUnitSphereCap(Vector3 targetDirection, float angle)
		{
			//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)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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)
			return GetPointOnUnitSphereCap(Quaternion.LookRotation(targetDirection), angle);
		}

		public static Vector3 RandomPointOnCircle(Vector3 origin, float radius, Xoroshiro128Plus random)
		{
			//IL_0012: 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_002f: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			float num = random.RangeFloat(0f, MathF.PI * 2f);
			return origin + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * radius;
		}

		public static float InverseHyperbolicScaling(float baseValue, float additionalValue, float maxValue, int itemCount)
		{
			return baseValue + (maxValue - baseValue) * (1f - 1f / (1f + additionalValue * (float)(itemCount - 1)));
		}
	}
	public static class MiscUtils
	{
		private static List<string> alreadyPlural = new List<string>
		{
			"400 Tickets", "Balls", "Gummy Vitamins", "Booster Boots", "Life Savings", "Predatory Instincts", "Fueling Bellows", "Sharpened Chopsticks", "Hardlight Shields", "Steroids",
			"Charging Nanobots", "Experimental Jets", "Prototype Jet Boots", "Low Quality Speakers", "Stargazer's Records", "Baby's Toys", "Defensive Microbots", "Death's Regards", "Spare Drone Parts", "Brainstalks",
			"Sorcerer's Pills", "Shifted Quartz", "Clasping Claws", "Enhancement Vials", "<style=cIsVoid>Corrupts all Shatterspleens.</style>", "Empyrean Braces", "Orbs of Falsity", "Visions of Heresy", "Hooks of Heresy", "Strides of Heresy",
			"Essence of Heresy", "Beads of Fealty", "Prescriptions", "Snake Eyes", "Panic Mines"
		};

		private static Dictionary<string, string> rules = new Dictionary<string, string>
		{
			{ "rounds$", "rounds" },
			{ "tooth$", "teeth" },
			{ "fungus$", "fungi" },
			{ "(a|e|i|o|u)o$", "$1os" },
			{ "o$", "oes" },
			{ "(a|e|i|o|u)y$", "$1ys" },
			{ "y$", "ies" },
			{ "ff$", "s" },
			{ "fe?$", "ves" },
			{ "es$", "es" },
			{ "(ch|sh|x|z|s)$", "$1es" },
			{ "s?$", "s" }
		};

		public static Vector3? RaycastToDirection(Vector3 position, float maxDistance, Vector3 direction, int layer)
		{
			//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)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(new Ray(position, direction), ref val, maxDistance, layer, (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref val)).point;
			}
			return null;
		}

		public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> toShuffle, Xoroshiro128Plus random)
		{
			List<T> list = new List<T>();
			foreach (T item in toShuffle)
			{
				list.Insert(random.RangeInt(0, list.Count + 1), item);
			}
			return list;
		}

		public static Vector3 FindClosestNodeToPosition(Vector3 position, HullClassification hullClassification, bool checkAirNodes = false)
		{
			//IL_001c: 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_0023: 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_0029: 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_0052: 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_003a: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			NodeGraph val = (checkAirNodes ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes);
			NodeIndex val2 = val.FindClosestNode(position, hullClassification, float.PositiveInfinity);
			if (val2 != NodeIndex.invalid)
			{
				Vector3 result = default(Vector3);
				val.GetNodePosition(val2, ref result);
				return result;
			}
			vanillaVoidPlugin.ModLogger.LogInfo((object)$"No closest node to be found for XYZ: {position}, returning 0,0,0");
			return Vector3.zero;
		}

		public static bool TeleportBody(CharacterBody characterBody, GameObject target, GameObject teleportEffect, HullClassification hullClassification, Xoroshiro128Plus rng, float minDistance = 20f, float maxDistance = 45f, bool teleportAir = false)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0047: 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_004e: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_007b: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//IL_0095: 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)
			if (!Object.op_Implicit((Object)(object)characterBody))
			{
				return false;
			}
			SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
			val.hullSize = hullClassification;
			val.nodeGraphType = (GraphType)(teleportAir ? 1 : 0);
			val.prefab = Resources.Load<GameObject>("SpawnCards/HelperPrefab");
			GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
			{
				placementMode = (PlacementMode)1,
				position = target.transform.position,
				minDistance = minDistance,
				maxDistance = maxDistance
			}, rng));
			if (Object.op_Implicit((Object)(object)val2))
			{
				TeleportHelper.TeleportBody(characterBody, val2.transform.position);
				if (Object.op_Implicit((Object)(object)teleportEffect))
				{
					EffectManager.SimpleEffect(teleportEffect, val2.transform.position, Quaternion.identity, true);
				}
				Object.Destroy((Object)(object)val2);
				Object.Destroy((Object)(object)val);
				return true;
			}
			Object.Destroy((Object)(object)val);
			return false;
		}

		public static Vector3? AboveTargetVectorFromDamageInfo(DamageInfo damageInfo, float distanceAboveTarget)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_007c: 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_0083: 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_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: 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_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_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: 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)
			if (damageInfo.rejected || !Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return null;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				TeamMask enemyTeams = TeamMask.GetEnemyTeams(component.teamComponent.teamIndex);
				HurtBox val = new SphereSearch
				{
					radius = 1f,
					mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
					origin = damageInfo.position
				}.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).OrderCandidatesByDistance()
					.FilterCandidatesByDistinctHurtBoxEntities()
					.GetHurtBoxes()
					.FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && Object.op_Implicit((Object)(object)val.healthComponent.body))
				{
					CharacterBody body = val.healthComponent.body;
					Vector3 val2 = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f));
					Vector3? val3 = RaycastToDirection(val2, distanceAboveTarget, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
					if (val3.HasValue)
					{
						return val3.Value;
					}
					return val2 + Vector3.up * distanceAboveTarget;
				}
			}
			return null;
		}

		public static Vector3? AboveTargetBody(CharacterBody body, float distanceAbove)
		{
			//IL_0030: 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_004e: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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)
			//IL_0090: 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_009b: 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)
			if (!Object.op_Implicit((Object)(object)body))
			{
				return null;
			}
			Vector3 val = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f));
			Vector3? val2 = RaycastToDirection(val, distanceAbove, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
			if (val2.HasValue)
			{
				return val2.Value;
			}
			return val + Vector3.up * distanceAbove;
		}

		public static Dictionary<string, Vector3> GetAimSurfaceAlignmentInfo(Ray ray, int layerMask, float distance)
		{
			//IL_0007: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_0057: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_0069: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_0087: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<string, Vector3> dictionary = new Dictionary<string, Vector3>();
			RaycastHit val = default(RaycastHit);
			if (!Physics.Raycast(ray, ref val, distance, layerMask, (QueryTriggerInteraction)1))
			{
				vanillaVoidPlugin.ModLogger.LogInfo((object)$"GetAimSurfaceAlignmentInfo did not hit anything in the aim direction on the specified layer ({layerMask}).");
				return null;
			}
			Vector3 point = ((RaycastHit)(ref val)).point;
			Vector3 val2 = Vector3.Cross(((Ray)(ref ray)).direction, Vector3.up);
			Vector3 val3 = Vector3.ProjectOnPlane(((RaycastHit)(ref val)).normal, val2);
			Vector3 value = Vector3.Cross(val2, val3);
			dictionary.Add("Position", point);
			dictionary.Add("Right", val2);
			dictionary.Add("Forward", value);
			dictionary.Add("Up", val3);
			return dictionary;
		}

		public static string GetPlural(string str)
		{
			if (alreadyPlural.Contains(str))
			{
				return str;
			}
			if (str == "Silence Between Two Strikes")
			{
				return "Silences Between Two Strikes";
			}
			Match match = Regex.Match(str, "(.+) of (.+)", RegexOptions.IgnoreCase);
			if (match.Success)
			{
				return GetPlural(match.Groups[1].Value) + " of " + match.Groups[2].Value;
			}
			match = Regex.Match(str, "^the (.+)", RegexOptions.IgnoreCase);
			if (match.Success)
			{
				return GetPlural(match.Groups[1].Value);
			}
			foreach (string key in rules.Keys)
			{
				if (Regex.Match(str, key, RegexOptions.IgnoreCase).Success)
				{
					return Regex.Replace(str, key, rules[key], RegexOptions.IgnoreCase);
				}
			}
			return str;
		}
	}
	public static class NetworkingHelpers
	{
		public static T GetObjectFromNetIdValue<T>(uint netIdValue)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			NetworkInstanceId key = default(NetworkInstanceId);
			((NetworkInstanceId)(ref key))..ctor(netIdValue);
			NetworkIdentity value = null;
			if (NetworkServer.active)
			{
				NetworkServer.objects.TryGetValue(key, out value);
			}
			else
			{
				ClientScene.objects.TryGetValue(key, out value);
			}
			if (Object.op_Implicit((Object)(object)value))
			{
				T component = ((Component)value).GetComponent<T>();
				if (component != null)
				{
					return component;
				}
			}
			return default(T);
		}
	}
}
namespace vanillaVoid.Utils.Components
{
	public class MaterialControllerComponents
	{
		public class HGControllerFinder : MonoBehaviour
		{
			public Renderer Renderer;

			public Material Material;

			public void Start()
			{
				if (Object.op_Implicit((Object)(object)Renderer))
				{
					Material = Renderer.materials[0];
					if (Object.op_Implicit((Object)(object)Material))
					{
						switch (((Object)Material.shader).name)
						{
						case "Hopoo Games/Deferred/Standard":
						{
							HGStandardController hGStandardController = ((Component)this).gameObject.AddComponent<HGStandardController>();
							hGStandardController.Material = Material;
							hGStandardController.Renderer = Renderer;
							break;
						}
						case "Hopoo Games/FX/Cloud Remap":
						{
							HGCloudRemapController hGCloudRemapController = ((Component)this).gameObject.AddComponent<HGCloudRemapController>();
							hGCloudRemapController.Material = Material;
							hGCloudRemapController.Renderer = Renderer;
							break;
						}
						case "Hopoo Games/FX/Cloud Intersection Remap":
						{
							HGIntersectionController hGIntersectionController = ((Component)this).gameObject.AddComponent<HGIntersectionController>();
							hGIntersectionController.Material = Material;
							hGIntersectionController.Renderer = Renderer;
							break;
						}
						}
					}
				}
				Object.Destroy((Object)(object)this);
			}
		}

		public class HGStandardController : MonoBehaviour
		{
			public enum _RampInfoEnum
			{
				TwoTone = 0,
				SmoothedTwoTone = 1,
				Unlitish = 3,
				Subsurface = 4,
				Grass = 5
			}

			public enum _DecalLayerEnum
			{
				Default,
				Environment,
				Character,
				Misc
			}

			public enum _CullEnum
			{
				Off,
				Front,
				Back
			}

			public enum _PrintDirectionEnum
			{
				BottomUp = 0,
				TopDown = 1,
				BackToFront = 3
			}

			public Material Material;

			public Renderer Renderer;

			public string MaterialName;

			public bool _EnableCutout;

			public Color _Color;

			public Texture _MainTex;

			public Vector2 _MainTexScale;

			public Vector2 _MainTexOffset;

			[Range(0f, 5f)]
			public float _NormalStrength;

			public Texture _NormalTex;

			public Vector2 _NormalTexScale;

			public Vector2 _NormalTexOffset;

			public Color _EmColor;

			public Texture _EmTex;

			[Range(0f, 10f)]
			public float _EmPower;

			[Range(0f, 1f)]
			public float _Smoothness;

			public bool _IgnoreDiffuseAlphaForSpeculars;

			public _RampInfoEnum _RampChoice;

			public _DecalLayerEnum _DecalLayer;

			[Range(0f, 1f)]
			public float _SpecularStrength;

			[Range(0.1f, 20f)]
			public float _SpecularExponent;

			public _CullEnum _Cull_Mode;

			public bool _EnableDither;

			[Range(0f, 1f)]
			public float _FadeBias;

			public bool _EnableFresnelEmission;

			public Texture _FresnelRamp;

			[Range(0.1f, 20f)]
			public float _FresnelPower;

			public Texture _FresnelMask;

			[Range(0f, 20f)]
			public float _FresnelBoost;

			public bool _EnablePrinting;

			[Range(-25f, 25f)]
			public float _SliceHeight;

			[Range(0f, 10f)]
			public floa