Decompiled source of VariantPack NebbysWrath v3.1.0

plugins/NebbysWrath.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.AncientWispMonster;
using EntityStates.ArchWispMonster;
using EntityStates.ExtractorUnit;
using EntityStates.FlyingVermin.Weapon;
using EntityStates.FriendUnit;
using EntityStates.GolemMonster;
using EntityStates.GreaterWispMonster;
using EntityStates.LemurianMonster;
using EntityStates.MagmaWorm;
using EntityStates.Mimic.Chest;
using EntityStates.Mimic.Devour;
using EntityStates.Mimic.Stalker;
using EntityStates.MinePod;
using EntityStates.MoffeinAncientWispSkills;
using EntityStates.ParentMonster;
using EntityStates.QuestVolatileBattery;
using EntityStates.RoboBallBoss.Weapon;
using EntityStates.Scorchling;
using EntityStates.SolusWing;
using EntityStates.TitanMonster;
using EntityStates.VagrantMonster;
using EntityStates.Wisp1Monster;
using Grumpy;
using HG;
using HG.Reflection;
using IL.EntityStates.RoboBallBoss.Weapon;
using KinematicCharacterController;
using LoadingScreenFix;
using MSU;
using MSU.Config;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using NW;
using NW.DamageTypes;
using NW.Modules;
using NW.PrefabClones;
using On.EntityStates.ExtractorUnit;
using On.EntityStates.Mimic.Devour;
using On.EntityStates.SolusWing;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.AddressableAssets;
using RoR2.AsyncManagement;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2BepInExPack.GameAssetPathsBetter;
using TO30.Components;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using VAPI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace EntityStates.MegaConstruct.Omicron
{
	public class FireLasers : BaseState
	{
		private static float _duration;

		private static string _animationLayerName;

		private static string _animationStateName;

		private static string _animationPlaybackRateParam;

		private static bool _obtainedOrigs;

		private float _fireStopwatch;

		private float _timeBetweenFires;

		private Transform[] _firePoints;

		public override void OnEnter()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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)
			if (!_obtainedOrigs)
			{
				_obtainedOrigs = true;
				SpawnMinorConstructs val = new SpawnMinorConstructs();
				_duration = val.duration / 2f;
				_animationLayerName = val.animationLayerName;
				_animationStateName = val.animationStateName;
				_animationPlaybackRateParam = val.animationPlaybackRateParam;
			}
			((BaseState)this).OnEnter();
			((EntityState)this).PlayAnimation(_animationLayerName, _animationStateName, _animationPlaybackRateParam, _duration, 0f);
			_timeBetweenFires = _duration / 4f;
			ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
			_firePoints = (Transform[])(object)new Transform[4]
			{
				modelChildLocator.FindChild("AttachmentPoint0"),
				modelChildLocator.FindChild("AttachmentPoint1"),
				modelChildLocator.FindChild("AttachmentPoint2"),
				modelChildLocator.FindChild("AttachmentPoint3")
			};
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > _duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			_fireStopwatch -= Time.fixedDeltaTime;
			if (_fireStopwatch <= 0f)
			{
				_fireStopwatch += _timeBetweenFires;
				Fire();
			}
		}

		private void Fire()
		{
			//IL_002b: 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_006f: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_00b1: 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)
			if (((EntityState)this).isAuthority)
			{
				Transform val = _firePoints[Run.instance.stageRng.RangeInt(0, _firePoints.Length)];
				FireProjectileInfo val2 = new FireProjectileInfo
				{
					crit = ((BaseState)this).RollCrit(),
					damage = base.damageStat,
					damageColorIndex = (DamageColorIndex)0,
					force = 30f,
					owner = ((EntityState)this).gameObject,
					position = val.position
				};
				Ray aimRay = ((BaseState)this).GetAimRay();
				val2.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				val2.projectilePrefab = OmicronProjectile.omicronProjectile;
				val2.damageTypeOverride = DamageTypeCombo.GenericPrimary;
				FireProjectileInfo val3 = val2;
				ProjectileManager.instance.FireProjectile(val3);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class LaserBarrage : FlyState
	{
		private static string _animationLayerName;

		private static string _animationEnterStateName;

		private static float _duration;

		private static bool _obtainedOrigs;

		private static float _baseTimeBetweenLasers = 0.25f;

		private static float _baseDurationUntilFullSpeed;

		private static float _fullSpeedMultiplier = 2f;

		private float _timeUntilFullSpeed;

		private float _fullSpeedStopwatch;

		private float _baseTimeBetweenLasersForThisState;

		private float _actualTimeBetweenLasers;

		private float _fireStopwatch;

		private Transform[] _firePoints;

		public override void OnEnter()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (!_obtainedOrigs)
			{
				_obtainedOrigs = true;
				RaiseShield val = new RaiseShield();
				_animationLayerName = val.animationLayerName;
				_animationEnterStateName = val.animationEnterStateName;
				_duration = val.duration;
				_baseDurationUntilFullSpeed = _duration / 2f;
			}
			((FlyState)this).OnEnter();
			((EntityState)this).PlayAnimation(_animationLayerName, _animationEnterStateName);
			_baseTimeBetweenLasersForThisState = _baseTimeBetweenLasers / ((BaseState)this).attackSpeedStat;
			_actualTimeBetweenLasers = _baseTimeBetweenLasersForThisState;
			_timeUntilFullSpeed = _baseDurationUntilFullSpeed / ((BaseState)this).attackSpeedStat;
			ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
			_firePoints = (Transform[])(object)new Transform[4]
			{
				modelChildLocator.FindChild("BarragePoint0"),
				modelChildLocator.FindChild("BarragePoint1"),
				modelChildLocator.FindChild("BarragePoint2"),
				modelChildLocator.FindChild("BarragePoint3")
			};
		}

		public override bool CanExecuteSkill(GenericSkill skillSlot)
		{
			return false;
		}

		public override void FixedUpdate()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			((FlyState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > _duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)new ExitShield());
			}
			if (_fullSpeedStopwatch < _timeUntilFullSpeed)
			{
				_fullSpeedStopwatch += Time.fixedDeltaTime;
				float num = Util.Remap(_fullSpeedStopwatch, 0f, _timeUntilFullSpeed, 1f, _fullSpeedMultiplier);
				_actualTimeBetweenLasers = _baseTimeBetweenLasersForThisState / num;
			}
			_fireStopwatch += Time.fixedDeltaTime;
			if (_fireStopwatch > _actualTimeBetweenLasers)
			{
				_fireStopwatch -= _actualTimeBetweenLasers;
				FireLaser();
			}
		}

		private void FireLaser()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				FireProjectileInfo val = new FireProjectileInfo
				{
					crit = ((BaseState)this).RollCrit(),
					damage = ((BaseState)this).damageStat * 0.5f,
					damageColorIndex = (DamageColorIndex)0,
					force = 30f,
					owner = ((EntityState)this).gameObject,
					projectilePrefab = OmicronProjectile.omicronProjectile,
					damageTypeOverride = DamageTypeCombo.GenericUtility
				};
				for (int i = 0; i < _firePoints.Length; i++)
				{
					val.rotation = Quaternion.LookRotation(_firePoints[i].forward);
					val.position = _firePoints[i].position;
					ProjectileManager.instance.FireProjectile(val);
				}
			}
		}
	}
}
namespace EntityStates.VagrantMonster.Weapon.Mothership
{
	public class ChargeJellies : BaseState
	{
		public static float baseDuration = 3f;

		public static GameObject chargingEffectPrefab;

		public static string chargingSoundString;

		private float duration;

		private float stopwatch;

		private GameObject chargeEffectInstance;

		private uint soundID;

		public override void OnEnter()
		{
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			chargingEffectPrefab = ChargeTrackingBomb.chargingEffectPrefab;
			chargingSoundString = ChargeTrackingBomb.chargingSoundString;
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			duration = baseDuration / 5f;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayCrossfade("Gesture, Override", "ChargeTrackingBomb", "ChargeTrackingBomb.playbackRate", duration, 0.3f);
			soundID = Util.PlayAttackSpeedSound(chargingSoundString, ((EntityState)this).gameObject, 5f);
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Transform val = component.FindChild("TrackingBombMuzzle");
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargingEffectPrefab))
				{
					chargeEffectInstance = Object.Instantiate<GameObject>(chargingEffectPrefab, val.position, val.rotation);
					chargeEffectInstance.transform.parent = val;
					chargeEffectInstance.GetComponent<ScaleParticleSystemDuration>().newDuration = duration;
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeEffectInstance))
			{
				EntityState.Destroy((Object)(object)chargeEffectInstance);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FireJellies());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)3;
		}
	}
	public class FireJellies : BaseState
	{
		public static float baseDuration = 3f;

		public static SpawnCard JellySpawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/Jellyfish/cscJellyfish.asset").WaitForCompletion();

		public static GameObject SpawnEffectPrefab;

		private float duration;

		private float stopwatch;

		private BullseyeSearch enemySearch;

		public override void OnEnter()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			//IL_00c0: 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_00ca: 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)
			SpawnEffectPrefab = FireTrackingBomb.muzzleEffectPrefab;
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			duration = baseDuration / 5f;
			((EntityState)this).PlayAnimation("Gesture, Override", "FireTrackingBomb", "FireTrackingBomb.playbackRate", duration, 0f);
			if (NetworkServer.active)
			{
				enemySearch = new BullseyeSearch();
				enemySearch.filterByDistinctEntity = false;
				enemySearch.filterByLoS = false;
				enemySearch.maxDistanceFilter = float.PositiveInfinity;
				enemySearch.minDistanceFilter = 0f;
				enemySearch.minAngleFilter = 0f;
				enemySearch.maxAngleFilter = 180f;
				enemySearch.teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam());
				enemySearch.sortMode = (SortMode)1;
				enemySearch.viewer = ((EntityState)this).characterBody;
			}
			SpawnJellies();
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void SpawnJellies()
		{
			//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_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 searchOrigin = ((Ray)(ref aimRay)).origin;
			RaycastHit val = default(RaycastHit);
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.GetAimRaycast(float.PositiveInfinity, ref val))
			{
				searchOrigin = ((RaycastHit)(ref val)).point;
			}
			if (enemySearch == null)
			{
				return;
			}
			enemySearch.searchOrigin = searchOrigin;
			enemySearch.RefreshCandidates();
			HurtBox val2 = enemySearch.GetResults().FirstOrDefault();
			Transform val3 = ((Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.healthComponent)) ? val2.healthComponent.body.coreTransform : ((EntityState)this).characterBody.coreTransform);
			if (!Object.op_Implicit((Object)(object)val3) || !Object.op_Implicit((Object)(object)VariantSpawnManager.instance))
			{
				return;
			}
			for (int i = 0; i < 5; i++)
			{
				DirectorSpawnRequest val4 = new DirectorSpawnRequest(JellySpawnCard, new DirectorPlacementRule
				{
					placementMode = (PlacementMode)1,
					minDistance = 3f,
					maxDistance = 20f,
					spawnOnTarget = val3
				}, VariantSpawnManager.instance.variantSpawnRng)
				{
					summonerBodyObject = ((EntityState)this).gameObject,
					onSpawnedServer = delegate(SpawnResult result)
					{
						//IL_000b: Unknown result type (might be due to invalid IL or missing references)
						Util.CopyEliteStatus(((EntityState)this).characterBody.masterObject, result.spawnedInstance, false);
					}
				};
				new VariantDirectorSpawnRequest(val4)
				{
					noGoldExpModifications = true,
					noItemReward = true,
					preassignedVariantDefs = null,
					supressArrivalMessage = true
				};
				DirectorCore instance = DirectorCore.instance;
				GameObject val5 = ((instance != null) ? instance.TrySpawnObject(val4) : null);
				if (Object.op_Implicit((Object)(object)val5))
				{
					CharacterBody body = val5.GetComponent<CharacterMaster>().GetBody();
					EffectManager.SimpleMuzzleFlash(SpawnEffectPrefab, ((Component)body).gameObject, "TrackingBombMuzzle", false);
				}
			}
		}
	}
}
namespace EntityStates.RoboBallMini.Weapon.MK2
{
	public class MK2Charge : BaseState
	{
		public static float baseDuration = 1f;

		public static GameObject chargeEffectPrefab;

		public static string attackString;

		public static string muzzleString;

		private float duration;

		private GameObject chargeInstance;

		public override void OnEnter()
		{
			//IL_009c: 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)
			baseDuration = ChargeEyeblast.baseDuration;
			chargeEffectPrefab = ChargeEyeblast.chargeEffectPrefab;
			attackString = ChargeEyeblast.attackString;
			muzzleString = "Muzzle";
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlayAttackSpeedSound(attackString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Transform val = component.FindChild(muzzleString);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargeEffectPrefab))
			{
				chargeInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val.position, val.rotation);
				chargeInstance.transform.parent = val;
				ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.newDuration = duration;
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeInstance))
			{
				EntityState.Destroy((Object)(object)chargeInstance);
			}
		}

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

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

		public virtual EntityState GetNextState()
		{
			return (EntityState)(object)new MK2Fire();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class MK2Fire : BaseState
	{
		[SerializeField]
		public GameObject projectilePrefab;

		public static GameObject muzzleflashEffectPrefab;

		[SerializeField]
		public int projectileCount = 3;

		[SerializeField]
		public float totalYawSpread = 5f;

		[SerializeField]
		public float baseDuration = 2f;

		[SerializeField]
		public float baseFireDuration = 0.2f;

		[SerializeField]
		public float damageCoefficient = 1.2f;

		[SerializeField]
		public float projectileSpeed;

		public static float force = 20f;

		public static float selfForce;

		public static string attackString;

		public static string muzzleString;

		private float duration;

		private float fireDuration;

		private int projectilesFired;

		private bool projectileSpreadIsYaw;

		public override void OnEnter()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//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_00a0: 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)
			FireEyeBlast val = new FireEyeBlast();
			projectilePrefab = val.projectilePrefab;
			muzzleflashEffectPrefab = FireEyeBlast.muzzleflashEffectPrefab;
			projectileSpeed = val.projectileSpeed;
			selfForce = FireEyeBlast.selfForce / 4f;
			attackString = FireEyeBlast.attackString;
			muzzleString = FireEyeBlast.muzzleString;
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			fireDuration = baseFireDuration / base.attackSpeedStat;
			Util.PlaySound(attackString, ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				HealthComponent healthComponent = ((EntityState)this).healthComponent;
				Ray aimRay = ((BaseState)this).GetAimRay();
				healthComponent.TakeDamageForce(((Ray)(ref aimRay)).direction * selfForce, false, false);
			}
			if (Random.value <= 0.5f)
			{
				projectileSpreadIsYaw = true;
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//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_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				int num = Mathf.FloorToInt(((EntityState)this).fixedAge / fireDuration * (float)projectileCount);
				if (projectilesFired <= num && projectilesFired < projectileCount)
				{
					if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab))
					{
						EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
					}
					Ray aimRay = ((BaseState)this).GetAimRay();
					float num2 = projectileSpeed;
					int num3 = Mathf.FloorToInt((float)projectilesFired - (float)(projectileCount - 1) / 2f);
					float num4 = 0f;
					float num5 = 0f;
					if (projectileSpreadIsYaw)
					{
						num4 = (float)num3 / (float)(projectileCount - 1) * totalYawSpread;
					}
					else
					{
						num5 = (float)num3 / (float)(projectileCount - 1) * totalYawSpread;
					}
					Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num4, num5);
					ProjectileDamage val2 = default(ProjectileDamage);
					if (projectilePrefab.TryGetComponent<ProjectileDamage>(ref val2))
					{
						DamageTypeCombo damageType = val2.damageType;
						ref DamageSource damageSource = ref damageType.damageSource;
						damageSource = (DamageSource)((uint)damageSource | 1u);
					}
					ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, num2, (DamageTypeCombo?)null);
					projectilesFired++;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.Scorchling.Electric
{
	public class ScorchlingElectricBomb : BaseState
	{
		public static float breachToSpitTime = 1f;

		public static float spitToLaunchTime = 0.3f;

		public static float spitToBurrowTime = 5f;

		public static float burrowToEndOfTime = 1f;

		public static float animDurationBreach = 1f;

		public static float animDurationSpit = 1f;

		public static float animDurationBurrow = 1f;

		public static float animDurationPostSpit = 0.75f;

		public static float percentageToFireProjectile = 0.75f;

		public static GameObject burrowEffectPrefab;

		public static float burrowRadius = 1f;

		public static string breachSoundString;

		public static string spitSoundString;

		public static string burrowSoundString;

		public static string burrowLoopSoundString;

		public static string burrowStopLoopSoundString;

		public static GameObject mortarProjectilePrefab;

		public static GameObject mortarMuzzleflashEffect;

		public static int mortarCount;

		public static string mortarMuzzleName;

		public static string mortarSoundString;

		public static float mortarDamageCoefficient;

		public static float timeToTarget = 3f;

		public static float projectileVelocity = 55f;

		public static float minimumDistance;

		private bool spitStarted;

		private bool firedProjectile;

		private bool earlyExit;

		private ScorchlingController sController;

		private bool _gotOrig;

		[AsyncAssetLoad]
		private static IEnumerator Load()
		{
			AsyncOperationHandle<GameObject> request = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ElectricWorm/ElectricOrbProjectile.prefab");
			while (!request.IsDone)
			{
				yield return null;
			}
			mortarProjectilePrefab = request.Result;
		}

		public override void OnEnter()
		{
			//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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_009f: 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)
			if (!_gotOrig)
			{
				ScorchlingLavaBomb val = new ScorchlingLavaBomb();
				breachToSpitTime = val.breachToSpitTime;
				spitToLaunchTime = val.spitToLaunchTime;
				spitToBurrowTime = val.spitToBurrowTime;
				burrowToEndOfTime = val.burrowToEndOfTime;
				animDurationBreach = val.animDurationBreach;
				animDurationSpit = val.animDurationSpit;
				animDurationBurrow = val.animDurationBurrow;
				animDurationPostSpit = val.animDurationPostSpit;
				percentageToFireProjectile = val.percentageToFireProjectile;
				burrowEffectPrefab = val.burrowEffectPrefab;
				burrowRadius = val.burrowRadius;
				breachSoundString = val.breachSoundString;
				spitSoundString = val.spitSoundString;
				burrowSoundString = val.burrowSoundString;
				burrowLoopSoundString = val.burrowLoopSoundString;
				burrowStopLoopSoundString = val.burrowStopLoopSoundString;
				mortarMuzzleflashEffect = ScorchlingLavaBomb.mortarMuzzleflashEffect;
				mortarCount = ScorchlingLavaBomb.mortarCount;
				mortarMuzzleName = ScorchlingLavaBomb.mortarMuzzleName;
				mortarSoundString = ScorchlingLavaBomb.mortarSoundString;
				mortarDamageCoefficient = ScorchlingLavaBomb.mortarDamageCoefficient;
				timeToTarget = ScorchlingLavaBomb.timeToTarget;
				projectileVelocity = ScorchlingLavaBomb.projectileVelocity;
				minimumDistance = ScorchlingLavaBomb.minimumDistance;
			}
			((BaseState)this).OnEnter();
			sController = ((Component)((EntityState)this).characterBody).GetComponent<ScorchlingController>();
			animDurationBreach = (sController.isBurrowed ? animDurationBreach : 0f);
			spitToBurrowTime += animDurationBreach + animDurationSpit;
			burrowToEndOfTime += spitToBurrowTime;
			if (sController.isBurrowed)
			{
				earlyExit = true;
				if (Util.HasEffectiveAuthority(((EntityState)this).characterBody.networkIdentity))
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ScorchlingElectricBreach
					{
						proceedImmediatelyToElectricBomb = true,
						breachToBurrow = breachToSpitTime
					});
				}
			}
			else
			{
				((EntityState)this).characterBody.SetAimTimer(burrowToEndOfTime);
			}
		}

		public override void FixedUpdate()
		{
			if (earlyExit)
			{
				return;
			}
			((EntityState)this).FixedUpdate();
			if (!spitStarted && ((EntityState)this).fixedAge > animDurationBreach)
			{
				spitStarted = true;
				((EntityState)this).PlayAnimation("FullBody, Override", "Spit", "Spit.playbackRate", animDurationSpit, 0f);
			}
			if (spitStarted && !firedProjectile && ((EntityState)this).fixedAge > animDurationSpit * percentageToFireProjectile + animDurationBreach)
			{
				firedProjectile = true;
				Util.PlaySound(spitSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(mortarMuzzleflashEffect, ((EntityState)this).gameObject, mortarMuzzleName, false);
				if (((EntityState)this).isAuthority)
				{
					Spit();
				}
			}
			if (firedProjectile && ((EntityState)this).fixedAge > animDurationBreach + animDurationSpit + animDurationPostSpit)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void Spit()
		{
			//IL_0023: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_00db: 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_00f7: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			Transform val = ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).GetComponent<ChildLocator>().FindChild("MuzzleFire");
			Ray val2 = default(Ray);
			((Ray)(ref val2))..ctor(val.position, val.forward);
			Ray val3 = default(Ray);
			((Ray)(ref val3))..ctor(((Ray)(ref val2)).origin, Vector3.up);
			BullseyeSearch val4 = new BullseyeSearch();
			val4.searchOrigin = ((Ray)(ref val2)).origin;
			val4.searchDirection = ((Ray)(ref val2)).direction;
			val4.filterByLoS = false;
			val4.teamMaskFilter = TeamMask.allButNeutral;
			if (Object.op_Implicit((Object)(object)((EntityState)this).teamComponent))
			{
				((TeamMask)(ref val4.teamMaskFilter)).RemoveTeam(((EntityState)this).teamComponent.teamIndex);
			}
			val4.sortMode = (SortMode)2;
			val4.RefreshCandidates();
			HurtBox val5 = val4.GetResults().FirstOrDefault();
			bool flag = false;
			Vector3 val6 = Vector3.zero;
			RaycastHit val7 = default(RaycastHit);
			if (Object.op_Implicit((Object)(object)val5))
			{
				val6 = ((Component)val5).transform.position;
				flag = true;
			}
			else if (Physics.Raycast(val2, ref val7, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1))
			{
				val6 = ((RaycastHit)(ref val7)).point;
				flag = true;
			}
			float magnitude = projectileVelocity;
			if (flag)
			{
				Vector3 val8 = val6 - ((Ray)(ref val3)).origin;
				Vector2 val9 = default(Vector2);
				((Vector2)(ref val9))..ctor(val8.x, val8.z);
				float magnitude2 = ((Vector2)(ref val9)).magnitude;
				Vector2 val10 = val9 / magnitude2;
				if (magnitude2 < minimumDistance)
				{
					magnitude2 = minimumDistance;
				}
				float num = Trajectory.CalculateInitialYSpeed(timeToTarget, val8.y);
				float num2 = magnitude2 / timeToTarget;
				Vector3 direction = default(Vector3);
				((Vector3)(ref direction))..ctor(val10.x * num2, num, val10.y * num2);
				magnitude = ((Vector3)(ref direction)).magnitude;
				((Ray)(ref val3)).direction = direction;
			}
			Quaternion val11 = Util.QuaternionSafeLookRotation(((Ray)(ref val3)).direction);
			ProjectileManager.instance.FireProjectile(mortarProjectilePrefab, ((Ray)(ref val3)).origin, val11, ((EntityState)this).gameObject, base.damageStat * mortarDamageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, magnitude, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class ScorchlingElectricBreach : BaseState
	{
		public static float crackToBreachTime = 1f;

		public float breachToBurrow = 5f;

		public static float burrowToEndOfTime = 1f;

		public static float animDuration = 1f;

		public static float blastProcCoefficient;

		public static float blastDamageCoefficient;

		public static float blastForce;

		public static Vector3 blastBonusForce;

		public static float knockbackForce;

		public static GameObject crackEffectPrefab;

		public static float crackRadius = 1f;

		public static GameObject blastEffectPrefab;

		public static GameObject blastImpactEffectPrefab;

		public static float blastRadius = 1f;

		public static GameObject burrowEffectPrefab;

		public static float burrowRadius = 1f;

		public static string preBreachSoundString;

		public static string breachSoundString;

		public static string burrowSoundString;

		public static string burrowLoopSoundString;

		public static string burrowStopLoopSoundString;

		private static bool _gotOrig;

		public bool proceedImmediatelyToElectricBomb;

		private bool breached;

		private bool burrowed;

		private bool amServer;

		private Vector3 breachPosition;

		private ScorchlingController scorchlingController;

		private CharacterBody enemyCBody;

		public override void OnEnter()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d0: 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_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: 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_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			if (!_gotOrig)
			{
				_gotOrig = true;
				ScorchlingBreach val = new ScorchlingBreach();
				crackToBreachTime = val.crackToBreachTime;
				burrowToEndOfTime = val.burrowToEndOfTime;
				animDuration = val.animDuration;
				blastProcCoefficient = val.blastProcCoefficient;
				blastDamageCoefficient = val.blastDamageCoefficient;
				blastForce = val.blastForce;
				blastBonusForce = val.blastBonusForce;
				knockbackForce = val.knockbackForce;
				crackEffectPrefab = val.crackEffectPrefab;
				crackRadius = val.crackRadius;
				blastEffectPrefab = val.blastEffectPrefab;
				blastImpactEffectPrefab = val.blastImpactEffectPrefab;
				blastRadius = val.blastRadius;
				burrowEffectPrefab = val.burrowEffectPrefab;
				burrowRadius = val.burrowRadius;
				preBreachSoundString = val.preBreachSoundString;
				breachSoundString = val.breachSoundString;
				burrowSoundString = val.burrowSoundString;
				burrowLoopSoundString = val.burrowLoopSoundString;
				burrowStopLoopSoundString = val.burrowStopLoopSoundString;
			}
			((BaseState)this).OnEnter();
			amServer = NetworkServer.active;
			scorchlingController = ((Component)((EntityState)this).characterBody).GetComponent<ScorchlingController>();
			Util.PlaySound(preBreachSoundString, ((EntityState)this).gameObject);
			if (amServer)
			{
				Target currentEnemy = ((Component)((EntityState)this).characterBody.master).GetComponent<BaseAI>().currentEnemy;
				enemyCBody = ((currentEnemy != null) ? currentEnemy.characterBody : null);
				if (proceedImmediatelyToElectricBomb)
				{
					breachToBurrow = 1f;
				}
				breachToBurrow += crackToBreachTime;
				burrowToEndOfTime += breachToBurrow;
				breachPosition = ((EntityState)this).characterBody.footPosition;
				if (!proceedImmediatelyToElectricBomb && Object.op_Implicit((Object)(object)enemyCBody))
				{
					breachPosition = enemyCBody.footPosition;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 0f;
				}
				((EntityState)this).characterBody.SetAimTimer(breachToBurrow);
				TeleportHelper.TeleportBody(((EntityState)this).characterBody, breachPosition);
				EffectManager.SpawnEffect(crackEffectPrefab, new EffectData
				{
					origin = breachPosition,
					scale = crackRadius
				}, true);
				scorchlingController.SetTeleportPermission(false);
			}
		}

		public override void FixedUpdate()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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)
			((EntityState)this).FixedUpdate();
			if (amServer && ((EntityState)this).fixedAge < crackToBreachTime && (Object)(object)enemyCBody != (Object)null)
			{
				Vector3 val = enemyCBody.corePosition - ((EntityState)this).characterBody.corePosition;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				((EntityState)this).characterBody.characterDirection.forward = normalized;
			}
			if (!breached && ((EntityState)this).fixedAge > crackToBreachTime)
			{
				breached = true;
				scorchlingController.Breach();
				((EntityState)this).PlayAnimation("FullBody, Override", "Breach", "Breach.playbackRate", animDuration, 0f);
				Util.PlaySound(breachSoundString, ((EntityState)this).gameObject);
				Util.PlaySound(burrowStopLoopSoundString, ((EntityState)this).gameObject);
				if (amServer)
				{
					DetonateAuthority();
				}
			}
			if (((EntityState)this).fixedAge > burrowToEndOfTime)
			{
				DoExit();
			}
		}

		private void DoExit()
		{
			if (proceedImmediatelyToElectricBomb)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new ScorchlingElectricBomb());
			}
			else
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		protected Result DetonateAuthority()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_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_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			EffectManager.SpawnEffect(blastEffectPrefab, new EffectData
			{
				origin = breachPosition,
				scale = blastRadius
			}, true);
			return new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				baseDamage = base.damageStat * blastDamageCoefficient,
				baseForce = blastForce,
				bonusForce = blastBonusForce,
				crit = ((BaseState)this).RollCrit(),
				damageType = DamageTypeCombo.GenericSecondary,
				falloffModel = (FalloffModel)0,
				procCoefficient = blastProcCoefficient,
				radius = blastRadius,
				position = breachPosition,
				attackerFiltering = (AttackerFiltering)2,
				impactEffect = EffectCatalog.FindEffectIndexFromPrefab(blastImpactEffectPrefab),
				teamIndex = ((EntityState)this).teamComponent.teamIndex,
				damageType = 
				{
					damageSource = (DamageSource)2
				}
			}.Fire();
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			if (!proceedImmediatelyToElectricBomb)
			{
				return (InterruptPriority)2;
			}
			return (InterruptPriority)7;
		}
	}
}
namespace EntityStates.RoboBallBoss.Weapon.Swarming
{
	public class DeployFamily : BaseState
	{
		public static float baseDuration;

		public static string attackSoundString;

		public static string summonSoundString;

		public static int maxSummonCount = 3;

		public static int maxSummonCountSuper = 5;

		public static float summonDuration;

		public static string summonMuzzleString;

		public static WeightedSelection<GameObject> weightedMasterSelection = new WeightedSelection<GameObject>(8);

		private Animator animator;

		private Transform modelTransform;

		private ChildLocator childLocator;

		private float duration;

		private float summonInterval;

		private float summonTimer;

		private int summonCount;

		private bool isSummoning;

		private static bool _initFromOrig;

		[SystemInitializer(new Type[] { })]
		private static void SystemInit()
		{
			((ResourceAvailability)(ref MasterCatalog.availability)).CallWhenAvailable((Action)delegate
			{
				weightedMasterSelection.AddChoice(MasterCatalog.FindMasterPrefab("RoboBallMiniMaster"), 1f);
				weightedMasterSelection.AddChoice(MasterCatalog.FindMasterPrefab("TankerMaster"), 1f);
				weightedMasterSelection.AddChoice(MasterCatalog.FindMasterPrefab("WorkerUnitMaster"), 1f);
				weightedMasterSelection.AddChoice(MasterCatalog.FindMasterPrefab("DefectiveUnitMaster"), 0.25f);
				weightedMasterSelection.AddChoice(MasterCatalog.FindMasterPrefab("ExtractorUnitMaster"), 0.25f);
				weightedMasterSelection.AddChoice(MasterCatalog.FindMasterPrefab("IronHaulerMaster"), 0.25f);
			});
		}

		public override void OnEnter()
		{
			//IL_00b0: 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)
			((BaseState)this).OnEnter();
			if (!_initFromOrig)
			{
				_initFromOrig = true;
				baseDuration = DeployMinions.baseDuration;
				attackSoundString = DeployMinions.attackSoundString;
				summonSoundString = DeployMinions.summonSoundString;
				summonDuration = DeployMinions.summonDuration;
				summonMuzzleString = DeployMinions.summonMuzzleString;
			}
			animator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
			duration = baseDuration;
			((EntityState)this).PlayCrossfade("Gesture, Additive", "DeployMinions", "DeployMinions.playbackRate", duration, 0.1f);
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			int num = ((((EntityState)this).characterBody.bodyIndex == BodyPrefabs.SuperRoboBallBossBody.bodyIndex) ? maxSummonCountSuper : maxSummonCount);
			summonInterval = summonDuration / (float)num;
		}

		private Transform FindTargetClosest(Vector3 point, TeamIndex enemyTeam)
		{
			//IL_0000: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(enemyTeam);
			float num = 99999f;
			Transform result = null;
			for (int i = 0; i < teamMembers.Count; i++)
			{
				float num2 = Vector3.SqrMagnitude(((Component)teamMembers[i]).transform.position - point);
				if (num2 < num)
				{
					num = num2;
					result = ((Component)teamMembers[i]).transform;
				}
			}
			return result;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			bool flag = animator.GetFloat("DeployMinions.active") > 0.9f;
			if (isSummoning)
			{
				summonTimer += Time.fixedDeltaTime;
				if (NetworkServer.active && summonTimer > 0f && summonCount < maxSummonCount)
				{
					summonCount++;
					summonTimer -= summonInterval;
					SummonMinion();
				}
			}
			isSummoning = flag;
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void SummonMinion()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)VariantSpawnManager.instance))
			{
				MasterSummon val = new MasterSummon
				{
					position = childLocator.FindChild(summonMuzzleString).position,
					masterPrefab = weightedMasterSelection.Evaluate(VariantSpawnManager.instance.variantSpawnRng.nextNormalizedFloat),
					summonerBodyObject = ((Component)((EntityState)this).characterBody).gameObject,
					preSpawnSetupCallback = delegate(CharacterMaster master)
					{
						Util.CopyEliteStatus(((EntityState)this).characterBody.masterObject, ((Component)master).gameObject, false);
					}
				};
				new VariantMasterSummon(val)
				{
					preassignedVariantDefs = null,
					noGoldExpModifications = true,
					noItemReward = true,
					spawnManagerMultiplier = 1.1f
				};
				val.Perform();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace EntityStates.ParentMonster.Child
{
	public class Tantrum : BaseState
	{
		public static float duration = 3f;

		public static float damageCoefficient = 4f;

		public static float forceMagnitude = 16f;

		public static float radius = 7f;

		private BlastAttack attack;

		public static string attackSoundString;

		public static GameObject slamImpactEffect;

		public static GameObject meleeTrailEffectL;

		public static GameObject meleeTrailEffectR;

		private Animator modelAnimator;

		private Transform modelTransform;

		private bool hasAttacked;

		public override void OnEnter()
		{
			//IL_006f: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			modelAnimator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlayAttackSpeedSound(attackSoundString, ((EntityState)this).gameObject, base.attackSpeedStat);
			((EntityState)this).PlayCrossfade("Body", "Slam", "Slam.playbackRate", duration / base.attackSpeedStat, 0.1f);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Ray aimRay = ((BaseState)this).GetAimRay();
				characterDirection.moveVector = ((Ray)(ref aimRay)).direction;
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)modelAnimator) && modelAnimator.GetFloat("Slam.hitBoxActive") > 0.5f && !hasAttacked)
			{
				if (((EntityState)this).isAuthority)
				{
					if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
					{
						((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterDirection.forward;
					}
					if (Object.op_Implicit((Object)(object)modelTransform))
					{
						Transform val = ((BaseState)this).FindModelChild("SlamZone");
						if (Object.op_Implicit((Object)(object)val))
						{
							attack = new BlastAttack();
							attack.attacker = ((EntityState)this).gameObject;
							attack.inflictor = ((EntityState)this).gameObject;
							attack.teamIndex = ((EntityState)this).teamComponent.teamIndex;
							attack.baseDamage = base.damageStat * damageCoefficient;
							attack.baseForce = forceMagnitude;
							attack.position = val.position;
							attack.radius = radius;
							attack.damageType = DamageTypeCombo.GenericPrimary;
							attack.Fire();
						}
					}
				}
				hasAttacked = true;
			}
			if (((EntityState)this).fixedAge >= duration / base.attackSpeedStat && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace EntityStates.NullifierMonster.Kamikaze
{
	public class KillSelf : EntityState
	{
		public override void OnEnter()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
			{
				((EntityState)this).healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
			}
		}
	}
}
namespace EntityStates.MinorConstruct.Weapon.Theta
{
	public class ChargeThetaLaser : BaseState
	{
		public static string enterSoundString;

		public static string exitSoundString;

		public static string animationLayerName;

		public static string animationStateName;

		public static string animationPlaybackRateParam;

		public static string chargeEffectMuzzle;

		public static EntityStateGameObject chargeEffectPrefab;

		public static float baseDuration;

		private float duration;

		private GameObject chargeInstance;

		private static bool _initFromOrig;

		public override void OnEnter()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: 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_00de: 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)
			((BaseState)this).OnEnter();
			if (!_initFromOrig)
			{
				_initFromOrig = true;
				ChargeConstructBeam val = new ChargeConstructBeam();
				enterSoundString = val.enterSoundString;
				exitSoundString = val.exitSoundString;
				animationLayerName = val.animationLayerName;
				animationStateName = val.animationStateName;
				animationPlaybackRateParam = val.animationPlaybackRateParam;
				chargeEffectMuzzle = val.chargeEffectMuzzle;
				chargeEffectPrefab = val.chargeEffectPrefab;
				baseDuration = val.baseDuration;
			}
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParam, duration, 0f);
			Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
			Transform val2 = ((BaseState)this).FindModelChild(chargeEffectMuzzle);
			if (Object.op_Implicit((Object)(object)val2) && EntityStateGameObject.op_Implicit(chargeEffectPrefab))
			{
				chargeInstance = Object.Instantiate<GameObject>(chargeEffectPrefab.gameObject, val2.position, val2.rotation);
				chargeInstance.transform.parent = ((EntityState)this).gameObject.transform;
				ScaleParticleSystemDuration component = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = duration;
				}
			}
		}

		public override void Update()
		{
			//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_0027: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).Update();
			if (Object.op_Implicit((Object)(object)chargeInstance))
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				chargeInstance.transform.forward = ((Ray)(ref aimRay)).direction;
			}
		}

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

		public override void OnExit()
		{
			Util.PlaySound(exitSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)chargeInstance))
			{
				EntityState.Destroy((Object)(object)chargeInstance);
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class FireThetaLaser : GenericProjectileBaseState
	{
		[SerializeField]
		public string animationLayerName;

		[SerializeField]
		public string animationStateName;

		private static FireConstructBeam _origStatic;

		private void InitFromOrig()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			if (_origStatic == null)
			{
				_origStatic = new FireConstructBeam();
			}
			base.effectPrefab = ((GenericProjectileBaseState)_origStatic).effectPrefab;
			base.projectilePrefab = OmicronProjectile.omicronProjectile;
			base.damageCoefficient = ((GenericProjectileBaseState)_origStatic).damageCoefficient;
			base.force = ((GenericProjectileBaseState)_origStatic).force;
			base.minSpread = ((GenericProjectileBaseState)_origStatic).minSpread;
			base.maxSpread = ((GenericProjectileBaseState)_origStatic).maxSpread;
			base.baseDuration = ((GenericProjectileBaseState)_origStatic).baseDuration;
			base.recoilAmplitude = ((GenericProjectileBaseState)_origStatic).recoilAmplitude;
			base.attackSoundString = ((GenericProjectileBaseState)_origStatic).attackSoundString;
			base.projectilePitchBonus = ((GenericProjectileBaseState)_origStatic).projectilePitchBonus;
			base.baseDelayBeforeFiringProjectile = ((GenericProjectileBaseState)_origStatic).baseDelayBeforeFiringProjectile;
			base.targetMuzzle = ((GenericProjectileBaseState)_origStatic).targetMuzzle;
			base.bloom = ((GenericProjectileBaseState)_origStatic).bloom;
			animationLayerName = _origStatic.animationLayerName;
			animationStateName = _origStatic.animationStateName;
		}

		public override void FireProjectile()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_00df: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				Ray val = (Ray)(((??)base.aimRayOverride) ?? ((BaseState)this).GetAimRay());
				val = ((GenericProjectileBaseState)this).ModifyProjectileAimRay(val);
				((Ray)(ref val)).direction = Util.ApplySpread(((Ray)(ref val)).direction, base.minSpread, base.maxSpread, 1f, 1f, 0f, base.projectilePitchBonus);
				Ray val2 = val;
				Quaternion val3 = Quaternion.Euler(0f, 45f, 0f);
				Quaternion val4 = Quaternion.Euler(0f, -45f, 0f);
				Quaternion val5 = ((Random.value > 0.5f) ? val3 : val4);
				((Ray)(ref val2)).direction = val5 * ((Ray)(ref val2)).direction;
				bool crit = ((BaseState)this).RollCrit();
				FireProjectileInfo val6 = new FireProjectileInfo
				{
					projectilePrefab = base.projectilePrefab,
					position = ((Ray)(ref val)).origin,
					rotation = Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction),
					owner = ((EntityState)this).gameObject,
					damage = ((BaseState)this).damageStat * base.damageCoefficient,
					force = base.force,
					crit = crit
				};
				((FireProjectileInfo)(ref val6)).fuseOverride = base.projectileFuseOverride ?? (-1f);
				((FireProjectileInfo)(ref val6)).speedOverride = base.projectileSpeedOverride ?? (-1f);
				val6.damageTypeOverride = DamageTypeCombo.GenericPrimary;
				FireProjectileInfo val7 = val6;
				((GenericProjectileBaseState)this).ModifyProjectileInfo(ref val7);
				ProjectileManager.instance.FireProjectile(val7);
				val7.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref val2)).direction);
				((GenericProjectileBaseState)this).ModifyProjectileInfo(ref val7);
				ProjectileManager.instance.FireProjectile(val7);
			}
		}

		public override void OnEnter()
		{
			InitFromOrig();
			((GenericProjectileBaseState)this).OnEnter();
			((EntityState)this).PlayAnimation(animationLayerName, animationStateName);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.MiniMushroom.Healer
{
	public class HealerGrenade : BaseState
	{
		public static string attackSoundString = "Play_minimushroom_spore_shoot";

		public static string chargeUpSoundString = "Play_minimushroom_spore_chargeUp";

		public static float recoilAmplitude = 1f;

		public static GameObject projectilePrefab = NW.PrefabClones.HealerGrenade.projectile;

		public static float baseDuration = 4.4f;

		public static string muzzleString = "Muzzle";

		public static float damageCoefficient = 1f;

		public static float timeToTarget = 1.5f;

		public static float projectileVelocity = 20f;

		public static float minimumDistance = 5f;

		public static float maximumDistance = 60f;

		public static float baseChargeTime = 2.6f;

		private uint chargeupSoundID;

		private Ray projectileRay;

		private Transform modelTransform;

		private float duration;

		private float chargeTime;

		private bool hasFired;

		private Animator modelAnimator;

		private GameObject vfxObject;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			chargeTime = baseChargeTime / base.attackSpeedStat;
			modelAnimator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				modelAnimator.SetBool("isCharged", false);
				((EntityState)this).PlayAnimation("Gesture, Additive", "Charge");
				chargeupSoundID = Util.PlaySound(chargeUpSoundString, ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).gameObject);
			}
			Transform val = ((BaseState)this).FindModelChild("ChargeSpot");
			if (Object.op_Implicit((Object)(object)val))
			{
				vfxObject = ((Component)val).gameObject;
				vfxObject.SetActive(true);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!(((EntityState)this).fixedAge >= chargeTime))
			{
				return;
			}
			if (!hasFired)
			{
				hasFired = true;
				Animator obj = modelAnimator;
				if (obj != null)
				{
					obj.SetBool("isCharged", true);
				}
				if (((EntityState)this).isAuthority)
				{
					FireGrenade(muzzleString);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).PlayAnimation("Gesture, Additive", "Empty");
			AkSoundEngine.StopPlayingID(chargeupSoundID);
			if (Object.op_Implicit((Object)(object)vfxObject))
			{
				vfxObject.SetActive(false);
			}
			((EntityState)this).OnExit();
		}

		private void FireGrenade(string targetMuzzle)
		{
			//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_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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00d9: 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_00c0: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: 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_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Ray)(ref aimRay)).origin, Vector3.up);
			Transform val2 = ((BaseState)this).FindModelChild(targetMuzzle);
			if (Object.op_Implicit((Object)(object)val2))
			{
				((Ray)(ref val)).origin = val2.position;
			}
			BullseyeSearch val3 = new BullseyeSearch();
			val3.searchOrigin = ((Ray)(ref aimRay)).origin;
			val3.searchDirection = ((Ray)(ref aimRay)).direction;
			val3.filterByLoS = false;
			val3.teamMaskFilter = TeamMask.allButNeutral;
			if (Object.op_Implicit((Object)(object)((EntityState)this).teamComponent))
			{
				((TeamMask)(ref val3.teamMaskFilter)).RemoveTeam(((EntityState)this).teamComponent.teamIndex);
			}
			val3.sortMode = (SortMode)2;
			val3.RefreshCandidates();
			HurtBox val4 = val3.GetResults().FirstOrDefault();
			bool flag = false;
			Vector3 val5 = Vector3.zero;
			RaycastHit val6 = default(RaycastHit);
			if (Object.op_Implicit((Object)(object)val4))
			{
				val5 = ((Component)val4).transform.position;
				flag = true;
			}
			else if (Physics.Raycast(aimRay, ref val6, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1))
			{
				val5 = ((RaycastHit)(ref val6)).point;
				flag = true;
			}
			float magnitude = projectileVelocity;
			if (flag)
			{
				Vector3 val7 = val5 - ((Ray)(ref val)).origin;
				Vector2 val8 = default(Vector2);
				((Vector2)(ref val8))..ctor(val7.x, val7.z);
				float magnitude2 = ((Vector2)(ref val8)).magnitude;
				Vector2 val9 = val8 / magnitude2;
				if (magnitude2 < minimumDistance)
				{
					magnitude2 = minimumDistance;
				}
				if (magnitude2 > maximumDistance)
				{
					magnitude2 = maximumDistance;
				}
				float num = Trajectory.CalculateInitialYSpeed(timeToTarget, val7.y);
				float num2 = magnitude2 / timeToTarget;
				Vector3 direction = default(Vector3);
				((Vector3)(ref direction))..ctor(val9.x * num2, num, val9.y * num2);
				magnitude = ((Vector3)(ref direction)).magnitude;
				((Ray)(ref val)).direction = direction;
			}
			Quaternion val10 = Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction + Random.insideUnitSphere * 0.05f);
			HealingWard component = ((ProjectileExplosion)projectilePrefab.GetComponent<ProjectileImpactExplosion>()).childrenProjectilePrefab.GetComponent<HealingWard>();
			component.healPoints = ((EntityState)this).characterBody.baseMaxHealth / 10f;
			component.healFraction = 0.01f;
			ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref val)).origin, val10, ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, magnitude, (DamageTypeCombo?)null);
		}
	}
}
namespace EntityStates.MiniMushroom.AD
{
	public class ArmorBreakerGrenade : BaseState
	{
		public static string attackSoundString = "Play_minimushroom_spore_shoot";

		public static string chargeUpSoundString = "Play_minimushroom_spore_chargeUp";

		public static float recoilAmplitude = 1f;

		public static GameObject projectilePrefab = NW.PrefabClones.ArmorBreakerGrenade.projectile;

		public static float baseDuration = 4.4f;

		public static string muzzleString = "Muzzle";

		public static float damageCoefficient = 1f;

		public static float timeToTarget = 1.5f;

		public static float projectileVelocity = 20f;

		public static float minimumDistance = 5f;

		public static float maximumDistance = 60f;

		public static float baseChargeTime = 2.6f;

		private uint chargeupSoundID;

		private Ray projectileRay;

		private Transform modelTransform;

		private float duration;

		private float chargeTime;

		private bool hasFired;

		private Animator modelAnimator;

		private GameObject vfxObject;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			chargeTime = baseChargeTime / base.attackSpeedStat;
			modelAnimator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				modelAnimator.SetBool("isCharged", false);
				((EntityState)this).PlayAnimation("Gesture, Additive", "Charge");
				chargeupSoundID = Util.PlaySound(chargeUpSoundString, ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).gameObject);
			}
			Transform val = ((BaseState)this).FindModelChild("ChargeSpot");
			if (Object.op_Implicit((Object)(object)val))
			{
				vfxObject = ((Component)val).gameObject;
				vfxObject.SetActive(true);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!(((EntityState)this).fixedAge >= chargeTime))
			{
				return;
			}
			if (!hasFired)
			{
				hasFired = true;
				Animator obj = modelAnimator;
				if (obj != null)
				{
					obj.SetBool("isCharged", true);
				}
				if (((EntityState)this).isAuthority)
				{
					FireGrenade(muzzleString);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).PlayAnimation("Gesture, Additive", "Empty");
			AkSoundEngine.StopPlayingID(chargeupSoundID);
			if (Object.op_Implicit((Object)(object)vfxObject))
			{
				vfxObject.SetActive(false);
			}
			((EntityState)this).OnExit();
		}

		private void FireGrenade(string targetMuzzle)
		{
			//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_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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00d9: 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_00c0: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: 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_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Ray)(ref aimRay)).origin, Vector3.up);
			Transform val2 = ((BaseState)this).FindModelChild(targetMuzzle);
			if (Object.op_Implicit((Object)(object)val2))
			{
				((Ray)(ref val)).origin = val2.position;
			}
			BullseyeSearch val3 = new BullseyeSearch();
			val3.searchOrigin = ((Ray)(ref aimRay)).origin;
			val3.searchDirection = ((Ray)(ref aimRay)).direction;
			val3.filterByLoS = false;
			val3.teamMaskFilter = TeamMask.allButNeutral;
			if (Object.op_Implicit((Object)(object)((EntityState)this).teamComponent))
			{
				((TeamMask)(ref val3.teamMaskFilter)).RemoveTeam(((EntityState)this).teamComponent.teamIndex);
			}
			val3.sortMode = (SortMode)2;
			val3.RefreshCandidates();
			HurtBox val4 = val3.GetResults().FirstOrDefault();
			bool flag = false;
			Vector3 val5 = Vector3.zero;
			RaycastHit val6 = default(RaycastHit);
			if (Object.op_Implicit((Object)(object)val4))
			{
				val5 = ((Component)val4).transform.position;
				flag = true;
			}
			else if (Physics.Raycast(aimRay, ref val6, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1))
			{
				val5 = ((RaycastHit)(ref val6)).point;
				flag = true;
			}
			float magnitude = projectileVelocity;
			if (flag)
			{
				Vector3 val7 = val5 - ((Ray)(ref val)).origin;
				Vector2 val8 = default(Vector2);
				((Vector2)(ref val8))..ctor(val7.x, val7.z);
				float magnitude2 = ((Vector2)(ref val8)).magnitude;
				Vector2 val9 = val8 / magnitude2;
				if (magnitude2 < minimumDistance)
				{
					magnitude2 = minimumDistance;
				}
				if (magnitude2 > maximumDistance)
				{
					magnitude2 = maximumDistance;
				}
				float num = Trajectory.CalculateInitialYSpeed(timeToTarget, val7.y);
				float num2 = magnitude2 / timeToTarget;
				Vector3 direction = default(Vector3);
				((Vector3)(ref direction))..ctor(val9.x * num2, num, val9.y * num2);
				magnitude = ((Vector3)(ref direction)).magnitude;
				((Ray)(ref val)).direction = direction;
			}
			Quaternion val10 = Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction + Random.insideUnitSphere * 0.05f);
			ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref val)).origin, val10, ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, magnitude, (DamageTypeCombo?)null);
		}
	}
}
namespace EntityStates.MinePod.Roller
{
	public class RollerPlant : BaseState
	{
		public static float mineSpawnDelay;

		public static float baseDuration;

		public static SpawnCard mineSpawnCard;

		public static EntityStateGameObject minePlantVFX;

		public static int spawnCount;

		public static string spawnPointChildName1;

		public static string spawnPointChildName2;

		public static string spawnPointChildName3;

		public static string emergeSoundEvent;

		public static string deploySoundEvent;

		public static string retractSoundEvent;

		private List<string> spawnPointChildNames;

		private float duration;

		private bool _mineSpawned;

		private float storedMoveSpeed;

		private ChildLocator childLocator;

		private bool opened;

		private bool _initFromOrig;

		public override void OnEnter()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (!_initFromOrig)
			{
				_initFromOrig = true;
				mineSpawnDelay = MinePlant.mineSpawnDelay;
				baseDuration = MinePlant.baseDuration;
				mineSpawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)RoR2_DLC3_SolusAmalgamator.cscSolusAmalgamatorThruster_asset).WaitForCompletion();
				minePlantVFX = MinePlant.minePlantVFX;
				spawnCount = MinePlant.spawnCount;
				spawnPointChildName1 = MinePlant.spawnPointChildName1;
				spawnPointChildName2 = MinePlant.spawnPointChildName2;
				spawnPointChildName3 = MinePlant.spawnPointChildName3;
				emergeSoundEvent = MinePlant.emergeSoundEvent;
				deploySoundEvent = MinePlant.deploySoundEvent;
				retractSoundEvent = MinePlant.retractSoundEvent;
			}
			if (((EntityState)this).characterBody.master.IsDeployableLimited((DeployableSlot)28))
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			spawnPointChildNames = new List<string>();
			if (!string.IsNullOrEmpty(spawnPointChildName1))
			{
				spawnPointChildNames.Add(spawnPointChildName1);
			}
			if (!string.IsNullOrEmpty(spawnPointChildName2))
			{
				spawnPointChildNames.Add(spawnPointChildName2);
			}
			if (!string.IsNullOrEmpty(spawnPointChildName3))
			{
				spawnPointChildNames.Add(spawnPointChildName3);
			}
			duration = baseDuration / base.attackSpeedStat;
			childLocator = ((EntityState)this).GetModelChildLocator();
			((BaseState)this).StartAimMode(0.3f, false);
			((EntityState)this).PlayAnimation("Body", "OpenPod", "OpenPod.playbackRate", mineSpawnDelay, 0f);
			opened = true;
			Util.PlayAttackSpeedSound(emergeSoundEvent, ((EntityState)this).gameObject, base.attackSpeedStat);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (opened)
			{
				((EntityState)this).PlayAnimation("Body", "ClosePod", "OpenPod.playbackRate", 1f, 0f);
			}
			Util.PlayAttackSpeedSound(retractSoundEvent, ((EntityState)this).gameObject, base.attackSpeedStat);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > mineSpawnDelay && !_mineSpawned)
			{
				_mineSpawned = true;
				SpawnMines();
			}
			if (((EntityState)this).fixedAge > duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void SpawnMines()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) && NetworkServer.active)
			{
				for (int i = 0; i < spawnCount; i++)
				{
					SpawnMine(spawnPointChildNames[i % spawnPointChildNames.Count]);
				}
			}
		}

		private void SpawnMine(string spawnPointChildName)
		{
			//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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).characterBody.master.GetDeployableCount((DeployableSlot)28) < ((EntityState)this).characterBody.master.GetDeployableSameSlotLimit((DeployableSlot)28))
			{
				Transform val = childLocator.FindChild(spawnPointChildName);
				DirectorSpawnRequest val2 = new DirectorSpawnRequest(mineSpawnCard, new DirectorPlacementRule
				{
					placementMode = (PlacementMode)0,
					minDistance = 0f,
					maxDistance = 0f,
					position = val.position
				}, RoR2Application.rng);
				val2.summonerBodyObject = ((EntityState)this).gameObject;
				val2.onSpawnedServer = OnCardSpawned;
				GameObject val3 = DirectorCore.instance.TrySpawnObject(val2);
				if (Object.op_Implicit((Object)(object)val3))
				{
					CharacterMaster component = val3.GetComponent<CharacterMaster>();
					Deployable val4 = val3.AddComponent<Deployable>();
					val4.onUndeploy = new UnityEvent();
					val4.onUndeploy.AddListener(new UnityAction(component.TrueKill));
					((EntityState)this).characterBody.master.AddDeployable(val4, (DeployableSlot)28);
					EffectManager.SimpleEffect(EntityStateGameObject.op_Implicit(minePlantVFX), val3.transform.position, Quaternion.identity, true);
				}
				Util.PlayAttackSpeedSound(deploySoundEvent, ((EntityState)this).gameObject, base.attackSpeedStat);
			}
			void OnCardSpawned(SpawnResult result)
			{
				//IL_0000: 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_0057: 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_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				if (result.success)
				{
					CharacterMaster val5 = ((EntityState)this).characterBody.master;
					if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.minionOwnership.ownerMaster))
					{
						val5 = val5.minionOwnership.ownerMaster;
					}
					CharacterMaster component2 = result.spawnedInstance.GetComponent<CharacterMaster>();
					component2.minionOwnership.SetOwner(val5);
					Util.CopyEliteStatus(new CopyEliteStatusParams
					{
						ownerMaster = ((EntityState)this).characterBody.masterObject,
						minionMaster = ((Component)component2).gameObject,
						copyFrom = (EliteUpgradeSource)1,
						limitTo = (EliteUpgradeSource)2
					});
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace EntityStates.Mimic.Stalker
{
	public class TeleportBehind : BaseState
	{
		public float baseDuration = 0.2f;

		[SerializeField]
		public bool scaleWithAttackSpeed = true;

		[SerializeField]
		public float nodeSearchRadiusMin;

		[SerializeField]
		public float nodeSearchRadiusMax = 20f;

		[SerializeField]
		public float collisionCheckDistance;

		private float duration;

		private CharacterBody target;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = (scaleWithAttackSpeed ? baseDuration : (baseDuration / base.attackSpeedStat));
			PlayEnterAnimation();
			CharacterBody body = ((EntityState)this).GetComponent<Deployable>().ownerMaster.GetBody();
			target = (Object.op_Implicit((Object)(object)body) ? body : ((EntityState)this).GetComponent<TargetingAndPredictionController>().GetTargetBody());
			if (!Object.op_Implicit((Object)(object)target))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)target) && ((EntityState)this).fixedAge > duration)
			{
				Teleport();
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			PlayExitAnimation();
		}

		public virtual void PlayEnterAnimation()
		{
		}

		public virtual void PlayExitAnimation()
		{
		}

		public void Teleport()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			Vector3 corePosition = target.corePosition;
			Ray aimRay = target.inputBank.GetAimRay();
			Vector3 desiredPosition = corePosition + -((Ray)(ref aimRay)).direction * 40f;
			if (FindOffsetPosition(desiredPosition, out var offsetPosition))
			{
				TeleportHelper.TeleportBody(((EntityState)this).characterBody, offsetPosition, true);
			}
		}

		public bool FindOffsetPosition(Vector3 desiredPosition, out Vector3 offsetPosition)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return FindBestTeleportPosition(desiredPosition, out offsetPosition);
		}

		public bool FindBestTeleportPosition(Vector3 nearPosition, out Vector3 teleportPosition)
		{
			//IL_0019: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result ty