Decompiled source of StormboundFalseSon v0.7.2

StormboundFalseSon.dll

Decompiled 4 days 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.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Destructible;
using EntityStates.FalseSon;
using EntityStates.FalseSonBoss;
using EntityStates.Geode;
using EntityStates.GolemMonster;
using EntityStates.Interactables.GoldBeacon;
using EntityStates.MeridianEvent;
using EntityStates.Missions.Goldshores;
using EntityStates.Missions.MiniGeodeTracker;
using EntityStates.PrimeMeridian;
using EntityStates.TitanMonster;
using IL.EntityStates.FalseSonBoss;
using IL.EntityStates.Geode;
using IL.RoR2;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;
using On.EntityStates;
using On.EntityStates.Destructible;
using On.EntityStates.FalseSon;
using On.EntityStates.FalseSonBoss;
using On.EntityStates.Geode;
using On.EntityStates.Interactables.GoldBeacon;
using On.EntityStates.MeridianEvent;
using On.EntityStates.Missions.Goldshores;
using On.EntityStates.PrimeMeridian;
using On.EntityStates.TitanMonster;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.EntitlementManagement;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using StormboundFalseSon.Changes;
using StormboundFalseSon.Modules;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[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: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyCompany("StormboundFalseSon")]
[assembly: AssemblyProduct("StormboundFalseSon")]
[assembly: AssemblyTitle("StormboundFalseSon")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	[CompilerGenerated]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace StormboundFalseSon
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInPlugin("com.Bloonjitsu7.StormboundFalseSon", "StormboundFalseSon", "0.7.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class StormboundFalseSonPlugin : BaseUnityPlugin
	{
		private Main changes;

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			new ContentPacks().Initialize();
			changes = new Main();
			changes.SetupConfig(((BaseUnityPlugin)this).Config);
			changes.Initialize();
		}
	}
}
namespace StormboundFalseSon.Modules
{
	public static class States
	{
		internal static List<Type> entityStates = new List<Type>();

		internal static void RegisterStates()
		{
			entityStates.Add(typeof(DelayedState));
			entityStates.Add(typeof(FireGoldLaser));
			entityStates.Add(typeof(GeodeRegenerate));
		}
	}
	public static class DamageTypes
	{
		public static ModdedDamageType stormboundLightning = DamageAPI.ReserveDamageType();

		public static ModdedDamageType stormboundLunarRuin = DamageAPI.ReserveDamageType();

		public static ModdedDamageType stormboundLaser = DamageAPI.ReserveDamageType();

		public static ModdedDamageType aurelioniteLaser = DamageAPI.ReserveDamageType();

		public static ModdedDamageType stormboundLaserTargeting = DamageAPI.ReserveDamageType();

		public static ModdedDamageType stormboundLaserCrystal = DamageAPI.ReserveDamageType();

		public static ModdedDamageType stormboundDevastatorCrystal = DamageAPI.ReserveDamageType();
	}
	public static class Buffs
	{
		internal static List<BuffDef> buffDefs = new List<BuffDef>();

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown, bool isHidden, bool ignoreNectar)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			val.isCooldown = isCooldown;
			val.isHidden = isHidden;
			val.ignoreGrowthNectar = ignoreNectar;
			buffDefs.Add(val);
			return val;
		}
	}
	public static class Effects
	{
		public static List<EffectDef> effectDefs = new List<EffectDef>();

		internal static void RegisterEffects()
		{
			FireGoldLaser.tracerEffectPrefab = CreateAurelioniteTracer();
			CoreChanges.lightningWarningEffect = CreateLightningWarning();
		}

		private static GameObject CreateHalcyoniteTether()
		{
			//IL_001f: 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)
			return CloneObject("RoR2/DLC2/Elites/EliteBead/EliteBeadTether.prefab", "StormboundTetherEffect", new Color(1f, 1f, 0f, 1f), new Color(1f, 1f, 0f, 1f), 1f, 1000f);
		}

		private static GameObject CreateLightningWarning()
		{
			//IL_001f: 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)
			return CloneObject("RoR2/DLC2/meridian/DisableSkillsLightning/LightningStrikePredictionEffect.prefab", "StormboundLightningPredictionEffect", new Color(1f, 0.4f, 0f, 0.5f), new Color(1f, 0.5f, 0f, 1f), 1f, 1000f, colorMesh: false);
		}

		private static GameObject CreateAurelioniteTracer()
		{
			//IL_000b: 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)
			GameObject val = CloneTracer("RoR2/Base/Huntress/TracerHuntressSnipe.prefab", "TracerStormboundAurelioniteLaser", Color.red, new Color(1f, 0.04f, 0.04f, 1f), 2f);
			Object.Destroy((Object)(object)((Component)val.transform.Find("TracerHead")).gameObject);
			return val;
		}

		private static GameObject CloneObject(string originalObjectName, string newObjectName, Color color1, Color color2, float scaleMult = 1f, float colorTemp = 0f, bool colorMesh = true, string soundName = "", bool parentToTransform = false)
		{
			//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_0078: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalObjectName).WaitForCompletion();
			if ((Object)(object)val == (Object)null)
			{
				Log.Warning(originalObjectName + " is null!");
				return null;
			}
			GameObject val2 = PrefabAPI.InstantiateClone(val, newObjectName, false);
			if ((Object)(object)val2.GetComponent<EffectComponent>() == (Object)null)
			{
				val2.AddComponent<EffectComponent>();
			}
			if ((Object)(object)val2.GetComponent<VFXAttributes>() == (Object)null)
			{
				val2.AddComponent<VFXAttributes>();
			}
			val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			val2.GetComponent<VFXAttributes>().DoNotPool = true;
			val2.Recolor(color1, color2, scaleMult, colorTemp, colorMesh);
			CreateEffectFromObject(val2, soundName, parentToTransform);
			return val2;
		}

		private static GameObject CloneTracer(string originalTracerName, string newTracerName, Color color1, Color color2, float widthMult = 1f, float? speed = null, float? length = null)
		{
			//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_007f: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalTracerName).WaitForCompletion();
			if ((Object)(object)val == (Object)null)
			{
				Log.Warning(originalTracerName + " is null!");
				return null;
			}
			GameObject val2 = PrefabAPI.InstantiateClone(val, newTracerName, false);
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<EffectComponent>()))
			{
				val2.AddComponent<EffectComponent>();
			}
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<VFXAttributes>()))
			{
				val2.AddComponent<VFXAttributes>();
			}
			val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			val2.GetComponent<VFXAttributes>().DoNotPool = true;
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<NetworkIdentity>()))
			{
				val2.AddComponent<NetworkIdentity>();
			}
			val2.GetComponent<Tracer>().speed = (speed.HasValue ? speed.Value : val2.GetComponent<Tracer>().speed);
			val2.GetComponent<Tracer>().length = (length.HasValue ? length.Value : val2.GetComponent<Tracer>().length);
			val2.Recolor(color1, color2, widthMult);
			CreateAndAddEffectDef(val2);
			return val2;
		}

		private static void Recolor(this GameObject thingToColor, Color color1, Color color2, float widthMult = 1f, float colorTemp = 0f, bool colorMesh = true)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_009b: 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_00ad: 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: Expected O, but got Unknown
			//IL_00d7: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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_0144: 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_01d8: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			bool flag = true;
			LineRenderer[] componentsInChildren = thingToColor.GetComponentsInChildren<LineRenderer>();
			foreach (LineRenderer val in componentsInChildren)
			{
				bool flag2 = true;
				val.startColor = color1;
				val.endColor = color2;
				if (widthMult != 1f)
				{
					val.widthMultiplier *= widthMult;
				}
			}
			ParticleSystem[] componentsInChildren2 = thingToColor.GetComponentsInChildren<ParticleSystem>();
			foreach (ParticleSystem val2 in componentsInChildren2)
			{
				MainModule main = val2.main;
				MinMaxCurve startSize = ((MainModule)(ref main)).startSize;
				((MainModule)(ref main)).startSize = new MinMaxCurve(((MinMaxCurve)(ref startSize)).constant * widthMult);
				((MainModule)(ref main)).startColor = new MinMaxGradient(color1);
				TrailModule trails = val2.trails;
				if (((TrailModule)(ref trails)).enabled)
				{
					Gradient val3 = new Gradient();
					GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[2];
					array[0].color = color1;
					array[0].time = 0f;
					array[1].color = color2;
					array[1].time = 1f;
					GradientAlphaKey[] array2 = (GradientAlphaKey[])(object)new GradientAlphaKey[2];
					array2[0].alpha = color1.a;
					array2[0].time = 0f;
					array2[1].alpha = color2.a;
					array2[1].time = 1f;
					val3.SetKeys(array, array2);
					((TrailModule)(ref trails)).colorOverLifetime = new MinMaxGradient(val3);
				}
			}
			Light[] componentsInChildren3 = thingToColor.GetComponentsInChildren<Light>();
			foreach (Light val4 in componentsInChildren3)
			{
				if (colorTemp > 0f)
				{
					val4.colorTemperature = colorTemp;
					val4.useColorTemperature = true;
				}
				else
				{
					val4.useColorTemperature = false;
				}
				val4.color = color1;
				Transform transform = ((Component)val4).transform;
				transform.localScale *= widthMult;
			}
			ParticleSystemRenderer[] componentsInChildren4 = thingToColor.GetComponentsInChildren<ParticleSystemRenderer>();
			foreach (ParticleSystemRenderer val5 in componentsInChildren4)
			{
				((Renderer)val5).material.SetColor("_MainColor", color1);
				((Renderer)val5).material.SetColor("_Color", color1);
				((Renderer)val5).material.SetColor("_TintColor", color2);
			}
			if (colorMesh)
			{
				MeshRenderer[] componentsInChildren5 = thingToColor.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val6 in componentsInChildren5)
				{
					((Renderer)val6).material.SetColor("_MainColor", color1);
					((Renderer)val6).material.SetColor("_Color", color1);
					((Renderer)val6).material.SetColor("_TintColor", color2);
				}
			}
		}

		internal static void AddEffectDef(EffectDef effectDef)
		{
			effectDefs.Add(effectDef);
		}

		internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab, bool donotPool = false)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if (donotPool)
			{
				VFXAttributes val = effectPrefab.GetComponent<VFXAttributes>();
				if ((Object)(object)val == (Object)null)
				{
					val = effectPrefab.AddComponent<VFXAttributes>();
				}
				val.DoNotPool = true;
			}
			EffectDef val2 = new EffectDef(effectPrefab);
			AddEffectDef(val2);
			return val2;
		}

		internal static void CreateEffectFromObject(GameObject newEffect, string soundName, bool parentToTransform)
		{
			//IL_0032: 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)
			newEffect.AddComponent<DestroyOnTimer>().duration = 6f;
			newEffect.AddComponent<NetworkIdentity>();
			if (!Object.op_Implicit((Object)(object)newEffect.GetComponent<VFXAttributes>()))
			{
				newEffect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			}
			EffectComponent component = newEffect.GetComponent<EffectComponent>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				component = newEffect.AddComponent<EffectComponent>();
				component.applyScale = true;
				component.effectIndex = (EffectIndex)(-1);
				component.parentToReferencedTransform = parentToTransform;
				component.positionAtReferencedTransform = true;
				component.soundName = soundName;
			}
			CreateAndAddEffectDef(newEffect);
		}
	}
	public static class EnemiesPlusUtils
	{
		public static void ReorderSkillDrivers(this GameObject master, AISkillDriver targetSkill, int targetIdx)
		{
			AISkillDriver[] components = master.GetComponents<AISkillDriver>();
			master.ReorderSkillDrivers(components, Array.IndexOf(components, targetSkill), targetIdx);
		}

		public static void ReorderSkillDrivers(this GameObject master, AISkillDriver[] skills, int currentIdx, int targetIdx)
		{
			if (currentIdx < 0 || currentIdx >= skills.Length)
			{
				Log.Error($"{currentIdx} index not found or out of range. Must be less than {skills.Length}");
				return;
			}
			string targetName = skills[currentIdx].customName;
			if (targetIdx < 0 || targetIdx >= skills.Length)
			{
				Log.Error($"Unable to reorder skilldriver {targetName} into position {targetIdx}. target must be less than {skills.Length}");
			}
			else
			{
				if (targetIdx == currentIdx)
				{
					return;
				}
				Dictionary<string, string> dictionary = skills.Where((AISkillDriver s) => (Object)(object)s.nextHighPriorityOverride != (Object)null).ToDictionary((AISkillDriver s) => s.customName, (AISkillDriver s) => s.nextHighPriorityOverride.customName);
				if (targetIdx > currentIdx)
				{
					master.AddComponentCopy<AISkillDriver>(skills[currentIdx]);
					Object.DestroyImmediate((Object)(object)skills[currentIdx]);
				}
				for (int num = targetIdx; num < skills.Length; num++)
				{
					if (num != currentIdx)
					{
						master.AddComponentCopy<AISkillDriver>(skills[num]);
						Object.DestroyImmediate((Object)(object)skills[num]);
					}
				}
				skills = master.GetComponents<AISkillDriver>();
				AISkillDriver val = ((IEnumerable<AISkillDriver>)skills).FirstOrDefault((Func<AISkillDriver, bool>)((AISkillDriver s) => s.customName == targetName));
				if (!dictionary.Any())
				{
					return;
				}
				foreach (AISkillDriver val2 in skills)
				{
					string target = "";
					if (val2.customName != null)
					{
						target = val2.customName;
					}
					if (Object.op_Implicit((Object)(object)val2) && dictionary.TryGetValue(val2.customName, out target))
					{
						AISkillDriver val3 = ((IEnumerable<AISkillDriver>)skills).FirstOrDefault((Func<AISkillDriver, bool>)((AISkillDriver s) => s.customName == target));
						if (!((Object)(object)val3 == (Object)null))
						{
							val2.nextHighPriorityOverride = val3;
						}
					}
				}
			}
		}

		public static T GetCopyOf<T>(this Component comp, T other) where T : Component
		{
			Type type = ((object)comp).GetType();
			if (type != ((object)other).GetType())
			{
				return default(T);
			}
			BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
			PropertyInfo[] properties = type.GetProperties(bindingAttr);
			PropertyInfo[] array = properties;
			foreach (PropertyInfo propertyInfo in array)
			{
				if (propertyInfo.CanWrite)
				{
					try
					{
						propertyInfo.SetValue(comp, propertyInfo.GetValue(other, null), null);
					}
					catch
					{
					}
				}
			}
			FieldInfo[] fields = type.GetFields(bindingAttr);
			FieldInfo[] array2 = fields;
			foreach (FieldInfo fieldInfo in array2)
			{
				fieldInfo.SetValue(comp, fieldInfo.GetValue(other));
			}
			return (T)(object)((comp is T) ? comp : null);
		}

		public static T AddComponentCopy<T>(this GameObject go, T toAdd) where T : Component
		{
			return ((Component)(object)go.AddComponent<T>()).GetCopyOf(toAdd);
		}
	}
	public static class Projectiles
	{
		internal static GameObject auriBeam;

		public static GameObject baseBeam = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanRockProjectile_prefab).WaitForCompletion();

		public static int totalOrbCount = 6;

		internal static List<GameObject> fsOrbList = new List<GameObject>();

		public static GameObject baseOrb = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.PrimeDevastatorProjectile_prefab).WaitForCompletion();

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

		internal static void RegisterProjectiles()
		{
			CreateAurelioniteBeam();
			projectilePrefabs.Add(auriBeam);
			CreateDevastatorProjectiles();
			for (int i = 0; i < fsOrbList.Count; i++)
			{
				projectilePrefabs.Add(fsOrbList[i]);
			}
		}

		private static void CreateDevastatorProjectiles()
		{
			//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_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < totalOrbCount; i++)
			{
				string text = $"fsOrb{i + 1}";
				GameObject val = PrefabAPI.InstantiateClone(baseOrb, text, true);
				if (fsOrbList.Count <= i)
				{
					fsOrbList.Add(val);
				}
				else
				{
					fsOrbList[i] = val;
				}
				ProjectileOwnerOrbiter val2 = fsOrbList[i].GetComponent<ProjectileOwnerOrbiter>();
				if ((Object)(object)val2 == (Object)null)
				{
					val2 = fsOrbList[i].AddComponent<ProjectileOwnerOrbiter>();
				}
				float num = 65f / (float)totalOrbCount;
				float num2 = (float)totalOrbCount / (float)(i + 1);
				val2.radius = num2 + num * (float)(i + 1);
				val2.offset.y = 2f;
				val2.initialDegreesFromOwnerForward = 340f;
				val2.degreesPerSecond = 90f;
				DestroyOnTimer val3 = fsOrbList[i].GetComponent<DestroyOnTimer>();
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = fsOrbList[i].AddComponent<DestroyOnTimer>();
				}
				val3.duration = 12f;
				PrimeDevastatorProjectileController component = fsOrbList[i].GetComponent<PrimeDevastatorProjectileController>();
				if ((Object)(object)component != (Object)null)
				{
				}
				ProjectileDamage val4 = fsOrbList[i].GetComponent<ProjectileDamage>();
				if ((Object)(object)val4 == (Object)null)
				{
					val4 = fsOrbList[i].AddComponent<ProjectileDamage>();
				}
				DamageTypeCombo damageType = val4.damageType;
				DamageAPI.AddModdedDamageType(ref damageType, DamageTypes.stormboundDevastatorCrystal);
				val4.damageType = damageType;
			}
			if (totalOrbCount > fsOrbList.Count)
			{
				Log.Warning("Orb List size is " + fsOrbList.Count + ", intended size was " + totalOrbCount + ". Readjusting intended size.");
				totalOrbCount = fsOrbList.Count;
			}
		}

		private static void CreateAurelioniteBeam()
		{
			auriBeam = PrefabAPI.InstantiateClone(baseBeam, "auriBeam", true);
			Rigidbody val = auriBeam.GetComponent<Rigidbody>();
			if (!Object.op_Implicit((Object)(object)val))
			{
				val = auriBeam.AddComponent<Rigidbody>();
			}
			ProjectileImpactExplosion val2 = default(ProjectileImpactExplosion);
			if (auriBeam.TryGetComponent<ProjectileImpactExplosion>(ref val2))
			{
				((ProjectileExplosion)val2).blastRadius = 1.5f;
				((ProjectileExplosion)val2).explosionEffect = null;
				val2.lifetimeExpiredSound = null;
				val2.lifetime = 3f;
			}
			ProjectileDirectionalTargetFinder val3 = default(ProjectileDirectionalTargetFinder);
			if (auriBeam.TryGetComponent<ProjectileDirectionalTargetFinder>(ref val3))
			{
				Object.DestroyImmediate((Object)(object)val3);
			}
			ProjectileSteerTowardTarget val4 = default(ProjectileSteerTowardTarget);
			if (auriBeam.TryGetComponent<ProjectileSteerTowardTarget>(ref val4))
			{
				Object.DestroyImmediate((Object)(object)val4);
			}
			ProjectileController component = auriBeam.GetComponent<ProjectileController>();
			component.rigidbody = val;
			component.rigidbody.useGravity = false;
			component.rigidbody.mass = 1f;
			component.procCoefficient = 0.8f;
			component.startSound = "";
			component.shouldPlaySounds = false;
		}

		private static void InitializeImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion)
		{
			//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_0064: 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_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)
			((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f;
			((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f;
			((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f;
			((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero;
			((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0;
			((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f;
			((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null;
			projectileImpactExplosion.destroyOnEnemy = true;
			projectileImpactExplosion.destroyOnWorld = true;
			projectileImpactExplosion.detonateOnEnemy = true;
			projectileImpactExplosion.impactOnWorld = true;
			((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0;
			((ProjectileExplosion)projectileImpactExplosion).fireChildren = false;
			projectileImpactExplosion.lifetime = 0f;
			projectileImpactExplosion.lifetimeAfterImpact = 0f;
			projectileImpactExplosion.lifetimeRandomOffset = 0f;
			projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f;
			projectileImpactExplosion.timerAfterImpact = false;
			((Component)projectileImpactExplosion).GetComponent<ProjectileDamage>().damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1);
		}
	}
	public class Skills
	{
		public class AISkillDriverData
		{
			public GameObject masterPrefab;

			public string customName;

			public SkillSlot skillSlot;

			public float minDistance = 0f;

			public float maxDistance = float.PositiveInfinity;

			public int desiredIndex = 0;

			public float moveInputScale = 1f;

			public MovementType movementType;

			public AimType aimType;

			public TargetType targetType;

			public bool ignoreNodeGraph = false;

			public float maxHealthFraction = float.PositiveInfinity;

			public float minHealthFraction = float.NegativeInfinity;

			public float maxTargetHealthFraction = float.PositiveInfinity;

			public float minTargetHealthFraction = float.NegativeInfinity;

			public bool requireReady = false;

			public SkillDef requiredSkillDef = null;

			public bool activationRequiresAimTargetLoS = false;

			public bool activationRequiresAimConfirmation = false;

			public bool activationRequiresTargetLoS = false;

			public bool selectionRequiresAimTarget = false;

			public bool selectionRequiresOnGround = false;

			public bool selectionRequiresTargetLoS = false;

			public bool selectionRequiresTargetNonFlier = false;

			public int maxTimesSelected = -1;

			public float driverUpdateTimerOverride = -1f;

			public bool noRepeat = false;

			public AISkillDriver nextHighPriorityOverride = null;

			public bool shouldSprint = false;

			public float aimVectorMaxSpeedOverride = -1f;

			public ButtonPressType buttonPressType = (ButtonPressType)0;
		}

		public static AISkillDriver CreateAISkillDriver(AISkillDriverData data)
		{
			//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_0078: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			if (data == null || (Object)(object)data.masterPrefab == (Object)null)
			{
				Log.Error("Could not create AISkillDriver");
				return null;
			}
			AISkillDriver val = data.masterPrefab.AddComponent<AISkillDriver>();
			val.customName = data.customName;
			val.skillSlot = data.skillSlot;
			val.minDistance = data.minDistance;
			val.maxDistance = data.maxDistance;
			val.moveInputScale = data.moveInputScale;
			val.movementType = data.movementType;
			val.aimType = data.aimType;
			val.moveTargetType = data.targetType;
			val.ignoreNodeGraph = data.ignoreNodeGraph;
			val.maxUserHealthFraction = data.maxHealthFraction;
			val.minUserHealthFraction = data.minHealthFraction;
			val.maxTargetHealthFraction = data.maxTargetHealthFraction;
			val.minTargetHealthFraction = data.minTargetHealthFraction;
			val.requireSkillReady = data.requireReady;
			val.requiredSkill = data.requiredSkillDef;
			val.activationRequiresAimConfirmation = data.activationRequiresAimConfirmation;
			val.activationRequiresAimTargetLoS = data.activationRequiresAimTargetLoS;
			val.activationRequiresTargetLoS = data.activationRequiresTargetLoS;
			val.selectionRequiresAimTarget = data.selectionRequiresAimTarget;
			val.selectionRequiresOnGround = data.selectionRequiresOnGround;
			val.selectionRequiresTargetLoS = data.selectionRequiresTargetLoS;
			val.selectionRequiresTargetNonFlier = data.selectionRequiresTargetNonFlier;
			val.maxTimesSelected = data.maxTimesSelected;
			val.driverUpdateTimerOverride = data.driverUpdateTimerOverride;
			val.noRepeat = data.noRepeat;
			val.nextHighPriorityOverride = data.nextHighPriorityOverride;
			val.shouldSprint = data.shouldSprint;
			val.aimVectorMaxSpeedOverride = data.aimVectorMaxSpeedOverride;
			val.buttonPressType = data.buttonPressType;
			data.masterPrefab.ReorderSkillDrivers(val, data.desiredIndex);
			return val;
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public string identifier => "com.Bloonjitsu7.BloonModpackBaseMod";

		public void Initialize()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			Effects.RegisterEffects();
			States.RegisterStates();
			Projectiles.RegisterProjectiles();
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

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

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.effectDefs.Add(Effects.effectDefs.ToArray());
			contentPack.entityStateTypes.Add(States.entityStates.ToArray());
			contentPack.projectilePrefabs.Add(Projectiles.projectilePrefabs.ToArray());
			contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
}
namespace StormboundFalseSon.Changes
{
	public class Main
	{
		public static float baseStrikeSpeed = 1.2f;

		public static float strikeSpeed;

		public static int scalingLevel = 0;

		public static float scalingMult = 0.2f;

		public static int currentPhase = 0;

		private CoreChanges coreChanges;

		private FalseSonChanges falseSonChanges;

		private LaserChanges laserChanges;

		private GeodeChanges geodeChanges;

		private AurelioniteChanges aurelioniteChanges;

		private GildedCoastChanges gildedCoastChanges;

		private VoidFieldsChanges voidFieldsChanges;

		public List<LightningStrikePoint> lightningPoints;

		public BullseyeSearch enemyFinder = new BullseyeSearch();

		public static DotIndex devastatorDotIndex;

		private static GameObject laserPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.LaserTitanGold_prefab).WaitForCompletion();

		public static bool hardMode = false;

		private static GameObject fs1BodyPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossBody_prefab).WaitForCompletion();

		private static GameObject fs2BodyPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossBodyLunarShard_prefab).WaitForCompletion();

		private static GameObject fs3BodyPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossBodyBrokenLunarShard_prefab).WaitForCompletion();

		private static GameObject fs1MasterPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossMaster_prefab).WaitForCompletion();

		private static GameObject fs2MasterPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossLunarShardMaster_prefab).WaitForCompletion();

		private static GameObject fs3MasterPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossLunarShardBrokenMaster_prefab).WaitForCompletion();

		public AISkillDriver fs2pillarDriver;

		public static BuffDef StormboundDevastatorDebuff;

		public static BuffDef LaserTargetDebuff;

		public static BuffDef LaserGoldDebuff;

		public static BuffDef LaserCrystalDebuff;

		public static BuffDef DamageCapBuff;

		public static BuffDef AuriArmorBuff;

		public static BuffDef GeodeStatBuff;

		public static BuffDef GeodeStatBuffCooldown;

		private static Sprite crystalIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_DLC2_FalseSon.texEnergizedCoreBuffIcon_png).WaitForCompletion();

		private static Sprite auriIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_DLC2_Elites_EliteAurelionite.texBuffAurelioniteBlessingIcon_png).WaitForCompletion();

		private static Sprite targetIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Grandparent.texBuffOverheat_tif).WaitForCompletion();

		private static Sprite oldIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Merc.texBuffMercExposeIcon_tif).WaitForCompletion();

		private static Sprite devastatorIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif).WaitForCompletion();

		private static Sprite geodeIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Croco.texBuffRegenBoostIcon_tif).WaitForCompletion();

		internal static bool HasHalcyonKnight => Chainloader.PluginInfos.ContainsKey("Onyx.HalcyonKnight");

		public static ConfigEntry<string> halcyonStages { get; set; }

		public static ConfigEntry<bool> laserEnable { get; set; }

		public static ConfigEntry<bool> geodeEnable { get; set; }

		public static ConfigEntry<bool> knightEnable { get; set; }

		public static ConfigEntry<bool> auriEnable { get; set; }

		public static ConfigEntry<bool> coastEnable { get; set; }

		public void SetupConfig(ConfigFile cfg)
		{
			halcyonStages = cfg.Bind<string>("Halcyon Shrines", "Guaranteed Spawns", "village,habitat,helminthroost,hollowsummit_wormsworms,hollowsummitnight_wormsworms", "List of stages to get a guaranteed Halcyon Shrine. Does not allow for more than one Halcyon Shrine to spawn per stage, and still uses up scene director credits. Shattered Abodes, Treeborn Colony, Helminth Hatchery, Hollow Summit, and Frozen Summit are selected by default (Hollow/Frozen Summit mod is not required). Stages are separated by commas with no spaces inbetween.");
			laserEnable = cfg.Bind<bool>("False Son - Lunar Gaze (Phase 2/3 Utility)", "Enable Laser Changes", true, "Enables the changes to the lunar gaze laser.");
			geodeEnable = cfg.Bind<bool>("False Son - Geode Mechanics", "Enable Changes", true, "Enables the changes to the geode mechanics during the False Son fight.");
			knightEnable = cfg.Bind<bool>("False Son - Geode Mechanics", "HalcyonKnight Compatibility", true, "Significantly reduces the stat bonuses granted to Halcyonite during the False Son fight if HalcyonKnight is installed.");
			auriEnable = cfg.Bind<bool>("Aurelionite - General Changes", "Enable Changes", true, "Enables the changes to Aurelionite.");
			coastEnable = cfg.Bind<bool>("Aurelionite - Gilded Coast Mechanics", "Enable Changes", true, "Enables the changes to the Gilded Coast mechanics.");
		}

		public void Initialize()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			CreateBuffs();
			SetupAIFixes();
			devastatorDotIndex = DotAPI.RegisterDotDef(1f, 0.1f, (DamageColorIndex)16, StormboundDevastatorDebuff, (CustomDotBehaviour)null, (CustomDotVisual)null);
			CharacterBody.UpdateAllTemporaryVisualEffects += new Manipulator(IL_UpdateVisualEffect);
			coreChanges = new CoreChanges();
			coreChanges.Initialize();
			falseSonChanges = new FalseSonChanges();
			falseSonChanges.Initialize();
			if (laserEnable.Value)
			{
				laserChanges = new LaserChanges();
				laserChanges.Initialize();
			}
			if (geodeEnable.Value)
			{
				geodeChanges = new GeodeChanges();
				geodeChanges.Initialize();
			}
			if (auriEnable.Value)
			{
				aurelioniteChanges = new AurelioniteChanges();
				aurelioniteChanges.Initialize();
			}
			if (coastEnable.Value)
			{
				gildedCoastChanges = new GildedCoastChanges();
				gildedCoastChanges.Initialize();
			}
			voidFieldsChanges = new VoidFieldsChanges();
			voidFieldsChanges.Initialize();
		}

		private void SetupAIFixes()
		{
			//IL_001e: 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_003e: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0501: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			//IL_077b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0780: Unknown result type (might be due to invalid IL or missing references)
			//IL_0788: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Unknown result type (might be due to invalid IL or missing references)
			Skills.AISkillDriverData data = new Skills.AISkillDriverData
			{
				masterPrefab = fs2MasterPrefab,
				customName = "moveAroundPillars",
				skillSlot = (SkillSlot)0,
				requireReady = false,
				maxDistance = 40f,
				targetType = (TargetType)3,
				movementType = (MovementType)0,
				aimType = (AimType)1,
				shouldSprint = true,
				desiredIndex = 7,
				driverUpdateTimerOverride = -1f
			};
			Skills.CreateAISkillDriver(data);
			Skills.AISkillDriverData data2 = new Skills.AISkillDriverData
			{
				masterPrefab = fs3MasterPrefab,
				customName = "moveAroundPillars",
				skillSlot = (SkillSlot)0,
				requireReady = false,
				maxDistance = 40f,
				targetType = (TargetType)3,
				movementType = (MovementType)0,
				aimType = (AimType)1,
				shouldSprint = true,
				desiredIndex = 7,
				driverUpdateTimerOverride = -1f
			};
			Skills.CreateAISkillDriver(data2);
			AISkillDriver val = null;
			AISkillDriver[] components = fs1MasterPrefab.GetComponents<AISkillDriver>();
			AISkillDriver[] array = components;
			foreach (AISkillDriver val2 in array)
			{
				string customName = val2.customName;
				Log.Debug("False Son p1 " + customName);
				if (customName == "FissureSlam")
				{
					val2.minDistance = 0f;
					val2.maxDistance = 30f;
					val2.ignoreNodeGraph = true;
					val2.activationRequiresTargetLoS = false;
				}
				if (customName == "TaintedOffering")
				{
					val2.minDistance = 30f;
				}
				if (customName == "Corrupted Paths (Step Brothers)")
				{
					val = val2;
					Log.Debug("maxDistance: " + val2.maxDistance);
					Log.Debug("minDistance: " + val2.minDistance);
					Log.Debug("movementType: " + ((object)Unsafe.As<MovementType, MovementType>(ref val2.movementType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("aimType: " + ((object)Unsafe.As<AimType, AimType>(ref val2.aimType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("moveTargetType: " + ((object)Unsafe.As<TargetType, TargetType>(ref val2.moveTargetType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("aimVectorMaxSpeedOverride: " + val2.aimVectorMaxSpeedOverride);
					Log.Debug("aimVectorDampTimeOverride: " + val2.aimVectorDampTimeOverride);
				}
			}
			AISkillDriver[] components2 = fs2MasterPrefab.GetComponents<AISkillDriver>();
			AISkillDriver[] array2 = components2;
			foreach (AISkillDriver val3 in array2)
			{
				string customName2 = val3.customName;
				Log.Debug("False Son p2 " + customName2);
				if (customName2 == "FissureSlam")
				{
					val3.minDistance = 0f;
					val3.maxDistance = 40f;
					val3.ignoreNodeGraph = true;
					val3.activationRequiresTargetLoS = false;
					val3.selectionRequiresTargetLoS = false;
					val3.movementType = (MovementType)1;
					val3.shouldSprint = true;
				}
				if (customName2 == "Follow Last Known Target")
				{
					Log.Debug("maxDistance: " + val3.maxDistance);
					Log.Debug("minDistance: " + val3.minDistance);
					Log.Debug("movementType: " + ((object)Unsafe.As<MovementType, MovementType>(ref val3.movementType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("aimType: " + ((object)Unsafe.As<AimType, AimType>(ref val3.aimType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("moveTargetType: " + ((object)Unsafe.As<TargetType, TargetType>(ref val3.moveTargetType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("aimVectorMaxSpeedOverride: " + val3.aimVectorMaxSpeedOverride);
					Log.Debug("aimVectorDampTimeOverride: " + val3.aimVectorDampTimeOverride);
					val3.moveTargetType = (TargetType)3;
					val3.aimType = (AimType)1;
					val3.shouldSprint = true;
					val3.movementType = (MovementType)1;
					val3.ignoreNodeGraph = true;
					val3.resetCurrentEnemyOnNextDriverSelection = false;
					val3.activationRequiresTargetLoS = false;
				}
				if (customName2 == "SwatAwayPlayers")
				{
					if ((Object)(object)val != (Object)null && hardMode)
					{
						val3.maxDistance = val.maxDistance;
						val3.minDistance = val.minDistance;
						val3.activationRequiresTargetLoS = val.activationRequiresTargetLoS;
						val3.activationRequiresAimTargetLoS = val.activationRequiresAimTargetLoS;
						val3.aimType = val.aimType;
						val3.movementType = val.movementType;
						val3.moveTargetType = val.moveTargetType;
						val3.aimVectorMaxSpeedOverride = val.aimVectorMaxSpeedOverride;
						val3.aimVectorDampTimeOverride = val.aimVectorDampTimeOverride;
						val3.selectionRequiresTargetLoS = false;
					}
					else
					{
						val3.maxDistance = 120f;
						val3.minDistance = 0f;
						val3.activationRequiresTargetLoS = false;
						val3.activationRequiresAimTargetLoS = false;
						val3.aimType = (AimType)2;
						val3.movementType = (MovementType)0;
						val3.moveTargetType = (TargetType)0;
						val3.selectionRequiresTargetLoS = false;
					}
				}
				if (customName2 == "Corrupted Paths (Step Brothers)")
				{
					val3.maxDistance = 0f;
					val3.minDistance = 0f;
				}
			}
			AISkillDriver[] components3 = fs3MasterPrefab.GetComponents<AISkillDriver>();
			AISkillDriver[] array3 = components3;
			foreach (AISkillDriver val4 in array3)
			{
				string customName3 = val4.customName;
				Log.Debug("False Son p3 " + customName3);
				if (customName3 == "FissureSlam")
				{
					val4.minDistance = 0f;
					val4.maxDistance = 40f;
					val4.ignoreNodeGraph = true;
					val4.activationRequiresTargetLoS = false;
					val4.selectionRequiresTargetLoS = false;
					val4.movementType = (MovementType)1;
					val4.shouldSprint = true;
				}
				if (customName3 == "Follow Last Known Target")
				{
					Log.Debug("maxDistance: " + val4.maxDistance);
					Log.Debug("minDistance: " + val4.minDistance);
					Log.Debug("movementType: " + ((object)Unsafe.As<MovementType, MovementType>(ref val4.movementType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("aimType: " + ((object)Unsafe.As<AimType, AimType>(ref val4.aimType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("moveTargetType: " + ((object)Unsafe.As<TargetType, TargetType>(ref val4.moveTargetType)/*cast due to .constrained prefix*/).ToString());
					Log.Debug("aimVectorMaxSpeedOverride: " + val4.aimVectorMaxSpeedOverride);
					Log.Debug("aimVectorDampTimeOverride: " + val4.aimVectorDampTimeOverride);
					val4.moveTargetType = (TargetType)3;
					val4.aimType = (AimType)1;
					val4.shouldSprint = true;
					val4.movementType = (MovementType)1;
					val4.ignoreNodeGraph = true;
					val4.resetCurrentEnemyOnNextDriverSelection = false;
					val4.activationRequiresTargetLoS = false;
				}
				if (customName3 == "SwatAwayPlayers")
				{
					if ((Object)(object)val != (Object)null && hardMode)
					{
						val4.maxDistance = val.maxDistance;
						val4.minDistance = val.minDistance;
						val4.activationRequiresTargetLoS = val.activationRequiresTargetLoS;
						val4.activationRequiresAimTargetLoS = val.activationRequiresAimTargetLoS;
						val4.aimType = val.aimType;
						val4.movementType = val.movementType;
						val4.moveTargetType = val.moveTargetType;
						val4.aimVectorMaxSpeedOverride = val.aimVectorMaxSpeedOverride;
						val4.aimVectorDampTimeOverride = val.aimVectorDampTimeOverride;
						val4.selectionRequiresTargetLoS = false;
					}
					else
					{
						val4.maxDistance = 120f;
						val4.minDistance = 0f;
						val4.activationRequiresTargetLoS = false;
						val4.activationRequiresAimTargetLoS = false;
						val4.aimType = (AimType)2;
						val4.movementType = (MovementType)0;
						val4.moveTargetType = (TargetType)0;
						val4.selectionRequiresTargetLoS = false;
					}
				}
			}
			fs1MasterPrefab.GetComponent<BaseAI>().aimVectorMaxSpeed = 360f;
			fs1MasterPrefab.GetComponent<BaseAI>().aimVectorMaxSpeed = 360f;
		}

		private void CreateBuffs()
		{
			//IL_001a: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_00bb: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			StormboundDevastatorDebuff = Buffs.AddNewBuff("BloonStormboundDevastatorDebuff", devastatorIcon, new Color(1f, 0.5f, 0f), canStack: false, isDebuff: true, isCooldown: false, isHidden: false, ignoreNectar: true);
			LaserTargetDebuff = Buffs.AddNewBuff("BloonLaserTargetDebuff", targetIcon, new Color(1f, 0.5f, 0f), canStack: true, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: true);
			LaserCrystalDebuff = Buffs.AddNewBuff("BloonLaserCrystalDebuff", crystalIcon, Color.white, canStack: true, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: true);
			LaserGoldDebuff = Buffs.AddNewBuff("BloonLaserGoldDebuff", Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(), Color.yellow, canStack: false, isDebuff: false, isCooldown: false, isHidden: true, ignoreNectar: true);
			DamageCapBuff = Buffs.AddNewBuff("BloonDamageCapBuff", Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(), Color.yellow, canStack: false, isDebuff: false, isCooldown: false, isHidden: true, ignoreNectar: true);
			AuriArmorBuff = Buffs.AddNewBuff("BloonAuriArmorBuff", auriIcon, Color.white, canStack: true, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: false);
			GeodeStatBuff = Buffs.AddNewBuff("BloonGeodeStatBuff", geodeIcon, Color.yellow, canStack: false, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: true);
			GeodeStatBuffCooldown = Buffs.AddNewBuff("BloonGeodeStatBuffCooldown", geodeIcon, Color.yellow, canStack: false, isDebuff: false, isCooldown: true, isHidden: true, ignoreNectar: true);
		}

		public void IL_UpdateVisualEffect(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0009: 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_0058: 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_0099: 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_0123: 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)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "TeslaField"),
				(Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(CharacterBody), "HasBuff")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<CharacterBody, bool>>((Func<CharacterBody, bool>)((CharacterBody self) => self.HasBuff(StormboundDevastatorDebuff)));
				val.Emit(OpCodes.Or);
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ShockDamageEnergized"),
				(Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(CharacterBody), "HasBuff")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<CharacterBody, bool>>((Func<CharacterBody, bool>)((CharacterBody self) => self.HasBuff(StormboundDevastatorDebuff)));
				val.Emit(OpCodes.Or);
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!");
			}
		}

		public static void SetAlpha(GameObject thingToColor, float alpha)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00ba: 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_00cb: 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_0103: 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_013e: 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)
			//IL_0158: 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)
			LineRenderer[] componentsInChildren = thingToColor.GetComponentsInChildren<LineRenderer>();
			foreach (LineRenderer val in componentsInChildren)
			{
				Color startColor = val.startColor;
				startColor.a = alpha;
				val.startColor = startColor;
				Color endColor = val.endColor;
				endColor.a = alpha;
				val.endColor = endColor;
			}
			ParticleSystem[] componentsInChildren2 = thingToColor.GetComponentsInChildren<ParticleSystem>();
			foreach (ParticleSystem val2 in componentsInChildren2)
			{
				MainModule main = val2.main;
				MinMaxGradient startColor2 = ((MainModule)(ref main)).startColor;
				Color colorMin = ((MinMaxGradient)(ref startColor2)).colorMin;
				colorMin.a = alpha;
				((MainModule)(ref main)).startColor = new MinMaxGradient(colorMin);
				TrailModule trails = val2.trails;
				if (((TrailModule)(ref trails)).enabled)
				{
					MinMaxGradient colorOverLifetime = ((TrailModule)(ref trails)).colorOverLifetime;
					Color colorMin2 = ((MinMaxGradient)(ref colorOverLifetime)).colorMin;
					colorMin2.a = alpha;
					((TrailModule)(ref trails)).colorOverLifetime = new MinMaxGradient(colorMin2);
				}
			}
			Light[] componentsInChildren3 = thingToColor.GetComponentsInChildren<Light>();
			foreach (Light val3 in componentsInChildren3)
			{
				Color color = val3.color;
				color.a = alpha;
			}
			ParticleSystemRenderer[] componentsInChildren4 = thingToColor.GetComponentsInChildren<ParticleSystemRenderer>();
			foreach (ParticleSystemRenderer val4 in componentsInChildren4)
			{
				_ = ((Renderer)val4).material.color;
				if (true)
				{
					Color color2 = ((Renderer)val4).material.color;
					color2.a = alpha;
					((Renderer)val4).material.color = color2;
				}
			}
		}
	}
	public class CoreChanges
	{
		public float phase1StrikeInterval = 3.5f;

		public float phase2StrikeInterval = 5.5f;

		public float phase3StrikeInterval = 6f;

		public float phase1AmbientStrikeSpeed = 2f;

		public float phase2AmbientStrikeSpeed = 1.5f;

		public float phase3AmbientStrikeSpeed = 1.2f;

		public static GameObject devastatorEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_Elites_EliteBead.EliteBeadCrystalExplosionVFX_prefab).WaitForCompletion();

		public static GameObject lightningWarningEffect;

		public static InteractableSpawnCard colossusPortalCard = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)RoR2_DLC2.iscColossusPortal_asset).WaitForCompletion();

		public static GameObject textureFinder = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_meridian_Assets.PMRingMiddle1_prefab).WaitForCompletion();

		public static Material meridianMat = Addressables.LoadAssetAsync<Material>((object)RoR2_DLC2_meridian_Assets.matPMTerrainPlayZoneWall_mat).WaitForCompletion();

		public static GameObject fsPillar = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_dampcavesimple.DCPebbleCrystal_prefab).WaitForCompletion(), "StormboundFSPillarPrefab", false);

		public SpawnCard lemSpawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)RoR2_Base_Lemurian.cscLemurian_asset).WaitForCompletion();

		public void Initialize()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Expected O, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Expected O, but got Unknown
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Expected O, but got Unknown
			MeshRenderer component = fsPillar.GetComponent<MeshRenderer>();
			((Renderer)component).material = meridianMat;
			HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(OnTakeDamage);
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
			HealthComponent.TakeDamageProcess += new Manipulator(IL_TakeDamageProcess);
			Run.onRunStartGlobal += Run_onRunStartGlobal;
			Run.onRunDestroyGlobal += Run_onRunDestroyGlobal;
			GlobalEventManager.ProcessHitEnemy += new Manipulator(LunarRuinDotFix);
			FrozenState.OnEnter += new hook_OnEnter(OnFrozenStateEnter);
			FSBFPhaseBaseState.FixedUpdate += new hook_FixedUpdate(OnFSBFPhaseUpdate);
			Phase1.OnEnter += new hook_OnEnter(OnPhase1Enter);
			Phase1.FixedUpdate += new hook_FixedUpdate(OnPhase1Update);
			Phase2.OnEnter += new hook_OnEnter(OnPhase2Enter);
			Phase3.OnEnter += new hook_OnEnter(OnPhase3Enter);
			Phase3.OnBossGroupDefeated += new hook_OnBossGroupDefeated(OnPhase3Finish);
			MeridianEventTriggerInteraction.HandleFSBFPhase2State += new hook_HandleFSBFPhase2State(OnPhase2State);
			LightningStrikeInstance.HandleWarning += new hook_HandleWarning(OnHandleWarning);
			SceneDirector.PopulateScene += new hook_PopulateScene(OnPopulateScene);
			SceneDirector.GenerateInteractableCardSelection += new hook_GenerateInteractableCardSelection(OnGenerateInteractableCardSelection);
			HalcyoniteShrineInteractable.Awake += new hook_Awake(OnHalcyoniteShrineAwake);
			SkyJumpDeathState.GiveColossusItem += new Manipulator(IL_GiveColossusItem);
		}

		private void OnTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo info)
		{
			//IL_0033: 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_007d: 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_0131: 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_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			bool flag2 = true;
			if (Object.op_Implicit((Object)(object)self.body) && self.body.baseNameToken.Contains("LUNARRAINSHARD"))
			{
				flag = true;
			}
			if ((DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLightning) || DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLunarRuin)) && Object.op_Implicit((Object)(object)self.body) && !flag)
			{
				self.body.AddTimedBuff(Buffs.lunarruin, 420f);
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLunarRuin) && Object.op_Implicit((Object)(object)self.body) && flag)
			{
				info.damage = 0f;
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.aurelioniteLaser) && Object.op_Implicit((Object)(object)self.body))
			{
				if (flag)
				{
					info.damage *= 0.1f;
				}
				else if (self.body.HasBuff(Main.LaserGoldDebuff))
				{
					info.damage = 0f;
				}
				else
				{
					self.body.AddTimedBuff(Main.LaserGoldDebuff, 0.5f);
				}
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLightning) && Object.op_Implicit((Object)(object)self.body))
			{
				float num = 0.125f * (1f + (float)Main.scalingLevel * Main.scalingMult);
				info.damage = self.fullCombinedHealth * num;
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLaserCrystal))
			{
				if (flag)
				{
					if (self.body.GetBuffCount(Main.LaserCrystalDebuff) >= 5)
					{
						info.damage = self.fullCombinedHealth * 2f;
					}
					else
					{
						info.damage = 0f;
					}
					self.body.AddTimedBuff(Main.LaserCrystalDebuff, 50f, 5);
					self.dontShowHealthbar = false;
				}
				else
				{
					info.damage = 0f;
					info.rejected = true;
					flag2 = false;
				}
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundDevastatorCrystal))
			{
				if (flag)
				{
					self.body.AddTimedBuff(Main.LaserCrystalDebuff, 50f, 5);
					self.body.AddTimedBuff(Main.LaserCrystalDebuff, 50f, 5);
					self.body.AddTimedBuff(Main.LaserCrystalDebuff, 50f, 5);
					self.body.AddTimedBuff(Main.LaserCrystalDebuff, 50f, 5);
					self.body.AddTimedBuff(Main.LaserCrystalDebuff, 50f, 5);
					self.dontShowHealthbar = false;
				}
				else
				{
					self.body.AddTimedBuff(Buffs.lunarruin, 420f);
					self.body.AddTimedBuff(Buffs.lunarruin, 420f);
				}
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLaser) && Object.op_Implicit((Object)(object)self.body))
			{
				if (!flag)
				{
					self.body.AddTimedBuff(Main.LaserTargetDebuff, 2f, 10);
					self.body.AddTimedBuff(Buffs.lunarruin, 420f);
					if (Main.currentPhase == 3)
					{
						self.body.AddTimedBuff(Buffs.lunarruin, 420f);
					}
				}
				else
				{
					info.damage = 0f;
				}
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLaserTargeting) && Object.op_Implicit((Object)(object)self.body))
			{
				if (!flag)
				{
					self.body.AddTimedBuff(Main.LaserTargetDebuff, 2f, 10);
				}
				info.damage = 0f;
				info.rejected = true;
				flag2 = false;
			}
			if (flag2)
			{
				orig.Invoke(self, info);
			}
		}

		private void GlobalEventManager_onServerDamageDealt(DamageReport report)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0069: 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_0087: Expected O, but got Unknown
			HealthComponent victim = report.victim;
			CharacterBody attackerBody = report.attackerBody;
			if (report.dotType == Main.devastatorDotIndex && (Object)(object)victim != (Object)null)
			{
				victim.body.AddTimedBuff(Buffs.lunarruin, 420f);
				Util.PlaySound("Play_item_use_BFG_zaps", ((Component)victim).gameObject);
				EffectData val = new EffectData
				{
					origin = report.victimBody.footPosition,
					scale = 0.25f,
					rootObject = ((Component)report.victim).gameObject
				};
				EffectManager.SpawnEffect(devastatorEffect, val, true);
			}
		}

		public void IL_TakeDamageProcess(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_00e1: 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_0165: 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)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			float num = default(float);
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(HealthComponent), "adaptiveArmorValue"),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchAdd(x),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 400f)
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<HealthComponent, float>>((Func<HealthComponent, float>)((HealthComponent self) => 1f + ((float)self.itemCounts.adaptiveArmor - 1f) * 0.25f));
				val.Emit(OpCodes.Mul);
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
			int loc1 = -1;
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1)
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldloc, loc1);
				val.EmitDelegate<Func<HealthComponent, float, float>>((Func<HealthComponent, float, float>)delegate(HealthComponent self, float damage)
				{
					num = self.fullCombinedHealth * 0.15f;
					if (self.body.HasBuff(Main.DamageCapBuff) && damage >= num)
					{
						float num2 = damage - num;
						num2 *= 0.5f;
						damage = num + num2;
					}
					return damage;
				});
				val.Emit(OpCodes.Stloc, loc1);
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!");
			}
		}

		private void OnMeridianStart(orig_Start orig, MeridianEventTriggerInteraction self)
		{
			for (int i = 0; i < ClassicStageInfo.instance.monsterSelection.Count; i++)
			{
			}
			orig.Invoke(self);
		}

		private void OnPhase2State(orig_HandleFSBFPhase2State orig, MeridianEventTriggerInteraction self)
		{
			orig.Invoke(self);
			self.phase2CombatDirector.SetActive(false);
		}

		private void OnSwapColumns(orig_SwapArenaColumns orig, MeridianEventTriggerInteraction self)
		{
			//IL_003a: 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_003c: 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)
			orig.Invoke(self);
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(58.62f, 150.16f, -103.93f);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(60f, 280f, 180f);
			GameObject val3 = Object.Instantiate<GameObject>(fsPillar, val, Quaternion.Euler(val2));
			val3.transform.eulerAngles = val2;
		}

		private void Run_onRunStartGlobal(Run obj)
		{
			//IL_0007: 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_0053: Invalid comparison between Unknown and I4
			Log.Debug($"{obj.selectedDifficulty} {(object)(DifficultyIndex)9}");
			SkillDef skillDef = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName("PrimeDevastator"));
			if ((Object)(object)skillDef != (Object)null)
			{
				skillDef.baseRechargeInterval = 60f;
			}
			if ((int)obj.selectedDifficulty >= 9)
			{
				SkillDef skillDef2 = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName("LunarGazePlus"));
				SkillDef val = SkillCatalog.allSkillDefs.FirstOrDefault((Func<SkillDef, bool>)((SkillDef skill) => skill.skillName == "Laser" && skill.baseRechargeInterval == 35f));
				if ((Object)(object)skillDef == (Object)null || (Object)(object)skillDef2 == (Object)null || (Object)(object)val == (Object)null)
				{
					Log.Error($"One or more SkillDefs could not be found! Check skill names. {skillDef} | {skillDef2} | {val}");
					return;
				}
				skillDef.baseRechargeInterval *= 1.5f;
				skillDef2.baseRechargeInterval *= 1.5f;
				val.baseRechargeInterval *= 1.5f;
				Log.Debug($"Devestator Skill Cooldown: {skillDef.baseRechargeInterval}");
				Log.Debug($"Lunar Gaze Plus Skill Cooldown: {skillDef2.baseRechargeInterval}");
				Log.Debug($"Lunar Gaze Skill Cooldown: {val.baseRechargeInterval}");
			}
		}

		private void Run_onRunDestroyGlobal(Run obj)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			SkillDef skillDef = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName("PrimeDevastator"));
			if ((int)obj.selectedDifficulty >= 9)
			{
				SkillDef skillDef2 = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName("LunarGazePlus"));
				SkillDef val = SkillCatalog.allSkillDefs.FirstOrDefault((Func<SkillDef, bool>)((SkillDef skill) => skill.skillName == "Laser" && skill.baseRechargeInterval == 52.5f));
				if ((Object)(object)skillDef == (Object)null || (Object)(object)skillDef2 == (Object)null || (Object)(object)val == (Object)null)
				{
					Log.Error($"One or more SkillDefs could not be found! Check skill names. {skillDef} | {skillDef2} | {val}");
					return;
				}
				skillDef.baseRechargeInterval /= 1.5f;
				skillDef2.baseRechargeInterval /= 1.5f;
				val.baseRechargeInterval /= 1.5f;
				Log.Debug($"Devestator Skill Cooldown: {skillDef.baseRechargeInterval}");
				Log.Debug($"Lunar Gaze Plus Skill Cooldown: {skillDef2.baseRechargeInterval}");
				Log.Debug($"Lunar Gaze Skill Cooldown: {val.baseRechargeInterval}");
			}
		}

		public void OnHandleWarning(orig_HandleWarning orig, LightningStrikeInstance self)
		{
			orig.Invoke(self);
			float delay = Mathf.Max(self.workingImpactDelay / 2f, self.workingImpactDelay - 0.75f);
			((MonoBehaviour)self).StartCoroutine(HandleSecondaryWarning(self, delay));
		}

		public IEnumerator HandleSecondaryWarning(LightningStrikeInstance self, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			EffectManager.SpawnEffect(lightningWarningEffect, new EffectData
			{
				origin = self.impactPosition,
				scale = self.blastRadius,
				genericFloat = self.workingImpactDelay - delay
			}, true);
		}

		public void OnFSBFPhaseUpdate(orig_FixedUpdate orig, FSBFPhaseBaseState self)
		{
			((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime();
			if ((Object)(object)self.phaseBossGroup != (Object)null)
			{
				self.phaseBossGroup.shouldDisplayHealthBarOnHud = ((FixedTimeStamp)(ref self.healthBarShowTime)).hasPassed;
			}
			if (!self.hasSpawned && FSBFPhaseBaseState.readyToSpawnNextBossBody && ((EntityState)self).fixedAge > self.durationBeforeEnablingCombatEncounter)
			{
				self.BeginEncounter();
			}
			else if (self.hasSpawned && FSBFPhaseBaseState.readyToSpawnNextBossBody && !self.spawnedNextState && ((EntityState)self).fixedAge > 2f + self.durationBeforeEnablingCombatEncounter && Object.op_Implicit((Object)(object)self.phaseScriptedCombatEncounter) && self.phaseScriptedCombatEncounter.combatSquad.memberCount == 0)
			{
				FSBFPhaseBaseState.endStateDelayTimer -= Time.deltaTime;
				if (FSBFPhaseBaseState.endStateDelayTimer < 0f)
				{
					self.spawnedNextState = true;
					((EntityState)self).outer.SetNextState(self.nextState);
				}
			}
			if (((EntityState)self).fixedAge > self.durationBeforeEnablingCombatEncounter)
			{
				self.ApplyDebuffToMinions();
			}
		}

		public void OnPhase1Enter(orig_OnEnter orig, Phase1 self)
		{
			orig.Invoke(self);
			if (NetworkServer.active)
			{
				foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
				{
					if (!((Object)(object)instance == (Object)null))
					{
						CharacterBody body = instance.master.GetBody();
						if (!((Object)(object)body == (Object)null))
						{
							Util.CleanseBody(body, true, false, false, true, false, false);
						}
					}
				}
			}
			if (Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount >= 5)
			{
				if (Run.instance.stageClearCount >= 10)
				{
					Main.scalingLevel = 3;
				}
				else if (Run.instance.stageClearCount >= 8)
				{
					Main.scalingLevel = 2;
				}
				else
				{
					Main.scalingLevel = 1;
				}
			}
			else
			{
				Main.scalingLevel = 0;
			}
			Main.strikeSpeed = Main.baseStrikeSpeed / (1f + Main.scalingMult * (float)Main.scalingLevel);
		}

		public void OnPhase1Update(orig_FixedUpdate orig, Phase1 self)
		{
			orig.Invoke(self);
			if (Main.currentPhase != 1 && ((EntityState)self).fixedAge > ((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.additionalEntryVFXDelay + ((FSBFPhaseBaseState)self).durationBeforeEnablingCombatEncounter + 4f)
			{
				Main.currentPhase = 1;
				if (Main.hardMode)
				{
					((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.frequencyOfLightningStrikes = phase1StrikeInterval;
					((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.delayBeforeExpiringAPreviousStrikePoint = phase1StrikeInterval;
					((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.lightningWarningDuration = phase1AmbientStrikeSpeed;
					LightningStormController.SetStormStrikePattern(((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern);
					LightningStormController.SetStormActive(true);
				}
			}
		}

		public void OnPhase2Enter(orig_OnEnter orig, Phase2 self)
		{
			orig.Invoke(self);
			((FSBFPhaseBaseState)self).durationBeforeEnablingCombatEncounter = 0f;
			((FSBFPhaseBaseState)self).durationBeforeRingsSpawn = 0.5f;
			Main.currentPhase = 2;
			if (Main.hardMode)
			{
				((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.frequencyOfLightningStrikes = phase2StrikeInterval;
				((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.delayBeforeExpiringAPreviousStrikePoint = phase2StrikeInterval;
				((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.lightningWarningDuration = phase2AmbientStrikeSpeed;
				LightningStormController.SetStormStrikePattern(((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern);
				LightningStormController.SetStormActive(true);
			}
		}

		public void OnPhase3Enter(orig_OnEnter orig, Phase3 self)
		{
			orig.Invoke(self);
			Main.currentPhase = 3;
			((FSBFPhaseBaseState)self).durationBeforeEnablingCombatEncounter = 0f;
			((FSBFPhaseBaseState)self).durationBeforeRingsSpawn = 0.5f;
			if (Main.hardMode)
			{
				((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.frequencyOfLightningStrikes = phase3StrikeInterval;
				((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.delayBeforeExpiringAPreviousStrikePoint = phase3StrikeInterval;
				((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.lightningWarningDuration = phase3AmbientStrikeSpeed;
				LightningStormController.SetStormStrikePattern(((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern);
				LightningStormController.SetStormActive(true);
			}
			LightningStormController.SetStormActive(false);
		}

		public void OnPhase3Finish(orig_OnBossGroupDefeated orig, Phase3 self, BossGroup bossGroup)
		{
			orig.Invoke(self, bossGroup);
			if (!NetworkServer.active)
			{
				return;
			}
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (!((Object)(object)instance == (Object)null))
				{
					CharacterBody body = instance.master.GetBody();
					if (!((Object)(object)body == (Object)null))
					{
						Util.CleanseBody(body, true, false, false, true, false, false);
					}
				}
			}
		}

		private void OnPopulateScene(orig_PopulateScene orig, SceneDirector self)
		{
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Invalid comparison between Unknown and I4
			WeightedSelection<DirectorCard> val = self.GenerateInteractableCardSelection();
			string text = "";
			if ((Object)(object)SceneInfo.instance != (Object)null && (Object)(object)SceneInfo.instance.sceneDef != (Object)null)
			{
				Log.Info(SceneInfo.instance.sceneDef.baseSceneName);
				text = SceneInfo.instance.sceneDef.baseSceneName;
			}
			string[] array = Main.halcyonStages.Value.Trim().TrimEnd(',').Split(new string[1] { "," }, StringSplitOptions.None);
			for (int i = 0; i < val.Count; i++)
			{
				if (val == null)
				{
					continue;
				}
				_ = ref val.choices[i];
				string name = ((Object)val.choices[i].value.spawnCard).name;
				if (!name.Contains("ShrineHalcyonite"))
				{
					continue;
				}
				string[] array2 = array;
				foreach (string text2 in array2)
				{
					if (!(text == text2))
					{
						continue;
					}
					DirectorCard value = val.choices[i].value;
					if (!value.IsAvailable())
					{
						continue;
					}
					self.interactableCredit -= value.cost;
					if (!Object.op_Implicit((Object)(object)Run.instance))
					{
						continue;
					}
					for (int k = 0; k < 10; k++)
					{
						DirectorPlacementRule val2 = new DirectorPlacementRule
						{
							placementMode = (PlacementMode)4
						};
						GameObject val3 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(value.GetSpawnCard(), val2, self.rng));
						if (Object.op_Implicit((Object)(object)val3))
						{
							Log.Message("Successfully guaranteed Halcyon Shrine on " + text2);
							PurchaseInteraction component = val3.GetComponent<PurchaseInteraction>();
							if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1)
							{
								component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost);
							}
							break;
						}
					}
				}
			}
			orig.Invoke(self);
		}

		private WeightedSelection<DirectorCard> OnGenerateInteractableCardSelection(orig_GenerateInteractableCardSelection orig, SceneDirector self)
		{
			WeightedSelection<DirectorCard> val = orig.Invoke(self);
			string text = "";
			if ((Object)(object)SceneInfo.instance != (Object)null && (Object)(object)SceneInfo.instance.sceneDef != (Object)null)
			{
				Log.Info(SceneInfo.instance.sceneDef.baseSceneName);
				text = SceneInfo.instance.sceneDef.baseSceneName;
			}
			string[] array = Main.halcyonStages.Value.Trim().TrimEnd(',').Split(new string[1] { "," }, StringSplitOptions.None);
			for (int i = 0; i < val.Count; i++)
			{
				if (val == null)
				{
					continue;
				}
				_ = ref val.choices[i];
				string name = ((Object)val.choices[i].value.spawnCard).name;
				if (!name.Contains("ShrineHalcyonite"))
				{
					continue;
				}
				val.choices[i].weight *= 1.15f;
				string[] array2 = array;
				foreach (string text2 in array2)
				{
					if (text == text2)
					{
						val.choices[i].weight = 0f;
					}
				}
			}
			return val;
		}

		public void OnHalcyoniteShrineAwake(orig_Awake orig, HalcyoniteShrineInteractable self)
		{
			orig.Invoke(self);
			if (!NetworkServer.active)
			{
				return;
			}
			int num = 0;
			if ((Object)(object)Run.instance != (Object)null)
			{
				num = Run.instance.stageClearCountInCurrentLoop;
			}
			if (self.portalSpawners == null)
			{
				return;
			}
			PortalSpawner[] portalSpawners = self.portalSpawners;
			foreach (PortalSpawner val in portalSpawners)
			{
				if (num >= 4)
				{
					val.portalSpawnCard = colossusPortalCard;
					val.spawnPreviewMessageToken = "PORTAL_STORM_WILL_OPEN";
					val.spawnMessageToken = "PORTAL_STORM_OPEN";
					val.previewChildName = "StormPortalIndicator";
					Log.Message("Success!");
				}
			}
		}

		public void IL_GiveColossusItem(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0009: 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_000d: 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)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			MethodReference val4 = default(MethodReference);
			int num = default(int);
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(Run), "treasureRng"),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val4),
				(Instruction x) => ILPatternMatchingExt.MatchNewobj(x, ref val4),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<SkyJumpDeathState>>((Action<SkyJumpDeathState>)delegate(SkyJumpDeathState self)
				{
					self.rewardOptionCount = 4;
				});
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
		}

		private void LunarRuinDotFix(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_00a9: 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_00c4: 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)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs).GetField("lunarruin"))
			}))
			{
				if (val.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Component>(x, "get_gameObject")
				}))
				{
					val.EmitDelegate<Action<CharacterBody>>((Action<CharacterBody>)delegate(CharacterBody body)
					{
						body.AddTimedBuff(Buffs.lunarruin, 5f);
						body.SetTimedBuffDurationIfPresent(Buffs.lunarruin, 5f, true);
					});
					ILLabel val2 = val.DefineLabel();
					val.Emit(OpCodes.Br, (object)val2);
					val.Emit(OpCodes.Ldloc, 1);
					MoveType val3 = (MoveType)2;
					if (val.TryGotoNext(val3, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DotController>(x, "InflictDot")
					}))
					{
						val.MarkLabel(val2);
					}
					else
					{
						Log.Error(((MemberReference)il.Method).Name + " Hook 3 failed!");
					}
				}
				else
				{
					Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!");
				}
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
		}

		private void OnFrozenStateEnter(orig_OnEnter orig, FrozenState self)
		{
			if (!(((Object)((EntityState)self).outer).name == "FalseSonBossBody(Clone)") && !(((Object)((EntityState)self).outer).name == "FalseSonBossBodyLunarShard(Clone)") && !(((Object)((EntityState)self).outer).name == "FalseSonBossBodyBrokenLunarShard(Clone)"))
			{
				orig.Invoke(self);
			}
		}
	}
	public class FalseSonChanges
	{
		private static GameObject warningPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common.TeamAreaIndicator__GroundOnly_prefab).WaitForCompletion();

		private static GameObject stakePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSon.LunarStake_prefab).WaitForCompletion();

		private static GameObject fissureWarningEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Vagrant.VagrantCannonExplosion_prefab).WaitForCompletion();

		private static GameObject warningPrefab2 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSon.OmniImpactVFXLunarStakeTerrain_prefab).WaitForCompletion();

		private static GameObject eyeGlowPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.LightningFlash_prefab).WaitForCompletion();

		public static GameObject devastatorProjectile = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.PrimeDevastatorProjectile_prefab).WaitForCompletion();

		public static GameObject meridianTeleportEffect1 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSonBoss.FalseSonBossLightningNovaSpawn_prefab).WaitForCompletion();

		public static GameObject meridianTeleportEffect2 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSon.MeridiansWillSecondaryLightningImpact_prefab).WaitForCompletion();

		public float crystalRadiusMult = 1.3f;

		public int bonusCrystalCount = 3;

		public int crystalScatters = 5;

		public float dashLightningTimer = 0f;

		public static float dashDelayDuration = 0.5f;

		public float speedoverride = -1f;

		public bool chargedStake = false;

		private BlastAttack _blastInfo = null;

		private Vector3[] testPattern = (Vector3[])(object)new Vector3[9]
		{
			new Vector3(0f, 0f, 0f),
			new Vector3(30f, 0f, -30f),
			new Vector3(30f, 0f, 0f),
			new Vector3(30f, 0f, 30f),
			new Vector3(0f, 0f, 30f),
			new Vector3(-30f, 0f, 30f),
			new Vector3(-30f, 0f, 0f),
			new Vector3(-30f, 0f, -30f),
			new Vector3(0f, 0f, -30f)
		};

		private static Vector3[] tornadoPattern = (Vector3[])(object)new Vector3[8]
		{
			new Vector3(28f, 0f, -28f),
			new Vector3(40f, 0f, 0f),
			new Vector3(28f, 0f, 28f),
			new Vector3(0f, 0f, 40f),
			new Vector3(-28f, 0f, 28f),
			new Vector3(-40f, 0f, 0f),
			new Vector3(-28f, 0f, -28f),
			new Vector3(0f, 0f, -40f)
		};

		private static Vector3[] pattern1a = (Vector3[])(object)new Vector3[12]
		{
			new Vector3(0f, 0f, 30f),
			new Vector3(15f, 0f, 27f),
			new Vector3(27f, 0f, 15f),
			new Vector3(30f, 0f, 0f),
			new Vector3(27f, 0f, -15f),
			new Vector3(15f, 0f, -27f),
			new Vector3(0f, 0f, -30f),
			new Vector3(-15f, 0f, -27f),
			new Vector3(-27f, 0f, -15f),
			new Vector3(-30f, 0f, 0f),
			new Vector3(-27f, 0f, 15f),
			new Vector3(-15f, 0f, 27f)
		};

		private static Vector3[] pattern1b = (Vector3[])(object)new Vector3[12]
		{
			new Vector3(12.5f, 0f, 12.5f),
			new Vector3(12.5f, 0f, -12.5f),
			new Vector3(-12.5f, 0f, 12.5f),
			new Vector3(-12.5f, 0f, -12.5f),
			new Vector3(25f, 0f, 25f),
			new Vector3(25f, 0f, -25f),
			new Vector3(-25f, 0f, 25f),
			new Vector3(-25f, 0f, -25f),
			new Vector3(37.5f, 0f, 37.5f),
			new Vector3(37.5f, 0f, -37.5f),
			new Vector3(-37.5f, 0f, 37.5f),
			new Vector3(-37.5f, 0f, -37.5f)
		};

		private static Vector3[] pattern1c = (Vector3[])(object)new Vector3[36]
		{
			new Vector3(10f, 0f, 10f),
			new Vector3(10f, 0f, -10f),
			new Vector3(-10f, 0f, 10f),
			new Vector3(-10f, 0f, -10f),
			new Vector3(20f, 0f, 20f),
			new Vector3(20f, 0f, -20f),
			new Vector3(-20f, 0f, 20f),
			new Vector3(-20f, 0f, -20f),
			new Vector3(20f, 0f, 0f),
			new Vector3(20f, 0f, -0f),
			new Vector3(-20f, 0f, 0f),
			new Vector3(-20f, 0f, -0f),
			new Vector3(30f, 0f, 30f),
			new Vector3(30f, 0f, -30f),
			new Vector3(-30f, 0f, 30f),
			new Vector3(-30f, 0f, -30f),
			new Vector3(30f, 0f, 10f),
			new Vector3(30f, 0f, -10f),
			new Vector3(-30f, 0f, 10f),
			new Vector3(-30f, 0f, -10f),
			new Vector3(10f, 0f, 30f),
			new Vector3(10f, 0f, -30f),
			new Vector3(-10f, 0f, 30f),
			new Vector3(-10f, 0f, -30f),
			new Vector3(40f, 0f, 20f),
			new Vector3(40f, 0f, -20f),
			new Vector3(40f, 0f, 0f),
			new Vector3(-40f, 0f, 20f),
			new Vector3(-40f, 0f, -20f),
			new Vector3(-40f, 0f, 0f),
			new Vector3(20f, 0f, 40f),
			new Vector3(-20f, 0f, 40f),
			new Vector3(0f, 0f, 40f),
			new Vector3(20f, 0f, -40f),
			new Vector3(-20f, 0f, -40f),
			new Vector3(0f, 0f, -40f)
		};

		private static Vector3[] pattern1d = (Vector3[])(object)new Vector3[12]
		{
			new Vector3(0f, 0f, 15f),
			new Vector3(10f, 0f, 5f),
			new Vector3(-10f, 0f, 5f),
			new Vector3(0f, 0f, 45f),
			new Vector3(10f, 0f, 35f),
			new Vector3(-10f, 0f, 35f),
			new Vector3(30f, 0f, 15f),
			new Vector3(40f, 0f, 5f),
			new Vector3(30f, 0f, -5f),
			new Vector3(-30f, 0f, 15f),
			new Vector3(-40f, 0f, 5f),
			new Vector3(-30f, 0f, -5f)
		};

		private static Vector3[] pattern1e = (Vector3[])(object)new Vector3[12]
		{
			new Vector3(0f, 0f, 35f),
			new Vector3(10f, 0f, 25f),
			new Vector3(-10f, 0f, 25f),
			new Vector3(0f, 0f, -35f),
			new Vector3(10f, 0f, -25f),
			new Vector3(-10f, 0f, -25f),
			new Vector3(25f, 0f, 10f),
			new Vector3(35f, 0f, 0f),
			new Vector3(25f, 0f, -10f),
			new Vector3(-25f, 0f, 10f),
			new Vector3(-35f, 0f, 0f),
			new Vector3(-25f, 0f, -10f)
		};

		public List<Vector3[]> patternList1 = new List<Vector3[]> { pattern1a, pattern1b, pattern1e };

		private static Vector3[] pattern2a = (Vector3[])(object)new Vector3[16]
		{
			new Vector3(0f, 0f, -10f),
			new Vector3(-10f, 0f, -20f),
			new Vector3(0f, 0f, -20f),
			new Vector3(10f, 0f, -20f),
			new Vector3(-12.5f, 0f, -30f),
			new Vector3(0f, 0f, -30f),
			new Vector3(12.5f, 0f, -30f),
			new Vector3(-15f, 0f, -40f),
			new Vector3(0f, 0f, -40f),
			new Vector3(15f, 0f, -40f),
			new Vector3(-17.5f, 0f, -50f),
			new Vector3(0f, 0f, -50f),
			new Vector3(17.5f, 0f, -50f),
			new Vector3(-20f, 0f, -60f),
			new Vector3(0f, 0f, -60f),
			new Vector3(20f, 0f, -60f)
		};

		private static Vector3[] pattern2b = (Vector3[])(object)new Vector3[16]
		{
			new Vector3(0f, 0f, 45f),
			new Vector3(18f, 0f, 42f),
			new Vector3(33f, 0f, 33f),
			new Vector3(42f, 0f, 18f),
			new Vector3(45f, 0f, 0f),
			new Vector3(42f, 0f, -18f),
			new Vector3(33f, 0f, -33f),
			new Vector3(18f, 0f, -42f),
			new Vector3(0f, 0f, -45f),
			new Vector3(-18f, 0f, -42f),
			new Vector3(-33f, 0f, -33f),
			new Vector3(-42f, 0f, -18f),
			new Vector3(-45f, 0f, 0f),
			new Vector3(-42f, 0f, 18f),
			new Vector3(-33f, 0f, 33f),
			new Vector3(-18f, 0f, 42f)
		};

		private static Vector3[] pattern2c = (Vector3[])(object)new Vector3[36]
		{
			new Vector3(10f, 0f, 0f),
			new Vector3(-10f, 0f, 0f),
			new Vector3(0f, 0f, 10f),
			new Vector3(0f, 0f, -10f),
			new Vector3(20f, 0f, 10f),
			new Vector3(20f, 0f, -10f),
			new Vector3(-20f, 0f, 10f),
			new Vector3(-20f, 0f, -10f),
			new Vector3(30f, 0f, 20f),
			new Vector3(30f, 0f, -20f),
			new Vector3(30f, 0f, 0f),
			new Vector3(-30f, 0f, 20f),
			new Vector3(-30f, 0f, -20f),
			new Vector3(-30f, 0f, 0f),
			new Vector3(20f, 0f, 30f),
			new Vector3(-20f, 0f, 30f),
			new Vector3(0f, 0f, 30f),
			new Vector3(20f, 0f, -30f),
			new Vector3(-20f, 0f, -30f),
			new Vector3(0f, 0f, -30f),
			new Vector3(40f, 0f, 30f),
			new Vector3(40f, 0f, -30f),
			new Vector3(40f, 0f, 10f),
			new Vector3(40f, 0f, -10f),
			new Vector3(-40f, 0f, 30f),
			new Vector3(-40f, 0f, -30f),
			new Vector3(-40f, 0f, 10f),
			new Vector3(-40f, 0f, -10f),
			new Vector3(30f, 0f, 40f),
			new Vector3(-30f, 0f, 40f),
			new Vector3(10f, 0f, 40f),
			new Vector3(-10f, 0f, 40f),
			new Vector3(30f, 0f, -40f),
			new Vector3(-30f, 0f, -40f),
			new Vector3(10f, 0f, -40f),
			new Vector3(-10f, 0f, -40f)
		};

		private static Vector3[] pattern2d = (Vector3[])(object)new Vector3[16]
		{
			new Vector3(10f, 0f, -27.5f),
			new Vector3(10f, 0f, -40f),
			new Vector3(10f, 0f, -52.5f),
			new Vector3(10f, 0f, -15f),
			new Vector3(-10f, 0f, -27.5f),
			new Vector3(-10f, 0f, -40f),
			new Vector3(-10f, 0f, -52.5f),
			new Vector3(-10f, 0f, -15f),
			new Vector3(25f, 0f, -10f),
			new Vector3(25f, 0f, -22.5f),
			new Vector3(25f, 0f, -35f),
			new Vector3(25f, 0f, 2.5f),
			new Vector3(-25f, 0f, -10f),
			new Vector3(-25f, 0f, -22.5f),
			new Vector3(-25f, 0f, -35f),
			new Vector3(-25f, 0f, 2.5f)
		};

		private static Vector3[] pattern2e = (Vector3[])(object)new Vector3[16]
		{
			new Vector3(52f, 0f, 16f),
			new Vector3(40f, 0f, 28f),
			new Vector3(28f, 0f, 40f),
			new Vector3(16f, 0f, 52f),
			new Vector3(-52f, 0f, 16f),
			new Vector3(-40f, 0f, 28f),
			new Vector3(-28f, 0f, 40f),
			new Vector3(-16f, 0f, 52f),
			new Vector3(52f, 0f, -16f),
			new Vector3(40f, 0f, -28f),
			new Vector3(28f, 0f, -40f),
			new Vector3(16f, 0f, -52f),
			new Vector3(-52f, 0f, -16f),
			new Vector3(-40f, 0f, -28f),
			new Vector3(-28f, 0f, -40f),
			new Vector3(-16f, 0f, -52f)
		};

		public List<Vector3[]> patternList2 = new List<Vector3[]> { pattern2a, pattern2b, pattern2d, pattern2e };

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Expected O, but got Unknown
			//IL_013a: 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_0156: Expected O,