Decompiled source of RiskyMithrix v1.1.0

RiskyMithrix.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.RiskyMithrix;
using EntityStates.RiskyMithrix.HammerSlam;
using EntityStates.RiskyMithrix.Weapon;
using IL.EntityStates.BrotherMonster;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.EntityStates.BrotherMonster;
using On.RoR2;
using R2API;
using R2API.Utils;
using RiskyMithrix.Changes;
using RiskyMithrix.Components;
using RiskyMithrix.Modules;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

[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("RiskyMithrix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+70b62f2efb60925bf87ad0ca3d9b5aeb7f436293")]
[assembly: AssemblyProduct("RiskyMithrix")]
[assembly: AssemblyTitle("RiskyMithrix")]
[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 EntityStates.RiskyMithrix
{
	public class WorldSlam : BaseState
	{
		private Animator modelAnimator;

		private Transform modelTransform;

		private float duration;

		private GameObject chargeInstance;

		private bool hasAttacked = false;

		public static float baseDuration = 6f;

		public static float damageCoefficient = 6f;

		public static GameObject chargeEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ChargeBrotherFist.prefab").WaitForCompletion();

		public static GameObject slamImpactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherSlamImpact.prefab").WaitForCompletion();

		public static float waveProjectileDamageCoefficient = 4f;

		public static float waveProjectileForce = 4000f;

		public static int waveProjectileCount = 4;

		public static float lineDamageCoefficient = 9f;

		private bool isCrit;

		public override void OnEnter()
		{
			//IL_0092: 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_00ff: 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)
			((BaseState)this).OnEnter();
			isCrit = ((BaseState)this).RollCrit();
			modelAnimator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			duration = baseDuration / base.attackSpeedStat;
			Util.PlayAttackSpeedSound("Play_moonBrother_orb_slam_pre", ((EntityState)this).gameObject, base.attackSpeedStat);
			((EntityState)this).PlayCrossfade("FullBody Override", "FistSlam", "playbackRate", duration, 0.1f);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterDirection.forward;
			}
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				AimAnimator component = ((Component)modelTransform).GetComponent<AimAnimator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					((Behaviour)component).enabled = true;
				}
			}
			Transform val = ((BaseState)this).FindModelChild("MuzzleRight");
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargeEffectPrefab))
			{
				chargeInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val.position, val.rotation);
				chargeInstance.transform.parent = val;
				ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.newDuration = duration / 2.8f;
				}
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)chargeInstance))
			{
				EntityState.Destroy((Object)(object)chargeInstance);
			}
			((EntityState)this).PlayAnimation("FullBody Override", "BufferEmpty");
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_016d: 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_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_0114: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: 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_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)modelAnimator) && (modelAnimator.GetFloat("fist.hitBoxActive") > 0.5f || ((EntityState)this).fixedAge >= duration * 0.5f) && !hasAttacked)
			{
				if (Object.op_Implicit((Object)(object)chargeInstance))
				{
					EntityState.Destroy((Object)(object)chargeInstance);
				}
				EffectManager.SimpleMuzzleFlash(slamImpactEffect, ((EntityState)this).gameObject, "MuzzleFloor", false);
				if (((EntityState)this).isAuthority)
				{
					if (Object.op_Implicit((Object)(object)modelTransform))
					{
						Transform val = ((BaseState)this).FindModelChild("MuzzleFloor");
						if (Object.op_Implicit((Object)(object)val))
						{
							new BlastAttack
							{
								attacker = ((EntityState)this).gameObject,
								inflictor = ((EntityState)this).gameObject,
								teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
								baseDamage = base.damageStat * damageCoefficient,
								baseForce = 5000f,
								position = val.position,
								radius = 12f,
								bonusForce = new Vector3(0f, 1000f, 0f),
								crit = isCrit
							}.Fire();
						}
					}
					float num = 360f / (float)waveProjectileCount;
					Vector3 val2 = Vector3.ProjectOnPlane(((EntityState)this).inputBank.aimDirection, Vector3.up);
					Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
					for (int i = 0; i < waveProjectileCount; i++)
					{
						Vector3 val3 = Quaternion.AngleAxis(num * (float)i, Vector3.up) * val2;
						ProjectileManager.instance.FireProjectileWithoutDamageType(PluginAssets.Projectiles.AntiFlyingUltOrbVanillaPrefab, footPosition, Util.QuaternionSafeLookRotation(val3), ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * waveProjectileDamageCoefficient, waveProjectileForce, isCrit, (DamageColorIndex)0, (GameObject)null, -1f);
					}
					FireAntiFlyingProjectile();
				}
				hasAttacked = true;
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void FireAntiFlyingProjectile()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: 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_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: 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)
			int num = ((!Object.op_Implicit((Object)(object)PhaseCounter.instance) || PhaseCounter.instance.phase <= 1) ? 1 : 3);
			TeamIndex myTeam = ((BaseState)this).GetTeam();
			IEnumerable<CharacterBody> enumerable = CharacterBody.instancesList.Where((CharacterBody b) => Object.op_Implicit((Object)(object)b.teamComponent) && b.teamComponent.teamIndex != myTeam && (Object)(object)b.master != (Object)null && !((Enum)b.bodyFlags).HasFlag((Enum)(object)(BodyFlags)4) && Object.op_Implicit((Object)(object)b.healthComponent) && b.healthComponent.alive);
			IEnumerable<CharacterBody> enumerable2 = enumerable.Where((CharacterBody b) => b.isPlayerControlled);
			IEnumerable<CharacterBody> enumerable3 = enumerable2.Where((CharacterBody b) => Object.op_Implicit((Object)(object)b.characterMotor) && b.characterMotor.isGrounded);
			for (int i = 0; i < num; i++)
			{
				IEnumerable<CharacterBody> enumerable4 = null;
				if (enumerable3.Count() > 0)
				{
					enumerable4 = enumerable3;
				}
				else if (enumerable2.Count() > 0)
				{
					enumerable4 = enumerable2;
				}
				else if (enumerable.Count() > 0)
				{
					enumerable4 = enumerable;
				}
				Vector3 position = ((EntityState)this).transform.position;
				CharacterBody target = null;
				if (enumerable4 != null)
				{
					target = enumerable4.ToArray()[Random.RandomRangeInt(0, enumerable4.Count())];
					enumerable3 = enumerable3.Where((CharacterBody b) => (Object)(object)b != (Object)(object)target);
					enumerable2 = enumerable2.Where((CharacterBody b) => (Object)(object)b != (Object)(object)target);
					enumerable = enumerable.Where((CharacterBody b) => (Object)(object)b != (Object)(object)target);
				}
				if (!Object.op_Implicit((Object)(object)target))
				{
					float num2 = Random.Range(60f, 120f);
					float num3 = Random.Range(0f, 360f);
					Vector3 val = Vector3.forward * num2;
					position = Quaternion.AngleAxis(num3, Vector3.up) * val;
				}
				FireProjectileInfo val2 = default(FireProjectileInfo);
				val2.projectilePrefab = PluginAssets.Projectiles.AntiFlyingUltLineVanillaPrefab;
				val2.damage = base.damageStat * damageCoefficient;
				val2.crit = isCrit;
				val2.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)4194304);
				val2.owner = ((EntityState)this).gameObject;
				val2.force = 0f;
				val2.procChainMask = default(ProcChainMask);
				val2.position = position;
				val2.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
				FireProjectileInfo val3 = val2;
				ProjectileManager.instance.FireProjectile(val3);
			}
		}
	}
}
namespace EntityStates.RiskyMithrix.Weapon
{
	public class FireLunarOrb : BaseState
	{
		public static float damageCoefficient = 1.2f;

		public static float baseDuration = 0.25f;

		public static GameObject muzzleFlashEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/MuzzleflashLunarShard.prefab").WaitForCompletion();

		private float duration;

		public override void OnEnter()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Transform val = ((BaseState)this).FindModelChild("MuzzleLeft");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Ray)(ref aimRay)).origin = val.position;
				}
				FireProjectileInfo val2 = default(FireProjectileInfo);
				val2.position = ((Ray)(ref aimRay)).origin;
				val2.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				val2.crit = ((BaseState)this).RollCrit();
				val2.damage = base.damageStat * damageCoefficient;
				val2.damageColorIndex = (DamageColorIndex)0;
				val2.owner = ((EntityState)this).gameObject;
				val2.procChainMask = default(ProcChainMask);
				val2.force = 0f;
				val2.useFuseOverride = false;
				val2.useSpeedOverride = false;
				val2.target = null;
				val2.projectilePrefab = PluginAssets.Projectiles.LunarOrbProjectilePrefab;
				FireProjectileInfo val3 = val2;
				ProjectileManager.instance.FireProjectile(val3);
			}
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireLunarShards");
			((EntityState)this).PlayAnimation("Gesture, Override", "FireLunarShards");
			((BaseState)this).AddRecoil(-0.6f, -1.2f, -4.5f, 4.5f);
			((EntityState)this).characterBody.AddSpreadBloom(0.4f);
			EffectManager.SimpleMuzzleFlash(muzzleFlashEffectPrefab, ((EntityState)this).gameObject, "MuzzleLeft", false);
			Util.PlaySound("Play_lunar_wisp_attack2_launch", ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((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.RiskyMithrix.HammerSlam
{
	public class GetBestTarget : BaseState
	{
		public static float maxRange = 45f;

		public static float maxAngle = 180f;

		public override void OnEnter()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			CharacterBody val = FindBestTarget(maxRange);
			if (((EntityState)this).isAuthority)
			{
				if ((Object)(object)val != (Object)null)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new RotateToTarget
					{
						target = val
					});
				}
				else
				{
					((EntityState)this).outer.SetNextState((EntityState)new WeaponSlam());
				}
			}
		}

		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 CharacterBody FindBestTarget(float range)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: 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_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			float rangeSqr = range * range;
			CharacterBody result = null;
			Vector3 forward = ((EntityState)this).transform.forward;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				forward = ((EntityState)this).characterDirection.forward;
			}
			Vector2 forward2d = new Vector2(forward.x, forward.z);
			((Vector2)(ref forward2d)).Normalize();
			Vector3 myPos = ((EntityState)this).transform.position;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				myPos = ((EntityState)this).characterBody.corePosition;
			}
			TeamIndex myTeam = ((BaseState)this).GetTeam();
			IEnumerable<CharacterBody> enumerable = CharacterBody.instancesList.Where(delegate(CharacterBody b)
			{
				//IL_0014: 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_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				bool flag = Object.op_Implicit((Object)(object)b.teamComponent) && b.teamComponent.teamIndex != myTeam && (Object)(object)b.master != (Object)null && !((Enum)b.bodyFlags).HasFlag((Enum)(object)(BodyFlags)4) && Object.op_Implicit((Object)(object)b.healthComponent) && b.healthComponent.alive;
				Vector3 val3 = b.corePosition - myPos;
				Vector2 val4 = default(Vector2);
				((Vector2)(ref val4))..ctor(val3.x, val3.z);
				flag = flag && ((Vector2)(ref val4)).sqrMagnitude <= rangeSqr;
				if (flag)
				{
					Vector2 val5 = default(Vector2);
					((Vector2)(ref val5))..ctor(val3.x, val3.z);
					((Vector2)(ref val5)).Normalize();
					float num3 = Vector2.Angle(forward2d, val5);
					flag = flag && num3 <= maxAngle;
				}
				return flag;
			});
			IEnumerable<CharacterBody> enumerable2 = enumerable.Where((CharacterBody b) => b.isPlayerControlled);
			IEnumerable<CharacterBody> enumerable3 = ((enumerable2.Count() > 0) ? enumerable2 : enumerable);
			if (enumerable3.Count() > 0)
			{
				float num = -1f;
				Vector2 val2 = default(Vector2);
				foreach (CharacterBody item in enumerable3)
				{
					Vector3 val = item.corePosition - myPos;
					((Vector2)(ref val2))..ctor(val.x, val.z);
					((Vector2)(ref val2)).Normalize();
					float num2 = Vector2.Angle(forward2d, val2);
					if (num2 < num || num < 0f)
					{
						result = item;
						num = num2;
					}
				}
			}
			return result;
		}
	}
	public class RotateToTarget : BaseState
	{
		public static float rotationSpeed = 600f;

		public static float maxDuration = 0.3f;

		public static float angleTolerance = 0.5f;

		public static float initialAngleTolerance = 20f;

		public CharacterBody target;

		public override void OnEnter()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (((EntityState)this).isAuthority && !Object.op_Implicit((Object)(object)target))
			{
				((EntityState)this).outer.SetNextState((EntityState)new WeaponSlam());
			}
		}

		public override void FixedUpdate()
		{
			//IL_0059: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_00d5: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: 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_013e: Expected O, but got Unknown
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!Object.op_Implicit((Object)(object)target) || ((EntityState)this).fixedAge >= maxDuration)
			{
				((EntityState)this).outer.SetNextState((EntityState)new WeaponSlam());
				return;
			}
			Vector3 val = ((EntityState)this).transform.position;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				val = ((EntityState)this).characterBody.corePosition;
			}
			Vector3 forward = ((EntityState)this).transform.forward;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				forward = ((EntityState)this).characterDirection.forward;
			}
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(forward.x, forward.z);
			((Vector2)(ref val2)).Normalize();
			Vector3 val3 = target.corePosition - val;
			Vector2 val4 = default(Vector2);
			((Vector2)(ref val4))..ctor(val3.x, val3.z);
			((Vector2)(ref val4)).Normalize();
			float num = Vector2.Angle(val2, val4);
			float num2 = angleTolerance;
			if (((EntityState)this).fixedAge <= 0.033f)
			{
				num2 = initialAngleTolerance;
			}
			if (num <= num2)
			{
				((EntityState)this).outer.SetNextState((EntityState)new WeaponSlam());
				return;
			}
			float num3 = Mathf.Min(num, rotationSpeed * ((EntityState)this).GetDeltaTime());
			((Vector3)(ref val3)).Normalize();
			Vector3 forward2 = Vector3.RotateTowards(forward, val3, MathF.PI / 180f * num3, float.PositiveInfinity);
			SetForward(forward2);
		}

		public Vector3 GetForward()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				return ((EntityState)this).characterDirection.forward;
			}
			return ((EntityState)this).transform.forward;
		}

		public void SetForward(Vector3 forward)
		{
			//IL_0028: 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)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = forward;
			}
			else
			{
				((EntityState)this).transform.forward = forward;
			}
		}

		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;
		}
	}
}
namespace RiskyMithrix
{
	internal static class PluginUtils
	{
		internal static void SetAddressableEntityStateField(string fullEntityStatePath, string fieldName, string value)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			string fieldName2 = fieldName;
			string value2 = value;
			AsyncOperationHandle<EntityStateConfiguration> val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)fullEntityStatePath);
			val.Completed += delegate(AsyncOperationHandle<EntityStateConfiguration> handle)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				SetAddressableEntityStateField_String_Completed(handle, fieldName2, value2);
			};
		}

		private static void SetAddressableEntityStateField_String_Completed(AsyncOperationHandle<EntityStateConfiguration> handle, string fieldName, string value)
		{
			EntityStateConfiguration result = handle.Result;
			for (int i = 0; i < result.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (result.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					result.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = value;
					return;
				}
			}
			Debug.LogError((object)("RiskyMithrix: " + ((object)result)?.ToString() + " does not have field " + fieldName));
		}

		internal static void SetAddressableEntityStateField(string fullEntityStatePath, string fieldName, Object newObject)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			string fieldName2 = fieldName;
			Object newObject2 = newObject;
			AsyncOperationHandle<EntityStateConfiguration> val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)fullEntityStatePath);
			val.Completed += delegate(AsyncOperationHandle<EntityStateConfiguration> handle)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				SetAddressableEntityStateField_Object_Completed(handle, fieldName2, newObject2);
			};
		}

		private static void SetAddressableEntityStateField_Object_Completed(AsyncOperationHandle<EntityStateConfiguration> handle, string fieldName, Object newObject)
		{
			EntityStateConfiguration result = handle.Result;
			for (int i = 0; i < result.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (result.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					result.serializedFieldsCollection.serializedFields[i].fieldValue.objectValue = newObject;
					return;
				}
			}
			Debug.LogError((object)("RiskyMithrix: " + ((object)result)?.ToString() + " does not have field " + fieldName));
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.RiskyLives.RiskyMithrix", "RiskyMithrix", "1.1.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class RiskyMithrix : BaseUnityPlugin
	{
		private void Awake()
		{
			PluginConfig.ReadConfig(((BaseUnityPlugin)this).Config);
			new PluginContentPack().Init();
			PluginAssets.Init();
			GeneralChanges.Init();
			SprintBashChanges.Init();
			LunarShardChanges.Init();
			SkyLeapChanges.Init();
			WeaponSlamChanges.Init();
		}
	}
}
namespace RiskyMithrix.Modules
{
	public static class PluginAssets
	{
		public static class Projectiles
		{
			public static GameObject SprintBashProjectilePrefab;

			public static GameObject LunarOrbProjectilePrefab;

			public static GameObject FirePillarVanillaPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherFirePillar.prefab").WaitForCompletion();

			public static GameObject AntiFlyingUltLineVanillaPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BrotherHaunt/BrotherUltLineProjectileStatic.prefab").WaitForCompletion();

			public static GameObject AntiFlyingUltOrbVanillaPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherSunderWave, Energized.prefab").WaitForCompletion();

			public static GameObject FlamePillarMovingPrefab;
		}

		public static class SkillDefs
		{
			public static SkillDef SprintLunarShardVanilla = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Brother/FireLunarShards.asset").WaitForCompletion();

			public static SkillDef FireLunarShardsHurt = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Brother/FireLunarShardsHurt.asset").WaitForCompletion();

			public static SkillDef FireLunarOrb;
		}

		public static class Effects
		{
			public static GameObject SkyLeapPredictionEffect;
		}

		public static GameObject BrotherHurtMasterObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherHurtMaster.prefab").WaitForCompletion();

		public static GameObject BrotherMasterObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherMaster.prefab").WaitForCompletion();

		public static GameObject ITBrotherMasterObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ITBrotherMaster.prefab").WaitForCompletion();

		public static GameObject BrotherBodyObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherBody.prefab").WaitForCompletion();

		public static GameObject ITBrotherBodyObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ITBrotherBody.prefab").WaitForCompletion();

		public static GameObject BrotherHurtBodyObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherHurtBody.prefab").WaitForCompletion();

		public static BodyIndex BrotherBodyIndex;

		public static BodyIndex ITBrotherBodyIndex;

		public static BodyIndex BrotherHurtBodyIndex;

		internal static void Init()
		{
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			CreateAssets();
		}

		private static void OnLoad()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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)
			BrotherBodyIndex = BodyCatalog.FindBodyIndex("BrotherBody");
			ITBrotherBodyIndex = BodyCatalog.FindBodyIndex("ITBrotherBody");
			BrotherHurtBodyIndex = BodyCatalog.FindBodyIndex("BrotherHurtBody");
		}

		private static void CreateAssets()
		{
			SetupSprintBashProjectile();
			SetupLunarOrb();
			SetupSkyLeapPredictionEffect();
			SetupFlamePillarMoving();
		}

		private static void SetupFlamePillarMoving()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/FalseSonBoss/FalseSonFissurePillar.prefab").WaitForCompletion(), "RiskyMithrixFlamePillarMoving", true);
			ProjectileDotZone component = val.GetComponent<ProjectileDotZone>();
			component.damageCoefficient = 0.25f;
			component.fireFrequency = 6f;
			component.resetFrequency = 6f;
			component.overlapProcCoefficient = 0.2f;
			PluginContentPack.projectilePrefabs.Add(val);
			Projectiles.FlamePillarMovingPrefab = val;
		}

		private static void SetupSkyLeapPredictionEffect()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Effects.SkyLeapPredictionEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarGolem/LunarGolemSpawnEffect.prefab").WaitForCompletion();
		}

		private static void SetupLunarOrb()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispTrackingBomb.prefab").WaitForCompletion(), "RiskyMithrixLunarOrbProjectile", true);
			ProjectileImpactExplosion component = val.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component).falloffModel = (FalloffModel)0;
			PluginContentPack.projectilePrefabs.Add(val);
			Projectiles.LunarOrbProjectilePrefab = val;
		}

		private static void SetupSprintBashProjectile()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/LunarShardProjectile.prefab").WaitForCompletion(), "RiskyMithrixLunarShardNoTrackingProjectile", true);
			val.GetComponent<ProjectileController>().isPrediction = true;
			Object.Destroy((Object)(object)val.GetComponent<ProjectileDirectionalTargetFinder>());
			Object.Destroy((Object)(object)val.GetComponent<ProjectileSteerTowardTarget>());
			Object.Destroy((Object)(object)val.GetComponent<ProjectileTargetComponent>());
			PluginContentPack.projectilePrefabs.Add(val);
			Projectiles.SprintBashProjectilePrefab = val;
		}
	}
	public static class PluginConfig
	{
		public static class General
		{
			public static ConfigEntry<bool> statChanges;

			public static ConfigEntry<bool> debuffResist;

			public static ConfigEntry<bool> fallImmunity;

			public static ConfigEntry<float> freezeResist;

			public static ConfigEntry<bool> prioritizePlayers;
		}

		public static class WeaponSlam
		{
			public static ConfigEntry<bool> stopOnUse;

			public static ConfigEntry<bool> rotateBeforeUse;

			public static ConfigEntry<bool> spawnFirePillars;

			public static ConfigEntry<int> firePillarsPhase1;

			public static ConfigEntry<int> firePillarsPhase2;
		}

		public static class SprintBash
		{
			public static ConfigEntry<bool> fireProjectilesPhase1;

			public static ConfigEntry<bool> fireProjectilesPhase2;
		}

		public static class LunarShard
		{
			public static ConfigEntry<bool> replaceLunarShard;

			public static ConfigEntry<bool> replaceLunarShardPhase4;
		}

		public static class SkyLeap
		{
			public static ConfigEntry<bool> directTargetPlayer;

			public static ConfigEntry<bool> createPillar;

			public static ConfigEntry<int> firePillarsPhase1;

			public static ConfigEntry<int> firePillarsPhase2;
		}

		public static class AntiFlyingAttack
		{
			public static ConfigEntry<bool> enabled;
		}

		internal const string catGeneral = "General";

		internal const string catSprintBash = "Sprint Bash";

		internal const string catLunarShard = "Lunar Shards";

		internal const string catSkyLeap = "Sky Leap";

		internal const string catAntiFlying = "Anti Flying Attack";

		internal const string catWeaponSlam = "Weapon Slam";

		internal static void ReadConfig(ConfigFile config)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_0043: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_008e: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			//IL_00d5: Expected O, but got Unknown
			//IL_00e5: 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_0100: Expected O, but got Unknown
			//IL_0100: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Expected O, but got Unknown
			//IL_017f: Expected O, but got Unknown
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Expected O, but got Unknown
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected O, but got Unknown
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Expected O, but got Unknown
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Expected O, but got Unknown
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Expected O, but got Unknown
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Expected O, but got Unknown
			General.statChanges = config.Bind<bool>(new ConfigDefinition("General", "Stat Changes"), true, (ConfigDescription)null);
			General.debuffResist = config.Bind<bool>(new ConfigDefinition("General", "Debuff Resistance"), true, new ConfigDescription("Slows and Attack Speed reduction are less effective.", (AcceptableValueBase)null, Array.Empty<object>()));
			General.fallImmunity = config.Bind<bool>(new ConfigDefinition("General", "Fall Damage Immunity"), true, (ConfigDescription)null);
			General.freezeResist = config.Bind<float>(new ConfigDefinition("General", "Freeze Resistance"), 0.5f, new ConfigDescription("Affects how long Freeze lasts on Mithrix. Set to 0 to make him immune to Freeze, 1 to make it work like Vanilla.", (AcceptableValueBase)null, Array.Empty<object>()));
			General.prioritizePlayers = config.Bind<bool>(new ConfigDefinition("General", "Prioritize Players"), true, (ConfigDescription)null);
			WeaponSlam.stopOnUse = config.Bind<bool>(new ConfigDefinition("Weapon Slam", "Stop Momentum"), true, new ConfigDescription("Stop Mithrix's movement before using Slam so that he doesn't overshoot his target when moving too fast.", (AcceptableValueBase)null, Array.Empty<object>()));
			WeaponSlam.rotateBeforeUse = config.Bind<bool>(new ConfigDefinition("Weapon Slam", "Rotate Before Use"), true, new ConfigDescription("Rotate towards a player before using Slam.", (AcceptableValueBase)null, Array.Empty<object>()));
			WeaponSlam.spawnFirePillars = config.Bind<bool>(new ConfigDefinition("Weapon Slam", "Flame Pillars"), true, (ConfigDescription)null);
			WeaponSlam.firePillarsPhase1 = config.Bind<int>(new ConfigDefinition("Weapon Slam", "Flame Pillars - Phase 1 Count"), 1, (ConfigDescription)null);
			WeaponSlam.firePillarsPhase2 = config.Bind<int>(new ConfigDefinition("Weapon Slam", "Flame Pillars - Phase 2 Count"), 3, (ConfigDescription)null);
			SprintBash.fireProjectilesPhase1 = config.Bind<bool>(new ConfigDefinition("Sprint Bash", "Fire Projectiles Always"), false, new ConfigDescription("Always fire projectiles during Sprint Bash.", (AcceptableValueBase)null, Array.Empty<object>()));
			SprintBash.fireProjectilesPhase2 = config.Bind<bool>(new ConfigDefinition("Sprint Bash", "Fire Projectiles in Phase 2"), true, (ConfigDescription)null);
			LunarShard.replaceLunarShard = config.Bind<bool>(new ConfigDefinition("Lunar Shards", "Replace Sprinting Lunar Shardswith Orbs"), true, (ConfigDescription)null);
			LunarShard.replaceLunarShardPhase4 = config.Bind<bool>(new ConfigDefinition("Lunar Shards", "Replace Phase 4 Lunar Shards with Orbs"), true, (ConfigDescription)null);
			SkyLeap.directTargetPlayer = config.Bind<bool>(new ConfigDefinition("Sky Leap", "Target Players"), true, (ConfigDescription)null);
			SkyLeap.createPillar = config.Bind<bool>(new ConfigDefinition("Sky Leap", "Flame Pillar"), true, (ConfigDescription)null);
			SkyLeap.firePillarsPhase1 = config.Bind<int>(new ConfigDefinition("Sky Leap", "Flame Pillars - Phase 1 Count"), 1, (ConfigDescription)null);
			SkyLeap.firePillarsPhase2 = config.Bind<int>(new ConfigDefinition("Sky Leap", "Flame Pillars - Phase 2 Count"), 4, (ConfigDescription)null);
		}
	}
	public class PluginContentPack : IContentPackProvider
	{
		[CompilerGenerated]
		private sealed class <FinalizeAsync>d__11 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FinalizeAsyncArgs args;

			public PluginContentPack <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <FinalizeAsync>d__11(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				args.ReportProgress(1f);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <GenerateContentPackAsync>d__10 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GetContentPackAsyncArgs args;

			public PluginContentPack <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <GenerateContentPackAsync>d__10(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				ContentPack.Copy(<>4__this.contentPack, args.output);
				args.ReportProgress(1f);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <LoadStaticContentAsync>d__9 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LoadStaticContentAsyncArgs args;

			public PluginContentPack <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <LoadStaticContentAsync>d__9(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				<>4__this.contentPack.identifier = <>4__this.identifier;
				<>4__this.contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
				<>4__this.contentPack.entityStateTypes.Add(entityStatesTypes.ToArray());
				<>4__this.contentPack.skillDefs.Add(skillDefs.ToArray());
				<>4__this.contentPack.effectDefs.Add(effectDefs.ToArray());
				args.ReportProgress(1f);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		internal ContentPack contentPack = new ContentPack();

		public static List<SkillDef> skillDefs = new List<SkillDef>();

		public static List<GameObject> projectilePrefabs = new List<GameObject>();

		public static List<Type> entityStatesTypes = new List<Type>();

		public static List<EffectDef> effectDefs = new List<EffectDef>();

		public string identifier => "com.RiskyLives.RiskyMithrix";

		internal void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		[IteratorStateMachine(typeof(<LoadStaticContentAsync>d__9))]
		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <LoadStaticContentAsync>d__9(0)
			{
				<>4__this = this,
				args = args
			};
		}

		[IteratorStateMachine(typeof(<GenerateContentPackAsync>d__10))]
		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <GenerateContentPackAsync>d__10(0)
			{
				<>4__this = this,
				args = args
			};
		}

		[IteratorStateMachine(typeof(<FinalizeAsync>d__11))]
		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <FinalizeAsync>d__11(0)
			{
				<>4__this = this,
				args = args
			};
		}
	}
}
namespace RiskyMithrix.Components
{
	public class SkyLeapVFXComponent : MonoBehaviour
	{
		public Vector3 offset = Vector3.zero;

		public float durationBetweenVFX = 0.5f;

		private float stopwatch = 0f;

		private void FixedUpdate()
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= durationBetweenVFX)
			{
				stopwatch -= durationBetweenVFX;
				SpawnVFX();
			}
		}

		public void SpawnVFX()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			EffectManager.SpawnEffect(PluginAssets.Effects.SkyLeapPredictionEffect, new EffectData
			{
				origin = ((Component)this).transform.position - offset
			}, true);
		}
	}
}
namespace RiskyMithrix.Changes
{
	internal static class AntiFlyingAttack
	{
		internal static void Init()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			PluginContentPack.entityStatesTypes.Add(typeof(AntiFlyingAttack));
			if (PluginConfig.AntiFlyingAttack.enabled.Value)
			{
				WeaponSlam.OnExit += new hook_OnExit(WeaponSlam_OnExit);
			}
		}

		private static void WeaponSlam_OnExit(orig_OnExit orig, WeaponSlam self)
		{
			((EntityState)self).outer.SetNextState((EntityState)(object)new WorldSlam());
		}
	}
	internal static class GeneralChanges
	{
		internal static void Init()
		{
			ModifyStats();
			DebuffResistance();
			AddFreezeResist();
		}

		private static void AddFreezeResist()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (!(PluginConfig.General.freezeResist.Value <= 0f) && !(PluginConfig.General.freezeResist.Value >= 1f))
			{
				SetStateOnHurt.SetFrozen += new hook_SetFrozen(SetStateOnHurt_SetFrozen);
			}
		}

		private static void SetStateOnHurt_SetFrozen(orig_SetFrozen orig, SetStateOnHurt self, float duration)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_004e: 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)
			if (Object.op_Implicit((Object)(object)self.targetStateMachine) && Object.op_Implicit((Object)(object)self.targetStateMachine.commonComponents.characterBody))
			{
				BodyIndex bodyIndex = self.targetStateMachine.commonComponents.characterBody.bodyIndex;
				if (bodyIndex == BodyCatalog.FindBodyIndex("BrotherBody") || bodyIndex == BodyCatalog.FindBodyIndex("ITBrotherBody"))
				{
					duration *= PluginConfig.General.freezeResist.Value;
				}
			}
			orig.Invoke(self, duration);
		}

		private static void FrozenState_OnEnter(orig_OnEnter orig, FrozenState self)
		{
			orig.Invoke(self);
		}

		private static void ModifyStats()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			ChangeStats(PluginAssets.BrotherBodyObject);
			ChangeStats(PluginAssets.ITBrotherBodyObject);
			if (PluginConfig.General.prioritizePlayers.Value)
			{
				SetPrioritizePlayers(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherMaster.prefab").WaitForCompletion());
				SetPrioritizePlayers(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ITBrotherMaster.prefab").WaitForCompletion());
			}
			static void ChangeStats(GameObject bodyObject)
			{
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				CharacterBody component2 = bodyObject.GetComponent<CharacterBody>();
				if ((Object)(object)component2 != (Object)null)
				{
					if (PluginConfig.General.statChanges.Value && component2.baseMaxHealth < 1200f)
					{
						component2.baseMaxHealth = 1200f;
						component2.levelMaxHealth = component2.baseMaxHealth * 0.3f;
					}
					if (PluginConfig.General.fallImmunity.Value)
					{
						component2.bodyFlags = (BodyFlags)(component2.bodyFlags | 1);
					}
					if (PluginConfig.General.freezeResist.Value <= 0f)
					{
						SetStateOnHurt component3 = bodyObject.GetComponent<SetStateOnHurt>();
						if (Object.op_Implicit((Object)(object)component3))
						{
							component3.canBeFrozen = false;
						}
					}
				}
			}
			static void SetPrioritizePlayers(GameObject masterObject)
			{
				BaseAI component = masterObject.GetComponent<BaseAI>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.prioritizePlayers = true;
				}
			}
		}

		private static void DebuffResistance()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if (PluginConfig.General.debuffResist.Value)
			{
				CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			}
		}

		private static void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (self.bodyIndex == PluginAssets.BrotherBodyIndex || self.bodyIndex == PluginAssets.BrotherHurtBodyIndex)
			{
				float num = self.baseMoveSpeed * (self.isSprinting ? self.sprintingSpeedMultiplier : 1f);
				if (self.moveSpeed > 0f && self.moveSpeed < num)
				{
					self.moveSpeed = Mathf.Lerp(self.moveSpeed, num, 0.5f);
				}
				if (self.attackSpeed < 1f && self.attackSpeed > 0f)
				{
					self.attackSpeed = Mathf.Lerp(self.attackSpeed, 1f, 0.5f);
				}
			}
		}
	}
	internal static class LunarShardChanges
	{
		internal static void Init()
		{
			ReplaceLunarShard();
		}

		private static void ReplaceLunarShard()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
			val.skillName = "SprintShootOrbs";
			((Object)val).name = val.skillName;
			val.icon = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Brother/FireLunarShards.asset").WaitForCompletion().icon;
			val.activationStateMachineName = "Weapon";
			val.activationState = new SerializableEntityStateType(typeof(FireLunarOrb));
			val.interruptPriority = (InterruptPriority)0;
			val.baseRechargeInterval = 6f;
			val.baseMaxStock = 4;
			val.rechargeStock = 4;
			val.requiredStock = 1;
			val.stockToConsume = 1;
			val.resetCooldownTimerOnUse = false;
			val.fullRestockOnAssign = true;
			val.dontAllowPastMaxStocks = false;
			val.beginSkillCooldownOnSkillEnd = false;
			val.cancelSprintingOnActivation = false;
			val.forceSprintDuringState = false;
			val.canceledFromSprinting = false;
			val.isCombatSkill = true;
			val.mustKeyPress = false;
			val.keywordTokens = new string[0];
			PluginContentPack.skillDefs.Add(val);
			PluginContentPack.entityStatesTypes.Add(typeof(FireLunarOrb));
			PluginAssets.SkillDefs.FireLunarOrb = val;
			if (PluginConfig.LunarShard.replaceLunarShard.Value)
			{
				ReplaceSkillOverride(PluginAssets.BrotherBodyObject);
				ReplaceSkillOverride(PluginAssets.ITBrotherBodyObject);
				ModifyMaster(PluginAssets.BrotherMasterObject);
				ModifyMaster(PluginAssets.ITBrotherMasterObject);
			}
			if (PluginConfig.LunarShard.replaceLunarShardPhase4.Value)
			{
				SkillFamily val2 = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Brother/BrotherHurtPrimaryFamily.asset").WaitForCompletion();
				val2.variants[0].skillDef = PluginAssets.SkillDefs.FireLunarOrb;
				ModifyMaster(PluginAssets.BrotherHurtMasterObject);
			}
			static void ModifyMaster(GameObject masterObject)
			{
				AISkillDriver[] components = masterObject.GetComponents<AISkillDriver>();
				AISkillDriver[] array = components;
				foreach (AISkillDriver val3 in array)
				{
					if ((Object)(object)val3.requiredSkill == (Object)(object)PluginAssets.SkillDefs.SprintLunarShardVanilla || (Object)(object)val3.requiredSkill == (Object)(object)PluginAssets.SkillDefs.FireLunarShardsHurt)
					{
						val3.requiredSkill = PluginAssets.SkillDefs.FireLunarOrb;
					}
				}
			}
			static void ReplaceSkillOverride(GameObject bodyObject)
			{
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: 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_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				SkillLocator component = bodyObject.GetComponent<SkillLocator>();
				ConditionalSkillOverride component2 = bodyObject.GetComponent<ConditionalSkillOverride>();
				List<ConditionalSkillInfo> list = new List<ConditionalSkillInfo>();
				ConditionalSkillInfo[] conditionalSkillInfos = component2.conditionalSkillInfos;
				foreach (ConditionalSkillInfo val4 in conditionalSkillInfos)
				{
					ConditionalSkillInfo val5 = default(ConditionalSkillInfo);
					val5.skillSlot = val4.skillSlot;
					val5.airborneSkillDef = (SkillDef)(((Object)(object)val4.airborneSkillDef == (Object)(object)PluginAssets.SkillDefs.SprintLunarShardVanilla) ? ((object)PluginAssets.SkillDefs.FireLunarOrb) : ((object)val4.airborneSkillDef));
					val5.sprintSkillDef = (SkillDef)(((Object)(object)val4.sprintSkillDef == (Object)(object)PluginAssets.SkillDefs.SprintLunarShardVanilla) ? ((object)PluginAssets.SkillDefs.FireLunarOrb) : ((object)val4.sprintSkillDef));
					ConditionalSkillInfo item = val5;
					list.Add(item);
				}
				component2.conditionalSkillInfos = list.ToArray();
			}
		}
	}
	internal static class SkyLeapChanges
	{
		internal static void Init()
		{
			TargetPlayers();
			CreatePillar();
		}

		private static void CreatePillar()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ExitSkyLeap.OnEnter += new hook_OnEnter(ExitSkyLeap_OnEnter);
		}

		private static void ExitSkyLeap_OnEnter(orig_OnEnter orig, ExitSkyLeap self)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_00d7: 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_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_010c: 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_010f: 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_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!((EntityState)self).isAuthority)
			{
				return;
			}
			Vector3 val = ((EntityState)self).transform.position;
			if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
			{
				val = ((EntityState)self).characterBody.footPosition;
			}
			int num = ((Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase > 1) ? PluginConfig.SkyLeap.firePillarsPhase2.Value : PluginConfig.SkyLeap.firePillarsPhase1.Value);
			if (num > 0)
			{
				bool flag = ((BaseState)self).RollCrit();
				ProjectileManager.instance.FireProjectileWithoutDamageType(PluginAssets.Projectiles.FirePillarVanillaPrefab, val, Quaternion.identity, ((EntityState)self).gameObject, ((BaseState)self).damageStat * 3f, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f);
				num--;
				float num2 = 360f / (float)num;
				Vector3 val2 = ((EntityState)self).transform.forward;
				if (Object.op_Implicit((Object)(object)((EntityState)self).characterDirection))
				{
					val2 = ((EntityState)self).characterDirection.forward;
				}
				for (int i = 0; i < num; i++)
				{
					ProjectileManager.instance.FireProjectile(PluginAssets.Projectiles.FlamePillarMovingPrefab, val, Util.QuaternionSafeLookRotation(val2), ((EntityState)self).gameObject, ((BaseState)self).damageStat * 3f, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
					val2 = Quaternion.AngleAxis(num2, Vector3.up) * val2;
				}
			}
		}

		private static void TargetPlayers()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			if (PluginConfig.SkyLeap.directTargetPlayer.Value)
			{
				HoldSkyLeap.OnEnter += new hook_OnEnter(HoldSkyLeap_OnEnter);
				HoldSkyLeap.OnExit += new hook_OnExit(HoldSkyLeap_OnExit);
			}
		}

		private static void HoldSkyLeap_OnExit(orig_OnExit orig, HoldSkyLeap self)
		{
			if (!((EntityState)self).outer.destroying && Object.op_Implicit((Object)(object)((EntityState)self).gameObject))
			{
				SkyLeapVFXComponent component = ((EntityState)self).gameObject.GetComponent<SkyLeapVFXComponent>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Object.Destroy((Object)(object)component);
				}
			}
			orig.Invoke(self);
		}

		private static void HoldSkyLeap_OnEnter(orig_OnEnter orig, HoldSkyLeap self)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: 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_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: 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_0155: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: 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_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!((EntityState)self).isAuthority)
			{
				return;
			}
			Vector3 val = Vector3.zero;
			if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
			{
				val = ((EntityState)self).transform.position - ((EntityState)self).characterBody.footPosition;
			}
			TeamIndex myTeam = ((BaseState)self).GetTeam();
			CharacterBody[] array = null;
			CharacterBody[] array2 = CharacterBody.instancesList.Where(delegate(CharacterBody body)
			{
				//IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				TeamIndex val7 = (TeamIndex)(-1);
				if (Object.op_Implicit((Object)(object)body.teamComponent))
				{
					val7 = body.teamComponent.teamIndex;
				}
				return val7 != myTeam && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive && !((Enum)body.bodyFlags).HasFlag((Enum)(object)(BodyFlags)4) && (Object)(object)body.master != (Object)null;
			}).ToArray();
			if (array2.Length != 0)
			{
				array = array2;
				CharacterBody[] array3 = array2.Where((CharacterBody body) => body.isPlayerControlled).ToArray();
				if (array3.Length != 0)
				{
					array = array3;
				}
			}
			if (array != null && array.Length != 0)
			{
				CharacterBody val2 = array[Random.RandomRangeInt(0, array.Length)];
				RaycastHit val3 = default(RaycastHit);
				if (Physics.Raycast(val2.footPosition, Vector3.down, ref val3, 200f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
				{
					Vector3 point = ((RaycastHit)(ref val3)).point;
					if ((Object)(object)((RaycastHit)(ref val3)).collider != (Object)null)
					{
						NodeGraph groundNodes = SceneInfo.instance.groundNodes;
						NodeIndex val4 = groundNodes.FindClosestNodeWithFlagConditions(point, (HullClassification)1, (NodeFlags)0, (NodeFlags)0, false);
						bool flag = true;
						Vector3 val5 = default(Vector3);
						groundNodes.GetNodePosition(val4, ref val5);
						if (Object.op_Implicit((Object)(object)((EntityState)self).characterMotor) && Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)self).characterMotor).Motor) && Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
						{
							Vector3 val6 = val5 + val;
							((EntityState)self).characterMotor.velocity = Vector3.zero;
							((BaseCharacterController)((EntityState)self).characterMotor).Motor.SetPosition(val6, true);
						}
					}
				}
			}
			Vector3 position = ((EntityState)self).transform.position;
			if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
			{
				position = ((EntityState)self).characterBody.footPosition;
			}
			SkyLeapVFXComponent skyLeapVFXComponent = ((EntityState)self).gameObject.GetComponent<SkyLeapVFXComponent>();
			if (!Object.op_Implicit((Object)(object)skyLeapVFXComponent))
			{
				skyLeapVFXComponent = ((EntityState)self).gameObject.AddComponent<SkyLeapVFXComponent>();
			}
			skyLeapVFXComponent.offset = val;
			skyLeapVFXComponent.SpawnVFX();
		}
	}
	internal static class SprintBashChanges
	{
		internal static void Init()
		{
			AddFireProjectiles();
		}

		private static void AddFireProjectiles()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			if (PluginConfig.SprintBash.fireProjectilesPhase2.Value || PluginConfig.SprintBash.fireProjectilesPhase1.Value)
			{
				SprintBash.OnEnter += new hook_OnEnter(SprintBash_OnEnter);
			}
		}

		private static void SprintBash_OnEnter(orig_OnEnter orig, SprintBash self)
		{
			//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_006d: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0126: 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_015c: 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_016b: 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_0186: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!((EntityState)self).isAuthority)
			{
				return;
			}
			bool value = PluginConfig.SprintBash.fireProjectilesPhase1.Value;
			bool flag = PluginConfig.SprintBash.fireProjectilesPhase2.Value && Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase > 1;
			if (value || flag)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction);
				Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, val);
				int num = 5;
				int num2 = num / 2;
				float num3 = 0f;
				float num4 = 0f;
				float num5 = 0f;
				num5 = Random.Range(1f + num3, 1f + num3) * (float)num * 1.25f;
				num4 = num5 / ((float)num - 1f);
				Vector3 val3 = Quaternion.AngleAxis((0f - num5) * 0.5f, val2) * ((Ray)(ref aimRay)).direction;
				Quaternion val4 = Quaternion.AngleAxis(num4, val2);
				Ray val5 = default(Ray);
				((Ray)(ref val5))..ctor(((Ray)(ref aimRay)).origin, val3);
				for (int i = 0; i < 5; i++)
				{
					ProjectileManager.instance.FireProjectile(PluginAssets.Projectiles.SprintBashProjectilePrefab, ((Ray)(ref val5)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val5)).direction), ((EntityState)self).gameObject, ((BaseState)self).damageStat * 0.1f, 0f, ((BasicMeleeAttack)self).isCritAuthority, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)(DamageTypeCombo.op_Implicit((DamageSource)2) | DamageTypeCombo.op_Implicit((DamageType)4194304)));
					((Ray)(ref val5)).direction = val4 * ((Ray)(ref val5)).direction;
				}
			}
		}
	}
	internal static class WeaponSlamChanges
	{
		internal static void Init()
		{
			PluginContentPack.entityStatesTypes.Add(typeof(GetBestTarget));
			PluginContentPack.entityStatesTypes.Add(typeof(RotateToTarget));
			StopMomentum();
			RotateBeforeUse();
			FlamePillars();
		}

		private static void FlamePillars()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if (PluginConfig.WeaponSlam.spawnFirePillars.Value)
			{
				WeaponSlam.FixedUpdate += new Manipulator(OverrideVanillaProjectiles);
			}
		}

		private static void OverrideVanillaProjectiles(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCall<PhaseCounter>(x, "get_instance")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<PhaseCounter, WeaponSlam, PhaseCounter>>((Func<PhaseCounter, WeaponSlam, PhaseCounter>)delegate(PhaseCounter phaseCounter, WeaponSlam self)
				{
					//IL_013e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0143: Unknown result type (might be due to invalid IL or missing references)
					//IL_0057: Unknown result type (might be due to invalid IL or missing references)
					//IL_005c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0061: Unknown result type (might be due to invalid IL or missing references)
					//IL_0066: Unknown result type (might be due to invalid IL or missing references)
					//IL_006e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0073: Unknown result type (might be due to invalid IL or missing references)
					//IL_0171: Unknown result type (might be due to invalid IL or missing references)
					//IL_0176: 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)
					//IL_016a: 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_008a: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
					//IL_01bd: 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_0194: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c8: 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_00f4: 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_01cf: Unknown result type (might be due to invalid IL or missing references)
					//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
					//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
					//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
					//IL_0208: Unknown result type (might be due to invalid IL or missing references)
					//IL_020d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0212: Unknown result type (might be due to invalid IL or missing references)
					//IL_0214: Unknown result type (might be due to invalid IL or missing references)
					//IL_0219: Unknown result type (might be due to invalid IL or missing references)
					int num = 1;
					if (Object.op_Implicit((Object)(object)phaseCounter))
					{
						num = phaseCounter.phase;
					}
					bool flag = ((BaseState)self).RollCrit();
					int value = PluginConfig.WeaponSlam.firePillarsPhase1.Value;
					if (num > 1)
					{
						Transform val2 = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString);
						float num2 = WeaponSlam.waveProjectileArc / (float)WeaponSlam.waveProjectileCount;
						Vector3 val3 = Vector3.ProjectOnPlane(((EntityState)self).characterDirection.forward, Vector3.up);
						Vector3 val4 = ((EntityState)self).characterBody.footPosition;
						if (Object.op_Implicit((Object)(object)val2))
						{
							val4 = val2.position;
						}
						for (int i = 0; i < WeaponSlam.waveProjectileCount; i++)
						{
							Vector3 val5 = Quaternion.AngleAxis(num2 * ((float)i - (float)WeaponSlam.waveProjectileCount / 2f), Vector3.up) * val3;
							ProjectileManager.instance.FireProjectile(WeaponSlam.waveProjectilePrefab, val4, Util.QuaternionSafeLookRotation(val5), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * WeaponSlam.waveProjectileDamageCoefficient, WeaponSlam.waveProjectileForce, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)(DamageTypeCombo.op_Implicit((DamageSource)1) | DamageTypeCombo.op_Implicit((DamageType)4194304)));
						}
						value = PluginConfig.WeaponSlam.firePillarsPhase2.Value;
					}
					Vector3 val6 = ((EntityState)self).characterBody.footPosition;
					Transform val7 = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString);
					if (Object.op_Implicit((Object)(object)val7))
					{
						val6 = ((Component)val7).transform.position;
					}
					Vector3 forward = ((EntityState)self).transform.forward;
					if (Object.op_Implicit((Object)(object)((EntityState)self).characterDirection))
					{
						forward = ((EntityState)self).characterDirection.forward;
					}
					float num3 = 120f;
					float num4 = num3 / (float)value;
					Vector3 val8 = Quaternion.AngleAxis((0f - num4) * (float)(value / 2), Vector3.up) * forward;
					for (int j = 0; j < value; j++)
					{
						ProjectileManager.instance.FireProjectile(PluginAssets.Projectiles.FlamePillarMovingPrefab, val6, Util.QuaternionSafeLookRotation(val8), ((EntityState)self).gameObject, ((BaseState)self).damageStat * 3f, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
						val8 = Quaternion.AngleAxis(num4, Vector3.up) * val8;
					}
					return null;
				});
			}
			else
			{
				Debug.LogError((object)"RiskyMithrix: WeaponSlam FlamePillars DisableVanillaProjectiles failed.");
			}
		}

		private static void RotateBeforeUse()
		{
			//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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (PluginConfig.WeaponSlam.rotateBeforeUse.Value)
			{
				SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Brother/WeaponSlam.asset").WaitForCompletion();
				val.activationState = new SerializableEntityStateType(typeof(GetBestTarget));
			}
		}

		private static void StopMomentum()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if (PluginConfig.WeaponSlam.stopOnUse.Value)
			{
				WeaponSlam.OnEnter += new hook_OnEnter(WeaponSlam_OnEnter);
			}
		}

		private static void WeaponSlam_OnEnter(orig_OnEnter orig, WeaponSlam self)
		{
			//IL_0044: 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)
			orig.Invoke(self);
			if (((EntityState)self).isAuthority && Object.op_Implicit((Object)(object)((EntityState)self).characterMotor))
			{
				((EntityState)self).characterMotor.velocity = new Vector3(0f, ((EntityState)self).characterMotor.velocity.y, 0f);
			}
		}
	}
}