Decompiled source of RiskyMod v2.2.16

plugins/Risky_Lives-RiskyMod/RiskyMod.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AI_Blacklist;
using AncientScepter;
using ArtifactOfPotential;
using AssistManager;
using AssistManager.VanillaTweaks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using DefenseMatrixManager;
using EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.Bison;
using EntityStates.Captain.Weapon;
using EntityStates.CaptainDefenseMatrixItem;
using EntityStates.CaptainSupplyDrop;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Croco;
using EntityStates.Drone;
using EntityStates.Drone.DroneWeapon;
using EntityStates.Engi.EngiBubbleShield;
using EntityStates.Engi.Mine;
using EntityStates.Headstompers;
using EntityStates.Huntress;
using EntityStates.LemurianMonster;
using EntityStates.Loader;
using EntityStates.LunarWisp;
using EntityStates.Mage;
using EntityStates.MagmaWorm;
using EntityStates.MajorConstruct.Weapon;
using EntityStates.Missions.BrotherEncounter;
using EntityStates.RiskyMod.Bandit2;
using EntityStates.RiskyMod.Bandit2.Primary;
using EntityStates.RiskyMod.Bandit2.Revolver;
using EntityStates.RiskyMod.Bandit2.Revolver.Scepter;
using EntityStates.RiskyMod.Captain;
using EntityStates.RiskyMod.Captain.Beacon;
using EntityStates.RiskyMod.Commando;
using EntityStates.RiskyMod.Commando.Scepter;
using EntityStates.RiskyMod.Croco;
using EntityStates.RiskyMod.Huntress;
using EntityStates.RiskyMod.Mage;
using EntityStates.RiskyMod.Mage.Weapon;
using EntityStates.RiskyMod.MegaDrone;
using EntityStates.RiskyMod.Turret1;
using EntityStates.TitanMonster;
using EntityStates.Toolbot;
using EntityStates.Treebot.Weapon;
using EntityStates.VoidInfestor;
using EntityStates.VoidSurvivor;
using HG;
using IL.EntityStates.Bandit2.Weapon;
using IL.EntityStates.Bison;
using IL.EntityStates.Captain.Weapon;
using IL.EntityStates.CaptainSupplyDrop;
using IL.EntityStates.Commando.CommandoWeapon;
using IL.EntityStates.Croco;
using IL.EntityStates.Drone;
using IL.EntityStates.Drone.DroneWeapon;
using IL.EntityStates.Engi.Mine;
using IL.EntityStates.Headstompers;
using IL.EntityStates.JellyfishMonster;
using IL.EntityStates.Loader;
using IL.EntityStates.Mage;
using IL.EntityStates.ParentMonster;
using IL.EntityStates.TitanMonster;
using IL.EntityStates.Toolbot;
using IL.EntityStates.VagrantMonster;
using IL.EntityStates.VagrantNovaItem;
using IL.EntityStates.VoidInfestor;
using IL.RoR2;
using IL.RoR2.Artifacts;
using IL.RoR2.Items;
using IL.RoR2.Projectile;
using Inferno;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using Moonstorm.Starstorm2.Interactables;
using NS_KingKombatArena;
using On.EntityStates;
using On.EntityStates.Bandit2.Weapon;
using On.EntityStates.CaptainDefenseMatrixItem;
using On.EntityStates.CaptainSupplyDrop;
using On.EntityStates.Commando;
using On.EntityStates.Commando.CommandoWeapon;
using On.EntityStates.Croco;
using On.EntityStates.Drone.DroneWeapon;
using On.EntityStates.Engi.EngiBubbleShield;
using On.EntityStates.Headstompers;
using On.EntityStates.LemurianMonster;
using On.EntityStates.Loader;
using On.EntityStates.LunarWisp;
using On.EntityStates.MagmaWorm;
using On.EntityStates.MajorConstruct.Weapon;
using On.EntityStates.Missions.BrotherEncounter;
using On.EntityStates.TitanMonster;
using On.EntityStates.Toolbot;
using On.EntityStates.Treebot.Weapon;
using On.EntityStates.VoidSurvivor;
using On.RoR2;
using On.RoR2.CharacterAI;
using On.RoR2.Items;
using On.RoR2.Projectile;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RiskyMod;
using RiskyMod.Allies;
using RiskyMod.Allies.DamageResistances;
using RiskyMod.Allies.DroneBehaviors;
using RiskyMod.Allies.DroneChanges;
using RiskyMod.Content;
using RiskyMod.Content.Enemies;
using RiskyMod.Enemies;
using RiskyMod.Enemies.Bosses;
using RiskyMod.Enemies.DLC1;
using RiskyMod.Enemies.DLC1.Voidling;
using RiskyMod.Enemies.DLC2;
using RiskyMod.Enemies.Mithrix;
using RiskyMod.Enemies.Mobs;
using RiskyMod.Enemies.Mobs.Lunar;
using RiskyMod.Enemies.Spawnpools;
using RiskyMod.Fixes;
using RiskyMod.Items;
using RiskyMod.Items.Boss;
using RiskyMod.Items.Common;
using RiskyMod.Items.DLC1.Boss;
using RiskyMod.Items.DLC1.Common;
using RiskyMod.Items.DLC1.Equipment;
using RiskyMod.Items.DLC1.Legendary;
using RiskyMod.Items.DLC1.Uncommon;
using RiskyMod.Items.DLC1.Void;
using RiskyMod.Items.DLC2;
using RiskyMod.Items.Equipment;
using RiskyMod.Items.Legendary;
using RiskyMod.Items.Lunar;
using RiskyMod.Items.Uncommon;
using RiskyMod.MonoBehaviours;
using RiskyMod.Moon;
using RiskyMod.SharedHooks;
using RiskyMod.Survivors;
using RiskyMod.Survivors.Bandit2;
using RiskyMod.Survivors.Bandit2.Components;
using RiskyMod.Survivors.Captain;
using RiskyMod.Survivors.Commando;
using RiskyMod.Survivors.Croco;
using RiskyMod.Survivors.Croco.Contagion;
using RiskyMod.Survivors.Croco.Contagion.Components;
using RiskyMod.Survivors.Croco.Tweaks;
using RiskyMod.Survivors.DLC1.VoidFiend;
using RiskyMod.Survivors.Engi;
using RiskyMod.Survivors.Huntress;
using RiskyMod.Survivors.Loader;
using RiskyMod.Survivors.Mage;
using RiskyMod.Survivors.Mage.Components;
using RiskyMod.Survivors.Mage.SkillTweaks;
using RiskyMod.Survivors.Merc;
using RiskyMod.Survivors.Toolbot;
using RiskyMod.Survivors.Treebot;
using RiskyMod.Tweaks;
using RiskyMod.Tweaks.Artifact;
using RiskyMod.Tweaks.CharacterMechanics;
using RiskyMod.Tweaks.Holdouts;
using RiskyMod.Tweaks.RunScaling;
using RiskyMod.VoidFields;
using RiskyMod.VoidLocus;
using RiskyTweaks.FireSelect;
using RiskyTweaks.Tweaks;
using RiskyTweaks.Tweaks.Survivors.Bandit2;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
using RoR2.UI;
using ShareSuite;
using SneedUtils;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using Zio.FileSystems;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RiskyMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3f44906af863ccca02c2aac68c3650cfd56d4ab4")]
[assembly: AssemblyProduct("RiskyMod")]
[assembly: AssemblyTitle("RiskyMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace SneedUtils
{
	public class SneedUtils
	{
		public enum MonsterCategories
		{
			BasicMonsters,
			Minibosses,
			Champions
		}

		public static GameObject teleportHelperPrefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab");

		public static void AddCooldownBuff(CharacterBody body, BuffDef buff, int cooldown, float bonusDuration = 0f)
		{
			body.ClearTimedBuffs(buff);
			for (int i = 0; i < cooldown; i++)
			{
				body.AddTimedBuff(buff, (float)i + 1f + bonusDuration);
			}
		}

		public static void AddModdedDamageTypeToProjectile(GameObject projectile, ModdedDamageType[] moddedDamageTypes)
		{
			if (Object.op_Implicit((Object)(object)projectile))
			{
				ModdedDamageTypeHolderComponent val = projectile.GetComponent<ModdedDamageTypeHolderComponent>();
				if (!Object.op_Implicit((Object)(object)val))
				{
					val = projectile.AddComponent<ModdedDamageTypeHolderComponent>();
				}
				for (int i = 0; i < moddedDamageTypes.Length; i++)
				{
					val.Add(moddedDamageTypes[i]);
				}
			}
		}

		public static void AddModdedDamageTypeToProjectile(GameObject projectile, ModdedDamageType moddedDamageType)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)projectile))
			{
				ModdedDamageTypeHolderComponent val = projectile.GetComponent<ModdedDamageTypeHolderComponent>();
				if (!Object.op_Implicit((Object)(object)val))
				{
					val = projectile.AddComponent<ModdedDamageTypeHolderComponent>();
				}
				val.Add(moddedDamageType);
			}
		}

		public static bool RemoveMonsterSpawnCardFromCategory(DirectorCardCategorySelection categorySelection, SpawnCard spawnCard, MonsterCategories monsterCategory)
		{
			int num = FindCategoryIndexByName(categorySelection, monsterCategory);
			if (num >= 0 && categorySelection.categories[num].cards != null)
			{
				int num2 = categorySelection.categories[num].cards.Length;
				categorySelection.categories[num].cards = categorySelection.categories[num].cards.Where((DirectorCard dc) => (Object)(object)dc.spawnCard != (Object)(object)spawnCard).ToArray();
				return categorySelection.categories[num].cards.Length < num2;
			}
			return false;
		}

		public static bool AddMonsterDirectorCardToCategory(DirectorCardCategorySelection categorySelection, DirectorCard directorCard, MonsterCategories monsterCategory)
		{
			int num = FindCategoryIndexByName(categorySelection, monsterCategory);
			if (num >= 0)
			{
				categorySelection.AddCard(num, directorCard);
				return true;
			}
			return false;
		}

		public static int FindCategoryIndexByName(DirectorCardCategorySelection dcs, MonsterCategories category)
		{
			string categoryName;
			switch (category)
			{
			case MonsterCategories.BasicMonsters:
				categoryName = "Basic Monsters";
				break;
			case MonsterCategories.Minibosses:
				categoryName = "Minibosses";
				break;
			case MonsterCategories.Champions:
				categoryName = "Champions";
				break;
			default:
				return -1;
			}
			return FindCategoryIndexByName(dcs, categoryName);
		}

		public static int FindCategoryIndexByName(DirectorCardCategorySelection dcs, string categoryName)
		{
			for (int i = 0; i < dcs.categories.Length; i++)
			{
				if (string.CompareOrdinal(dcs.categories[i].name, categoryName) == 0)
				{
					return i;
				}
			}
			return -1;
		}

		public static bool ReplaceSkillDef(SkillFamily skillFamily, SkillDef targetSkill, SkillDef newSkill)
		{
			bool flag = false;
			if (skillFamily.variants != null && (Object)(object)targetSkill != (Object)null && (Object)(object)newSkill != (Object)null)
			{
				for (int i = 0; i < skillFamily.variants.Length; i++)
				{
					if ((Object)(object)skillFamily.variants[i].skillDef == (Object)(object)targetSkill)
					{
						skillFamily.variants[i].skillDef = newSkill;
						flag = true;
						break;
					}
				}
			}
			if (!flag)
			{
				Debug.LogError((object)("RiskyMod: Could not replace TargetSkill " + (object)targetSkill));
			}
			return flag;
		}

		public static bool ShouldRunInfernoChange()
		{
			return !EnemiesCore.infernoCompat || !CheckInfernoActive();
		}

		public static bool CheckInfernoActive()
		{
			bool result = false;
			if (SoftDependencies.InfernoPluginLoaded)
			{
				result = CheckInfernoActiveInternal();
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static bool CheckInfernoActiveInternal()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			return (Object)(object)Run.instance != (Object)null && Run.instance.selectedDifficulty == Main.InfernoDiffIndex;
		}

		public static bool GetKeyPressed(ConfigEntry<KeyboardShortcut> entry)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_004f: 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)
			KeyboardShortcut value = entry.Value;
			foreach (KeyCode modifier in ((KeyboardShortcut)(ref value)).Modifiers)
			{
				if (!Input.GetKey(modifier))
				{
					return false;
				}
			}
			value = entry.Value;
			return Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey);
		}

		public static Vector3 FindSafeTeleportPosition(GameObject gameObject, Vector3 targetPosition)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			return FindSafeTeleportPosition(gameObject, targetPosition, float.NegativeInfinity, float.NegativeInfinity);
		}

		public static Vector3 FindSafeTeleportPosition(GameObject gameObject, Vector3 targetPosition, float idealMinDistance, float idealMaxDistance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00a7: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00e4: 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_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_00e9: Unknown result type (might be due to invalid IL or missing references)
			SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
			val.hullSize = (HullClassification)0;
			val.nodeGraphType = (GraphType)0;
			val.prefab = teleportHelperPrefab;
			Vector3 result = targetPosition;
			GameObject val2 = null;
			if (idealMaxDistance > 0f && idealMinDistance < idealMaxDistance)
			{
				val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
				{
					placementMode = (PlacementMode)1,
					minDistance = idealMinDistance,
					maxDistance = idealMaxDistance,
					position = targetPosition
				}, RoR2Application.rng));
			}
			if (!Object.op_Implicit((Object)(object)val2))
			{
				val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
				{
					placementMode = (PlacementMode)3,
					position = targetPosition
				}, RoR2Application.rng));
				if (Object.op_Implicit((Object)(object)val2))
				{
					result = val2.transform.position;
				}
			}
			if (Object.op_Implicit((Object)(object)val2))
			{
				Object.Destroy((Object)(object)val2);
			}
			Object.Destroy((Object)(object)val);
			return result;
		}

		public static void StunEnemiesInSphere(CharacterBody body, float radius)
		{
			//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_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)
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.teamComponent))
			{
				return;
			}
			List<HealthComponent> list = new List<HealthComponent>();
			Collider[] array = Physics.OverlapSphere(body.corePosition, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
			for (int i = 0; i < array.Length; i++)
			{
				HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
				if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || list.Contains(component.healthComponent))
				{
					continue;
				}
				list.Add(component.healthComponent);
				if (Object.op_Implicit((Object)(object)component.healthComponent.body.teamComponent) && component.healthComponent.body.teamComponent.teamIndex != body.teamComponent.teamIndex)
				{
					SetStateOnHurt component2 = ((Component)component.healthComponent).gameObject.GetComponent<SetStateOnHurt>();
					if (Object.op_Implicit((Object)(object)component2) && component2.canBeStunned)
					{
						component2.SetStun(1f);
					}
				}
			}
		}

		public static void FixSkillName(SkillDef skillDef)
		{
			((Object)skillDef).name = skillDef.skillName;
		}

		public static BuffDef CreateBuffDef(string name, bool canStack, bool isCooldown, bool isDebuff, Color color, Sprite iconSprite)
		{
			//IL_0025: 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)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = name;
			val.canStack = canStack;
			val.isCooldown = isCooldown;
			val.isDebuff = isDebuff;
			val.buffColor = color;
			val.iconSprite = iconSprite;
			Content.buffDefs.Add(val);
			((Object)val).name = ((Object)val).name;
			return val;
		}

		public static bool IsLocalUser(GameObject playerObject)
		{
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				if ((Object)(object)playerObject == (Object)(object)readOnlyLocalUsers.cachedBodyObject)
				{
					return true;
				}
			}
			return false;
		}

		public static bool IsLocalUser(CharacterBody playerBody)
		{
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				if ((Object)(object)playerBody == (Object)(object)readOnlyLocalUsers.cachedBody)
				{
					return true;
				}
			}
			return false;
		}

		public static int FindEnemiesInSphere(float radius, Vector3 position, TeamIndex team, bool airborneOnly = false)
		{
			//IL_0009: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			List<HealthComponent> list = new List<HealthComponent>();
			Collider[] array = Physics.OverlapSphere(position, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
			for (int i = 0; i < array.Length; i++)
			{
				HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					continue;
				}
				HealthComponent healthComponent = component.healthComponent;
				if (Object.op_Implicit((Object)(object)healthComponent) && !list.Contains(healthComponent))
				{
					list.Add(healthComponent);
					if (Object.op_Implicit((Object)(object)healthComponent.body) && Object.op_Implicit((Object)(object)healthComponent.body.teamComponent) && healthComponent.body.teamComponent.teamIndex != team && (!airborneOnly || healthComponent.body.isFlying || (Object.op_Implicit((Object)(object)healthComponent.body.characterMotor) && !healthComponent.body.characterMotor.isGrounded)))
					{
						num++;
					}
				}
			}
			return num;
		}

		public static bool IsEnemyInSphere(float radius, Vector3 position, TeamIndex team, bool airborneOnly = false)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			List<HealthComponent> list = new List<HealthComponent>();
			Collider[] array = Physics.OverlapSphere(position, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
			for (int i = 0; i < array.Length; i++)
			{
				HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					continue;
				}
				HealthComponent healthComponent = component.healthComponent;
				if (Object.op_Implicit((Object)(object)healthComponent) && !list.Contains(healthComponent))
				{
					list.Add(healthComponent);
					if (Object.op_Implicit((Object)(object)healthComponent.body) && Object.op_Implicit((Object)(object)healthComponent.body.teamComponent) && healthComponent.body.teamComponent.teamIndex != team && (!airborneOnly || healthComponent.body.isFlying || (Object.op_Implicit((Object)(object)healthComponent.body.characterMotor) && !healthComponent.body.characterMotor.isGrounded)))
					{
						return true;
					}
				}
			}
			return false;
		}

		public static void RemoveItemTag(ItemDef itemDef, ItemTag tag)
		{
			//IL_0002: 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_002e: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Invalid comparison between Unknown and I4
			//IL_0044: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			if (!itemDef.ContainsTag(tag))
			{
				return;
			}
			List<ItemTag> list = itemDef.tags.ToList();
			list.Remove(tag);
			itemDef.tags = list.ToArray();
			ItemIndex itemIndex = itemDef.itemIndex;
			if ((int)itemIndex != -1 && ItemCatalog.itemIndicesByTag != null && ItemCatalog.itemIndicesByTag[tag] != null)
			{
				List<ItemIndex> list2 = ItemCatalog.itemIndicesByTag[tag].ToList();
				if (list2.Contains(itemIndex))
				{
					list2.Remove(itemIndex);
					ItemCatalog.itemIndicesByTag[tag] = list2.ToArray();
				}
			}
		}

		public static void AddItemTag(ItemDef itemDef, ItemTag tag)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Invalid comparison between Unknown and I4
			//IL_0050: 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_006d: 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)
			if (itemDef.ContainsTag(tag))
			{
				return;
			}
			List<ItemTag> list = itemDef.tags.ToList();
			list.Add(tag);
			itemDef.tags = list.ToArray();
			ItemIndex itemIndex = itemDef.itemIndex;
			if ((int)itemIndex != -1 && ItemCatalog.itemIndicesByTag != null)
			{
				List<ItemIndex> list2 = ItemCatalog.itemIndicesByTag[tag].ToList();
				if (!list2.Contains(itemIndex))
				{
					list2.Add(itemIndex);
					ItemCatalog.itemIndicesByTag[tag] = list2.ToArray();
				}
			}
		}

		public static void DumpEntityStateConfig(EntityStateConfiguration esc)
		{
			for (int i = 0; i < esc.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (Object.op_Implicit(esc.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue))
				{
					Debug.Log((object)(esc.serializedFieldsCollection.serializedFields[i].fieldName + " - " + (object)esc.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue));
				}
				else
				{
					Debug.Log((object)(esc.serializedFieldsCollection.serializedFields[i].fieldName + " - " + esc.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue));
				}
			}
		}

		public static void DumpEntityStateConfig(string entityStateName)
		{
			EntityStateConfiguration esc = LegacyResourcesAPI.Load<EntityStateConfiguration>("entitystateconfigurations/" + entityStateName);
			DumpEntityStateConfig(esc);
		}

		public static void DumpAddressableEntityStateConfig(string addressablePath)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			EntityStateConfiguration esc = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)addressablePath).WaitForCompletion();
			DumpEntityStateConfig(esc);
		}

		public static Object GetEntityStateFieldObject(string entityStateName, string fieldName)
		{
			EntityStateConfiguration val = LegacyResourcesAPI.Load<EntityStateConfiguration>("entitystateconfigurations/" + entityStateName);
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					return val.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue;
				}
			}
			return null;
		}

		public static string GetEntityStateFieldString(string entityStateName, string fieldName)
		{
			EntityStateConfiguration val = LegacyResourcesAPI.Load<EntityStateConfiguration>("entitystateconfigurations/" + entityStateName);
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					return val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue;
				}
			}
			return string.Empty;
		}

		public static bool SetEntityStateField(string entityStateName, string fieldName, Object newObject)
		{
			EntityStateConfiguration val = LegacyResourcesAPI.Load<EntityStateConfiguration>("entitystateconfigurations/" + entityStateName);
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue = newObject;
					return true;
				}
			}
			return false;
		}

		public static bool SetEntityStateField(string entityStateName, string fieldName, string value)
		{
			EntityStateConfiguration val = LegacyResourcesAPI.Load<EntityStateConfiguration>("entitystateconfigurations/" + entityStateName);
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = value;
					return true;
				}
			}
			return false;
		}

		public static bool SetAddressableEntityStateField(string fullEntityStatePath, string fieldName, string value)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)fullEntityStatePath).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = value;
					return true;
				}
			}
			return false;
		}

		public static bool SetAddressableEntityStateField(string fullEntityStatePath, string fieldName, Object newObject)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)fullEntityStatePath).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue = newObject;
					return true;
				}
			}
			return false;
		}

		public static Object GetAddressableEntityStateFieldObject(string fullEntityStatePath, string fieldName)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)fullEntityStatePath).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					return val.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue;
				}
			}
			return null;
		}

		public static string GetAddressableEntityStateFieldString(string fullEntityStatePath, string fieldName)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)fullEntityStatePath).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					return val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue;
				}
			}
			return string.Empty;
		}

		public static string FloatToString(float f)
		{
			int num = Mathf.FloorToInt(f);
			int num2 = Mathf.FloorToInt((f - (float)num) * 100f);
			return num + "." + num2;
		}

		public static bool AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00b3: 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)
			if (!Object.op_Implicit((Object)(object)skillDef))
			{
				Debug.LogError((object)("SkillsReturns: Could not add " + skillDef.skillName + ": SkillDef is null."));
				return false;
			}
			if ((Object)(object)skillFamily == (Object)null)
			{
				Debug.LogError((object)("SkillsReturns: Could not add " + skillDef.skillName + ": SkillFamily is null."));
				return false;
			}
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val = new Variant
			{
				skillDef = skillDef,
				unlockableName = ""
			};
			((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null);
			variants[num] = val;
			return true;
		}
	}
}
namespace EntityStates.RiskyMod.Mage
{
	public class SpecialLightning : BaseState
	{
		private bool rightMuzzle = true;

		public static float totalDamageCoefficient = 12f;

		public static GameObject gauntletEffectPrefab;

		public static GameObject gauntletMissEffectPrefab;

		public static float maxDistance = 40f;

		public static float bounceDistance = 20f;

		public static float baseEntryDuration = 0.6f;

		public static float baseAttackDuration = 3f;

		public static float procCoefficientPerTick = 1f;

		public static float baseTickFrequency = 5f;

		public static float force = 100f;

		public static int bounceCount = 1;

		public static string startAttackSoundString = "Play_mage_m2_shoot";

		public static string endAttackSoundString = "";

		public static float recoilForce = 0f;

		private static int baseTickCount = 20;

		private float tickFrequency;

		public int loadBaseTickCount;

		public float loadBaseTickFrequency;

		public float loadTotalDamageCoefficient;

		public float loadMaxDistance;

		public float loadBounceDistance;

		public float loadBounceCount;

		private float tickDamageCoefficient;

		public static GameObject laserEffectPrefab;

		private float flamethrowerStopwatch;

		private float stopwatch;

		private float entryDuration;

		private float flamethrowerDuration;

		private bool hasBegunAttack;

		private ChildLocator childLocator;

		private Transform leftMuzzleTransform;

		private Transform rightMuzzleTransform;

		private bool isCrit;

		private const float flamethrowerEffectBaseDistance = 16f;

		public virtual void LoadStats()
		{
			loadBaseTickCount = baseTickCount;
			loadBaseTickFrequency = baseTickFrequency;
			loadMaxDistance = maxDistance;
			loadBounceDistance = bounceDistance;
			loadTotalDamageCoefficient = totalDamageCoefficient;
			loadBounceCount = bounceCount;
		}

		public virtual void ModifyAttack(LightningOrb lo)
		{
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			LoadStats();
			tickDamageCoefficient = loadTotalDamageCoefficient / (baseTickFrequency * baseAttackDuration);
			entryDuration = baseEntryDuration / base.attackSpeedStat;
			tickFrequency = loadBaseTickFrequency * base.attackSpeedStat;
			flamethrowerDuration = baseAttackDuration;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(entryDuration + flamethrowerDuration + 1f);
			}
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				leftMuzzleTransform = childLocator.FindChild("MuzzleLeft");
				rightMuzzleTransform = childLocator.FindChild("MuzzleRight");
			}
			isCrit = ((BaseState)this).RollCrit();
			((EntityState)this).PlayAnimation("Gesture, Additive", "PrepFlamethrower", "Flamethrower.playbackRate", entryDuration, 0f);
		}

		public override void OnExit()
		{
			Util.PlaySound(endAttackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("Gesture, Additive", "ExitFlamethrower", 0.1f);
			((EntityState)this).OnExit();
		}

		private void FireGauntlet(string muzzleString)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: 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_00fe: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: 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_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				string text = (rightMuzzle ? "MuzzleRight" : "MuzzleLeft");
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 origin = ((Ray)(ref aimRay)).origin;
				if (Object.op_Implicit((Object)(object)leftMuzzleTransform) && Object.op_Implicit((Object)(object)rightMuzzleTransform))
				{
					origin = ((!rightMuzzle) ? leftMuzzleTransform.position : rightMuzzleTransform.position);
					rightMuzzle = !rightMuzzle;
				}
				List<HealthComponent> bouncedObjects = new List<HealthComponent>();
				LightningOrb val = new LightningOrb
				{
					bouncedObjects = bouncedObjects,
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					damageValue = base.damageStat * tickDamageCoefficient,
					procCoefficient = procCoefficientPerTick,
					teamIndex = ((BaseState)this).GetTeam(),
					isCrit = isCrit,
					procChainMask = default(ProcChainMask),
					lightningType = (LightningType)8,
					damageColorIndex = (DamageColorIndex)0,
					bouncesRemaining = 1,
					targetsToFindPerBounce = 6,
					range = loadBounceDistance,
					origin = origin,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0),
					speed = 120f
				};
				val.damageType.damageSource = (DamageSource)8;
				ModifyAttack(val);
				BullseyeSearch val2 = new BullseyeSearch();
				val2.teamMaskFilter = TeamMask.allButNeutral;
				((TeamMask)(ref val2.teamMaskFilter)).RemoveTeam(((EntityState)this).characterBody.teamComponent.teamIndex);
				val2.filterByLoS = false;
				val2.searchOrigin = ((Ray)(ref aimRay)).origin - ((Ray)(ref aimRay)).direction;
				val2.sortMode = (SortMode)2;
				val2.maxDistanceFilter = loadMaxDistance + 1f;
				val2.maxAngleFilter = (((EntityState)this).isAuthority ? 45f : 90f);
				val2.searchDirection = ((Ray)(ref aimRay)).direction;
				val2.RefreshCandidates();
				GameObject val3 = gauntletMissEffectPrefab;
				HurtBox val4 = val2.GetResults().FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val4))
				{
					val.bouncedObjects.Add(val4.healthComponent);
					((Orb)val).target = val4;
					OrbManager.instance.AddOrb((Orb)(object)val);
					val3 = gauntletEffectPrefab;
				}
				else
				{
					new BulletAttack
					{
						owner = ((EntityState)this).gameObject,
						weapon = ((EntityState)this).gameObject,
						origin = ((Ray)(ref aimRay)).origin,
						aimVector = ((Ray)(ref aimRay)).direction,
						minSpread = 0f,
						maxSpread = 0f,
						damage = tickDamageCoefficient * base.damageStat,
						force = force,
						tracerEffectPrefab = laserEffectPrefab,
						muzzleName = text,
						hitEffectPrefab = null,
						isCrit = isCrit,
						radius = 1f,
						smartCollision = false,
						stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
						maxDistance = maxDistance - 5f
					}.Fire();
				}
				EffectManager.SimpleMuzzleFlash(val3, ((EntityState)this).gameObject, text, true);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= entryDuration && !hasBegunAttack)
			{
				hasBegunAttack = true;
				Util.PlaySound(startAttackSoundString, ((EntityState)this).gameObject);
				((EntityState)this).PlayAnimation("Gesture, Additive", "Flamethrower", "Flamethrower.playbackRate", flamethrowerDuration, 0f);
				FireGauntlet("MuzzleCenter");
			}
			if (hasBegunAttack)
			{
				flamethrowerStopwatch += Time.deltaTime;
				if (flamethrowerStopwatch > 1f / tickFrequency)
				{
					flamethrowerStopwatch -= 1f / tickFrequency;
					FireGauntlet("MuzzleCenter");
				}
			}
			if (((EntityState)this).fixedAge > baseEntryDuration + baseAttackDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class SpecialLightningScepter : SpecialLightning
	{
		public override void LoadStats()
		{
			base.LoadStats();
			loadMaxDistance = 60f;
			loadBounceDistance = 30f;
			loadTotalDamageCoefficient = 32f;
			loadBounceCount = 2f;
		}
	}
}
namespace EntityStates.RiskyMod.Mage.Weapon
{
	public class PrepFireStorm : BaseState
	{
		public static float baseDuration = 0.5f;

		public static float damageCoefficient = 21.6f;

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

		public static GameObject muzzleflashEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Mage/MuzzleflashMageFireLarge.prefab").WaitForCompletion();

		public static GameObject crosshairOverridePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/SimpleDotCrosshair.prefab").WaitForCompletion();

		public static string PrepIonSurgeSoundString = "Play_mage_m1_shoot";

		public static float maxDistance = 600f;

		public static string fireSoundString = "Play_mage_R_end";

		public static GameObject projectilePrefab;

		public static GameObject blastEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniExplosionVFX.prefab").WaitForCompletion();

		public static float blastRadius = 8f;

		public static float blastJumpRadius = 14f;

		public static float blastForce = 4000f;

		private float duration;

		private float stopwatch;

		private GameObject areaIndicatorInstance;

		private OverrideRequest crosshairOverrideRequest;

		public override void OnEnter()
		{
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(duration + 2f);
			crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, crosshairOverridePrefab, (OverridePriority)1);
			((EntityState)this).PlayAnimation("Gesture, Additive", "PrepIonSurge", "PrepIonSurge.playbackRate", duration, 0f);
			Util.PlaySound(PrepIonSurgeSoundString, ((EntityState)this).gameObject);
			areaIndicatorInstance = Object.Instantiate<GameObject>(areaIndicatorPrefab);
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				areaIndicatorInstance.transform.localScale = blastRadius * Vector3.one;
			}
			UpdateAreaIndicator();
		}

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

		private void UpdateAreaIndicator()
		{
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: 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_003b: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 val = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * maxDistance;
				RaycastHit val2 = default(RaycastHit);
				if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val2, maxDistance, CommonMasks.bullet, (QueryTriggerInteraction)0))
				{
					val = ((RaycastHit)(ref val2)).point;
				}
				areaIndicatorInstance.transform.SetPositionAndRotation(val, Quaternion.identity);
				areaIndicatorInstance.transform.localScale = blastRadius * Vector3.one;
			}
		}

		private void OnPreRenderSceneCam(SceneCamera sceneCam)
		{
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				((Component)areaIndicatorInstance.transform).gameObject.layer = (((Object)(object)sceneCam.cameraRigController.target == (Object)(object)((EntityState)this).gameObject) ? LayerIndex.defaultLayer.intVal : LayerIndex.noDraw.intVal);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (!((EntityState)this).inputBank.skill3.down && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			if (!((EntityState)this).outer.destroying)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireWall");
				Util.PlaySound(fireSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(muzzleflashEffect, ((EntityState)this).gameObject, "MuzzleLeft", true);
				EffectManager.SimpleMuzzleFlash(muzzleflashEffect, ((EntityState)this).gameObject, "MuzzleRight", true);
			}
			EntityState.Destroy((Object)(object)areaIndicatorInstance.gameObject);
			OverrideRequest val = crosshairOverrideRequest;
			if (val != null)
			{
				val.Dispose();
			}
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 position = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * maxDistance;
				RaycastHit val2 = default(RaycastHit);
				if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val2, maxDistance, CommonMasks.bullet, (QueryTriggerInteraction)0))
				{
					position = ((RaycastHit)(ref val2)).point;
				}
				if (MageCore.utilitySelfKnockback.Value && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
				{
					ApplySelfKnockback();
				}
				ProjectileManager instance = ProjectileManager.instance;
				FireProjectileInfo val3 = new FireProjectileInfo
				{
					damage = base.damageStat * damageCoefficient,
					crit = ((BaseState)this).RollCrit(),
					damageColorIndex = (DamageColorIndex)0,
					position = position,
					procChainMask = default(ProcChainMask),
					force = 0f,
					owner = ((EntityState)this).gameObject,
					projectilePrefab = projectilePrefab,
					rotation = Quaternion.identity
				};
				((FireProjectileInfo)(ref val3)).speedOverride = 0f;
				val3.target = null;
				instance.FireProjectile(val3);
			}
			((EntityState)this).OnExit();
		}

		public void ApplySelfKnockback()
		{
			//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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0067: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			EntityStateMachine val = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Jet");
			if (!Object.op_Implicit((Object)(object)val) || !(((object)val.state).GetType() == typeof(JetpackOn)))
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 val2 = -1f * ((Ray)(ref aimRay)).direction * blastForce;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				((EntityState)this).characterMotor.ApplyForce(val2, true, false);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	public class PrepIceWall : BaseState
	{
		public static float baseDuration = 0.5f;

		public static GameObject areaIndicatorPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/FirewallAreaIndicator.prefab").WaitForCompletion();

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

		public static GameObject projectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageIcewallWalkerProjectile.prefab").WaitForCompletion();

		public static float damageCoefficient = 1f;

		public static GameObject muzzleflashEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageIceLarge.prefab").WaitForCompletion();

		public static GameObject goodCrosshairPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/SimpleDotCrosshair.prefab").WaitForCompletion();

		public static GameObject badCrosshairPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/SimpleDotCrosshair.prefab").WaitForCompletion();

		public static string PrepIceWallSoundString = "Play_mage_shift_start";

		public static float maxDistance = 600f;

		public static string fireSoundString = "Play_mage_shift_stop";

		public static float maxSlopeAngle = 70f;

		public static GameObject hitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageIceExplosion.prefab").WaitForCompletion();

		public static GameObject blastEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniImpactVFXFrozen.prefab").WaitForCompletion();

		public static float blastRadius = 6f;

		public static float blastJumpRadius = 14f;

		public static float blastForce = 4000f;

		private float duration;

		private float stopwatch;

		private bool goodPlacement;

		private GameObject areaIndicatorInstance;

		private GameObject areaIndicatorCircleInstance;

		private OverrideRequest crosshairOverrideRequest;

		public override void OnEnter()
		{
			//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)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(duration + 2f);
			((EntityState)this).PlayAnimation("Gesture, Additive", "PrepIceWall", "PrepIceWall.playbackRate", duration, 0f);
			Util.PlaySound(PrepIceWallSoundString, ((EntityState)this).gameObject);
			areaIndicatorInstance = Object.Instantiate<GameObject>(areaIndicatorPrefab);
			areaIndicatorCircleInstance = Object.Instantiate<GameObject>(areaIndicatorCirclePrefab);
			if (Object.op_Implicit((Object)(object)areaIndicatorCircleInstance))
			{
				areaIndicatorCircleInstance.transform.localScale = blastRadius * Vector3.one;
			}
			UpdateAreaIndicator();
		}

		private void UpdateAreaIndicator()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: 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_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			bool flag = goodPlacement;
			goodPlacement = false;
			areaIndicatorInstance.SetActive(true);
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				float num = maxDistance;
				float num2 = 0f;
				Ray aimRay = ((BaseState)this).GetAimRay();
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(CameraRigController.ModifyAimRayIfApplicable(aimRay, ((EntityState)this).gameObject, ref num2), ref val, num + num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
				{
					areaIndicatorInstance.transform.position = ((RaycastHit)(ref val)).point;
					areaIndicatorInstance.transform.up = ((RaycastHit)(ref val)).normal;
					areaIndicatorInstance.transform.forward = -((Ray)(ref aimRay)).direction;
					goodPlacement = Vector3.Angle(Vector3.up, ((RaycastHit)(ref val)).normal) < maxSlopeAngle;
				}
				if (flag != goodPlacement || crosshairOverrideRequest == null)
				{
					OverrideRequest val2 = crosshairOverrideRequest;
					if (val2 != null)
					{
						val2.Dispose();
					}
					GameObject val3 = (goodPlacement ? goodCrosshairPrefab : badCrosshairPrefab);
					crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, val3, (OverridePriority)1);
				}
			}
			if (Object.op_Implicit((Object)(object)areaIndicatorCircleInstance))
			{
				Ray aimRay2 = ((BaseState)this).GetAimRay();
				Vector3 val4 = ((Ray)(ref aimRay2)).origin + ((Ray)(ref aimRay2)).direction * maxDistance;
				RaycastHit val5 = default(RaycastHit);
				if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay2, ref val5, maxDistance, CommonMasks.bullet, (QueryTriggerInteraction)0))
				{
					val4 = ((RaycastHit)(ref val5)).point;
				}
				areaIndicatorCircleInstance.transform.SetPositionAndRotation(val4, Quaternion.identity);
				areaIndicatorCircleInstance.transform.localScale = blastRadius * Vector3.one;
			}
			areaIndicatorInstance.SetActive(goodPlacement);
			areaIndicatorCircleInstance.SetActive(!goodPlacement);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (!((EntityState)this).inputBank.skill3.down && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//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_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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			if (!((EntityState)this).outer.destroying)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireWall");
				Util.PlaySound(fireSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(muzzleflashEffect, ((EntityState)this).gameObject, "MuzzleLeft", true);
				EffectManager.SimpleMuzzleFlash(muzzleflashEffect, ((EntityState)this).gameObject, "MuzzleRight", true);
				if (goodPlacement && Object.op_Implicit((Object)(object)areaIndicatorInstance) && ((EntityState)this).isAuthority)
				{
					Vector3 forward = areaIndicatorInstance.transform.forward;
					forward.y = 0f;
					((Vector3)(ref forward)).Normalize();
					Vector3 val = Vector3.Cross(Vector3.up, forward);
					bool flag = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
					ProjectileManager.instance.FireProjectile(projectilePrefab, areaIndicatorInstance.transform.position + Vector3.up, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
					ProjectileManager.instance.FireProjectile(projectilePrefab, areaIndicatorInstance.transform.position + Vector3.up, Util.QuaternionSafeLookRotation(-val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
				}
			}
			EntityState.Destroy((Object)(object)areaIndicatorInstance.gameObject);
			EntityState.Destroy((Object)(object)areaIndicatorCircleInstance.gameObject);
			OverrideRequest val2 = crosshairOverrideRequest;
			if (val2 != null)
			{
				val2.Dispose();
			}
			if (((EntityState)this).isAuthority)
			{
				FireBlast();
				if (MageCore.utilitySelfKnockback.Value && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
				{
					ApplySelfKnockback();
				}
			}
			((EntityState)this).OnExit();
		}

		public void ApplySelfKnockback()
		{
			//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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0067: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			EntityStateMachine val = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Jet");
			if (!Object.op_Implicit((Object)(object)val) || !(((object)val.state).GetType() == typeof(JetpackOn)))
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 val2 = -1f * ((Ray)(ref aimRay)).direction * blastForce;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				((EntityState)this).characterMotor.ApplyForce(val2, true, false);
			}
		}

		public void FireBlast()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: 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_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Expected O, but got Unknown
			//IL_013c: 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)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * maxDistance;
			RaycastHit val2 = default(RaycastHit);
			if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val2, maxDistance, CommonMasks.bullet, (QueryTriggerInteraction)0))
			{
				val = ((RaycastHit)(ref val2)).point;
			}
			EffectData val3 = new EffectData();
			val3.rotation = Util.QuaternionSafeLookRotation(Vector3.up);
			val3.origin = val;
			val3.scale = blastRadius;
			EffectManager.SpawnEffect(blastEffectPrefab, val3, true);
			BlastAttack val4 = new BlastAttack
			{
				radius = blastRadius,
				procCoefficient = 1f,
				position = val,
				attacker = ((EntityState)this).gameObject,
				crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master),
				baseDamage = ((EntityState)this).characterBody.damage * damageCoefficient,
				falloffModel = (FalloffModel)0,
				baseForce = 0f,
				teamIndex = ((BaseState)this).GetTeam(),
				damageType = DamageTypeCombo.op_Implicit((DamageType)256),
				attackerFiltering = (AttackerFiltering)2,
				impactEffect = EffectCatalog.FindEffectIndexFromPrefab(hitEffectPrefab)
			};
			val4.Fire();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
}
namespace EntityStates.RiskyMod.Loader
{
	public class GroundSlamScaled : BaseCharacterMain
	{
		public static float airControl = 0.2f;

		public static float minimumDuration = 0.1f;

		public static float blastRadius = 10f;

		public static float blastProcCoefficient = 1f;

		public static float blastDamageCoefficient = 20f;

		public static string enterSoundString = "Play_loader_R_variant_whooshDown";

		public static float initialVerticalVelocity = -20f;

		public static float exitVerticalVelocity = 12f;

		public static float verticalAcceleration = -100f;

		public static float exitSlowdownCoefficient = 0.2f;

		public static GameObject blastImpactEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/omnieffect/omniimpactvfxloaderlightning");

		public static GameObject blastEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/loadergroundslam");

		public static GameObject fistEffectPrefab;

		public static float maxDamageBoost = 2f;

		public static float maxRadiusBoost = 2f;

		public static float maxForceBoost = 2f;

		public static float maxBoostDistance = 100f;

		private float initialY;

		private float previousAirControl;

		private GameObject leftFistEffectInstance;

		private GameObject rightFistEffectInstance;

		private bool detonateNextFrame;

		public override void OnEnter()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			((BaseCharacterMain)this).OnEnter();
			((EntityState)this).PlayCrossfade("Body", "GroundSlam", 0.2f);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.onMovementHit += new MovementHitDelegate(OnMovementHit);
				((EntityState)this).characterMotor.velocity.y = initialVerticalVelocity;
			}
			Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
			previousAirControl = ((EntityState)this).characterMotor.airControl;
			((EntityState)this).characterMotor.airControl = airControl;
			leftFistEffectInstance = Object.Instantiate<GameObject>(fistEffectPrefab, ((BaseState)this).FindModelChild("MechHandR"));
			rightFistEffectInstance = Object.Instantiate<GameObject>(fistEffectPrefab, ((BaseState)this).FindModelChild("MechHandL"));
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				initialY = ((EntityState)this).characterBody.footPosition.y;
			}
		}

		public override void FixedUpdate()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b8: 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_0150: Unknown result type (might be due to invalid IL or missing references)
			((BaseCharacterMain)this).FixedUpdate();
			if (!((EntityState)this).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				return;
			}
			((EntityState)this).characterMotor.moveDirection = ((EntityState)this).inputBank.moveVector;
			((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterMotor.moveDirection;
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity.y = characterMotor.velocity.y + verticalAcceleration * Time.fixedDeltaTime;
			if (((EntityState)this).fixedAge >= minimumDuration && (detonateNextFrame || ((BaseCharacterController)((EntityState)this).characterMotor).Motor.GroundingStatus.IsStableOnGround))
			{
				Result val = DetonateAuthority();
				if (val.hitCount > 0 && Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
				{
					((EntityState)this).healthComponent.AddBarrierAuthority(LoaderMeleeAttack.barrierPercentagePerHit * ((EntityState)this).healthComponent.fullBarrier);
				}
				((EntityState)this).outer.SetNextStateToMain();
			}
			if (!detonateNextFrame && !((BaseCharacterController)((EntityState)this).characterMotor).Motor.GroundingStatus.IsStableOnGround && ((EntityState)this).fixedAge >= minimumDuration && global::SneedUtils.SneedUtils.IsEnemyInSphere(5f, ((EntityState)this).characterBody.footPosition, ((BaseState)this).GetTeam()))
			{
				detonateNextFrame = true;
			}
		}

		public override void OnExit()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.onMovementHit -= new MovementHitDelegate(OnMovementHit);
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.velocity *= exitSlowdownCoefficient;
				((EntityState)this).characterMotor.velocity.y = exitVerticalVelocity;
			}
			((EntityState)this).characterMotor.airControl = previousAirControl;
			EntityState.Destroy((Object)(object)leftFistEffectInstance);
			EntityState.Destroy((Object)(object)rightFistEffectInstance);
			((BaseCharacterMain)this).OnExit();
		}

		private void OnMovementHit(ref MovementHitInfo movementHitInfo)
		{
			detonateNextFrame = true;
		}

		public Result DetonateAuthority()
		{
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_005f: 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_0085: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
			EffectManager.SpawnEffect(blastEffectPrefab, new EffectData
			{
				origin = footPosition,
				scale = blastRadius
			}, true);
			BlastAttack val = new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				baseDamage = ((BaseState)this).damageStat * blastDamageCoefficient,
				baseForce = 1200f,
				bonusForce = new Vector3(0f, 3000f, 0f),
				crit = ((BaseState)this).RollCrit(),
				damageType = DamageTypeCombo.op_Implicit((DamageType)32),
				falloffModel = (FalloffModel)0,
				procCoefficient = blastProcCoefficient,
				radius = blastRadius,
				position = footPosition,
				attackerFiltering = (AttackerFiltering)2,
				impactEffect = EffectCatalog.FindEffectIndexFromPrefab(blastImpactEffectPrefab),
				teamIndex = ((EntityState)this).teamComponent.teamIndex
			};
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				float num = (initialY - ((EntityState)this).characterBody.footPosition.y) / maxBoostDistance;
				float num2 = Mathf.Lerp(1f, maxDamageBoost, num);
				float num3 = Mathf.Lerp(1f, maxRadiusBoost, num);
				val.baseDamage *= num2;
				val.radius *= num3;
			}
			DamageAPI.AddModdedDamageType(val, SharedDamageTypes.AntiFlyingForce);
			return val.Fire();
		}
	}
	public class PreGroundSlamScaled : BaseCharacterMain
	{
		public static float baseDuration = 0.4f;

		public static string enterSoundString = "Play_loader_R_variant_activate";

		public static float upwardVelocity = 12f;

		private float duration;

		public override void OnEnter()
		{
			((BaseCharacterMain)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).PlayAnimation("Body", "PreGroundSlam", "GroundSlam.playbackRate", duration, 0f);
			Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
			((EntityState)this).characterMotor.velocity.y = upwardVelocity;
		}

		public override void FixedUpdate()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((BaseCharacterMain)this).FixedUpdate();
			((EntityState)this).characterMotor.moveDirection = ((EntityState)this).inputBank.moveVector;
			if (((EntityState)this).fixedAge > duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new GroundSlamScaled());
			}
		}
	}
}
namespace EntityStates.RiskyMod.Huntress
{
	public class ArrowRainScepter : BaseArrowBarrage
	{
		public static float arrowRainRadius = 11.25f;

		public static float damageCoefficient = 4.2f;

		public static GameObject projectilePrefab;

		public static GameObject areaIndicatorPrefab;

		public static GameObject muzzleFlashEffect;

		private GameObject areaIndicatorInstance;

		private bool shouldFireArrowRain;

		private void LoadStats()
		{
			base.maxDuration = 1.5f;
			base.beginLoopSoundString = "Play_huntress_R_aim_loop";
			base.endLoopSoundString = "Stop_huntress_R_aim_loop";
			base.fireSoundString = "Play_huntress_R_rain_start";
		}

		public override void OnEnter()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			LoadStats();
			((BaseArrowBarrage)this).OnEnter();
			((EntityState)this).PlayAnimation("FullBody, Override", "LoopArrowRain");
			if (Object.op_Implicit((Object)(object)areaIndicatorPrefab))
			{
				areaIndicatorInstance = Object.Instantiate<GameObject>(areaIndicatorPrefab);
				areaIndicatorInstance.transform.localScale = new Vector3(arrowRainRadius, arrowRainRadius, arrowRainRadius);
			}
		}

		private void UpdateAreaIndicator()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				float num = 1000f;
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(((BaseState)this).GetAimRay(), ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
				{
					areaIndicatorInstance.transform.position = ((RaycastHit)(ref val)).point;
					areaIndicatorInstance.transform.up = ((RaycastHit)(ref val)).normal;
				}
			}
		}

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

		public override void HandlePrimaryAttack()
		{
			((BaseArrowBarrage)this).HandlePrimaryAttack();
			shouldFireArrowRain = true;
			((EntityState)this).outer.SetNextStateToMain();
		}

		public void DoFireArrowRain()
		{
			//IL_0048: 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)
			EffectManager.SimpleMuzzleFlash(muzzleFlashEffect, ((EntityState)this).gameObject, "Muzzle", false);
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance) && shouldFireArrowRain)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, areaIndicatorInstance.transform.position, areaIndicatorInstance.transform.rotation, ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 0f, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
			}
		}

		public override void OnExit()
		{
			if (shouldFireArrowRain && !((EntityState)this).outer.destroying)
			{
				DoFireArrowRain();
			}
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				EntityState.Destroy((Object)(object)areaIndicatorInstance.gameObject);
			}
			((BaseArrowBarrage)this).OnExit();
		}
	}
	public class BeginArrowRainScepter : BaseBeginArrowBarrage
	{
		private void LoadStats()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			base.basePrepDuration = 0.25f;
			base.blinkDuration = 0.3f;
			base.jumpCoefficient = 3f;
			base.blinkVector = Vector3.up;
		}

		public override void OnEnter()
		{
			LoadStats();
			((BaseBeginArrowBarrage)this).OnEnter();
		}

		public override EntityState InstantiateNextState()
		{
			return (EntityState)(object)new ArrowRainScepter();
		}
	}
}
namespace EntityStates.RiskyMod.Croco
{
	public class FireDiseaseProjectileScepter : BaseState
	{
		public static GameObject projectilePrefab;

		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashcroco");

		public static float baseDuration = 0.5f;

		public static float damageCoefficient = 1f;

		public static float force = 0f;

		public static string attackString = "Play_acrid_R_shoot";

		public static float recoilAmplitude = 2f;

		public static float bloom = 1f;

		private float duration;

		public override void OnEnter()
		{
			//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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			duration = baseDuration / base.attackSpeedStat;
			((BaseState)this).StartAimMode(duration + 2f, false);
			((EntityState)this).PlayAnimation("Gesture, Mouth", "FireSpit", "FireSpit.playbackRate", duration, 0f);
			Util.PlaySound(attackString, ((EntityState)this).gameObject);
			((BaseState)this).AddRecoil(-1f * recoilAmplitude, -1.5f * recoilAmplitude, -0.25f * recoilAmplitude, 0.25f * recoilAmplitude);
			((EntityState)this).characterBody.AddSpreadBloom(bloom);
			string text = "MouthMuzzle";
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, false);
			}
			if (((EntityState)this).isAuthority)
			{
				FireProjectileInfo val = default(FireProjectileInfo);
				val.projectilePrefab = projectilePrefab;
				val.position = ((Ray)(ref aimRay)).origin;
				val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
				val.owner = ((EntityState)this).gameObject;
				val.damage = base.damageStat * damageCoefficient;
				val.force = force;
				val.crit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
				CrocoDamageTypeController component = ((EntityState)this).GetComponent<CrocoDamageTypeController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					val.damageTypeOverride = component.GetDamageType();
				}
				ProjectileManager.instance.FireProjectile(val);
			}
		}

		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()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.RiskyMod.Commando
{
	public class FireLightningRound : GenericProjectileBaseState
	{
		public static GameObject lightningMuzzleflashEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/MuzzleflashFMJ.prefab").WaitForCompletion();

		public static GameObject lightningProjectilePrefab;

		private static int FireFMJStateHash = Animator.StringToHash("FireFMJ");

		private static int FireFMJParamHash = Animator.StringToHash("FireFMJ.playbackRate");

		public override void OnEnter()
		{
			base.effectPrefab = lightningMuzzleflashEffect;
			base.projectilePrefab = lightningProjectilePrefab;
			base.force = 2000f;
			base.damageCoefficient = 4.5f;
			base.baseDuration = 0.5f;
			base.minSpread = 0f;
			base.maxSpread = 0f;
			base.recoilAmplitude = 1.5f;
			base.attackSoundString = "Play_commando_M2";
			base.projectilePitchBonus = 0f;
			base.baseDelayBeforeFiringProjectile = 0f;
			base.recoilAmplitude = 1.5f;
			base.bloom = -1f;
			base.targetMuzzle = "MuzzleCenter";
			((GenericProjectileBaseState)this).OnEnter();
		}

		public override void PlayAnimation(float duration)
		{
			((GenericProjectileBaseState)this).PlayAnimation(duration);
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", FireFMJStateHash, FireFMJParamHash, duration);
				((EntityState)this).PlayAnimation("Gesture, Override", FireFMJStateHash, FireFMJParamHash, duration);
			}
		}

		public override Ray ModifyProjectileAimRay(Ray aimRay)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			TrajectoryAimAssist.ApplyTrajectoryAimAssist(ref aimRay, base.projectilePrefab, ((EntityState)this).gameObject, 1f);
			return aimRay;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class ShrapnelBarrage : BaseState
	{
		private bool triggeredExplosion = false;

		public float internalBaseBulletCount;

		public float internalBaseDurationBetweenShots;

		public static GameObject explosionEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick");

		public static float blastRadius = 3f;

		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/MuzzleflashBarrage");

		public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/HitsparkCommandoBarrage");

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/TracerCommandoBoost");

		public static float force = 100f;

		public static float minSpread = 0f;

		public static float maxSpread = 1f;

		public static float baseDurationBetweenShots = 0.12f;

		public static float totalDuration = 1f;

		public static float bulletRadius = 0.5f;

		public static int baseBulletCount = 6;

		public static string fireBarrageSoundString = "Play_commando_m1";

		public static float recoilAmplitude = 1.5f;

		public static float spreadBloomValue = 0.15f;

		public static string muzzleName = "MuzzleRight";

		private int totalBulletsFired;

		private int bulletCount;

		public float stopwatchBetweenShots;

		private Animator modelAnimator;

		private Transform modelTransform;

		private float duration;

		private float durationBetweenShots;

		private float maxAttackSpeed;

		protected virtual float DamageCoefficient => 1.2f;

		public virtual void LoadStats()
		{
			internalBaseBulletCount = baseBulletCount;
			internalBaseDurationBetweenShots = baseDurationBetweenShots;
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			LoadStats();
			((EntityState)this).characterBody.SetSpreadBloom(0.2f, false);
			duration = totalDuration;
			durationBetweenShots = internalBaseDurationBetweenShots / base.attackSpeedStat;
			bulletCount = (int)(internalBaseBulletCount * base.attackSpeedStat);
			maxAttackSpeed = base.attackSpeedStat;
			modelAnimator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireBarrage", "FireBarrage.playbackRate", duration, 0.2f);
			((EntityState)this).PlayCrossfade("Gesture, Override", "FireBarrage", "FireBarrage.playbackRate", duration, 0.2f);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			FireBullet();
		}

		private void FireBullet()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_00bf: 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_00cf: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be du