Decompiled source of StormboundFalseSon v0.1.0

StormboundFalseSon.dll

Decompiled 7 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Destructible;
using EntityStates.FalseSonBoss;
using EntityStates.MeridianEvent;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Destructible;
using On.EntityStates.FalseSonBoss;
using On.EntityStates.MeridianEvent;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using StormboundFalseSon.Main;
using StormboundFalseSon.Modules;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("StormboundFalseSon")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StormboundFalseSon")]
[assembly: AssemblyTitle("StormboundFalseSon")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	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.1.0")]
	public class StormboundFalseSonPlugin : BaseUnityPlugin
	{
		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			new ContentPacks().Initialize();
			FalseSonChanges falseSonChanges = new FalseSonChanges();
			falseSonChanges.Initialize();
		}
	}
}
namespace StormboundFalseSon.Modules
{
	public static class DamageTypes
	{
		public static ModdedDamageType stormboundLightning = DamageAPI.ReserveDamageType();

		public static ModdedDamageType stormboundLunarRuin = 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)
		{
			//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;
			buffDefs.Add(val);
			return val;
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

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

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

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

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			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.Main
{
	public class FalseSonChanges
	{
		public float phase1StrikeInterval = 3.5f;

		public float phase2StrikeInterval = 3f;

		public float phase3StrikeInterval = 2.5f;

		public float phase1AmbientStrikeSpeed = 2f;

		public float phase2AmbientStrikeSpeed = 1.75f;

		public float phase3AmbientStrikeSpeed = 1.5f;

		public int currentPhase = 0;

		public List<LightningStrikePoint> lightningPoints;

		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[] 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)
		};

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

		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(-12f, 0f, 30f),
			new Vector3(0f, 0f, 30f),
			new Vector3(12f, 0f, 30f),
			new Vector3(-14f, 0f, 40f),
			new Vector3(0f, 0f, 40f),
			new Vector3(14f, 0f, 40f),
			new Vector3(-16f, 0f, 50f),
			new Vector3(0f, 0f, 50f),
			new Vector3(16f, 0f, 50f),
			new Vector3(-18f, 0f, 60f),
			new Vector3(0f, 0f, 60f),
			new Vector3(18f, 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)
		};

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

		public BullseyeSearch enemyFinder = new BullseyeSearch();

		public static DotIndex devastatorDotIndex;

		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 devastatorEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_Elites_EliteBead.EliteBeadCrystalExplosionVFX_prefab).WaitForCompletion();

		public static BuffDef StormboundDevastatorDebuff;

		public float dashLightningTimer = 0f;

		public float speedoverride = -1f;

		public bool chargedStake = false;

		public void Initialize()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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, but got Unknown
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			CreateBuffs();
			devastatorDotIndex = DotAPI.RegisterDotDef(0.75f, 0.5f, (DamageColorIndex)16, StormboundDevastatorDebuff, (CustomDotBehaviour)null, (CustomDotVisual)null);
			HealthComponent.TakeDamage += new hook_TakeDamage(OnTakeDamage);
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
			GlobalEventManager.ProcessHitEnemy += new Manipulator(LunarRuinDotFix);
			Phase1.FixedUpdate += new hook_FixedUpdate(OnPhase1Update);
			Phase2.OnEnter += new hook_OnEnter(OnPhase2Enter);
			Phase3.OnEnter += new hook_OnEnter(OnPhase3Enter);
			FissureSlam.DetonateAuthority += new hook_DetonateAuthority(OnFissureSlamDetonate);
			LunarRainDeathState.Explode += new hook_Explode(OnLunarSpikeExplode);
			LunarRainDeathState.OnEnter += new hook_OnEnter(OnLunarSpikeEnter);
			LunarRain.OnEnter += new hook_OnEnter(OnLunarRainEnter);
			LunarGazeLeap.OnEnter += new hook_OnEnter(OnLeapEnter);
			PrimeDevastator.FixedUpdate += new hook_FixedUpdate(OnDevastatorUpdate);
			PrimeDevastator.CreateOrbChain += new hook_CreateOrbChain(OnDevastatorOrb);
			CorruptedPathsDash.FixedUpdate += new hook_FixedUpdate(OnDashUpdate);
			LightningStrikeInstance.SetupDefaultBlastInfo += new hook_SetupDefaultBlastInfo(OnSetupLightning);
			TaintedOffering.FireProjectile += new hook_FireProjectile(OnTaintedOfferingFire);
			TaintedOffering.FixedUpdate += new hook_FixedUpdate(OnTaintedOfferingUpdate);
			TaintedOffering.OnEnter += new hook_OnEnter(OnTaintedOfferingEnter);
		}

		private void CreateBuffs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			StormboundDevastatorDebuff = Buffs.AddNewBuff("BloonStormboundDevastatorDebuff", Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC3/Buffs/texElectrocutedDebuffIcon.png").WaitForCompletion(), Color.yellow, canStack: false, isDebuff: true, isCooldown: false, isHidden: false);
		}

		private void OnTakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo info)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLightning) && Object.op_Implicit((Object)(object)self.body))
			{
				info.damage = self.fullHealth * 0.15f;
				self.body.AddTimedBuff(Buffs.lunarruin, 420f);
			}
			if (DamageAPI.HasModdedDamageType(info, DamageTypes.stormboundLunarRuin) && Object.op_Implicit((Object)(object)self.body))
			{
				self.body.AddTimedBuff(Buffs.lunarruin, 20f);
			}
			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 == 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.75f,
					rootObject = ((Component)report.victim).gameObject
				};
				EffectManager.SpawnEffect(devastatorEffect, val, true);
			}
		}

		public void OnPhase1Update(orig_FixedUpdate orig, Phase1 self)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			orig.Invoke(self);
			if (currentPhase != 1 && ((EntityState)self).fixedAge > ((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.additionalEntryVFXDelay + ((FSBFPhaseBaseState)self).durationBeforeEnablingCombatEncounter + 4f)
			{
				currentPhase = 1;
				LightningStrikePattern val = new LightningStrikePattern();
				val.frequencyOfLightningStrikes = phase1StrikeInterval;
				val.delayBeforeExpiringAPreviousStrikePoint = phase1StrikeInterval;
				val.lightningWarningDuration = phase1AmbientStrikeSpeed;
				LightningStormController.SetStormStrikePattern(val);
				LightningStormController.SetStormActive(true);
			}
		}

		public void OnPhase2Enter(orig_OnEnter orig, Phase2 self)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			orig.Invoke(self);
			currentPhase = 2;
			LightningStrikePattern val = new LightningStrikePattern();
			val.frequencyOfLightningStrikes = phase2StrikeInterval;
			val.delayBeforeExpiringAPreviousStrikePoint = phase2StrikeInterval;
			val.lightningWarningDuration = phase2AmbientStrikeSpeed;
			LightningStormController.SetStormStrikePattern(val);
			LightningStormController.SetStormActive(true);
		}

		public void OnPhase3Enter(orig_OnEnter orig, Phase3 self)
		{
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.lightningStrikePoints = ((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.lightningStrikePoints;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.frequencyOfLightningStrikes = phase3StrikeInterval;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.delayBeforeExpiringAPreviousStrikePoint = phase3StrikeInterval;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.lightningWarningDuration = phase3AmbientStrikeSpeed;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.forEachAdditionalPlayerReduceStrikeTotalBy = 1f;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.timeBetweenIndividualStrikes = 0.15f;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.maxAcceptableDistanceFromPredictedPoint = 2f;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.minimumDistanceBetweenPoints = 3f;
			((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.bossLightningStrikePattern.DebugProjectedLinesDisplayTime = -1f;
			orig.Invoke(self);
			lightningPoints = ((FSBFEncounterBaseState)self).meridianEventTriggerInteraction.startingLightningStrikePattern.lightningStrikePoints;
			currentPhase = 3;
		}

		public Result OnFissureSlamDetonate(orig_DetonateAuthority orig, FissureSlam self)
		{
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: 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)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).isAuthority)
			{
				Vector3 position = ((Component)((BaseState)self).FindModelChild("ClubExplosionPoint")).transform.position;
				float x = position.x;
				float y = MeridianEventTriggerInteraction.instance.arenaCenter.position.y;
				float z = position.z;
				Quaternion val = Util.QuaternionSafeLookRotation(((EntityState)self).modelLocator.modelTransform.forward);
				float num = val.y * -180f;
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(x, y, z);
				int index = Random.Range(0, patternList1.Count);
				Vector3[] array = patternList1[index];
				float num2 = 1f;
				Util.ShuffleArray<Vector3>(array);
				for (int i = 0; i < 12; i++)
				{
					Vector3 val3 = array[i];
					Vector3 val4 = Quaternion.AngleAxis(num, Vector3.down) * val3;
					Vector3 val5 = val4 + val2;
					Object.Instantiate<GameObject>(LunarGazeExitLeap.lightningPrefab, val5, val).GetComponent<LightningStrikeInstance>().Initialize(val5, _blastInfo, num2, true);
					num2 += 0.01f;
				}
				if (currentPhase > 1)
				{
					int index2 = Random.Range(0, patternList2.Count);
					Vector3[] array2 = patternList2[index2];
					float num3 = 1.3f;
					Util.ShuffleArray<Vector3>(array2);
					for (int j = 0; j < 16; j++)
					{
						Vector3 val6 = array2[j];
						Vector3 val7 = Quaternion.AngleAxis(num, Vector3.down) * val6;
						Vector3 val8 = val2 + val7;
						Object.Instantiate<GameObject>(LunarGazeExitLeap.lightningPrefab, val8, val).GetComponent<LightningStrikeInstance>().Initialize(val8, _blastInfo, num3, true);
						num3 += 0.01f;
					}
				}
				BaseAI val9 = default(BaseAI);
				if (((Component)((EntityState)self).characterBody.master).TryGetComponent<BaseAI>(ref val9) && currentPhase > 2)
				{
					Target currentEnemy = val9.currentEnemy;
					if (currentEnemy != null && (Object)(object)val9.currentEnemy.gameObject != (Object)null)
					{
						x = currentEnemy.gameObject.transform.position.x;
						z = currentEnemy.gameObject.transform.position.z;
						Vector3 val10 = default(Vector3);
						((Vector3)(ref val10))..ctor(x, y, z);
					}
				}
			}
			return orig.Invoke(self);
		}

		public void OnLunarSpikeExplode(orig_Explode orig, LunarRainDeathState self)
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)((EntityState)self).modelLocator))
			{
				if (Object.op_Implicit((Object)(object)((EntityState)self).modelLocator.modelBaseTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)self).modelLocator.modelBaseTransform).gameObject);
				}
				if (Object.op_Implicit((Object)(object)((EntityState)self).modelLocator.modelTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)self).modelLocator.modelTransform).gameObject);
				}
			}
			if (Object.op_Implicit((Object)(object)LunarRainDeathState.explosionEffectPrefab))
			{
				EffectManager.SpawnEffect(LunarRainDeathState.explosionEffectPrefab, new EffectData
				{
					origin = ((EntityState)self).transform.position,
					scale = LunarRainDeathState.vfxScale * 1.6f,
					rotation = ((EntityState)self).transform.rotation
				}, true);
			}
			BlastAttack val = new BlastAttack();
			val.attacker = ((EntityState)self).gameObject;
			val.damageColorIndex = (DamageColorIndex)3;
			val.baseDamage = LunarRainDeathState.baseDamage * LunarRainDeathState.explosionDamageCoefficient * Run.instance.teamlessDamageCoefficient * 1.6f;
			val.radius = LunarRainDeathState.explosionRadius * 1.4f;
			val.falloffModel = (FalloffModel)3;
			val.procCoefficient = LunarRainDeathState.explosionProcCoefficient;
			val.teamIndex = (TeamIndex)2;
			val.damageType = DamageTypeCombo.op_Implicit((DamageType)1073741824);
			val.damageType.damageTypeExtended = (DamageTypeExtended)8192;
			val.position = ((EntityState)self).transform.position;
			val.baseForce = LunarRainDeathState.explosionForce;
			val.canRejectForce = LunarRainDeathState.canRejectForce;
			val.attackerFiltering = (AttackerFiltering)2;
			DamageAPI.AddModdedDamageType(val, DamageTypes.stormboundLunarRuin);
			val.Fire();
			EntityState.Destroy((Object)(object)((EntityState)self).gameObject);
		}

		public void OnLunarSpikeEnter(orig_OnEnter orig, LunarRainDeathState self)
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
			{
				((BaseState)self).attackSpeedStat = ((EntityState)self).characterBody.attackSpeed;
				((BaseState)self).damageStat = ((EntityState)self).characterBody.damage;
				((BaseState)self).critStat = ((EntityState)self).characterBody.crit;
				((BaseState)self).moveSpeedStat = ((EntityState)self).characterBody.moveSpeed;
			}
			if ((Object)(object)((EntityState)self).teamComponent != (Object)null)
			{
				((EntityState)self).teamComponent.teamIndex = (TeamIndex)2;
			}
			if (Object.op_Implicit((Object)(object)LunarRainDeathState.chargePrefab))
			{
				GameObject val = Object.Instantiate<GameObject>(warningPrefab, ((EntityState)self).transform.position, Util.QuaternionSafeLookRotation(Vector3.up));
				val.transform.localScale = Vector3.one * LunarRainDeathState.explosionRadius * 1.4f;
				Object.Destroy((Object)(object)val, LunarRainDeathState.chargeDuration);
				TeamAreaIndicator component = val.GetComponent<TeamAreaIndicator>();
				if ((Object)(object)component != (Object)null)
				{
					component.teamComponent = ((EntityState)self).teamComponent;
				}
				EffectData val2 = new EffectData
				{
					scale = LunarRainDeathState.explosionRadius * 1.4f,
					origin = ((EntityState)self).transform.position
				};
				EffectManager.SpawnEffect(LunarRainDeathState.chargePrefab, val2, false);
			}
			FlashEmission component2 = ((Component)((EntityState)self).modelLocator.modelTransform).GetComponent<FlashEmission>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.StartFlash();
			}
			Util.PlaySound(LunarRainDeathState.explosiveIndicatorSoundString, ((EntityState)self).gameObject);
		}

		public void OnLunarRainEnter(orig_OnEnter orig, LunarRain self)
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			BaseAI val = default(BaseAI);
			if (!((Component)((EntityState)self).characterBody.master).TryGetComponent<BaseAI>(ref val))
			{
				return;
			}
			Target currentEnemy = val.currentEnemy;
			if (currentEnemy == null || !((Object)(object)val.currentEnemy.gameObject != (Object)null))
			{
				return;
			}
			List<NodeIndex> list = new List<NodeIndex>();
			List<Vector3> list2 = new List<Vector3>();
			if (!Object.op_Implicit((Object)(object)SceneInfo.instance) || !Object.op_Implicit((Object)(object)SceneInfo.instance.groundNodes))
			{
				Debug.LogWarning((object)"No ground nodes available");
				return;
			}
			NodeGraph groundNodes = SceneInfo.instance.groundNodes;
			float x = currentEnemy.gameObject.transform.position.x;
			float y = MeridianEventTriggerInteraction.instance.arenaCenter.position.y;
			float z = currentEnemy.gameObject.transform.position.z;
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(x, y, z);
			list = groundNodes.FindNodesInRange(val2, 10f, 45f, (HullMask)1);
			Vector3 item = default(Vector3);
			foreach (NodeIndex item2 in list)
			{
				if (groundNodes.GetNodePosition(item2, ref item))
				{
					list2.Add(item);
				}
			}
			Util.ShuffleList<Vector3>(list2);
			for (int i = 0; i < 3; i++)
			{
				self.totalLunarDropsToFire++;
				self.fissureLocs.Add(list2[i]);
			}
		}

		public void OnDashUpdate(orig_FixedUpdate orig, CorruptedPathsDash self)
		{
			//IL_0053: 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_007e: 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_00a7: 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)
			orig.Invoke(self);
			if (self.isDashing)
			{
				if (self.stopwatch >= dashLightningTimer + 0.01f && ((EntityState)self).isAuthority)
				{
					dashLightningTimer = self.stopwatch;
					float x = ((EntityState)self).gameObject.transform.position.x;
					float y = MeridianEventTriggerInteraction.instance.arenaCenter.position.y;
					float z = ((EntityState)self).gameObject.transform.position.z;
					Vector3 val = default(Vector3);
					((Vector3)(ref val))..ctor(x, y, z);
					Object.Instantiate<GameObject>(LunarGazeExitLeap.lightningPrefab, val, ((EntityState)self).gameObject.transform.rotation).GetComponent<LightningStrikeInstance>().Initialize(val, _blastInfo, 0.5f, true);
				}
			}
			else
			{
				dashLightningTimer = 0f;
			}
		}

		public void OnDevastatorUpdate(orig_FixedUpdate orig, PrimeDevastator self)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime();
			if (!self.chargeEffectSpawned && ((EntityState)self).fixedAge > self.duration * 0.3f)
			{
				self.chargeEffectSpawned = true;
			}
			if (!self.slamEffectSpawned && ((EntityState)self).fixedAge > PrimeDevastator.slamEffectDelay)
			{
				self.slamEffectSpawned = true;
				self.DetonateAuthority();
				self.ChainEffectToPlayers();
			}
			if (!self.orbsSpawned && ((EntityState)self).isAuthority && ((EntityState)self).fixedAge > PrimeDevastator.playerLightningDelay)
			{
				self.orbSpawnTimer += Time.deltaTime;
				if (self.orbSpawnTimer > 0.35f)
				{
					self.FireDevastator("MuzzleOrb1");
					self.orbNumber++;
					self.orbSpawnTimer = 0f;
				}
				if (self.orbNumber >= 6)
				{
					self.orbsSpawned = true;
				}
			}
			if (((EntityState)self).fixedAge >= self.duration + 1f && ((EntityState)self).isAuthority)
			{
				((EntityState)self).outer.SetNextStateToMain();
			}
		}

		public void OnDevastatorFire(orig_FireDevastator orig, PrimeDevastator self, string targetMuzzle)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			self.projectileRay = ((BaseState)self).GetAimRay();
			if (Object.op_Implicit((Object)(object)self.modelTransform))
			{
				ChildLocator component = ((Component)self.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild(targetMuzzle);
					if (Object.op_Implicit((Object)(object)val))
					{
						((Ray)(ref self.projectileRay)).origin = val.position;
					}
				}
			}
			float num = 6f * (float)self.orbNumber;
			if (((EntityState)self).isAuthority)
			{
				FireProjectileInfo val2 = default(FireProjectileInfo);
				val2.projectilePrefab = PrimeDevastator.projectilePrefab;
				val2.position = ((EntityState)self).gameObject.transform.position + new Vector3(num, 0f, 0f);
				val2.rotation = Quaternion.identity;
				val2.owner = ((EntityState)self).gameObject;
				val2.damage = ((BaseState)self).damageStat * self.damageCoefficient;
				val2.force = 0f;
				val2.crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master);
				ProjectileManager.instance.FireProjectile(val2);
			}
			((EntityState)self).characterBody.AddSpreadBloom(PrimeDevastator.spreadBloomValue);
		}

		public void OnDevastatorOrb(orig_CreateOrbChain orig, PrimeDevastator self, Vector3 sourceOrigin, HurtBox targetHurtbox)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			StormboundPrimeDevastatorOrb stormboundPrimeDevastatorOrb = new StormboundPrimeDevastatorOrb();
			((Orb)stormboundPrimeDevastatorOrb).origin = sourceOrigin;
			((Orb)stormboundPrimeDevastatorOrb).target = targetHurtbox;
			stormboundPrimeDevastatorOrb.lightningEffectPrefab = PrimeDevastator.lightningEffectPrefab;
			stormboundPrimeDevastatorOrb.blastRadius = PrimeDevastator.blastRadius;
			((GenericDamageOrb)stormboundPrimeDevastatorOrb).attacker = ((EntityState)self).gameObject;
			OrbManager.instance.AddOrb((Orb)(object)stormboundPrimeDevastatorOrb);
		}

		public void IL_DevastatorUpdate(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			ILCursor val2 = val;
			MoveType val3 = (MoveType)0;
			if (val2.TryGotoNext(val3, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.5f)
			}))
			{
				val.Next.Operand = 0.35f;
				ILCursor val4 = val;
				if (val4.TryGotoNext(val3, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4)
				}))
				{
					val.Next.Operand = 6;
				}
				else
				{
					Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!");
				}
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
		}

		public void OnLeapEnter(orig_OnEnter orig, LunarGazeLeap self)
		{
			orig.Invoke(self);
			if (((EntityState)self).isAuthority)
			{
				if (self.isPlus)
				{
					((MonoBehaviour)((EntityState)self).characterBody).StartCoroutine(FireLeapLightningPlus());
				}
				else
				{
					((MonoBehaviour)((EntityState)self).characterBody).StartCoroutine(FireLeapLightning());
				}
			}
		}

		private IEnumerator FireLeapLightning()
		{
			new List<NodeIndex>();
			List<Vector3> possibleLightningPositions = new List<Vector3>();
			Transform arenaCenter = MeridianEventTriggerInteraction.instance.arenaCenter;
			if (!Object.op_Implicit((Object)(object)SceneInfo.instance) || !Object.op_Implicit((Object)(object)SceneInfo.instance.groundNodes))
			{
				Debug.LogWarning((object)"No ground nodes available");
				yield break;
			}
			NodeGraph nodeGraph = SceneInfo.instance.groundNodes;
			List<NodeIndex> possibleLightningNodes = nodeGraph.FindNodesInRange(arenaCenter.position, 15f, 100f, (HullMask)1);
			Vector3 item = default(Vector3);
			foreach (NodeIndex nodeIndex in possibleLightningNodes)
			{
				if (nodeGraph.GetNodePosition(nodeIndex, ref item))
				{
					possibleLightningPositions.Add(item);
				}
				item = default(Vector3);
			}
			for (int i = 0; i < 40; i++)
			{
				int strikeCount = Random.RandomRangeInt(4, 6);
				for (int j = 1; j < strikeCount; j++)
				{
					int rand = Random.RandomRangeInt(0, possibleLightningPositions.Count);
					Vector3 vector = possibleLightningPositions[rand];
					possibleLightningPositions.RemoveAt(rand);
					Object.Instantiate<GameObject>(LunarGazeExitLeap.lightningPrefab, vector, arenaCenter.rotation).GetComponent<LightningStrikeInstance>().Initialize(vector, _blastInfo, 1.2f, true);
				}
				yield return (object)new WaitForSeconds(0.06f);
			}
		}

		private IEnumerator FireLeapLightningPlus()
		{
			new List<NodeIndex>();
			List<Vector3> possibleLightningPositions = new List<Vector3>();
			Transform arenaCenter = MeridianEventTriggerInteraction.instance.arenaCenter;
			if (!Object.op_Implicit((Object)(object)SceneInfo.instance) || !Object.op_Implicit((Object)(object)SceneInfo.instance.groundNodes))
			{
				Debug.LogWarning((object)"No ground nodes available");
				yield break;
			}
			NodeGraph nodeGraph = SceneInfo.instance.groundNodes;
			List<NodeIndex> possibleLightningNodes = nodeGraph.FindNodesInRange(arenaCenter.position, 15f, 75f, (HullMask)1);
			Vector3 item = default(Vector3);
			foreach (NodeIndex nodeIndex in possibleLightningNodes)
			{
				if (nodeGraph.GetNodePosition(nodeIndex, ref item))
				{
					possibleLightningPositions.Add(item);
				}
				item = default(Vector3);
			}
			for (int i = 0; i < 40; i++)
			{
				int strikeCount = Random.RandomRangeInt(3, 5);
				for (int j = 1; j < strikeCount; j++)
				{
					int rand = Random.RandomRangeInt(0, possibleLightningPositions.Count);
					Vector3 vector = possibleLightningPositions[rand];
					possibleLightningPositions.RemoveAt(rand);
					Object.Instantiate<GameObject>(LunarGazeExitLeap.lightningPrefab, vector, arenaCenter.rotation).GetComponent<LightningStrikeInstance>().Initialize(vector, _blastInfo, 1.2f, true);
				}
				yield return (object)new WaitForSeconds(0.06f);
			}
		}

		private void OnSetupLightning(orig_SetupDefaultBlastInfo orig, LightningStrikeInstance self, ref BlastAttack info)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, ref info);
			DamageAPI.AddModdedDamageType(info, DamageTypes.stormboundLightning);
		}

		public void OnTaintedOfferingEnter(orig_OnEnter orig, TaintedOffering self)
		{
			orig.Invoke(self);
			((EntityState)self).characterBody.SetAimTimer(0.3f);
		}

		public void OnTaintedOfferingUpdate(orig_FixedUpdate orig, TaintedOffering self)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			((GenericProjectileBaseState)self).stopwatch = ((GenericProjectileBaseState)self).stopwatch + ((EntityState)self).GetDeltaTime();
			((EntityState)self).characterDirection.moveVector = ((EntityState)self).inputBank.aimDirection;
			if (((GenericProjectileBaseState)self).stopwatch >= ((GenericProjectileBaseState)self).delayBeforeFiringProjectile && !((GenericProjectileBaseState)self).firedProjectile)
			{
				((GenericProjectileBaseState)self).firedProjectile = true;
				for (int num = 5; num > 0; num--)
				{
					switch (num)
					{
					case 1:
						self.projectileYawBonus = -10f;
						((GenericProjectileBaseState)self).projectilePitchBonus = 0f;
						break;
					case 2:
						self.projectileYawBonus = 10f;
						((GenericProjectileBaseState)self).projectilePitchBonus = 0f;
						break;
					case 3:
						self.projectileYawBonus = 0f;
						((GenericProjectileBaseState)self).projectilePitchBonus = -10f;
						break;
					case 4:
						self.projectileYawBonus = 0f;
						((GenericProjectileBaseState)self).projectilePitchBonus = 10f;
						speedoverride = 35f;
						break;
					case 5:
						self.projectileYawBonus = 0f;
						((GenericProjectileBaseState)self).projectilePitchBonus = 0f;
						chargedStake = true;
						speedoverride = 50f;
						break;
					}
					((GenericProjectileBaseState)self).FireProjectile();
				}
				((GenericProjectileBaseState)self).DoFireEffects();
			}
			if (((GenericProjectileBaseState)self).stopwatch >= ((GenericProjectileBaseState)self).baseDuration && ((EntityState)self).isAuthority)
			{
				((EntityState)self).outer.SetNextStateToMain();
			}
		}

		public void OnTaintedOfferingFire(orig_FireProjectile orig, TaintedOffering self)
		{
			//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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: 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)
			if (((EntityState)self).isAuthority)
			{
				Ray val = ((BaseState)self).GetAimRay();
				val = ((GenericProjectileBaseState)self).ModifyProjectileAimRay(val);
				((Ray)(ref val)).direction = Util.ApplySpread(((Ray)(ref val)).direction, ((GenericProjectileBaseState)self).minSpread, ((GenericProjectileBaseState)self).maxSpread, 1f, 1f, self.projectileYawBonus, ((GenericProjectileBaseState)self).projectilePitchBonus);
				if (chargedStake)
				{
					ProjectileManager.instance.FireProjectileWithoutDamageType(stakePrefab, ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction), ((EntityState)self).gameObject, ((BaseState)self).damageStat * ((GenericProjectileBaseState)self).damageCoefficient, ((GenericProjectileBaseState)self).force, Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, speedoverride);
					chargedStake = false;
				}
				else
				{
					ProjectileManager.instance.FireProjectileWithoutDamageType(((GenericProjectileBaseState)self).projectilePrefab, ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction), ((EntityState)self).gameObject, ((BaseState)self).damageStat * ((GenericProjectileBaseState)self).damageCoefficient, ((GenericProjectileBaseState)self).force, Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, speedoverride);
				}
			}
		}

		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_00b2: 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_00d0: 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)
			ILCursor val = new ILCursor(il);
			ILCursor val2 = val;
			if (val2.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs).GetField("lunarruin"))
			}))
			{
				ILCursor val3 = val;
				if (val3.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);
					});
					ILLabel val4 = val.DefineLabel();
					val.Emit(OpCodes.Br, (object)val4);
					val.Emit(OpCodes.Ldloc, 1);
					ILCursor val5 = val;
					MoveType val6 = (MoveType)2;
					if (val5.TryGotoNext(val6, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DotController>(x, "InflictDot")
					}))
					{
						val.MarkLabel(val4);
					}
					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!");
			}
		}
	}
	public class StormboundPrimeDevastatorOrb : GenericDamageOrb
	{
		public float blastRadius;

		public GameObject lightningEffectPrefab;

		private const float skillDisableTiming = 3f;

		public override void Begin()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			((Orb)this).duration = ((Orb)this).distanceToTarget / 120f;
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/FalseSonBoss/PrimeDevastatorLightningOrbEffect.prefab").WaitForCompletion();
			EffectData val2 = new EffectData
			{
				origin = ((Orb)this).origin,
				genericFloat = ((Orb)this).duration
			};
			val2.SetHurtBoxReference(((Orb)this).target);
			EffectManager.SpawnEffect(val, val2, true);
		}

		public override void OnArrival()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			((GenericDamageOrb)this).OnArrival();
			CharacterBody body = ((Orb)this).target.healthComponent.body;
			body.AddTimedBuff(Buffs.DisableAllSkills, 3f);
			InflictDotInfo val = default(InflictDotInfo);
			val.attackerObject = base.attacker;
			val.victimObject = ((Component)body).gameObject;
			val.dotIndex = FalseSonChanges.devastatorDotIndex;
			val.duration = 420f;
			val.damageMultiplier = 1f;
			InflictDotInfo val2 = val;
			DotController.InflictDot(ref val2);
			EffectManager.SpawnEffect(lightningEffectPrefab, new EffectData
			{
				origin = body.corePosition,
				scale = blastRadius
			}, true);
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}