Decompiled source of VariantPack NebbysWrath v2.1.0

plugins/NebbysWrath.dll

Decompiled a month 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.Bootstrap;
using BepInEx.Logging;
using EntityStates;
using EntityStates.AncientWispMonster;
using EntityStates.ArchWispMonster;
using EntityStates.GolemMonster;
using EntityStates.GreaterWispMonster;
using EntityStates.JellyfishMonster.Spectral;
using EntityStates.LemurianBruiserMonster;
using EntityStates.LemurianMonster;
using EntityStates.MagmaWorm;
using EntityStates.MajorConstruct.Weapon;
using EntityStates.ParentMonster;
using EntityStates.RoboBallBoss.Weapon;
using EntityStates.TitanMonster;
using EntityStates.VagrantMonster;
using EntityStates.Wisp1Monster;
using HG;
using HG.Reflection;
using KinematicCharacterController;
using MSU;
using MSU.Config;
using NW;
using NW.DamageTypes;
using NW.Modules;
using NW.PrefabClones;
using On.EntityStates.MajorConstruct.Weapon;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using VAPI;
using VAPI.Components;

[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_009f: 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_00a6: 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 = default(FireProjectileInfo);
				val2.crit = ((BaseState)this).RollCrit();
				val2.damage = base.damageStat;
				val2.damageColorIndex = (DamageColorIndex)0;
				val2.force = 30f;
				val2.owner = ((EntityState)this).gameObject;
				val2.position = val.position;
				Ray aimRay = ((BaseState)this).GetAimRay();
				val2.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				val2.projectilePrefab = OmicronProjectile.omicronProjectile;
				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.5f;

		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_0030: 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_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				FireProjectileInfo val = default(FireProjectileInfo);
				val.crit = ((BaseState)this).RollCrit();
				val.damage = ((BaseState)this).damageStat;
				val.damageColorIndex = (DamageColorIndex)0;
				val.force = 30f;
				val.owner = ((EntityState)this).gameObject;
				val.projectilePrefab = OmicronProjectile.omicronProjectile;
				FireProjectileInfo val2 = val;
				for (int i = 0; i < _firePoints.Length; i++)
				{
					val2.rotation = Quaternion.LookRotation(_firePoints[i].forward);
					val2.position = _firePoints[i].position;
					ProjectileManager.instance.FireProjectile(val2);
				}
			}
		}
	}
}
namespace EntityStates.VagrantMonster.Mothership
{
	public class DeployJellies : DeathState
	{
		public static GameObject masterPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Jellyfish/JellyfishMaster.prefab").WaitForCompletion();

		public static VariantDef moajDef;

		public static EquipmentIndex index;

		private Vector3 spawnPossition;

		private DeathRewards rewards;

		private static void LoadDef()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			moajDef = VariantCatalog.GetVariantDef(VariantCatalog.FindVariantIndex("MOAJ"));
		}

		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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			((DeathState)this).OnEnter();
			spawnPossition = ((EntityState)this).characterBody.corePosition;
			index = ((EntityState)this).characterBody.equipmentSlot.equipmentIndex;
			rewards = ((EntityState)this).GetComponent<DeathRewards>();
			if (NetworkServer.active)
			{
				if (Chainloader.PluginInfos.ContainsKey("com.Nebby.TO30") && Object.op_Implicit((Object)(object)moajDef))
				{
					SpawnJellies(3, (VariantDef[])(object)new VariantDef[1] { moajDef });
				}
				else
				{
					SpawnJellies(10, Array.Empty<VariantDef>());
				}
			}
		}

		private void SpawnJellies(int count, VariantDef[] variantDefs)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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)
			for (int i = 0; i < count; i++)
			{
				VariantSummon val = new VariantSummon();
				((MasterSummon)val).position = spawnPossition;
				((MasterSummon)val).masterPrefab = masterPrefab;
				((MasterSummon)val).summonerBodyObject = ((EntityState)this).gameObject;
				((MasterSummon)val).teamIndexOverride = ((EntityState)this).teamComponent.teamIndex;
				val.variantDefs = variantDefs;
				val.applyOnStart = true;
				if (Object.op_Implicit((Object)(object)rewards))
				{
					val.summonerDeathRewards = rewards;
					val.deathRewardsCoefficient = count / 10;
				}
				CharacterMaster val2 = val.PerformSummon();
				if (Object.op_Implicit((Object)(object)val2))
				{
					CharacterBody body = val2.GetBody();
					body.AddTimedBuff(Buffs.Immune, 1f);
					body.inventory.SetEquipmentIndex(index);
				}
			}
		}
	}
}
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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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_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_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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_00ea: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			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();
			if (!Object.op_Implicit((Object)(object)((Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.healthComponent)) ? val2.healthComponent.body.coreTransform : ((EntityState)this).characterBody.coreTransform)))
			{
				return;
			}
			for (int i = 0; i < 5; i++)
			{
				VariantDirectorSpawnRequest val3 = new VariantDirectorSpawnRequest(JellySpawnCard, new DirectorPlacementRule
				{
					placementMode = (PlacementMode)1,
					minDistance = 3f,
					maxDistance = 20f,
					spawnOnTarget = ((EntityState)this).transform
				}, RoR2Application.rng);
				val3.applyOnStart = false;
				val3.supressRewards = true;
				val3.variantDefs = Array.Empty<VariantDef>();
				((DirectorSpawnRequest)val3).summonerBodyObject = ((EntityState)this).gameObject;
				DirectorCore instance = DirectorCore.instance;
				GameObject val4 = ((instance != null) ? instance.TrySpawnObject((DirectorSpawnRequest)(object)val3) : null);
				if (Object.op_Implicit((Object)(object)val4))
				{
					CharacterBody body = val4.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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: 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);
					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);
					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_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);
		}

		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_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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: 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_00ca: 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.op_Implicit((DamageType)32),
				falloffModel = (FalloffModel)0,
				procCoefficient = blastProcCoefficient,
				radius = blastRadius,
				position = breachPosition,
				attackerFiltering = (AttackerFiltering)2,
				impactEffect = EffectCatalog.FindEffectIndexFromPrefab(blastImpactEffectPrefab),
				teamIndex = ((EntityState)this).teamComponent.teamIndex
			}.Fire();
		}

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

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

		public static string attackSoundString = DeployMinions.attackSoundString;

		public static string summonSoundString = DeployMinions.summonSoundString;

		public static float maxSummonCount = 5f;

		public static float summonDuration = DeployMinions.summonDuration;

		public static string summonMuzzleString = DeployMinions.summonMuzzleString;

		public static GameObject roboBallMiniMaster = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/RoboBallBoss/RoboBallMiniMaster.prefab").WaitForCompletion();

		public static VariantDef swarmingDef = NWAssets.LoadAsset<VariantDef>("SwarmerProbe");

		private Animator animator;

		private Transform modelTransform;

		private ChildLocator childLocator;

		private float duration;

		private float summonInterval;

		private float summonTimer;

		private int summonCount;

		private bool isSummoning;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			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);
			summonInterval = summonDuration / maxSummonCount;
		}

		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 && (float)summonCount < maxSummonCount)
				{
					summonCount++;
					summonTimer -= summonInterval;
					SummonMinion();
				}
			}
			isSummoning = flag;
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void SummonMinion()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			VariantSummon val = new VariantSummon();
			((MasterSummon)val).position = childLocator.FindChild(summonMuzzleString).position;
			((MasterSummon)val).masterPrefab = roboBallMiniMaster;
			((MasterSummon)val).summonerBodyObject = ((Component)((EntityState)this).characterBody).gameObject;
			val.applyOnStart = true;
			val.supressRewards = true;
			val.variantDefs = (VariantDef[])(object)new VariantDef[1] { swarmingDef };
			val.PerformSummon();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace EntityStates.ParentMonster.Child
{
	public class ChildDeath : GenericCharacterDeath
	{
		public float timeBeforeDestealth = 2f;

		public float destealthDuration = 0.1f;

		public Material destealthMaterial;

		public GameObject effectPrefab;

		public string effectMuzzleString = "SlamZone";

		public static Vector3 SpawnPosition;

		public static CharacterSpawnCard parentSpawnCard = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Parent/cscParent.asset").WaitForCompletion();

		public static DeathState og = new DeathState();

		private bool destealth;

		private DeathRewards deathRewards;

		public override bool shouldAutoDestroy
		{
			get
			{
				if (destealth)
				{
					return ((EntityState)this).fixedAge > timeBeforeDestealth + destealthDuration;
				}
				return false;
			}
		}

		public override void OnEnter()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterDeath)this).OnEnter();
			SpawnPosition = ((EntityState)this).characterBody.corePosition;
			effectPrefab = og.effectPrefab;
			destealthMaterial = og.destealthMaterial;
			deathRewards = ((EntityState)this).GetComponent<DeathRewards>();
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).DestroyModel();
			((GenericCharacterDeath)this).OnExit();
		}

		private void SpawnParents()
		{
			//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_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_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_004e: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return;
			}
			for (int i = 0; i < 2; i++)
			{
				VariantDirectorSpawnRequest val = new VariantDirectorSpawnRequest((SpawnCard)(object)parentSpawnCard, new DirectorPlacementRule
				{
					maxDistance = 20f,
					minDistance = 3f,
					placementMode = (PlacementMode)1,
					spawnOnTarget = ((EntityState)this).transform
				}, RoR2Application.rng);
				val.applyOnStart = false;
				((DirectorSpawnRequest)val).ignoreTeamMemberLimit = true;
				((DirectorSpawnRequest)val).teamIndexOverride = ((EntityState)this).teamComponent.teamIndex;
				val.variantDefs = Array.Empty<VariantDef>();
				if (Object.op_Implicit((Object)(object)deathRewards))
				{
					val.deathRewardsBase = deathRewards;
					val.deathRewardsCoefficient = 0.5f;
				}
				GameObject val2 = DirectorCore.instance.TrySpawnObject((DirectorSpawnRequest)(object)val);
				if (Object.op_Implicit((Object)(object)val2))
				{
					val2.GetComponent<CharacterMaster>().GetBody().AddBuff(Buffs.WarCryBuff);
				}
			}
		}

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (((EntityState)this).fixedAge > timeBeforeDestealth && !destealth)
			{
				SpawnParents();
				DoDestealth();
			}
			if (destealth && ((EntityState)this).fixedAge > timeBeforeDestealth + destealthDuration)
			{
				((GenericCharacterDeath)this).DestroyModel();
			}
		}

		private void DoDestealth()
		{
			destealth = true;
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, effectMuzzleString, false);
			}
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				CharacterModel component = ((Component)modelTransform).gameObject.GetComponent<CharacterModel>();
				if (Object.op_Implicit((Object)(object)destealthMaterial))
				{
					TemporaryOverlay obj = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
					obj.duration = destealthDuration;
					obj.destroyComponentOnEnd = true;
					obj.originalMaterial = destealthMaterial;
					obj.inspectorCharacterModel = component;
					obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					obj.animateShaderAlpha = true;
					PrintController component2 = ((Component)((EntityState)this).modelLocator.modelTransform).gameObject.GetComponent<PrintController>();
					((Behaviour)component2).enabled = false;
					component2.printTime = destealthDuration;
					component2.startingPrintHeight = 0f;
					component2.maxPrintHeight = 20f;
					component2.startingPrintBias = 0f;
					component2.maxPrintBias = 2f;
					component2.disableWhenFinished = false;
					component2.printCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
					((Behaviour)component2).enabled = true;
				}
				Transform val = ((BaseState)this).FindModelChild("CoreLight");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
		}
	}
	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)
			((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.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.MiniMushroom.Healer
{
	public class HealerGrenade : BaseState
	{
		public static GameObject chargeEffectPrefab = SporeGrenade.chargeEffectPrefab;

		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 chargeEffectInstance;

		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))
			{
				chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val);
			}
		}

		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)chargeEffectInstance))
			{
				EntityState.Destroy((Object)(object)chargeEffectInstance);
			}
			((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);
		}
	}
}
namespace EntityStates.MiniMushroom.AD
{
	public class ArmorBreakerGrenade : BaseState
	{
		public static GameObject chargeEffectPrefab = SporeGrenade.chargeEffectPrefab;

		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 chargeEffectInstance;

		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))
			{
				chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val);
			}
		}

		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)chargeEffectInstance))
			{
				EntityState.Destroy((Object)(object)chargeEffectInstance);
			}
			((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);
		}
	}
}
namespace EntityStates.Wisp1Monster.Stone
{
	public class ChargeStoneLaser : BaseState
	{
		public static float baseDuration = 3f;

		public static float laserMaxWidth = 0.2f;

		public static GameObject effectPrefab = ChargeLaser.effectPrefab;

		public static GameObject laserPrefab = ChargeLaser.laserPrefab;

		public static string attackSoundString = ChargeLaser.attackSoundString;

		private float duration;

		private uint chargePlayID;

		private GameObject chargeEffectInstance;

		private GameObject laserEffectInstance;

		private LineRenderer laserLineComponent;

		private Vector3 laserDirection;

		private Vector3 visualEndPosition;

		private float flashTimer;

		private bool laserOn;

		public override void OnEnter()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			chargePlayID = Util.PlayAttackSpeedSound(attackSoundString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild("Muzzle");
					if (Object.op_Implicit((Object)(object)val))
					{
						if (Object.op_Implicit((Object)(object)effectPrefab))
						{
							chargeEffectInstance = Object.Instantiate<GameObject>(effectPrefab, val.position, val.rotation);
							chargeEffectInstance.transform.parent = val;
							ScaleParticleSystemDuration component2 = chargeEffectInstance.GetComponent<ScaleParticleSystemDuration>();
							if (Object.op_Implicit((Object)(object)component2))
							{
								component2.newDuration = duration;
							}
						}
						if (Object.op_Implicit((Object)(object)laserPrefab))
						{
							laserEffectInstance = Object.Instantiate<GameObject>(laserPrefab, val.position, val.rotation);
							laserEffectInstance.transform.parent = val;
							laserLineComponent = laserEffectInstance.GetComponent<LineRenderer>();
						}
					}
				}
				((EntityState)this).PlayAnimation("Body", "ChargeAttack1", "ChargeAttack1.playbackRate", duration, 0f);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					((EntityState)this).characterBody.SetAimTimer(duration);
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			flashTimer = 0f;
			laserOn = true;
		}

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

		public override void Update()
		{
			//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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0093: 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_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)
			((EntityState)this).Update();
			if (!Object.op_Implicit((Object)(object)laserEffectInstance) || !Object.op_Implicit((Object)(object)laserLineComponent))
			{
				return;
			}
			float num = 1000f;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 position = laserEffectInstance.transform.parent.position;
			Vector3 point = ((Ray)(ref aimRay)).GetPoint(num);
			laserDirection = point - position;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(aimRay, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
			{
				point = ((RaycastHit)(ref val)).point;
			}
			laserLineComponent.SetPosition(0, position);
			laserLineComponent.SetPosition(1, point);
			float num2;
			if (duration - ((EntityState)this).age > 0.5f)
			{
				num2 = ((EntityState)this).age / duration;
			}
			else
			{
				flashTimer -= Time.deltaTime;
				if (flashTimer <= 0f)
				{
					laserOn = !laserOn;
					flashTimer = 1f / 30f;
				}
				num2 = (laserOn ? 1f : 0f);
			}
			num2 *= laserMaxWidth;
			laserLineComponent.startWidth = num2;
			laserLineComponent.endWidth = num2;
		}

		public override void FixedUpdate()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				FireStoneLaser fireStoneLaser = new FireStoneLaser();
				fireStoneLaser.laserDirection = laserDirection;
				((EntityState)this).outer.SetNextState((EntityState)(object)fireStoneLaser);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class FireStoneLaser : BaseState
	{
		public static GameObject effectPrefab = FireLaser.effectPrefab;

		public static GameObject hitEffectPrefab = FireLaser.hitEffectPrefab;

		public static GameObject tracerEffectPrefab = FireLaser.tracerEffectPrefab;

		public static float damageCoefficient = FireLaser.damageCoefficient;

		public static float blastRadius = FireLaser.blastRadius;

		public static float force = FireLaser.force;

		public static float minSpread = FireLaser.minSpread;

		public static float maxSpread = FireLaser.maxSpread;

		public static int bulletCount = FireLaser.bulletCount;

		public static float baseDuration = FireLaser.baseDuration;

		public static string attackSoundString = FireLaser.attackSoundString;

		public Vector3 laserDirection;

		private float duration;

		private Ray modifiedAimRay;

		public override void OnEnter()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: 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_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: 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_0196: 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_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: 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)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: 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_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			modifiedAimRay = ((BaseState)this).GetAimRay();
			((Ray)(ref modifiedAimRay)).direction = laserDirection;
			((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			string text = "Muzzle";
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			((EntityState)this).PlayAnimation("Body", "FireAttack1", "FireAttack1.playbackRate", duration, 0f);
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, false);
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			float num = 1000f;
			Vector3 val = ((Ray)(ref modifiedAimRay)).origin + ((Ray)(ref modifiedAimRay)).direction * num;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(modifiedAimRay, ref val2, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
			{
				val = ((RaycastHit)(ref val2)).point;
			}
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
				baseDamage = base.damageStat * 5.72f * damageCoefficient,
				baseForce = force * 0.2f,
				position = val,
				radius = blastRadius,
				falloffModel = (FalloffModel)2,
				bonusForce = force * ((Ray)(ref modifiedAimRay)).direction
			}.Fire();
			_ = ((Ray)(ref modifiedAimRay)).origin;
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (Object.op_Implicit((Object)(object)component))
			{
				int num2 = component.FindChildIndex(text);
				if (Object.op_Implicit((Object)(object)tracerEffectPrefab))
				{
					EffectData val3 = new EffectData
					{
						origin = val,
						start = ((Ray)(ref modifiedAimRay)).origin
					};
					val3.SetChildLocatorTransformReference(((EntityState)this).gameObject, num2);
					EffectManager.SpawnEffect(tracerEffectPrefab, val3, true);
					EffectManager.SpawnEffect(hitEffectPrefab, val3, true);
				}
			}
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.Wisp1Monster.Archaic
{
	public class ChargeArchaicCannon : BaseState
	{
		public static GameObject chargeEffectPrefab;

		public static GameObject laserEffectPrefab = ChargeEmbers.laserEffectPrefab;

		public static float baseDuration = 3f;

		private GameObject chargeEffectInstance;

		private GameObject laserEffectInstance;

		private LineRenderer laserEffectInstanceLineRenderer;

		protected float duration;

		private string attackString;

		private float stopwatch;

		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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			ChargeCannons val = new ChargeCannons();
			chargeEffectPrefab = ((ChargeCannons)val).effectPrefab;
			attackString = ((ChargeCannons)val).attackString;
			((BaseState)this).OnEnter();
			Util.PlayAttackSpeedSound(attackString, ((EntityState)this).gameObject, base.attackSpeedStat * (2f / baseDuration));
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.FindChild("Muzzle")))
				{
					if (Object.op_Implicit((Object)(object)chargeEffectPrefab))
					{
						chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation);
						chargeEffectInstance.transform.parent = ((EntityState)this).transform;
						ScaleParticleSystemDuration component2 = chargeEffectInstance.GetComponent<ScaleParticleSystemDuration>();
						if (Object.op_Implicit((Object)(object)component2))
						{
							component2.newDuration = duration;
						}
					}
					if (Object.op_Implicit((Object)(object)laserEffectPrefab))
					{
						laserEffectInstance = Object.Instantiate<GameObject>(laserEffectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation);
						laserEffectInstance.transform.parent = ((EntityState)this).transform;
						laserEffectInstanceLineRenderer = laserEffectInstance.GetComponent<LineRenderer>();
					}
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			((EntityState)this).PlayAnimation("Body", "ChargeAttack1", "ChargeAttack1.playbackRate", duration, 0f);
		}

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

		public override void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002b: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).Update();
			Ray aimRay = ((BaseState)this).GetAimRay();
			float num = 50f;
			Vector3 origin = ((Ray)(ref aimRay)).origin;
			Vector3 point = ((Ray)(ref aimRay)).GetPoint(num);
			laserEffectInstanceLineRenderer.SetPosition(0, origin);
			laserEffectInstanceLineRenderer.SetPosition(1, point);
			Color startColor = default(Color);
			((Color)(ref startColor))..ctor(255f, 191f, 237f, stopwatch / duration);
			Color clear = Color.clear;
			laserEffectInstanceLineRenderer.startColor = startColor;
			laserEffectInstanceLineRenderer.endColor = clear;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch +=