Decompiled source of OldFathomlessVoidling v0.9.1

FathomlessVoidling.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
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.Configuration;
using EntityStates;
using EntityStates.GrandParentBoss;
using EntityStates.Huntress;
using EntityStates.ImpBossMonster;
using EntityStates.NullifierMonster;
using EntityStates.VoidRaidCrab;
using EntityStates.VoidRaidCrab.Weapon;
using Microsoft.CodeAnalysis;
using On.EntityStates.VoidRaidCrab;
using On.RoR2;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[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]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FathomlessVoidling
{
	[BepInPlugin("com.Nuxlar.FathomlessVoidling", "FathomlessVoidling", "0.9.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class FathomlessVoidling : BaseUnityPlugin
	{
		public static GameObject voidRaidCrabBase = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyBase.prefab").WaitForCompletion();

		public static GameObject voidRaidCrabPhase1 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase1.prefab").WaitForCompletion();

		public static GameObject voidRaidCrabPhase2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase2.prefab").WaitForCompletion();

		public static GameObject voidRaidCrabPhase3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase3.prefab").WaitForCompletion();

		public static GameObject meteor = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Grandparent/GrandparentBoulder.prefab").WaitForCompletion(), "VoidMeteor");

		private static GameObject meteorGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Grandparent/GrandparentBoulderGhost.prefab").WaitForCompletion(), "VoidMeteorGhost");

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

		public static GameObject bombPrefab3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidJailer/VoidJailerDeathBombProjectile.prefab").WaitForCompletion();

		public static GameObject bombPrefab2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierDeathBombProjectile.prefab").WaitForCompletion();

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

		private static Material boulderMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Grandparent/matGrandparentBoulderProjectile.mat").WaitForCompletion();

		private static Material voidAffixMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/EliteVoid/matEliteVoidOverlay.mat").WaitForCompletion();

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

		public static GameObject spawnEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/VoidRaidCrabSpawnEffect.prefab").WaitForCompletion();

		public static GameObject spinBeamVFX = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/VoidRaidCrabSpinBeamVFX.prefab").WaitForCompletion();

		public static GameObject r2wCauldron = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarCauldrons/LunarCauldron, RedToWhite Variant.prefab").WaitForCompletion();

		public static GameObject g2rCauldron = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarCauldrons/LunarCauldron, GreenToRed Variant.prefab").WaitForCompletion();

		public static GameObject w2gCauldron = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarCauldrons/LunarCauldron, WhiteToGreen.prefab").WaitForCompletion();

		public static SpawnCard locusPortalCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC1/PortalVoid/iscVoidPortal.asset").WaitForCompletion();

		public static SceneDef voidRaid = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC1/voidraid/voidraid.asset").WaitForCompletion();

		private static AnimationCurve singularityDeathCurve = null;

		private static AnimationCurve singularityPullCurve = null;

		public void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			ModConfig.InitConfig(((BaseUnityPlugin)this).Config);
			Run.Start += new hook_Start(RunStart);
			Stage.Start += new hook_Start(StageStart);
			VoidStageMissionController.RequestFog += new hook_RequestFog(RequestFog);
			TeleporterInteraction.AttemptToSpawnAllEligiblePortals += new hook_AttemptToSpawnAllEligiblePortals(TeleporterInteraction_AttemptToSpawnAllEligiblePortals);
			CharacterMaster.onStartGlobal += MasterChanges;
			CharacterMaster.OnBodyStart += new hook_OnBodyStart(CharacterMaster_OnBodyStart);
			BaseVacuumAttackState.OnEnter += new hook_OnEnter(BaseVacuumAttackStateOnEnter);
			voidRaid.blockOrbitalSkills = false;
			new Skills();
			SetupProjectiles();
			AddContent();
		}

		private void StageStart(orig_Start orig, Stage self)
		{
			orig.Invoke(self);
			if (self.sceneDef.cachedName == "voidstage" && ModConfig.enableAltMoon.Value)
			{
				SpawnLocusCauldrons();
			}
		}

		private void SpawnLocusCauldrons()
		{
			//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_0038: 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_007f: 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_00c6: 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_010d: 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_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Object.Instantiate<GameObject>(r2wCauldron, new Vector3(-142.67f, 29.94f, 242.74f), Quaternion.identity);
			obj.transform.eulerAngles = new Vector3(0f, 66f, 0f);
			NetworkServer.Spawn(obj);
			GameObject obj2 = Object.Instantiate<GameObject>(g2rCauldron, new Vector3(-136.76f, 29.94f, 246.51f), Quaternion.identity);
			obj2.transform.eulerAngles = new Vector3(0f, 66f, 0f);
			NetworkServer.Spawn(obj2);
			GameObject obj3 = Object.Instantiate<GameObject>(g2rCauldron, new Vector3(-149.74f, 29.93f, 239.7f), Quaternion.identity);
			obj3.transform.eulerAngles = new Vector3(0f, 66f, 0f);
			NetworkServer.Spawn(obj3);
			GameObject obj4 = Object.Instantiate<GameObject>(w2gCauldron, new Vector3(-157.41f, 29.97f, 237.12f), Quaternion.identity);
			obj4.transform.eulerAngles = new Vector3(0f, 66f, 0f);
			NetworkServer.Spawn(obj4);
			GameObject obj5 = Object.Instantiate<GameObject>(w2gCauldron, new Vector3(-126.63f, 29.93f, 249.1f), Quaternion.identity);
			obj5.transform.eulerAngles = new Vector3(0f, 66f, 0f);
			NetworkServer.Spawn(obj5);
		}

		private FogRequest RequestFog(orig_RequestFog orig, VoidStageMissionController self, IZone zone)
		{
			if (ModConfig.enableVoidFog.Value)
			{
				return orig.Invoke(self, zone);
			}
			return null;
		}

		private void TeleporterInteraction_AttemptToSpawnAllEligiblePortals(orig_AttemptToSpawnAllEligiblePortals orig, TeleporterInteraction self)
		{
			if ((Object)(object)SceneCatalog.mostRecentSceneDef == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("skymeadow") && ModConfig.enableAltMoon.Value)
			{
				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();
				}
				SpawnLocusPortal(((Component)self).transform, self.rng);
			}
			orig.Invoke(self);
		}

		private void SpawnLocusPortal(Transform transform, Xoroshiro128Plus rng)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			DirectorCore instance = DirectorCore.instance;
			DirectorPlacementRule val = new DirectorPlacementRule();
			val.minDistance = 10f;
			val.maxDistance = 40f;
			val.placementMode = (PlacementMode)1;
			val.position = transform.position;
			val.spawnOnTarget = transform;
			DirectorSpawnRequest val2 = new DirectorSpawnRequest(locusPortalCard, val, rng);
			GameObject val3 = instance.TrySpawnObject(val2);
			if (Object.op_Implicit((Object)(object)val3))
			{
				NetworkServer.Spawn(val3);
			}
		}

		private void BaseVacuumAttackStateOnEnter(orig_OnEnter orig, BaseVacuumAttackState self)
		{
			orig.Invoke(self);
			if (((Object)((EntityState)self).characterBody).name == "MiniVoidRaidCrabBodyPhase2(Clone)")
			{
				Transform val = VoidRaidGauntletController.instance.currentDonut.root.transform.Find("ReflectionProbe, Center");
				if (Object.op_Implicit((Object)(object)val))
				{
					self.vacuumOrigin = val;
				}
			}
		}

		private void AddContent()
		{
			//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)
			bool flag = default(bool);
			ContentAddition.AddEntityState<ChargeRend>(ref flag);
			ContentAddition.AddEntityState<Rend>(ref flag);
			ContentAddition.AddEntityState<Reap>(ref flag);
			ContentAddition.AddEntityState<ChargeCrush>(ref flag);
			ContentAddition.AddEntityState<Crush>(ref flag);
			ContentAddition.AddEntityState<Disillusion>(ref flag);
			ContentAddition.AddEntityState<Transpose>(ref flag);
			ContentAddition.AddProjectile(meteor);
		}

		private void SetupProjectiles()
		{
			//IL_003b: 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)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Setting Up Projectiles");
			ProjectileController component = meteor.GetComponent<ProjectileController>();
			component.cannotBeDeleted = true;
			meteor.transform.localScale = new Vector3(1.75f, 1.75f, 1.75f);
			meteorGhost.transform.localScale = new Vector3(2f, 2f, 2f);
			((Renderer)((Component)meteorGhost.transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[2] { boulderMat, voidAffixMat };
			component.ghost = meteorGhost.GetComponent<ProjectileGhostController>();
			component.ghostPrefab = meteorGhost;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Setting Up Projectiles");
		}

		private void AdjustPhase1Stats()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Adjusting P1 Stats");
			CharacterBody component = voidRaidCrabPhase1.GetComponent<CharacterBody>();
			component.subtitleNameToken = "Augur of the Abyss";
			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;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Adjusting P1 Stats");
		}

		private void AdjustPhase2Stats()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Adjusting P2 Stats");
			CharacterBody component = voidRaidCrabPhase2.GetComponent<CharacterBody>();
			component.subtitleNameToken = "Augur of the Abyss";
			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;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Adjusting P2 Stats");
		}

		private void AdjustPhase3Stats()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Adjusting P3 Stats");
			CharacterBody component = voidRaidCrabPhase3.GetComponent<CharacterBody>();
			component.subtitleNameToken = "Augur of the Abyss";
			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;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Adjusting P3 Stats");
		}

		private void AdjustPhase1Skills(CharacterBody body)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d7: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Adjusting P1 Skills");
			SkillLocator skillLocator = body.skillLocator;
			SkillDef skillDef = skillLocator.primary.skillFamily.variants[0].skillDef;
			SkillDef skillDef2 = skillLocator.secondary.skillFamily.variants[0].skillDef;
			SkillDef skillDef3 = skillLocator.utility.skillFamily.variants[0].skillDef;
			SkillDef skillDef4 = skillLocator.special.skillFamily.variants[0].skillDef;
			skillDef.activationState = new SerializableEntityStateType(typeof(Disillusion));
			skillDef2.activationState = new SerializableEntityStateType(typeof(VacuumEnter));
			skillDef3.activationState = new SerializableEntityStateType(typeof(Transpose));
			skillDef4.activationState = new SerializableEntityStateType(typeof(ChargeRend));
			new FireMissiles().projectilePrefab.GetComponent<ProjectileSteerTowardTarget>().rotationSpeed = 180f;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Adjusting P1 Skills");
		}

		private void AdjustPhase2Skills(CharacterBody body)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Adjusting P2 Skills");
			SkillLocator skillLocator = body.skillLocator;
			SkillDef skillDef = skillLocator.primary.skillFamily.variants[0].skillDef;
			SkillDef skillDef2 = skillLocator.secondary.skillFamily.variants[0].skillDef;
			SkillDef skillDef3 = skillLocator.utility.skillFamily.variants[0].skillDef;
			SkillDef skillDef4 = skillLocator.special.skillFamily.variants[0].skillDef;
			skillDef.activationState = new SerializableEntityStateType(typeof(Disillusion));
			skillDef2.activationState = new SerializableEntityStateType(typeof(VacuumEnter));
			skillDef3.activationState = new SerializableEntityStateType(typeof(Transpose));
			skillDef4.activationState = new SerializableEntityStateType(typeof(SpinBeamEnter));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Adjusting P2 Skills");
		}

		private void AdjustPhase3Skills(CharacterBody body)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Adjusting P3 Skills");
			SkillLocator skillLocator = body.skillLocator;
			SkillDef skillDef = skillLocator.primary.skillFamily.variants[0].skillDef;
			SkillDef skillDef2 = skillLocator.secondary.skillFamily.variants[0].skillDef;
			SkillDef skillDef3 = skillLocator.utility.skillFamily.variants[0].skillDef;
			SkillDef skillDef4 = skillLocator.special.skillFamily.variants[0].skillDef;
			skillDef.activationState = new SerializableEntityStateType(typeof(Disillusion));
			skillDef2.activationState = new SerializableEntityStateType(typeof(ChargeCrush));
			skillDef3.activationState = new SerializableEntityStateType(typeof(Transpose));
			skillDef4.activationState = new SerializableEntityStateType(typeof(SpinBeamEnter));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Adjusting P3 Skills");
		}

		private void RunStart(orig_Start orig, Run self)
		{
			orig.Invoke(self);
			AdjustPhase1Stats();
			AdjustPhase2Stats();
			AdjustPhase3Stats();
		}

		private void CharacterMaster_OnBodyStart(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body)
		{
			orig.Invoke(self, body);
			if (((Object)body).name == "MiniVoidRaidCrabBodyPhase1(Clone)")
			{
				AdjustPhase1Skills(body);
			}
			if (((Object)body).name == "MiniVoidRaidCrabBodyPhase2(Clone)")
			{
				AdjustPhase2Skills(body);
			}
			if (((Object)body).name == "MiniVoidRaidCrabBodyPhase3(Clone)")
			{
				AdjustPhase3Skills(body);
			}
		}

		private void MasterChanges(CharacterMaster master)
		{
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)master).name == "MiniVoidRaidCrabMasterPhase1(Clone)" || ((Object)master).name == "MiniVoidRaidCrabMasterPhase2(Clone)" || ((Object)master).name == "MiniVoidRaidCrabMasterPhase3(Clone)")
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Editing AISkillDrivers");
				(from x in ((Component)master).GetComponents<AISkillDriver>()
					where (int)x.skillSlot == 0
					select x).First();
				AISkillDriver obj = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where (int)x.skillSlot == 1
					select x).First();
				AISkillDriver val = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where (int)x.skillSlot == 2
					select x).First();
				AISkillDriver val2 = (from x in ((Component)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;
				val.maxUserHealthFraction = float.PositiveInfinity;
				val.minUserHealthFraction = float.NegativeInfinity;
				val.requiredSkill = null;
				val.maxDistance = 400f;
				val.minDistance = 0f;
				val2.maxUserHealthFraction = 0.8f;
				val2.minUserHealthFraction = float.NegativeInfinity;
				val2.requiredSkill = null;
				val2.maxDistance = 400f;
				val2.minDistance = 0f;
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished Editing AISkillDrivers");
			}
			if (((Object)master).name == "MiniVoidRaidCrabMasterPhase1(Clone)" || ((Object)master).name == "MiniVoidRaidCrabMasterPhase2(Clone)" || ((Object)master).name == "MiniVoidRaidCrabMasterPhase3(Clone)")
			{
				master.inventory.GiveItem(Items.TeleportWhenOob, 1);
			}
		}
	}
	internal class ModConfig
	{
		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)
		{
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: 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_01ec: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Expected O, but got Unknown
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: 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: Expected O, but got Unknown
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_022b: 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_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Expected O, but got Unknown
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Expected O, but got Unknown
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Expected O, but got Unknown
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Expected O, but got Unknown
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Expected O, but got Unknown
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: 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_02f5: Expected O, but got Unknown
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Expected O, but got Unknown
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Expected O, but got Unknown
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Expected O, but got Unknown
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Expected O, but got Unknown
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Expected O, but got Unknown
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Expected O, but got Unknown
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Expected O, but got Unknown
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Expected O, but got Unknown
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Expected O, but got Unknown
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Expected O, but got Unknown
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Expected O, but got Unknown
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Expected O, but got Unknown
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Expected O, but got Unknown
			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).");
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableAltMoon));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableVoidFog));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(baseHealth, new StepSliderConfig
			{
				min = 1000f,
				max = 2000f,
				increment = 50f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(levelHealth, new StepSliderConfig
			{
				min = 100f,
				max = 500f,
				increment = 25f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(baseDamage, new StepSliderConfig
			{
				min = 10f,
				max = 20f,
				increment = 0.5f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(levelDamage, new StepSliderConfig
			{
				min = 1f,
				max = 6f,
				increment = 0.25f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(baseArmor, new StepSliderConfig
			{
				min = 20f,
				max = 60f,
				increment = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(baseAtkSpd, new StepSliderConfig
			{
				min = 0.5f,
				max = 2f,
				increment = 0.25f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(baseSpd, new StepSliderConfig
			{
				min = 45f,
				max = 135f,
				increment = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(acceleration, new StepSliderConfig
			{
				min = 20f,
				max = 70f,
				increment = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(primCD, new IntSliderConfig
			{
				min = 1,
				max = 10
			}));
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(secCD, new IntSliderConfig
			{
				min = 30,
				max = 50
			}));
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(utilCD, new IntSliderConfig
			{
				min = 10,
				max = 30
			}));
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(specCD, new IntSliderConfig
			{
				min = 20,
				max = 40
			}));
			ModSettingsManager.SetModDescription("Voidling without fathoms");
		}
	}
	public class Skills
	{
		public Skills()
		{
			CreateSkills();
		}

		private void CreateSkills()
		{
			for (int i = 0; i < 3; i++)
			{
				CreatePrimary(i);
				CreateSecondary(i);
				CreateUtility(i);
				CreateSpecial(i);
			}
		}

		private void CreatePrimary(int phase)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_011f: 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)
			GameObject val = FathomlessVoidling.voidRaidCrabPhase1;
			if (phase == 1)
			{
				val = FathomlessVoidling.voidRaidCrabPhase2;
			}
			if (phase == 2)
			{
				val = FathomlessVoidling.voidRaidCrabPhase3;
			}
			SkillLocator component = val.GetComponent<SkillLocator>();
			GenericSkill val2 = val.GetComponents<GenericSkill>()[0];
			val2.skillName = "Disillusion";
			SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val3).name = ((Object)FathomlessVoidling.voidRaidCrabBase).name + "DisillusionFamily";
			val3.variants = (Variant[])(object)new Variant[1];
			val2._skillFamily = val3;
			SkillDef val4 = ScriptableObject.CreateInstance<SkillDef>();
			val4.activationState = new SerializableEntityStateType(typeof(Disillusion));
			val4.skillNameToken = "Disillusion";
			val4.activationStateMachineName = "Weapon";
			val4.baseMaxStock = 1;
			val4.baseRechargeInterval = ModConfig.primCD.Value;
			val4.beginSkillCooldownOnSkillEnd = true;
			val4.canceledFromSprinting = false;
			val4.cancelSprintingOnActivation = false;
			val4.fullRestockOnAssign = true;
			val4.interruptPriority = (InterruptPriority)2;
			val4.isCombatSkill = true;
			val4.mustKeyPress = false;
			val4.rechargeStock = 1;
			val4.requiredStock = 1;
			val4.stockToConsume = 1;
			val3.variants[0] = new Variant
			{
				skillDef = val4
			};
			ContentAddition.AddSkillFamily(val3);
			component.primary = val2;
		}

		private void CreateSecondary(int phase)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_011f: 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)
			GameObject val = FathomlessVoidling.voidRaidCrabPhase1;
			if (phase == 1)
			{
				val = FathomlessVoidling.voidRaidCrabPhase2;
			}
			if (phase == 2)
			{
				val = FathomlessVoidling.voidRaidCrabPhase3;
			}
			SkillLocator component = val.GetComponent<SkillLocator>();
			GenericSkill val2 = val.GetComponents<GenericSkill>()[1];
			val2.skillName = "Singularity";
			SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val3).name = ((Object)FathomlessVoidling.voidRaidCrabBase).name + "SingularityFamily";
			val3.variants = (Variant[])(object)new Variant[1];
			val2._skillFamily = val3;
			SkillDef val4 = ScriptableObject.CreateInstance<SkillDef>();
			val4.activationState = new SerializableEntityStateType(typeof(VacuumEnter));
			val4.skillNameToken = "Singularity";
			val4.activationStateMachineName = "Body";
			val4.baseMaxStock = 1;
			val4.baseRechargeInterval = ModConfig.secCD.Value;
			val4.beginSkillCooldownOnSkillEnd = true;
			val4.canceledFromSprinting = true;
			val4.cancelSprintingOnActivation = true;
			val4.fullRestockOnAssign = true;
			val4.interruptPriority = (InterruptPriority)3;
			val4.isCombatSkill = true;
			val4.mustKeyPress = false;
			val4.rechargeStock = 1;
			val4.requiredStock = 1;
			val4.stockToConsume = 1;
			val3.variants[0] = new Variant
			{
				skillDef = val4
			};
			ContentAddition.AddSkillFamily(val3);
			component.secondary = val2;
		}

		private void CreateUtility(int phase)
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = FathomlessVoidling.voidRaidCrabPhase1;
			if (phase == 1)
			{
				val = FathomlessVoidling.voidRaidCrabPhase2;
			}
			if (phase == 2)
			{
				val = FathomlessVoidling.voidRaidCrabPhase3;
			}
			SkillLocator component = val.GetComponent<SkillLocator>();
			GenericSkill val2 = ((phase == 0) ? val.AddComponent<GenericSkill>() : val.GetComponents<GenericSkill>()[2]);
			val2.skillName = "Transpose";
			SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val3).name = ((Object)FathomlessVoidling.voidRaidCrabBase).name + "TransposeFamily";
			val3.variants = (Variant[])(object)new Variant[1];
			val2._skillFamily = val3;
			SkillDef val4 = ScriptableObject.CreateInstance<SkillDef>();
			val4.activationState = new SerializableEntityStateType(typeof(Transpose));
			val4.skillNameToken = "Transpose";
			val4.activationStateMachineName = "Body";
			val4.baseMaxStock = 1;
			val4.baseRechargeInterval = ModConfig.utilCD.Value;
			val4.beginSkillCooldownOnSkillEnd = true;
			val4.canceledFromSprinting = false;
			val4.cancelSprintingOnActivation = false;
			val4.fullRestockOnAssign = true;
			val4.interruptPriority = (InterruptPriority)1;
			val4.isCombatSkill = true;
			val4.mustKeyPress = false;
			val4.rechargeStock = 1;
			val4.requiredStock = 1;
			val4.stockToConsume = 1;
			val3.variants[0] = new Variant
			{
				skillDef = val4
			};
			ContentAddition.AddSkillFamily(val3);
			component.utility = val2;
		}

		private void CreateSpecial(int phase)
		{
			//IL_0085: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: 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)
			GameObject val = FathomlessVoidling.voidRaidCrabPhase1;
			if (phase == 1)
			{
				val = FathomlessVoidling.voidRaidCrabPhase2;
			}
			if (phase == 2)
			{
				val = FathomlessVoidling.voidRaidCrabPhase3;
			}
			SkillLocator component = val.GetComponent<SkillLocator>();
			GenericSkill val2 = ((phase == 0) ? val.GetComponents<GenericSkill>()[2] : val.GetComponents<GenericSkill>()[3]);
			val2.skillName = "OmegaBeam";
			SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val3).name = ((Object)FathomlessVoidling.voidRaidCrabBase).name + "OmegaBeamFamily";
			val3.variants = (Variant[])(object)new Variant[1];
			val2._skillFamily = val3;
			SkillDef val4 = ScriptableObject.CreateInstance<SkillDef>();
			val4.activationState = new SerializableEntityStateType(typeof(Transpose));
			val4.skillNameToken = "OmegaBeam";
			val4.activationStateMachineName = "Body";
			val4.baseMaxStock = 1;
			val4.baseRechargeInterval = ModConfig.specCD.Value;
			val4.beginSkillCooldownOnSkillEnd = true;
			val4.canceledFromSprinting = false;
			val4.cancelSprintingOnActivation = false;
			val4.fullRestockOnAssign = true;
			val4.interruptPriority = (InterruptPriority)2;
			val4.isCombatSkill = true;
			val4.mustKeyPress = false;
			val4.rechargeStock = 1;
			val4.requiredStock = 1;
			val4.stockToConsume = 1;
			val3.variants[0] = new Variant
			{
				skillDef = val4
			};
			ContentAddition.AddSkillFamily(val3);
			component.special = val2;
		}
	}
	public class Disillusion : BaseState
	{
		private class Predictor
		{
			private enum ExtrapolationType
			{
				None,
				Linear,
				Polar
			}

			private Transform bodyTransform;

			private Transform targetTransform;

			private Vector3 targetPosition0;

			private Vector3 targetPosition1;

			private Vector3 targetPosition2;

			private int collectedPositions;

			public bool hasTargetTransform => Object.op_Implicit((Object)(object)targetTransform);

			public bool isPredictionReady => collectedPositions > 2;

			public Predictor(Transform bodyTransform)
			{
				this.bodyTransform = bodyTransform;
			}

			private void PushTargetPosition(Vector3 newTargetPosition)
			{
				//IL_0002: 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_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				targetPosition2 = targetPosition1;
				targetPosition1 = targetPosition0;
				targetPosition0 = newTargetPosition;
				collectedPositions++;
			}

			public void SetTargetTransform(Transform newTargetTransform)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0020: Unknown result type (might be due to invalid IL or missing references)
				targetTransform = newTargetTransform;
				targetPosition2 = (targetPosition1 = (targetPosition0 = newTargetTransform.position));
				collectedPositions = 1;
			}

			public void Update()
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)targetTransform))
				{
					PushTargetPosition(targetTransform.position);
				}
			}

			public bool GetPredictedTargetPosition(float time, out Vector3 predictedPosition)
			{
				//IL_0001: 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_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: 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_0023: 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_003d: 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_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: 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_00a4: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: 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_00cc: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
				//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_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: 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_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_014b: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e4: 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)
				Vector3 val = targetPosition1 - targetPosition2;
				Vector3 val2 = targetPosition0 - targetPosition1;
				val.y = 0f;
				val2.y = 0f;
				ExtrapolationType extrapolationType = ((!(val == Vector3.zero) && !(val2 == Vector3.zero)) ? ((!((double)Vector3.Dot(((Vector3)(ref val)).normalized, ((Vector3)(ref val2)).normalized) <= 0.980000019073486)) ? ExtrapolationType.Linear : ExtrapolationType.Polar) : ExtrapolationType.None);
				float num = 1f / Time.fixedDeltaTime;
				predictedPosition = targetPosition0;
				switch (extrapolationType)
				{
				case ExtrapolationType.Linear:
					predictedPosition = targetPosition0 + val2 * (time * num);
					break;
				case ExtrapolationType.Polar:
				{
					Vector3 position = bodyTransform.position;
					Vector3 val3 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition2 - position));
					Vector3 val4 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition1 - position));
					Vector3 val5 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition0 - position));
					float magnitude = ((Vector3)(ref val3)).magnitude;
					float magnitude2 = ((Vector3)(ref val4)).magnitude;
					float magnitude3 = ((Vector3)(ref val5)).magnitude;
					float num2 = Vector2.SignedAngle(Vector2.op_Implicit(val3), Vector2.op_Implicit(val4)) * num;
					float num3 = Vector2.SignedAngle(Vector2.op_Implicit(val4), Vector2.op_Implicit(val5)) * num;
					double num4 = ((double)magnitude2 - (double)magnitude) * (double)num;
					float num5 = (magnitude3 - magnitude2) * num;
					float num6 = (float)(((double)num2 + (double)num3) * 0.5);
					double num7 = num5;
					float num8 = (float)((num4 + num7) * 0.5);
					float num9 = magnitude3 + num8 * time;
					if ((double)num9 < 0.0)
					{
						num9 = 0f;
					}
					Vector2 val6 = Util.RotateVector2(Vector2.op_Implicit(val5), num6 * time) * (num9 * magnitude3);
					predictedPosition = position;
					predictedPosition.x += val6.x;
					predictedPosition.z += val6.y;
					break;
				}
				}
				return true;
			}
		}

		public static int portalBombCount;

		public static float baseDuration = 4f;

		public static float damageCoefficient;

		public static float procCoefficient;

		public static float randomRadius;

		public static float force;

		public static float minimumDistanceBetweenBombs;

		private GameObject bombPrefab;

		private float duration;

		private int bombsFired;

		private float fireTimer;

		private float stopwatch;

		private float fireInterval;

		private Vector3 lastBombPosition;

		private Vector3 predictedTargetPosition;

		private Predictor predictor;

		public override void OnEnter()
		{
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			switch (((Object)((EntityState)this).characterBody).name)
			{
			case "MiniVoidRaidCrabBodyPhase1(Clone)":
				bombPrefab = FathomlessVoidling.bombPrefab1;
				break;
			case "MiniVoidRaidCrabBodyPhase2(Clone)":
				bombPrefab = FathomlessVoidling.bombPrefab2;
				break;
			case "MiniVoidRaidCrabBodyPhase3(Clone)":
				bombPrefab = FathomlessVoidling.bombPrefab3;
				break;
			}
			fireInterval = duration / 5f;
			fireTimer = 0f;
			stopwatch = 0f;
			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);
			}
		}

		private void FireBomb(Vector3 point)
		{
			//IL_0007: 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_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_0065: Unknown result type (might be due to invalid IL or missing references)
			ProjectileManager.instance.FireProjectile(new FireProjectileInfo
			{
				projectilePrefab = bombPrefab,
				position = point,
				rotation = Quaternion.identity,
				owner = ((EntityState)this).gameObject,
				damage = 0f,
				force = 0f,
				crit = ((EntityState)this).characterBody.RollCrit()
			});
		}

		public override void FixedUpdate()
		{
			//IL_005b: 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_00af: 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_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_00e4: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			predictor.Update();
			if ((double)stopwatch <= 1.0)
			{
				predictor.GetPredictedTargetPosition(1f, out predictedTargetPosition);
			}
			else
			{
				stopwatch = 0f;
				FireBomb(predictedTargetPosition);
			}
			fireTimer -= Time.fixedDeltaTime;
			if ((double)fireTimer <= 0.0)
			{
				fireTimer += fireInterval;
				EffectManager.SimpleMuzzleFlash(new FireMissiles().muzzleFlashPrefab, ((EntityState)this).gameObject, new FireMissiles().muzzleName, false);
				Util.PlayAttackSpeedSound(new FireMissiles().fireWaveSoundString, ((EntityState)this).gameObject, base.attackSpeedStat);
				Ray aimRay = ((BaseState)this).GetAimRay();
				Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
				FireProjectileInfo val2 = default(FireProjectileInfo);
				val2.projectilePrefab = new FireMissiles().projectilePrefab;
				val2.position = ((BaseState)this).FindModelChild(new FireMissiles().muzzleName).position;
				val2.owner = ((EntityState)this).gameObject;
				val2.damage = base.damageStat * new FireMissiles().damageCoefficient;
				val2.force = new FireMissiles().force;
				FireProjectileInfo val3 = val2;
				for (int i = 0; i < new FireMissiles().numMissilesPerWave; i++)
				{
					val3.rotation = val * new FireMissiles().GetRandomRollPitch();
					val3.crit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
					ProjectileManager.instance.FireProjectile(val3);
				}
				EffectManager.SimpleMuzzleFlash(FirePortalBomb.muzzleflashEffectPrefab, ((EntityState)this).gameObject, new FireMissiles().muzzleName, true);
				bombsFired++;
			}
			if (!((double)((EntityState)this).fixedAge < (double)duration))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
	public class ChargeRend : BaseMultiBeamState
	{
		[SerializeField]
		public float baseDuration = new ChargeMultiBeam().baseDuration;

		[SerializeField]
		public GameObject chargeEffectPrefab = new ChargeMultiBeam().chargeEffectPrefab;

		[SerializeField]
		public GameObject warningLaserVfxPrefab = new ChargeMultiBeam().warningLaserVfxPrefab;

		[SerializeField]
		public string muzzleName = new ChargeMultiBeam().muzzleName;

		[SerializeField]
		public string enterSoundString = new ChargeMultiBeam().enterSoundString;

		[SerializeField]
		public bool isSoundScaledByAttackSpeed = new ChargeMultiBeam().isSoundScaledByAttackSpeed;

		[SerializeField]
		public string animationLayerName = new ChargeMultiBeam().animationLayerName;

		[SerializeField]
		public string animationStateName = new ChargeMultiBeam().animationStateName;

		[SerializeField]
		public string animationPlaybackRateParam = new ChargeMultiBeam().animationPlaybackRateParam;

		private float duration;

		private GameObject chargeEffectInstance;

		private GameObject warningLaserVfxInstance;

		private RayAttackIndicator warningLaserVfxInstanceRayAttackIndicator;

		private bool warningLaserEnabled
		{
			get
			{
				return Object.op_Implicit((Object)(object)warningLaserVfxInstance);
			}
			set
			{
				if (value == warningLaserEnabled)
				{
					return;
				}
				if (value)
				{
					if (Object.op_Implicit((Object)(object)warningLaserVfxPrefab))
					{
						warningLaserVfxInstance = Object.Instantiate<GameObject>(warningLaserVfxPrefab);
						warningLaserVfxInstanceRayAttackIndicator = warningLaserVfxInstance.GetComponent<RayAttackIndicator>();
						UpdateWarningLaser();
					}
				}
				else
				{
					EntityState.Destroy((Object)(object)warningLaserVfxInstance);
					warningLaserVfxInstance = null;
					warningLaserVfxInstanceRayAttackIndicator = null;
				}
			}
		}

		public override void OnEnter()
		{
			//IL_007f: 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)
			((BaseMultiBeamState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParam, duration);
			ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
			if (Object.op_Implicit((Object)(object)modelChildLocator) && Object.op_Implicit((Object)(object)chargeEffectPrefab))
			{
				Transform val = modelChildLocator.FindChild(muzzleName) ?? ((EntityState)this).characterBody.coreTransform;
				if (Object.op_Implicit((Object)(object)val))
				{
					chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val.position, val.rotation);
					chargeEffectInstance.transform.parent = val;
					ScaleParticleSystemDuration component = chargeEffectInstance.GetComponent<ScaleParticleSystemDuration>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.newDuration = duration;
					}
				}
			}
			if (!string.IsNullOrEmpty(enterSoundString))
			{
				if (isSoundScaledByAttackSpeed)
				{
					Util.PlayAttackSpeedSound(enterSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				}
				else
				{
					Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
				}
			}
			warningLaserEnabled = true;
		}

		public override void OnExit()
		{
			warningLaserEnabled = false;
			EntityState.Destroy((Object)(object)chargeEffectInstance);
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && !((double)((EntityState)this).fixedAge < (double)duration))
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Rend());
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			UpdateWarningLaser();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)6;
		}

		private void UpdateWarningLaser()
		{
			//IL_002e: 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)
			if (Object.op_Implicit((Object)(object)warningLaserVfxInstanceRayAttackIndicator))
			{
				warningLaserVfxInstanceRayAttackIndicator.attackRange = BaseMultiBeamState.beamMaxDistance;
				Ray attackRay = default(Ray);
				Vector3 val = default(Vector3);
				((BaseMultiBeamState)this).CalcBeamPath(ref attackRay, ref val);
				warningLaserVfxInstanceRayAttackIndicator.attackRay = attackRay;
			}
		}
	}
	public class Rend : BaseState
	{
		private float stopwatch;

		private float missileStopwatch;

		public float baseDuration = 4f;

		public static string muzzleString = BaseMultiBeamState.muzzleName;

		public static float missileSpawnFrequency = 6f;

		public static float missileSpawnDelay = 0f;

		public static float damageCoefficient;

		public static float maxSpread = 1f;

		public static float blastDamageCoefficient = 1f;

		public static float blastForceMagnitude = 3000f;

		public static float blastRadius = 6f;

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

		public static string muzzleName = "EyeProjectileCenter";

		public static string animationLayerName = "Gesture";

		public static string animationStateName = "FireMultiBeamFinale";

		public static string animationPlaybackRateParam = "MultiBeam.playbackRate";

		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 muzzleEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/VoidRaidCrabTripleBeamMuzzleflash.prefab").WaitForCompletion();

		private float duration;

		private static Random rand = new Random();

		protected Transform muzzleTransform { get; private set; }

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			missileStopwatch -= missileSpawnDelay;
			duration = baseDuration / base.attackSpeedStat;
			muzzleTransform = ((BaseState)this).FindModelChild(muzzleName);
		}

		private void FireBlob()
		{
			//IL_001b: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_0085: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_00cc: 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_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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Expected O, but got Unknown
			((EntityState)this).PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParam, duration);
			Util.PlaySound(((BaseFireMultiBeam)new FireMultiBeamSmall()).enterSoundString, ((EntityState)this).gameObject);
			CalcBeamPath(out var beamRay, out var beamEndPos);
			beamEndPos += new Vector3(Random.Range(-15f, 15f), Random.Range(-10f, 10f), Random.Range(-15f, 15f));
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
				baseDamage = base.damageStat * (blastDamageCoefficient / 2f),
				baseForce = blastForceMagnitude,
				position = beamEndPos,
				radius = blastRadius,
				falloffModel = (FalloffModel)2,
				bonusForce = blastBonusForce,
				damageType = (DamageType)0
			}.Fire();
			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 val = new EffectData
						{
							origin = beamEndPos,
							start = ((Ray)(ref beamRay)).origin,
							scale = blastRadius
						};
						val.SetChildLocatorTransformReference(((EntityState)this).gameObject, num);
						EffectManager.SpawnEffect(tracerEffectPrefab, val, true);
						EffectManager.SpawnEffect(explosionEffectPrefab, val, true);
					}
				}
			}
			OnFireBeam(((Ray)(ref beamRay)).origin, beamEndPos);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			missileStopwatch += Time.fixedDeltaTime;
			if ((double)missileStopwatch >= 1.0 / (double)missileSpawnFrequency)
			{
				missileStopwatch -= 1f / missileSpawnFrequency;
				FireBlob();
				if (!((double)stopwatch < (double)baseDuration) && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public void OnFireBeam(Vector3 beamStart, Vector3 beamEnd)
		{
			//IL_0007: 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_0020: 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_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_003a: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			ProjectileManager.instance.FireProjectile(new FireProjectileInfo
			{
				projectilePrefab = new FireMultiBeamFinale().projectilePrefab,
				position = beamEnd + Vector3.up * new FireMultiBeamFinale().projectileVerticalSpawnOffset,
				owner = ((EntityState)this).gameObject,
				damage = base.damageStat * (new FireMultiBeamFinale().projectileDamageCoefficient / 6f),
				crit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master)
			});
		}

		public void CalcBeamPath(out Ray beamRay, out Vector3 beamEndPos)
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//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_00a2: 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_00aa: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			float num = float.PositiveInfinity;
			RaycastHit[] array = Physics.RaycastAll(aimRay, BaseMultiBeamState.beamMaxDistance, LayerMask.op_Implicit(CommonMasks.bullet), (QueryTriggerInteraction)1);
			Transform root = ((EntityState)this).GetModelTransform().root;
			for (int i = 0; i < array.Length; i++)
			{
				ref RaycastHit reference = ref array[i];
				float distance = ((RaycastHit)(ref reference)).distance;
				if ((double)distance < (double)num && (Object)(object)((Component)((RaycastHit)(ref reference)).collider).transform.root != (Object)(object)root)
				{
					num = distance;
				}
			}
			float num2 = Mathf.Min(num, BaseMultiBeamState.beamMaxDistance);
			beamEndPos = ((Ray)(ref aimRay)).GetPoint(num2);
			Vector3 position = muzzleTransform.position;
			beamRay = new Ray(position, beamEndPos - position);
		}
	}
	public class ChargeCrush : BaseState
	{
		[SerializeField]
		public float baseDuration = 3.3f;

		protected float duration { get; private set; }

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

		public override void FixedUpdate()
		{
			//IL_001f: 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)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && !((double)((EntityState)this).fixedAge < (double)duration))
			{
				Util.PlaySound(((BaseFireMultiBeam)new FireMultiBeamSmall()).enterSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(new FireMissiles().muzzleFlashPrefab, ((EntityState)this).gameObject, BaseMultiBeamState.muzzleName, false);
				((EntityState)this).PlayAnimation("Body", "SuckExit", "Suck.playbackRate", 3.3f);
				((EntityState)this).outer.SetNextState((EntityState)(object)new Crush());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class ChargeReap : BaseSpinBeamAttackState
	{
		public override void OnEnter()
		{
			((BaseSpinBeamAttackState)this).OnEnter();
			((BaseSpinBeamAttackState)this).CreateBeamVFXInstance(SpinBeamWindUp.warningLaserPrefab);
			Util.PlaySound(SpinBeamWindUp.enterSoundString, ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if ((double)((EntityState)this).fixedAge >= (double)((BaseSpinBeamAttackState)this).duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Reap());
			}
			((BaseSpinBeamAttackState)this).SetHeadYawRevolutions(SpinBeamWindUp.revolutionsCurve.Evaluate(((BaseSpinBeamAttackState)this).normalizedFixedAge));
		}
	}
	public class Crush : BaseState
	{
		private float stopwatch;

		private float missileStopwatch;

		public static float baseDuration = 6f;

		public static string muzzleString = BaseMultiBeamState.muzzleName;

		public static float missileSpawnFrequency = 6f;

		public static float missileSpawnDelay = 0f;

		public static float damageCoefficient;

		public static float maxSpread = 1f;

		public static GameObject projectilePrefab;

		public static GameObject muzzleflashPrefab;

		private ChildLocator childLocator;

		private static Random rand = new Random();

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			missileStopwatch -= missileSpawnDelay;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)childLocator))
				{
					Object.op_Implicit((Object)(object)childLocator.FindChild(muzzleString));
				}
			}
		}

		private void FireBlob(Ray projectileRay, float bonusPitch, float bonusYaw)
		{
			//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_007d: 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_00cf: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			EffectManager.SpawnEffect(FathomlessVoidling.portal, new EffectData
			{
				origin = ((Ray)(ref projectileRay)).origin,
				rotation = Util.QuaternionSafeLookRotation(((Ray)(ref projectileRay)).direction)
			}, false);
			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 * (new FireSecondaryProjectile().damageCoefficient * 2f);
			val.owner = ((EntityState)this).gameObject;
			val.force = new FireSecondaryProjectile().force * 2f;
			((FireProjectileInfo)(ref val)).speedOverride = 100f;
			val.projectilePrefab = FathomlessVoidling.meteor;
			FireProjectileInfo val2 = val;
			ProjectileManager.instance.FireProjectile(val2);
		}

		public override void FixedUpdate()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			missileStopwatch += Time.fixedDeltaTime;
			if (!((double)missileStopwatch >= 1.0 / (double)missileSpawnFrequency))
			{
				return;
			}
			missileStopwatch -= 1f / missileSpawnFrequency;
			Transform val = childLocator.FindChild(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;
				}
				FireBlob(projectileRay, 0f, 0f);
			}
			if (!((double)stopwatch < (double)baseDuration) && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Reap : BaseState
	{
		private class Predictor
		{
			private enum ExtrapolationType
			{
				None,
				Linear,
				Polar
			}

			private Transform bodyTransform;

			private Transform targetTransform;

			private Vector3 targetPosition0;

			private Vector3 targetPosition1;

			private Vector3 targetPosition2;

			private int collectedPositions;

			public bool hasTargetTransform => Object.op_Implicit((Object)(object)targetTransform);

			public bool isPredictionReady => collectedPositions > 2;

			public Predictor(Transform bodyTransform)
			{
				this.bodyTransform = bodyTransform;
			}

			private void PushTargetPosition(Vector3 newTargetPosition)
			{
				//IL_0002: 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_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				targetPosition2 = targetPosition1;
				targetPosition1 = targetPosition0;
				targetPosition0 = newTargetPosition;
				collectedPositions++;
			}

			public void SetTargetTransform(Transform newTargetTransform)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0020: Unknown result type (might be due to invalid IL or missing references)
				targetTransform = newTargetTransform;
				targetPosition2 = (targetPosition1 = (targetPosition0 = newTargetTransform.position));
				collectedPositions = 1;
			}

			public void Update()
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)targetTransform))
				{
					PushTargetPosition(targetTransform.position);
				}
			}

			public bool GetPredictedTargetPosition(float time, out Vector3 predictedPosition)
			{
				//IL_0001: 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_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: 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_0023: 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_003d: 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_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: 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_00a4: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: 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_00cc: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
				//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_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: 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_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_014b: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e4: 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)
				Vector3 val = targetPosition1 - targetPosition2;
				Vector3 val2 = targetPosition0 - targetPosition1;
				val.y = 0f;
				val2.y = 0f;
				ExtrapolationType extrapolationType = ((!(val == Vector3.zero) && !(val2 == Vector3.zero)) ? ((!((double)Vector3.Dot(((Vector3)(ref val)).normalized, ((Vector3)(ref val2)).normalized) <= 0.980000019073486)) ? ExtrapolationType.Linear : ExtrapolationType.Polar) : ExtrapolationType.None);
				float num = 1f / Time.fixedDeltaTime;
				predictedPosition = targetPosition0;
				switch (extrapolationType)
				{
				case ExtrapolationType.Linear:
					predictedPosition = targetPosition0 + val2 * (time * num);
					break;
				case ExtrapolationType.Polar:
				{
					Vector3 position = bodyTransform.position;
					Vector3 val3 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition2 - position));
					Vector3 val4 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition1 - position));
					Vector3 val5 = Vector2.op_Implicit(Util.Vector3XZToVector2XY(targetPosition0 - position));
					float magnitude = ((Vector3)(ref val3)).magnitude;
					float magnitude2 = ((Vector3)(ref val4)).magnitude;
					float magnitude3 = ((Vector3)(ref val5)).magnitude;
					float num2 = Vector2.SignedAngle(Vector2.op_Implicit(val3), Vector2.op_Implicit(val4)) * num;
					float num3 = Vector2.SignedAngle(Vector2.op_Implicit(val4), Vector2.op_Implicit(val5)) * num;
					double num4 = ((double)magnitude2 - (double)magnitude) * (double)num;
					float num5 = (magnitude3 - magnitude2) * num;
					float num6 = (float)(((double)num2 + (double)num3) * 0.5);
					double num7 = num5;
					float num8 = (float)((num4 + num7) * 0.5);
					float num9 = magnitude3 + num8 * time;
					if ((double)num9 < 0.0)
					{
						num9 = 0f;
					}
					Vector2 val6 = Util.RotateVector2(Vector2.op_Implicit(val5), num6 * time) * (num9 * magnitude3);
					predictedPosition = position;
					predictedPosition.x += val6.x;
					predictedPosition.z += val6.y;
					break;
				}
				}
				return true;
			}
		}

		public static int portalBombCount;

		public static float baseDuration = 4f;

		private float duration;

		private float stopwatch;

		private float beamTickTimer;

		private Vector3 predictedTargetPosition;

		private GameObject predictiveLaserIndicator;

		private int counter;

		private Predictor predictor;

		private static GameObject areaIndicatorPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab").WaitForCompletion();

		public override void OnEnter()
		{
			//IL_003e: 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_006b: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d9: 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)
			((BaseState)this).OnEnter();
			counter++;
			predictiveLaserIndicator = Object.Instantiate<GameObject>(areaIndicatorPrefab);
			predictiveLaserIndicator.transform.localScale = new Vector3(ArrowRain.arrowRainRadius, ArrowRain.arrowRainRadius, ArrowRain.arrowRainRadius);
			duration = baseDuration / base.attackSpeedStat;
			stopwatch = 0f;
			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 = 500f;
			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);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			predictor.Update();
			if ((double)stopwatch <= 1.0)
			{
				predictor.GetPredictedTargetPosition(1f, out predictedTargetPosition);
				predictiveLaserIndicator.transform.position = predictedTargetPosition;
			}
			else
			{
				stopwatch = 0f;
				predictiveLaserIndicator.transform.position = new Vector3(0f, 0f, 0f);
				((EntityState)this).outer.SetNextState((EntityState)(object)new ReapLaser
				{
					count = counter
				});
			}
			if (!((double)((EntityState)this).fixedAge < (double)duration))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
	public class ReapLaser : BaseSpinBeamAttackState
	{
		public int count;

		public Vector3 targetPosition;

		private Ray aimRay;

		private float baseDuration = 2f;

		private float duration;

		private float beamTickTimer;

		private SoundLoopPtr loopPtr;

		public override void OnEnter()
		{
			//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_003a: 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_004a: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			if (count > 3)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			aimRay = ((BaseState)this).GetAimRay();
			((Ray)(ref aimRay)).direction = targetPosition - ((Ray)(ref aimRay)).origin;
			((BaseSpinBeamAttackState)this).beamVfxInstance = Object.Instantiate<GameObject>(SpinBeamAttack.beamVfxPrefab, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction));
			loopPtr = LoopSoundManager.PlaySoundLoopLocal(((EntityState)this).gameObject, SpinBeamAttack.loopSound);
			Util.PlaySound(SpinBeamAttack.enterSoundString, ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			if (((EntityState)this).isAuthority)
			{
				if ((double)beamTickTimer <= 0.0)
				{
					beamTickTimer += 1f / SpinBeamAttack.beamTickFrequency;
					FireBeamBulletAuthority();
				}
				beamTickTimer -= Time.fixedDeltaTime;
			}
		}

		public override void OnExit()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			LoopSoundManager.StopSoundLoopLocal(loopPtr);
			VfxKillBehavior.KillVfxObject(((BaseSpinBeamAttackState)this).beamVfxInstance);
			((BaseSpinBeamAttackState)this).beamVfxInstance = null;
			((EntityState)this).outer.SetNextState((EntityState)(object)new Reap());
		}

		private void FireBeamBulletAuthority()
		{
			//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_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_0016: 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_0027: 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_003d: 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_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_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_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown r