Decompiled source of OldFathomlessVoidling v0.10.1

plugins/viliger-FathomlessVoidling/FathomlessVoidling.dll

Decompiled 2 weeks ago
using System;
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 BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.GameOver;
using EntityStates.NullifierMonster;
using EntityStates.VoidRaidCrab.Weapon;
using FathomlessVoidling.ModCompat;
using FathomlessVoidling.VoidEnding;
using FathomlessVoidling.VoidlingEntityStates;
using FathomlessVoidling.VoidlingEntityStates.Phase1;
using FathomlessVoidling.VoidlingEntityStates.Phase2;
using FathomlessVoidling.VoidlingEntityStates.Phase3;
using HG;
using On.RoR2;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2BepInExPack.GameAssetPaths;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FathomlessVoidling")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FathomlessVoidling")]
[assembly: AssemblyTitle("FathomlessVoidling")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace FathomlessVoidling
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Nuxlar.FathomlessVoidling", "FathomlessVoidling", "0.10.1")]
	public class FathomlessVoidlingPlugin : BaseUnityPlugin
	{
		public const string ModName = "FathomlessVoidling";

		public const string Version = "0.10.1";

		public const string GUID = "com.Nuxlar.FathomlessVoidling";

		public void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			Log.Init(((BaseUnityPlugin)this).Logger);
			ModConfig.InitConfig(((BaseUnityPlugin)this).Config);
			SetupVoidling.SetupStuff();
			SetupStage.SetupStuff();
			Addressables.LoadAssetAsync<GameEndingDef>((object)"RoR2/DLC1/GameModes/VoidEnding.asset").WaitForCompletion().gameOverControllerState = new SerializableEntityStateType(typeof(VoidEndingStart));
			Language.collectLanguageRootFolders += Language_collectLanguageRootFolders;
		}

		private void Language_collectLanguageRootFolders(List<string> folders)
		{
			folders.Add(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Language"));
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	internal class ModConfig
	{
		public static ConfigEntry<bool> EnableVoidCutscene;

		public static ConfigEntry<bool> enableAltMoon;

		public static ConfigEntry<bool> enableVoidFog;

		public static ConfigEntry<float> baseHealth;

		public static ConfigEntry<float> levelHealth;

		public static ConfigEntry<float> baseDamage;

		public static ConfigEntry<float> levelDamage;

		public static ConfigEntry<float> baseArmor;

		public static ConfigEntry<float> baseAtkSpd;

		public static ConfigEntry<float> baseSpd;

		public static ConfigEntry<float> acceleration;

		public static ConfigEntry<int> primCD;

		public static ConfigEntry<int> secCD;

		public static ConfigEntry<int> utilCD;

		public static ConfigEntry<int> specCD;

		public static void InitConfig(ConfigFile config)
		{
			enableAltMoon = config.Bind<bool>("General", "Alt Moon", true, "Toggle Void Locus as an alternative to the moon. Adds stage 5 Locus portal and item cauldrons.");
			enableVoidFog = config.Bind<bool>("General", "Pillar Fog", false, "Toggle void pillar fog.");
			baseHealth = config.Bind<float>("Stats", "Base Health", 1250f, "Vanilla: 2000");
			levelHealth = config.Bind<float>("Stats", "Level Health", 350f, "Health gained per level. Vanilla: 600");
			baseDamage = config.Bind<float>("Stats", "Base Damage", 15f, "Vanilla: 15");
			levelDamage = config.Bind<float>("Stats", "Level Damage", 3f, "Damage gained per level. Vanilla: 3");
			baseArmor = config.Bind<float>("Stats", "Base Armor", 30f, "Vanilla: 20");
			baseAtkSpd = config.Bind<float>("Stats", "Base Attack Speed", 1.25f, "Vanilla: 1");
			baseSpd = config.Bind<float>("Stats", "Base Move Speed", 90f, "Vanilla: 45");
			acceleration = config.Bind<float>("Stats", "Acceleration", 45f, "Vanilla: 20");
			primCD = config.Bind<int>("Skills", "Primary Cooldown", 10, "Cooldown for Disillusion (Main missile attack).");
			secCD = config.Bind<int>("Skills", "Secondary Cooldown", 40, "Cooldown for Secondary (Vacuum, Singularity, Crush).");
			utilCD = config.Bind<int>("Skills", "Util Cooldown", 20, "Cooldown for Transpose (Blink).");
			specCD = config.Bind<int>("Skills", "Special Cooldown", 30, "Cooldown for Special (Rend, SpinBeam, Reap).");
			EnableVoidCutscene = config.Bind<bool>("General", "Enable Void outro cutscene", true, "Enables somewhat unfinished void outro cutscene.");
			if (RiskOfOptionsCompat.enabled)
			{
				RiskOfOptionsCompat.CreateNewOption(enableAltMoon);
				RiskOfOptionsCompat.CreateNewOption(enableVoidFog);
				RiskOfOptionsCompat.CreateNewOption(EnableVoidCutscene);
				RiskOfOptionsCompat.CreateNewOption(baseHealth, 1000f, 2000f, 50f);
				RiskOfOptionsCompat.CreateNewOption(levelHealth, 100f, 500f, 25f);
				RiskOfOptionsCompat.CreateNewOption(baseDamage, 10f, 20f, 0.5f);
				RiskOfOptionsCompat.CreateNewOption(levelDamage, 1f, 6f, 0.25f);
				RiskOfOptionsCompat.CreateNewOption(baseArmor, 20f, 60f, 5f);
				RiskOfOptionsCompat.CreateNewOption(baseAtkSpd, 0.5f, 2f, 0.25f);
				RiskOfOptionsCompat.CreateNewOption(baseSpd, 45f, 135f, 5f);
				RiskOfOptionsCompat.CreateNewOption(acceleration, 20f, 70f, 5f);
				RiskOfOptionsCompat.CreateNewOption(primCD, 1, 10);
				RiskOfOptionsCompat.CreateNewOption(secCD, 30, 50);
				RiskOfOptionsCompat.CreateNewOption(utilCD, 10, 30);
				RiskOfOptionsCompat.CreateNewOption(specCD, 20, 40);
				RiskOfOptionsCompat.SetDescription();
			}
		}
	}
	public class SetupStage
	{
		public static SpawnCard locusPortalCard;

		public static void SetupStuff()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC1/voidraid/voidraid.asset").WaitForCompletion().blockOrbitalSkills = false;
			if (!ModConfig.enableVoidFog.Value)
			{
				VoidStageMissionController.RequestFog += new hook_RequestFog(VoidStageMissionController_RequestFog);
			}
			if (ModConfig.enableAltMoon.Value)
			{
				locusPortalCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC1/PortalVoid/iscVoidPortal.asset").WaitForCompletion();
				Stage.onServerStageBegin += Stage_onServerStageBegin;
				TeleporterInteraction.AttemptToSpawnAllEligiblePortals += new hook_AttemptToSpawnAllEligiblePortals(TeleporterInteraction_AttemptToSpawnAllEligiblePortals1);
			}
		}

		private static FogRequest VoidStageMissionController_RequestFog(orig_RequestFog orig, VoidStageMissionController self, IZone zone)
		{
			return null;
		}

		private static void TeleporterInteraction_AttemptToSpawnAllEligiblePortals1(orig_AttemptToSpawnAllEligiblePortals orig, TeleporterInteraction self)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			if (self.beginContextString.Contains("LUNAR"))
			{
				List<PortalSpawner> list = self.portalSpawners.ToList();
				PortalSpawner val = list.Find((PortalSpawner x) => (Object)(object)x.portalSpawnCard == (Object)(object)locusPortalCard);
				if ((Object)(object)val != (Object)null)
				{
					list.Remove(val);
					self.portalSpawners = list.ToArray();
				}
				if (!NetworkServer.active)
				{
					return;
				}
				DirectorCore instance = DirectorCore.instance;
				DirectorPlacementRule val2 = new DirectorPlacementRule
				{
					minDistance = 10f,
					maxDistance = 40f,
					placementMode = (PlacementMode)1,
					position = ((Component)self).transform.position,
					spawnOnTarget = ((Component)self).transform
				};
				DirectorSpawnRequest val3 = new DirectorSpawnRequest(locusPortalCard, val2, self.rng);
				GameObject val4 = instance.TrySpawnObject(val3);
				if (Object.op_Implicit((Object)(object)val4))
				{
					NetworkServer.Spawn(val4);
					Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
					{
						baseToken = "PORTAL_VOID_OPEN"
					});
				}
			}
			orig.Invoke(self);
		}

		private static void Stage_onServerStageBegin(Stage stage)
		{
			//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_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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			if (!(stage.sceneDef.cachedName == "voidstage"))
			{
				return;
			}
			AsyncOperationHandle<GameObject> handle1 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_LunarCauldrons_LunarCauldron_RedToWhite.Variant_prefab);
			if (handle1.IsValid())
			{
				handle1.Completed += delegate(AsyncOperationHandle<GameObject> result)
				{
					//IL_0061: Unknown result type (might be due to invalid IL or missing references)
					//IL_002d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0032: Unknown result type (might be due to invalid IL or missing references)
					//IL_0051: Unknown result type (might be due to invalid IL or missing references)
					if (result.IsDone && Object.op_Implicit((Object)(object)result.Result))
					{
						GameObject obj5 = Object.Instantiate<GameObject>(result.Result, new Vector3(-142.67f, 29.94f, 242.74f), Quaternion.identity);
						obj5.transform.eulerAngles = new Vector3(0f, 66f, 0f);
						NetworkServer.Spawn(obj5);
					}
					Addressables.Release<GameObject>(handle1);
				};
			}
			AsyncOperationHandle<GameObject> handle2 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_LunarCauldrons_LunarCauldron_GreenToRed.Variant_prefab);
			if (handle2.IsValid())
			{
				handle2.Completed += delegate(AsyncOperationHandle<GameObject> result)
				{
					//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
					//IL_0033: Unknown result type (might be due to invalid IL or missing references)
					//IL_0038: 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_007c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0081: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
					if (result.IsDone && Object.op_Implicit((Object)(object)result.Result))
					{
						GameObject obj3 = Object.Instantiate<GameObject>(result.Result, new Vector3(-136.76f, 29.94f, 246.51f), Quaternion.identity);
						obj3.transform.eulerAngles = new Vector3(0f, 66f, 0f);
						NetworkServer.Spawn(obj3);
						GameObject obj4 = Object.Instantiate<GameObject>(result.Result, new Vector3(-149.74f, 29.93f, 239.7f), Quaternion.identity);
						obj4.transform.eulerAngles = new Vector3(0f, 66f, 0f);
						NetworkServer.Spawn(obj4);
					}
					Addressables.Release<GameObject>(handle2);
				};
			}
			AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_LunarCauldrons_LunarCauldron.WhiteToGreen_prefab);
			if (!val.IsValid())
			{
				return;
			}
			val.Completed += delegate(AsyncOperationHandle<GameObject> result)
			{
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: 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_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				if (result.IsDone && Object.op_Implicit((Object)(object)result.Result))
				{
					GameObject obj = Object.Instantiate<GameObject>(result.Result, new Vector3(-157.41f, 29.97f, 237.12f), Quaternion.identity);
					obj.transform.eulerAngles = new Vector3(0f, 66f, 0f);
					NetworkServer.Spawn(obj);
					GameObject obj2 = Object.Instantiate<GameObject>(result.Result, new Vector3(-126.63f, 29.93f, 249.1f), Quaternion.identity);
					obj2.transform.eulerAngles = new Vector3(0f, 66f, 0f);
					NetworkServer.Spawn(obj2);
				}
				Addressables.Release<GameObject>(handle2);
			};
		}
	}
	public class SetupVoidling
	{
		protected class SkillParams
		{
			public string name;

			public string nameToken = "FATHOMLESS_VOIDLING_SKILL_NO_NAME";

			public string descriptionToken = "FATHOMLESS_VOIDLING_SKILL_NO_DESCRIPTION";

			public Sprite icon;

			public string activationStateMachine = "Body";

			public SerializableEntityStateType activationState;

			public InterruptPriority interruptPriority = (InterruptPriority)1;

			public float baseRechargeInterval = 1f;

			public int baseMaxStock = 1;

			public int rechargeStock = 1;

			public int requiredStock = 1;

			public int stockToConsume = 1;

			public bool resetCooldownTimerOnUse;

			public bool fullRestockOnAssign = true;

			public bool dontAllowPAstMaxStocks;

			public bool beginSkillCooldownOnSkillEnd;

			public bool cancelSprintingOnActivation = true;

			public bool forceSprintDuringState;

			public bool canceledFromSprinting;

			public bool isCombatSkill = true;

			public bool mustKeyPress;

			public SkillParams(string name, SerializableEntityStateType activationState)
			{
				//IL_0023: 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_0073: Unknown result type (might be due to invalid IL or missing references)
				this.name = name;
				this.activationState = activationState;
			}
		}

		public static void SetupStuff()
		{
			ModifyBodies();
			ModifyMasters();
			SetupProjectiles();
			RegisterEntityStates();
		}

		private static void RegisterEntityStates()
		{
			//IL_0002: 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_0012: 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_0022: 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_0032: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			ContentAddition.AddEntityState<Transpose>(ref flag);
			ContentAddition.AddEntityState<ChargeRend>(ref flag);
			ContentAddition.AddEntityState<FathomlessVoidling.VoidlingEntityStates.Phase1.Disillusion>(ref flag);
			ContentAddition.AddEntityState<Rend>(ref flag);
			ContentAddition.AddEntityState<FathomlessVoidling.VoidlingEntityStates.Phase2.Disillusion>(ref flag);
			ContentAddition.AddEntityState<ChargeCrush>(ref flag);
			ContentAddition.AddEntityState<Crush>(ref flag);
			ContentAddition.AddEntityState<FathomlessVoidling.VoidlingEntityStates.Phase3.Disillusion>(ref flag);
			ContentAddition.AddEntityState<VoidEndingPlayCutscene>(ref flag);
			ContentAddition.AddEntityState<VoidEndingSetSceneAndWaitForPlayers>(ref flag);
			ContentAddition.AddEntityState<VoidEndingStart>(ref flag);
		}

		public static void SetupProjectiles()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_005f: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Grandparent/GrandparentBoulder.prefab").WaitForCompletion(), "VoidMeteor", true);
			GameObject val2 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Grandparent/GrandparentBoulderGhost.prefab").WaitForCompletion(), "VoidMeteorGhost", false);
			ProjectileController component = val.GetComponent<ProjectileController>();
			component.cannotBeDeleted = true;
			val.transform.localScale = new Vector3(1.75f, 1.75f, 1.75f);
			val2.transform.localScale = new Vector3(2f, 2f, 2f);
			((Renderer)((Component)val2.transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[2]
			{
				Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Grandparent/matGrandparentBoulderProjectile.mat").WaitForCompletion(),
				Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/EliteVoid/matEliteVoidOverlay.mat").WaitForCompletion()
			};
			component.ghostPrefab = val2;
			Crush.meteorPrefab = val;
			ContentAddition.AddProjectile(Crush.meteorPrefab);
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/VoidRaidCrabMissileProjectile.prefab").WaitForCompletion().GetComponent<ProjectileSteerTowardTarget>()
				.rotationSpeed = 180f;
		}

		private static void ModifyBodies()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: 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)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			SkillDef val = CreateSkillDef(new SkillParams("FathomlessVoidlingTranspose", new SerializableEntityStateType(typeof(Transpose)))
			{
				nameToken = "FATHOMLESS_VOIDLING_TRANSPOSE",
				activationStateMachine = "Body",
				baseMaxStock = 1,
				baseRechargeInterval = ModConfig.utilCD.Value,
				beginSkillCooldownOnSkillEnd = true,
				canceledFromSprinting = false,
				cancelSprintingOnActivation = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)1,
				isCombatSkill = true,
				mustKeyPress = false,
				rechargeStock = 1,
				requiredStock = 1,
				stockToConsume = 1
			});
			SkillFamily val2 = CreateSkillFamily("FathomlessVoidlingTransposeFamily", val);
			ContentAddition.AddSkillDef(val);
			ContentAddition.AddSkillFamily(val2);
			GameObject obj = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase1.prefab").WaitForCompletion();
			AdjustStats(obj);
			AdjustP1Skills(obj, val2);
			GameObject obj2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase2.prefab").WaitForCompletion();
			AdjustStats(obj2);
			AdjustP2Skills(obj2, val2);
			GameObject obj3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase3.prefab").WaitForCompletion();
			AdjustStats(obj3);
			AdjustP3Skills(obj3, val2);
			static void AdjustStats(GameObject gameObject)
			{
				CharacterBody component = gameObject.GetComponent<CharacterBody>();
				component.subtitleNameToken = "FATHOMLESS_VOIDLING_BODY_SUBTITLE";
				component.baseMaxHealth = ModConfig.baseHealth.Value;
				component.levelMaxHealth = ModConfig.levelHealth.Value;
				component.baseDamage = ModConfig.baseDamage.Value;
				component.levelDamage = ModConfig.levelDamage.Value;
				component.baseAttackSpeed = ModConfig.baseAtkSpd.Value;
				component.baseMoveSpeed = ModConfig.baseSpd.Value;
				component.baseAcceleration = ModConfig.acceleration.Value;
				component.baseArmor = ModConfig.baseArmor.Value;
			}
		}

		private static void AdjustP1Skills(GameObject bodyObject, SkillFamily transposeFamily)
		{
			//IL_0045: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			SkillLocator component = bodyObject.GetComponent<SkillLocator>();
			component.primary = null;
			component.secondary = null;
			component.utility = null;
			component.special = null;
			GenericSkill val = default(GenericSkill);
			while (bodyObject.TryGetComponent<GenericSkill>(ref val))
			{
				Object.DestroyImmediate((Object)(object)val);
			}
			SkillDef val2 = CreateSkillDef(new SkillParams("FathomlessVoidlingSkillPrimaryP1", new SerializableEntityStateType(typeof(FathomlessVoidling.VoidlingEntityStates.Phase1.Disillusion)))
			{
				nameToken = "FATHOMLESS_VOIDLING_DISILLUSION",
				activationStateMachine = "Weapon",
				baseMaxStock = 1,
				baseRechargeInterval = ModConfig.primCD.Value,
				beginSkillCooldownOnSkillEnd = true,
				canceledFromSprinting = false,
				cancelSprintingOnActivation = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)1,
				isCombatSkill = true,
				mustKeyPress = false,
				rechargeStock = 1,
				requiredStock = 1,
				stockToConsume = 1
			});
			SkillFamily val3 = CreateSkillFamily("FathomlessVoidlingSkillFamilyPrimaryP1", val2);
			GenericSkill val4 = bodyObject.AddComponent<GenericSkill>();
			val4._skillFamily = val3;
			component.primary = val4;
			ContentAddition.AddSkillDef(val2);
			ContentAddition.AddSkillFamily(val3);
			SkillDef val5 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidRaidCrab/RaidCrabVacuumAttack.asset").WaitForCompletion();
			val5.baseRechargeInterval = ModConfig.secCD.Value;
			SkillFamily val6 = CreateSkillFamily("FathomlessVoidlingSkillFamilySecondaryP1", val5);
			GenericSkill val7 = bodyObject.AddComponent<GenericSkill>();
			val7._skillFamily = val6;
			component.secondary = val7;
			ContentAddition.AddSkillFamily(val6);
			GenericSkill val8 = bodyObject.AddComponent<GenericSkill>();
			val8._skillFamily = transposeFamily;
			component.utility = val8;
			SkillDef val9 = CreateSkillDef(new SkillParams("FathomlessVoidlingSkillSpecialP1", new SerializableEntityStateType(typeof(ChargeRend)))
			{
				nameToken = "FATHOMLESS_VOIDLING_REND",
				activationStateMachine = "Body",
				baseMaxStock = 1,
				baseRechargeInterval = ModConfig.specCD.Value,
				beginSkillCooldownOnSkillEnd = true,
				canceledFromSprinting = false,
				cancelSprintingOnActivation = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)1,
				isCombatSkill = true,
				mustKeyPress = false,
				rechargeStock = 1,
				requiredStock = 1,
				stockToConsume = 1
			});
			SkillFamily val10 = CreateSkillFamily("FathomlessVoidlingSkillFamilySpecialP1", val9);
			GenericSkill val11 = bodyObject.AddComponent<GenericSkill>();
			val11._skillFamily = val10;
			component.special = val11;
			ContentAddition.AddSkillDef(val9);
			ContentAddition.AddSkillFamily(val10);
		}

		private static void AdjustP2Skills(GameObject bodyObject, SkillFamily transposeFamily)
		{
			//IL_0045: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			SkillLocator component = bodyObject.GetComponent<SkillLocator>();
			component.primary = null;
			component.secondary = null;
			component.utility = null;
			component.special = null;
			GenericSkill val = default(GenericSkill);
			while (bodyObject.TryGetComponent<GenericSkill>(ref val))
			{
				Object.DestroyImmediate((Object)(object)val);
			}
			SkillDef val2 = CreateSkillDef(new SkillParams("FathomlessVoidlingSkillPrimaryP2", new SerializableEntityStateType(typeof(FathomlessVoidling.VoidlingEntityStates.Phase2.Disillusion)))
			{
				nameToken = "FATHOMLESS_VOIDLING_DISILLUSION",
				activationStateMachine = "Weapon",
				baseMaxStock = 1,
				baseRechargeInterval = ModConfig.primCD.Value,
				beginSkillCooldownOnSkillEnd = true,
				canceledFromSprinting = false,
				cancelSprintingOnActivation = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)1,
				isCombatSkill = true,
				mustKeyPress = false,
				rechargeStock = 1,
				requiredStock = 1,
				stockToConsume = 1
			});
			SkillFamily val3 = CreateSkillFamily("FathomlessVoidlingSkillFamilyPrimaryP2", val2);
			GenericSkill val4 = bodyObject.AddComponent<GenericSkill>();
			val4._skillFamily = val3;
			component.primary = val4;
			ContentAddition.AddSkillDef(val2);
			ContentAddition.AddSkillFamily(val3);
			SkillDef val5 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidRaidCrab/RaidCrabVacuumAttack.asset").WaitForCompletion();
			val5.baseRechargeInterval = ModConfig.secCD.Value;
			SkillFamily val6 = CreateSkillFamily("FathomlessVoidlingSkillFamilySecondaryP2", val5);
			GenericSkill val7 = bodyObject.AddComponent<GenericSkill>();
			val7._skillFamily = val6;
			component.secondary = val7;
			ContentAddition.AddSkillFamily(val6);
			GenericSkill val8 = bodyObject.AddComponent<GenericSkill>();
			val8._skillFamily = transposeFamily;
			component.utility = val8;
			SkillDef val9 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidRaidCrab/RaidCrabSpinBeam.asset").WaitForCompletion();
			val9.baseRechargeInterval = ModConfig.specCD.Value;
			SkillFamily val10 = CreateSkillFamily("FathomlessVoidlingSkillFamilySpecialP2", val9);
			GenericSkill val11 = bodyObject.AddComponent<GenericSkill>();
			val11._skillFamily = val10;
			component.special = val11;
			ContentAddition.AddSkillFamily(val10);
		}

		private static void AdjustP3Skills(GameObject bodyObject, SkillFamily transposeFamily)
		{
			//IL_0045: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			SkillLocator component = bodyObject.GetComponent<SkillLocator>();
			component.primary = null;
			component.secondary = null;
			component.utility = null;
			component.special = null;
			GenericSkill val = default(GenericSkill);
			while (bodyObject.TryGetComponent<GenericSkill>(ref val))
			{
				Object.DestroyImmediate((Object)(object)val);
			}
			SkillDef val2 = CreateSkillDef(new SkillParams("FathomlessVoidlingSkillPrimaryP3", new SerializableEntityStateType(typeof(FathomlessVoidling.VoidlingEntityStates.Phase3.Disillusion)))
			{
				nameToken = "FATHOMLESS_VOIDLING_DISILLUSION",
				activationStateMachine = "Weapon",
				baseMaxStock = 1,
				baseRechargeInterval = ModConfig.primCD.Value,
				beginSkillCooldownOnSkillEnd = true,
				canceledFromSprinting = false,
				cancelSprintingOnActivation = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)1,
				isCombatSkill = true,
				mustKeyPress = false,
				rechargeStock = 1,
				requiredStock = 1,
				stockToConsume = 1
			});
			SkillFamily val3 = CreateSkillFamily("FathomlessVoidlingSkillFamilyPrimaryP3", val2);
			GenericSkill val4 = bodyObject.AddComponent<GenericSkill>();
			val4._skillFamily = val3;
			component.primary = val4;
			ContentAddition.AddSkillDef(val2);
			ContentAddition.AddSkillFamily(val3);
			SkillDef val5 = CreateSkillDef(new SkillParams("FathomlessVoidlingSkillSecondaryP3", new SerializableEntityStateType(typeof(ChargeCrush)))
			{
				nameToken = "FATHOMLESS_VOIDLING_SINGULARITY",
				activationStateMachine = "Body",
				baseMaxStock = 1,
				baseRechargeInterval = ModConfig.secCD.Value,
				beginSkillCooldownOnSkillEnd = true,
				canceledFromSprinting = true,
				cancelSprintingOnActivation = true,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)1,
				isCombatSkill = true,
				mustKeyPress = false,
				rechargeStock = 1,
				requiredStock = 1,
				stockToConsume = 1
			});
			SkillFamily val6 = CreateSkillFamily("FathomlessVoidlingSkillFamilySecondaryP3", val5);
			GenericSkill val7 = bodyObject.AddComponent<GenericSkill>();
			val7._skillFamily = val6;
			component.secondary = val7;
			ContentAddition.AddSkillDef(val5);
			ContentAddition.AddSkillFamily(val6);
			GenericSkill val8 = bodyObject.AddComponent<GenericSkill>();
			val8._skillFamily = transposeFamily;
			component.utility = val8;
			SkillDef val9 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/VoidRaidCrab/RaidCrabSpinBeam.asset").WaitForCompletion();
			val9.baseRechargeInterval = ModConfig.specCD.Value;
			SkillFamily val10 = CreateSkillFamily("FathomlessVoidlingSkillFamilySpecialP3", val9);
			GenericSkill val11 = bodyObject.AddComponent<GenericSkill>();
			val11._skillFamily = val10;
			component.special = val11;
			ContentAddition.AddSkillFamily(val10);
		}

		private static void ModifyMasters()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			ItemDef oobItem2 = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/TeleportWhenOob/TeleportWhenOob.asset").WaitForCompletion();
			GameObject master2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabMasterPhase1.prefab").WaitForCompletion();
			ModifyAIStates(master2);
			AddTeleportWhenOOB(master2, oobItem2);
			GameObject master3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabMasterPhase2.prefab").WaitForCompletion();
			ModifyAIStates(master3);
			AddTeleportWhenOOB(master3, oobItem2);
			GameObject master4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabMasterPhase3.prefab").WaitForCompletion();
			ModifyAIStates(master4);
			AddTeleportWhenOOB(master4, oobItem2);
			static void AddTeleportWhenOOB(GameObject master, ItemDef oobItem)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				ref ItemDefInfo[] itemDefInfos = ref master.GetComponent<GivePickupsOnStart>().itemDefInfos;
				ItemDefInfo val = new ItemDefInfo
				{
					count = 1,
					dontExceedCount = true,
					itemDef = oobItem
				};
				ArrayUtils.ArrayAppend<ItemDefInfo>(ref itemDefInfos, ref val);
			}
			static void ModifyAIStates(GameObject master)
			{
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				AISkillDriver obj = (from x in master.GetComponents<AISkillDriver>()
					where (int)x.skillSlot == 1
					select x).First();
				AISkillDriver val2 = (from x in master.GetComponents<AISkillDriver>()
					where (int)x.skillSlot == 2
					select x).First();
				AISkillDriver val3 = (from x in master.GetComponents<AISkillDriver>()
					where (int)x.skillSlot == 3
					select x).First();
				obj.movementType = (MovementType)0;
				obj.maxUserHealthFraction = 0.9f;
				obj.minUserHealthFraction = float.NegativeInfinity;
				obj.requiredSkill = null;
				obj.maxDistance = 200f;
				val2.maxUserHealthFraction = float.PositiveInfinity;
				val2.minUserHealthFraction = float.NegativeInfinity;
				val2.requiredSkill = null;
				val2.maxDistance = 400f;
				val2.minDistance = 0f;
				val3.maxUserHealthFraction = 0.8f;
				val3.minUserHealthFraction = float.NegativeInfinity;
				val3.requiredSkill = null;
				val3.maxDistance = 400f;
				val3.minDistance = 0f;
			}
		}

		private static SkillFamily CreateSkillFamily(string name, params SkillDef[] skills)
		{
			SkillFamily obj = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)obj).name = name;
			obj.variants = Array.ConvertAll(skills, delegate(SkillDef item)
			{
				//IL_0002: 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_002c: Expected O, but got Unknown
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				Variant result = default(Variant);
				result.skillDef = item;
				result.unlockableDef = null;
				((Variant)(ref result)).viewableNode = new Node(item.skillNameToken, false, (Node)null);
				return result;
			});
			obj.defaultVariantIndex = 0u;
			return obj;
		}

		private static SkillDef CreateSkillDef(SkillParams skillParams)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			SkillDef obj = ScriptableObject.CreateInstance<SkillDef>();
			((Object)obj).name = skillParams.name;
			obj.skillName = skillParams.name;
			obj.skillNameToken = skillParams.nameToken;
			obj.skillDescriptionToken = skillParams.descriptionToken;
			obj.icon = skillParams.icon;
			obj.activationStateMachineName = skillParams.activationStateMachine;
			obj.activationState = skillParams.activationState;
			obj.interruptPriority = skillParams.interruptPriority;
			obj.baseRechargeInterval = skillParams.baseRechargeInterval;
			obj.baseMaxStock = skillParams.baseMaxStock;
			obj.rechargeStock = skillParams.rechargeStock;
			obj.requiredStock = skillParams.requiredStock;
			obj.stockToConsume = skillParams.stockToConsume;
			obj.resetCooldownTimerOnUse = skillParams.resetCooldownTimerOnUse;
			obj.fullRestockOnAssign = skillParams.fullRestockOnAssign;
			obj.dontAllowPastMaxStocks = skillParams.dontAllowPAstMaxStocks;
			obj.beginSkillCooldownOnSkillEnd = skillParams.beginSkillCooldownOnSkillEnd;
			obj.canceledFromSprinting = skillParams.canceledFromSprinting;
			obj.forceSprintDuringState = skillParams.forceSprintDuringState;
			obj.canceledFromSprinting = skillParams.canceledFromSprinting;
			obj.isCombatSkill = skillParams.isCombatSkill;
			obj.mustKeyPress = skillParams.mustKeyPress;
			return obj;
		}
	}
}
namespace FathomlessVoidling.VoidlingEntityStates
{
	public abstract class BaseDisillusion : BaseState
	{
		public static GameObject missilesMuzzleFlashPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.VoidRaidCrabMuzzleflashEyeMissiles_prefab).WaitForCompletion();

		public static string missilesMuzzleName = "EyeProjectileCenter";

		public static GameObject missilesProjectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.VoidRaidCrabMissileProjectile_prefab).WaitForCompletion();

		public static float missilesDamageCoefficient = 0.3f;

		public static float missilesForce = 100f;

		public static int missilesNumMissilesPerWave = 6;

		public static float missilesMinSpreadDegrees = 0f;

		public static float missilesRangeSpreadDegrees = 20f;

		public static float baseDuration = 4f;

		public static float fireFrequency = 5f;

		public static float bombFireTimer = 1f;

		private float duration;

		private float fireInterval;

		private float fireStopwatch;

		private Predictor predictor;

		private float bombStopwatch;

		internal abstract GameObject bombPrefab { get; }

		public override void OnEnter()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00a9: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			fireInterval = duration / fireFrequency;
			if (((EntityState)this).isAuthority)
			{
				BullseyeSearch val = new BullseyeSearch();
				val.teamMaskFilter = TeamMask.allButNeutral;
				if (Object.op_Implicit((Object)(object)((EntityState)this).teamComponent))
				{
					((TeamMask)(ref val.teamMaskFilter)).RemoveTeam(((EntityState)this).teamComponent.teamIndex);
				}
				val.maxDistanceFilter = 1000f;
				val.maxAngleFilter = 360f;
				Ray aimRay = ((BaseState)this).GetAimRay();
				val.searchOrigin = ((Ray)(ref aimRay)).origin;
				val.searchDirection = ((Ray)(ref aimRay)).direction;
				val.filterByLoS = false;
				val.sortMode = (SortMode)3;
				val.RefreshCandidates();
				HurtBox val2 = val.GetResults().FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val2))
				{
					predictor = new Predictor(((EntityState)this).transform);
					predictor.SetTargetTransform(((Component)val2).transform);
					FireMissileAuthority();
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_0058: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				predictor.Update();
				bombStopwatch += Time.fixedDeltaTime;
				if (bombStopwatch >= bombFireTimer)
				{
					Vector3 position = default(Vector3);
					predictor.GetPredictedTargetPosition(1f, ref position);
					ProjectileManager.instance.FireProjectile(new FireProjectileInfo
					{
						projectilePrefab = bombPrefab,
						position = position,
						rotation = Quaternion.identity,
						owner = ((EntityState)this).gameObject,
						damage = 0f,
						force = 0f,
						crit = ((EntityState)this).characterBody.RollCrit()
					});
					bombStopwatch -= bombFireTimer;
				}
				fireStopwatch += Time.fixedDeltaTime;
				if (fireStopwatch >= fireInterval)
				{
					FireMissileAuthority();
					fireStopwatch -= fireInterval;
				}
			}
			if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void FireMissileAuthority()
		{
			//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)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_004b: 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)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			EffectManager.SimpleMuzzleFlash(missilesMuzzleFlashPrefab, ((EntityState)this).gameObject, missilesMuzzleName, true);
			Ray aimRay = ((BaseState)this).GetAimRay();
			Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
			FireProjectileInfo val2 = default(FireProjectileInfo);
			val2.projectilePrefab = missilesProjectilePrefab;
			val2.position = ((BaseState)this).FindModelChild(missilesMuzzleName).position;
			val2.owner = ((EntityState)this).gameObject;
			val2.damage = base.damageStat * missilesDamageCoefficient;
			val2.force = missilesForce;
			FireProjectileInfo val3 = val2;
			for (int i = 0; i < missilesNumMissilesPerWave; i++)
			{
				val3.rotation = val * GetRandomRollPitch();
				val3.crit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
				ProjectileManager.instance.FireProjectile(val3);
			}
			EffectManager.SimpleMuzzleFlash(FirePortalBomb.muzzleflashEffectPrefab, ((EntityState)this).gameObject, missilesMuzzleName, true);
		}

		protected Quaternion GetRandomRollPitch()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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_0036: 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)
			Quaternion val = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.forward);
			Quaternion val2 = Quaternion.AngleAxis(missilesMinSpreadDegrees + Random.Range(0f, missilesRangeSpreadDegrees), Vector3.left);
			return val * val2;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Transpose : BaseState
	{
		public static GameObject deathBombPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabDeathBombExplosion.prefab").WaitForCompletion();

		public static float duration = 2f;

		public static float blinkDistance = 500f;

		public static Material destealthMaterial = Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Imp.matImpDissolve_mat).WaitForCompletion();

		private Transform modelTransform;

		private Animator animator;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		private Vector3 blinkStart;

		private Vector3 blinkDestination;

		public override void OnEnter()
		{
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				animator = ((Component)modelTransform).GetComponent<Animator>();
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				int invisibilityCount = obj.invisibilityCount;
				obj.invisibilityCount = invisibilityCount + 1;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup obj2 = hurtboxGroup;
				int invisibilityCount = obj2.hurtBoxesDeactivatorCounter;
				obj2.hurtBoxesDeactivatorCounter = invisibilityCount + 1;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor))
			{
				((Behaviour)((EntityState)this).rigidbodyMotor).enabled = false;
			}
			Util.PlaySound("Play_voidRaid_snipe_shoot_final", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				InputBankTest inputBank = ((EntityState)this).inputBank;
				inputBank.moveVector *= blinkDistance;
				CalculateBlinkDestination();
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			}
		}

		public override void FixedUpdate()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration || ((EntityState)this).isAuthority)
			{
				((EntityState)this).rigidbodyMotor.AddDisplacement(blinkDestination);
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound("Play_voidRaid_snipe_shoot_final", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				CreateBlinkEffect(((EntityState)this).characterBody.corePosition);
			}
			if (Object.op_Implicit((Object)(object)modelTransform) && Object.op_Implicit((Object)(object)destealthMaterial))
			{
				TemporaryOverlay obj = ((Component)animator).gameObject.AddComponent<TemporaryOverlay>();
				obj.duration = 1f;
				obj.destroyComponentOnEnd = true;
				obj.originalMaterial = destealthMaterial;
				obj.inspectorCharacterModel = ((Component)animator).gameObject.GetComponent<CharacterModel>();
				obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				obj.animateShaderAlpha = true;
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj2 = characterModel;
				int invisibilityCount = obj2.invisibilityCount;
				obj2.invisibilityCount = invisibilityCount - 1;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup obj3 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = obj3.hurtBoxesDeactivatorCounter - 1;
				obj3.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor))
			{
				((Behaviour)((EntityState)this).rigidbodyMotor).enabled = true;
			}
		}

		private void CalculateBlinkDestination()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: 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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0027: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_004b: 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)
			//IL_005c: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.zero;
			Ray aimRay = ((BaseState)this).GetAimRay();
			BullseyeSearch val2 = new BullseyeSearch
			{
				searchOrigin = ((Ray)(ref aimRay)).origin,
				searchDirection = ((Ray)(ref aimRay)).direction,
				maxDistanceFilter = blinkDistance,
				teamMaskFilter = TeamMask.allButNeutral,
				filterByLoS = false,
				sortMode = (SortMode)2
			};
			((TeamMask)(ref val2.teamMaskFilter)).RemoveTeam(TeamComponent.GetObjectTeam(((EntityState)this).gameObject));
			val2.RefreshCandidates();
			HurtBox val3 = val2.GetResults().FirstOrDefault();
			if (Object.op_Implicit((Object)(object)val3))
			{
				val = ((Component)val3).transform.position - ((EntityState)this).transform.position;
			}
			blinkDestination = ((EntityState)this).transform.position;
			blinkStart = ((EntityState)this).transform.position;
			NodeGraph groundNodes = SceneInfo.instance.groundNodes;
			groundNodes.GetNodePosition(groundNodes.FindClosestNodeWithFlagConditions(val, ((EntityState)this).characterBody.hullClassification, (NodeFlags)0, (NodeFlags)4, true), ref blinkDestination);
		}

		private void CreateBlinkEffect(Vector3 origin1)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: 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_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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			EffectManager.SpawnEffect(deathBombPrefab, new EffectData
			{
				rotation = Util.QuaternionSafeLookRotation(blinkDestination - blinkStart),
				origin = origin1,
				scale = 75f
			}, true);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace FathomlessVoidling.VoidlingEntityStates.Phase3
{
	public class ChargeCrush : BaseState
	{
		public static float baseDuration = 3.5f;

		public static GameObject missilesMuzzleFlashPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.VoidRaidCrabMuzzleflashEyeMissiles_prefab).WaitForCompletion();

		private float duration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation("Body", "SuckEnter", "Suck.playbackRate", duration, 0f);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Crush());
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			Util.PlaySound("Play_voidRaid_snipe_shoot", ((EntityState)this).gameObject);
			EffectManager.SimpleMuzzleFlash(missilesMuzzleFlashPrefab, ((EntityState)this).gameObject, "EyeProjectileCenter", false);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Crush : BaseState
	{
		public static GameObject meteorPrefab;

		public static GameObject portalPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabSpawnEffect.prefab").WaitForCompletion();

		public static float duration = 6f;

		public static float missileSpawnFrequency = 6f;

		public static string muzzleString = "EyeProjectileCenter";

		public static float damageCoefficient = 2f;

		public static float force = 10000f;

		private float missileStopwatch;

		private float missileTimer;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((EntityState)this).PlayAnimation("Body", "SuckExit", "Suck.playbackRate", 3.3f, 0f);
			missileTimer = 1f / missileSpawnFrequency;
		}

		public override void FixedUpdate()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				missileStopwatch += Time.fixedDeltaTime;
				if (missileStopwatch >= missileTimer)
				{
					Transform val = ((BaseState)this).FindModelChild(muzzleString);
					if (Object.op_Implicit((Object)(object)val))
					{
						Ray aimRay = ((BaseState)this).GetAimRay();
						Ray projectileRay = default(Ray);
						((Ray)(ref projectileRay)).direction = ((Ray)(ref aimRay)).direction;
						float num = 1000f;
						float num2 = Random.Range(-100f, 100f);
						float num3 = Random.Range(50f, 75f);
						float num4 = Random.Range(-100f, 100f);
						Vector3 val2 = default(Vector3);
						((Vector3)(ref val2))..ctor(num2, num3, num4);
						Vector3 origin = val.position + val2;
						((Ray)(ref projectileRay)).origin = origin;
						RaycastHit val3 = default(RaycastHit);
						if (Physics.Raycast(aimRay, ref val3, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
						{
							((Ray)(ref projectileRay)).direction = ((RaycastHit)(ref val3)).point - ((Ray)(ref projectileRay)).origin;
						}
						FireBlobAuthority(projectileRay);
					}
					missileStopwatch -= missileTimer;
				}
			}
			if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void FireBlobAuthority(Ray projectileRay)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			EffectManager.SpawnEffect(portalPrefab, new EffectData
			{
				origin = ((Ray)(ref projectileRay)).origin,
				rotation = Util.QuaternionSafeLookRotation(((Ray)(ref projectileRay)).direction)
			}, true);
			FireProjectileInfo val = default(FireProjectileInfo);
			val.position = ((Ray)(ref projectileRay)).origin;
			val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref projectileRay)).direction);
			val.crit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
			val.damage = base.damageStat * damageCoefficient;
			val.owner = ((EntityState)this).gameObject;
			val.force = force;
			((FireProjectileInfo)(ref val)).speedOverride = 100f;
			val.projectilePrefab = meteorPrefab;
			FireProjectileInfo val2 = val;
			ProjectileManager.instance.FireProjectile(val2);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Disillusion : BaseDisillusion
	{
		public static GameObject staticBombPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidJailer/VoidJailerDeathBombProjectile.prefab").WaitForCompletion();

		internal override GameObject bombPrefab => staticBombPrefab;
	}
}
namespace FathomlessVoidling.VoidlingEntityStates.Phase2
{
	public class Disillusion : BaseDisillusion
	{
		public static GameObject staticBombPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierDeathBombProjectile.prefab").WaitForCompletion();

		internal override GameObject bombPrefab => staticBombPrefab;
	}
}
namespace FathomlessVoidling.VoidlingEntityStates.Phase1
{
	public class ChargeRend : ChargeMultiBeam
	{
		public static float staticBaseDuration = 1f;

		public static GameObject staticChargeEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.VoidRaidCrabTripleBeamChargeUp_prefab).WaitForCompletion();

		public static GameObject staticWarningLaserVfxPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.MultiBeamRayIndicator_prefab).WaitForCompletion();

		public static string staticMuzzleName = "EyeProjectileCenter";

		public static string staticEnterSoundString = "Play_voidRaid_snipe_chargeUp";

		public static bool staticIsSoundScaledByAttackSpeed = false;

		public static string staticAnimationLayerName = "Gesture";

		public static string staticAnimationStateName = "ChargeMultiBeam";

		public static string staticAnimationPlaybackRateParam = "MultiBeam.playbackRate";

		public override void OnEnter()
		{
			base.baseDuration = staticBaseDuration;
			base.chargeEffectPrefab = staticChargeEffectPrefab;
			base.warningLaserVfxPrefab = staticWarningLaserVfxPrefab;
			base.muzzleName = staticMuzzleName;
			base.enterSoundString = staticEnterSoundString;
			base.isSoundScaledByAttackSpeed = staticIsSoundScaledByAttackSpeed;
			base.animationLayerName = staticAnimationLayerName;
			base.animationStateName = staticAnimationStateName;
			base.animationPlaybackRateParam = staticAnimationPlaybackRateParam;
			((ChargeMultiBeam)this).OnEnter();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).fixedAge = ((EntityState)this).fixedAge + ((EntityState)this).GetDeltaTime();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > base.duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Rend());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Disillusion : BaseDisillusion
	{
		public static GameObject staticBombPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabDeathBombProjectile.prefab").WaitForCompletion();

		internal override GameObject bombPrefab => staticBombPrefab;
	}
	public class Rend : BaseMultiBeamState
	{
		public static GameObject tracerEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.TracerVoidRaidCrabTripleBeamSmall_prefab).WaitForCompletion();

		public static GameObject explosionEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.VoidRaidCrabTripleBeamExplosion_prefab).WaitForCompletion();

		public static GameObject projectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidRaidCrab.VoidRaidCrabMultiBeamDotZone_prefab).WaitForCompletion();

		public static float projectileDamageCoefficient = 2f;

		public static float baseDuration = 4f;

		public static float missileSpawnFrequency = 6f;

		public static string animationLayerName = "Gesture";

		public static string animationStateName = "FireMultiBeamFinale";

		public static string animationPlaybackRateParam = "MultiBeam.playbackRate";

		public static float blastRadius = 6f;

		public static float blastDamageCoefficient = 1f;

		public static Vector3 blastBonusForce = new Vector3(0f, 100f, 0f);

		public static float blastForceMagnitude = 3000f;

		private float duration;

		private float missileStopwatch;

		private float missleSpawnTimer;

		private BlastAttack blobBlastAttack;

		public override void OnEnter()
		{
			((BaseMultiBeamState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			missleSpawnTimer = 1f / missileSpawnFrequency;
			if (((EntityState)this).isAuthority)
			{
				blobBlastAttack = SetupBlastAttack();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			missileStopwatch += Time.fixedDeltaTime;
			if (missileStopwatch >= missleSpawnTimer)
			{
				FireBlob();
				missileStopwatch -= missleSpawnTimer;
			}
			if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private BlastAttack SetupBlastAttack()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			return new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
				baseDamage = ((BaseState)this).damageStat * (blastDamageCoefficient / 2f),
				baseForce = blastForceMagnitude,
				radius = blastRadius,
				falloffModel = (FalloffModel)2,
				bonusForce = blastBonusForce,
				damageType = DamageTypeCombo.op_Implicit((DamageType)0)
			};
		}

		private void FireBlob()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_0110: 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_012d: 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_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			((EntityState)this).PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParam, duration, 0f);
			Util.PlaySound(((BaseFireMultiBeam)new FireMultiBeamSmall()).enterSoundString, ((EntityState)this).gameObject);
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			Ray val = default(Ray);
			Vector3 val2 = default(Vector3);
			((BaseMultiBeamState)this).CalcBeamPath(ref val, ref val2);
			val2 += new Vector3(Random.Range(-15f, 15f), Random.Range(-10f, 10f), Random.Range(-15f, 15f));
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					int num = component.FindChildIndex(BaseMultiBeamState.muzzleName);
					if (Object.op_Implicit((Object)(object)tracerEffectPrefab))
					{
						EffectData val3 = new EffectData
						{
							origin = val2,
							start = ((Ray)(ref val)).origin,
							scale = blastRadius
						};
						val3.SetChildLocatorTransformReference(((EntityState)this).gameObject, num);
						EffectManager.SpawnEffect(tracerEffectPrefab, val3, true);
						EffectManager.SpawnEffect(explosionEffectPrefab, val3, true);
					}
				}
			}
			blobBlastAttack.position = val2;
			blobBlastAttack.crit = ((BaseState)this).RollCrit();
			blobBlastAttack.Fire();
			ProjectileManager.instance.FireProjectile(new FireProjectileInfo
			{
				projectilePrefab = projectilePrefab,
				position = val2,
				owner = ((EntityState)this).gameObject,
				damage = ((BaseState)this).damageStat * (projectileDamageCoefficient / 6f),
				crit = ((BaseState)this).RollCrit()
			});
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace FathomlessVoidling.VoidEnding
{
	public class VoidEndingPlayCutscene : BaseGameOverControllerState
	{
		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (NetworkServer.active && (!Object.op_Implicit((Object)(object)OutroCutsceneController.instance) || OutroCutsceneController.instance.cutsceneIsFinished))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)OutroCutsceneController.instance) && Object.op_Implicit((Object)(object)OutroCutsceneController.instance.playableDirector))
			{
				OutroCutsceneController.instance.playableDirector.time = OutroCutsceneController.instance.playableDirector.duration;
			}
			((EntityState)this).OnExit();
		}
	}
	public class VoidEndingSetSceneAndWaitForPlayers : BaseGameOverControllerState
	{
		private SceneDef desiredSceneDef;

		public override void OnEnter()
		{
			((BaseGameOverControllerState)this).OnEnter();
			FadeToBlackManager.ForceFullBlack();
			FadeToBlackManager.fadeCount++;
			desiredSceneDef = SceneCatalog.GetSceneDefFromSceneName("voidoutro");
			if (NetworkServer.active)
			{
				Run.instance.AdvanceStage(desiredSceneDef);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (NetworkServer.active && NetworkUser.AllParticipatingNetworkUsersReady() && (Object)(object)SceneCatalog.mostRecentSceneDef == (Object)(object)desiredSceneDef)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new VoidEndingPlayCutscene());
			}
		}

		public override void OnExit()
		{
			FadeToBlackManager.fadeCount--;
			((EntityState)this).OnExit();
		}
	}
	public class VoidEndingStart : BaseGameOverControllerState
	{
		public static float duration = 3f;

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new VoidEndingSetSceneAndWaitForPlayers());
			}
		}

		public override void OnEnter()
		{
			((BaseGameOverControllerState)this).OnEnter();
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}
	}
}
namespace FathomlessVoidling.ModCompat
{
	public static class RiskOfOptionsCompat
	{
		private static bool? _enabled;

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
				}
				return _enabled.Value;
			}
		}

		public static void SetDescription()
		{
			ModSettingsManager.SetModDescription("Voidling without fathoms", "com.Nuxlar.FathomlessVoidling", "FathomlessVoidling");
		}

		public static void SetIcon(Sprite icon)
		{
			ModSettingsManager.SetModIcon(icon, "com.Nuxlar.FathomlessVoidling", "FathomlessVoidling");
		}

		public static void CreateNewOption(ConfigEntry<float> entry, float min = 0f, float max = 5f, float increment = 0.01f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(entry, new StepSliderConfig
			{
				min = min,
				max = max,
				increment = increment,
				restartRequired = true
			}));
		}

		public static void CreateNewOption(ConfigEntry<bool> entry)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry, true));
		}

		public static void CreateNewOption(ConfigEntry<int> entry, int min = 0, int max = 200)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry, new IntSliderConfig
			{
				min = min,
				max = max,
				restartRequired = true
			}));
		}
	}
}