Decompiled source of GojoSpells v1.0.0

BepInEx/plugins/GojoSpells/MageArena_GojoSpells.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using BlackMagicAPI.Managers;
using BlackMagicAPI.Modules.Spells;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MageArena_GojoSpells")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MageArena_GojoSpells")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e4457a8b-7c85-4479-8907-f8c239dc6743")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 MageArena_GojoSpells
{
	[BepInPlugin("com.rezarg.magearena.gojospells", "Gojo Spells", "1.0.0")]
	[BepInProcess("MageArena.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class GojoSpells : BaseUnityPlugin
	{
		public const string NAME = "Gojo Spells";

		public const string GUID = "com.rezarg.magearena.gojospells";

		public const string VERSION = "1.0.0";

		public static readonly string modsync = "all";

		public static ManualLogSource? Logger;

		public static AssetBundle? SpellAssets;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			SpellAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, "Resources", "assets"));
			Logger.LogInfo((object)("Loaded AssetBundle: " + string.Join(", ", SpellAssets.GetAllAssetNames())));
			BlackMagicManager.RegisterSpell((BaseUnityPlugin)(object)this, typeof(RedData), typeof(RedLogic));
			BlackMagicManager.RegisterSpell((BaseUnityPlugin)(object)this, typeof(BlueData), typeof(BlueLogic));
			BlackMagicManager.RegisterSpell((BaseUnityPlugin)(object)this, typeof(PurpleData), typeof(PurpleLogic));
			BlackMagicManager.RegisterSpell((BaseUnityPlugin)(object)this, typeof(DomainExpansionData), typeof(DomainExpansionLogic));
			BlackMagicManager.RegisterDeathIcon((BaseUnityPlugin)(object)this, "gojo", "death_icon");
			Logger.LogInfo((object)"Cookies");
			BlackMagicManager.RegisterCraftingRecipe((BaseUnityPlugin)(object)this, typeof(RedLogic), typeof(BlueLogic), typeof(PurpleLogic));
			Logger.LogInfo((object)"Plugin Gojo Spells (com.rezarg.magearena.gojospells) v1.0.0 initialized!");
		}
	}
	internal class BlueData : SpellData
	{
		public override string Name => "Blue";

		public override float Cooldown => 15f;

		public override Color GlowColor => Color.blue;

		public override bool CanSpawnInColoseum => true;

		public override bool CanSpawnInTeamChest => true;

		public override bool DebugForceSpawn => true;
	}
	internal class BlueLogic : SpellLogic
	{
		[CompilerGenerated]
		private sealed class <CoAnimate>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public BlueLogic <>4__this;

			private float <value>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//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_0063: 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_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Expected O, but got Unknown
				int num = <>1__state;
				BlueLogic blueLogic = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					if (<value>5__2 >= 0.5f)
					{
						goto IL_00a6;
					}
				}
				else
				{
					<>1__state = -1;
					<value>5__2 = 0f;
				}
				if (!((Object)(object)blueLogic.magicBall == (Object)null))
				{
					<value>5__2 += Time.deltaTime;
					blueLogic.magicBall.transform.localScale = Vector3.Lerp(Vector3.zero, Vector3.one * 5f, <value>5__2 / 0.5f);
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				goto IL_00a6;
				IL_00a6:
				return false;
			}

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

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

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

			private object <>2__current;

			public BlueLogic <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Expected O, but got Unknown
				int num = <>1__state;
				BlueLogic blueLogic = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Object.Destroy((Object)(object)blueLogic.magicBall);
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public GameObject playerObj;

			public BlueLogic <>4__this;

			public PlayerMovement pm;

			private Camera <camera>5__2;

			private GameObject[] <allPlayers>5__3;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<camera>5__2 = null;
				<allPlayers>5__3 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_005d: 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_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: 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_01c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Expected O, but got Unknown
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_0139: 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_019c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_01af: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				BlueLogic blueLogic = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<camera>5__2 = playerObj.GetComponentInChildren<Camera>();
					<allPlayers>5__3 = GameObject.FindGameObjectsWithTag("Player");
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if ((Object)(object)blueLogic.magicBall != (Object)null)
				{
					blueLogic.magicBall.transform.position = Vector3.Lerp(blueLogic.magicBall.transform.position, ((Component)<camera>5__2).transform.position + ((Component)<camera>5__2).transform.forward * 9f, 4f * Time.deltaTime);
					blueLogic.magicBall.transform.Rotate(Vector3.up, 100f * Time.deltaTime);
					for (int i = 0; i < <allPlayers>5__3.Length; i++)
					{
						GameObject val = <allPlayers>5__3[i];
						if ((Object)(object)val == (Object)(object)playerObj)
						{
							continue;
						}
						float num2 = Vector3.Distance(val.transform.position, blueLogic.magicBall.transform.position);
						if (!(num2 > 15f))
						{
							Vector3 val2 = val.transform.position - blueLogic.magicBall.transform.position;
							Vector3 normalized = ((Vector3)(ref val2)).normalized;
							float num3 = 15f * (1f - num2 / 15f);
							PlayerMovement component = val.GetComponent<PlayerMovement>();
							if (!((Object)(object)component == (Object)null))
							{
								component.DamagePlayer(Time.deltaTime * 5f, playerObj, "gojo");
								component.ShakeCam(num3 / 15f, 0.1f);
								component.velocity -= normalized * num3;
							}
						}
					}
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				pm.canMove = true;
				return false;
			}

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

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

		private GameObject magicBall;

		public override void CastSpell(GameObject playerObj, PageController page, Vector3 spawnPos, Vector3 viewDirectionVector, int castingLevel)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			AssetBundle? spellAssets = GojoSpells.SpellAssets;
			GameObject val = ((spellAssets != null) ? spellAssets.LoadAsset<GameObject>("BlueBall") : null);
			magicBall = Object.Instantiate<GameObject>(val, spawnPos, Quaternion.identity);
			((MonoBehaviour)this).StartCoroutine(CoAnimate());
			((MonoBehaviour)this).StartCoroutine(CoUpdate(playerObj, playerObj.GetComponent<PlayerMovement>()));
			((MonoBehaviour)this).StartCoroutine(CoDespawn());
		}

		[IteratorStateMachine(typeof(<CoDespawn>d__2))]
		private IEnumerator CoDespawn()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoDespawn>d__2(0)
			{
				<>4__this = this
			};
		}

		[IteratorStateMachine(typeof(<CoAnimate>d__3))]
		private IEnumerator CoAnimate()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoAnimate>d__3(0)
			{
				<>4__this = this
			};
		}

		[IteratorStateMachine(typeof(<CoUpdate>d__4))]
		private IEnumerator CoUpdate(GameObject playerObj, PlayerMovement pm)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoUpdate>d__4(0)
			{
				<>4__this = this,
				playerObj = playerObj,
				pm = pm
			};
		}
	}
	internal class DomainExpansionData : SpellData
	{
		public override string Name => "Domain Expansion";

		public override float Cooldown => 120f;

		public override Color GlowColor => Color.black;

		public override bool CanSpawnInColoseum => true;

		public override bool CanSpawnInTeamChest => true;

		public override bool DebugForceSpawn => true;

		public override string[] SubNames => new string[4] { "Domain", "Void", "Infinite Void", "Unlimited Void" };
	}
	internal class DomainExpansionLogic : SpellLogic
	{
		[CompilerGenerated]
		private sealed class <CoCast>d__2 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public DomainExpansionLogic <>4__this;

			public PlayerMovement pm;

			public GameObject playerObj;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Expected O, but got Unknown
				int num = <>1__state;
				DomainExpansionLogic domainExpansionLogic = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((MonoBehaviour)domainExpansionLogic).StartCoroutine(domainExpansionLogic.CoRotate());
					<>2__current = (object)new WaitForSeconds(30f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					Object.Destroy((Object)(object)domainExpansionLogic.domain);
					PlayerMovement obj = pm;
					obj.level -= 5;
					playerObj.GetComponentInChildren<PlayerInteract>().leveluptxt("Your domain has closed.");
					playerObj.GetComponentInChildren<PlayerInteract>().SetLevelNum(pm.level);
					pm.portalSource.PlayOneShot(pm.levelup);
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public DomainExpansionLogic <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002b: 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_004b: Expected O, but got Unknown
				int num = <>1__state;
				DomainExpansionLogic domainExpansionLogic = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if ((Object)(object)domainExpansionLogic.domain != (Object)null)
				{
					domainExpansionLogic.domain.transform.Rotate(Vector3.up, 30f * Time.deltaTime);
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				return false;
			}

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

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

		private GameObject domain;

		public override void CastSpell(GameObject playerObj, PageController page, Vector3 spawnPos, Vector3 viewDirectionVector, int castingLevel)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			AssetBundle? spellAssets = GojoSpells.SpellAssets;
			GameObject val = ((spellAssets != null) ? spellAssets.LoadAsset<GameObject>("VoidDomain") : null);
			domain = Object.Instantiate<GameObject>(val, spawnPos, Quaternion.identity);
			domain.transform.localScale = new Vector3(3f, 3f, 3f);
			domain.layer = LayerMask.NameToLayer("Ground");
			PlayerMovement component = playerObj.GetComponent<PlayerMovement>();
			component.level += 5;
			playerObj.GetComponentInChildren<PlayerInteract>().leveluptxt("Your inate domain empowers you...");
			playerObj.GetComponentInChildren<PlayerInteract>().SetLevelNum(component.level);
			component.portalSource.PlayOneShot(component.levelup);
			((MonoBehaviour)this).StartCoroutine(CoCast(playerObj, component));
		}

		[IteratorStateMachine(typeof(<CoCast>d__2))]
		private IEnumerator CoCast(GameObject playerObj, PlayerMovement pm)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoCast>d__2(0)
			{
				<>4__this = this,
				playerObj = playerObj,
				pm = pm
			};
		}

		[IteratorStateMachine(typeof(<CoRotate>d__3))]
		private IEnumerator CoRotate()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoRotate>d__3(0)
			{
				<>4__this = this
			};
		}
	}
	internal class PurpleData : SpellData
	{
		public override string Name => "Purple";

		public override float Cooldown => 75f;

		public override Color GlowColor => new Color(0.4392157f, 10f / 51f, 73f / 85f);

		public override bool CanSpawnInColoseum => true;

		public override bool CanSpawnInTeamChest => false;

		public override string[] SubNames => new string[1] { "Hollow Purple" };
	}
	internal class PurpleLogic : SpellLogic
	{
		[CompilerGenerated]
		private sealed class <CoCast>d__4 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public GameObject playerObj;

			public PurpleLogic <>4__this;

			private float <alpha>5__2;

			private GameObject[] <allPlayers>5__3;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0060: 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_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_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: 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_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Unknown result type (might be due to invalid IL or missing references)
				//IL_0147: Unknown result type (might be due to invalid IL or missing references)
				//IL_015d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0167: Expected O, but got Unknown
				//IL_0222: Unknown result type (might be due to invalid IL or missing references)
				//IL_0232: 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_0241: Unknown result type (might be due to invalid IL or missing references)
				//IL_0251: Unknown result type (might be due to invalid IL or missing references)
				//IL_025b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0260: Unknown result type (might be due to invalid IL or missing references)
				//IL_0265: Unknown result type (might be due to invalid IL or missing references)
				//IL_027d: Unknown result type (might be due to invalid IL or missing references)
				//IL_029d: Unknown result type (might be due to invalid IL or missing references)
				//IL_037d: Unknown result type (might be due to invalid IL or missing references)
				//IL_038d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0397: Unknown result type (might be due to invalid IL or missing references)
				//IL_039c: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f1: 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_01db: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0320: Unknown result type (might be due to invalid IL or missing references)
				//IL_032a: Expected O, but got Unknown
				//IL_0424: Unknown result type (might be due to invalid IL or missing references)
				//IL_0434: Unknown result type (might be due to invalid IL or missing references)
				//IL_0489: Unknown result type (might be due to invalid IL or missing references)
				//IL_0493: Expected O, but got Unknown
				//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				PurpleLogic purpleLogic = <>4__this;
				AssetBundle? spellAssets;
				GameObject val2;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<alpha>5__2 = 0f;
					goto IL_0177;
				case 1:
					<>1__state = -1;
					goto IL_0177;
				case 2:
					<>1__state = -1;
					goto IL_033a;
				case 3:
					{
						<>1__state = -1;
						break;
					}
					IL_0177:
					if (<alpha>5__2 < 1f)
					{
						<alpha>5__2 += Time.deltaTime / 2f;
						Vector3 val = playerObj.transform.position + playerObj.transform.forward * 10f + playerObj.transform.up * 3f;
						purpleLogic.redBall.transform.position = Vector3.Lerp(val + playerObj.transform.right * -2f, val, <alpha>5__2);
						purpleLogic.redBall.transform.Rotate(Vector3.up, 150f * Time.deltaTime);
						purpleLogic.blueBall.transform.position = Vector3.Lerp(val + playerObj.transform.right * 2f, val, <alpha>5__2);
						purpleLogic.blueBall.transform.Rotate(Vector3.up, -150f * Time.deltaTime);
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					Object.Destroy((Object)(object)purpleLogic.redBall);
					Object.Destroy((Object)(object)purpleLogic.blueBall);
					<allPlayers>5__3 = GameObject.FindGameObjectsWithTag("Player");
					spellAssets = GojoSpells.SpellAssets;
					val2 = ((spellAssets != null) ? spellAssets.LoadAsset<GameObject>("PurpleBall") : null);
					purpleLogic.purpleBall = Object.Instantiate<GameObject>(val2);
					purpleLogic.purpleBall.transform.localScale = Vector3.one * 1.5f;
					<alpha>5__2 = 0f;
					goto IL_033a;
					IL_033a:
					if (<alpha>5__2 < 1f)
					{
						<alpha>5__2 += Time.deltaTime / 1.75f;
						Vector3 position = playerObj.transform.position + playerObj.transform.forward * 10f + playerObj.transform.up * 3f;
						purpleLogic.purpleBall.transform.Rotate(playerObj.transform.forward, 250f * Time.deltaTime);
						purpleLogic.purpleBall.transform.position = position;
						for (int i = 0; i < <allPlayers>5__3.Length; i++)
						{
							GameObject val3 = <allPlayers>5__3[i];
							if (!(Vector3.Distance(val3.transform.position, playerObj.transform.position) > 25f))
							{
								PlayerMovement component = val3.GetComponent<PlayerMovement>();
								if (!((Object)(object)component == (Object)null))
								{
									component.ShakeCam(0.5f + <alpha>5__2 / 2f, 0.2f);
								}
							}
						}
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 2;
						return true;
					}
					<alpha>5__2 = 0f;
					break;
				}
				if (<alpha>5__2 < 1f)
				{
					<alpha>5__2 += Time.deltaTime / 0.65f;
					Vector3 position2 = playerObj.transform.position + playerObj.transform.forward * 10f + playerObj.transform.up * 3f;
					purpleLogic.purpleBall.transform.localScale = Vector3.Lerp(Vector3.one * 1.5f, Vector3.one * 1.2f, <alpha>5__2);
					purpleLogic.purpleBall.transform.position = position2;
					for (int j = 0; j < <allPlayers>5__3.Length; j++)
					{
						GameObject val4 = <allPlayers>5__3[j];
						if (!(Vector3.Distance(val4.transform.position, playerObj.transform.position) > 25f))
						{
							PlayerMovement component2 = val4.GetComponent<PlayerMovement>();
							if (!((Object)(object)component2 == (Object)null))
							{
								component2.ShakeCam(0.65f + <alpha>5__2 / 2.5f, 0.2f);
							}
						}
					}
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 3;
					return true;
				}
				Object.Destroy((Object)(object)purpleLogic.purpleBall);
				for (int k = 0; k < <allPlayers>5__3.Length; k++)
				{
					GameObject val5 = <allPlayers>5__3[k];
					if (!((Object)(object)val5 == (Object)(object)playerObj) && !(Vector3.Distance(val5.transform.position, playerObj.transform.position) > 25f))
					{
						((MonoBehaviour)purpleLogic).StartCoroutine(purpleLogic.CoFlashbang(playerObj, val5));
					}
				}
				return false;
			}

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

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

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

			private object <>2__current;

			public GameObject playerObj;

			public GameObject sauce;

			private Camera <cam>5__2;

			private PlayerMovement <pm>5__3;

			private GameObject <flashbang>5__4;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<cam>5__2 = null;
				<pm>5__3 = null;
				<flashbang>5__4 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Expected O, but got Unknown
				AssetBundle? spellAssets;
				GameObject val;
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<cam>5__2 = playerObj.GetComponentInChildren<Camera>();
					if ((Object)(object)<cam>5__2 == (Object)null)
					{
						<>2__current = null;
						<>1__state = 1;
						return true;
					}
					goto IL_005c;
				case 1:
					<>1__state = -1;
					goto IL_005c;
				case 2:
					<>1__state = -1;
					goto IL_0092;
				case 3:
					{
						<>1__state = -1;
						Object.Destroy((Object)(object)<flashbang>5__4);
						return false;
					}
					IL_0092:
					spellAssets = GojoSpells.SpellAssets;
					val = ((spellAssets != null) ? spellAssets.LoadAsset<GameObject>("Flashbang") : null);
					<flashbang>5__4 = Object.Instantiate<GameObject>(val, ((Component)<cam>5__2).transform);
					<pm>5__3.DamagePlayer(100f, sauce, "gojo");
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 3;
					return true;
					IL_005c:
					<pm>5__3 = playerObj.GetComponent<PlayerMovement>();
					if ((Object)(object)<pm>5__3 == (Object)null)
					{
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
					goto IL_0092;
				}
			}

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

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

		private GameObject redBall;

		private GameObject blueBall;

		private GameObject purpleBall;

		public override void CastSpell(GameObject playerObj, PageController page, Vector3 spawnPos, Vector3 viewDirectionVector, int castingLevel)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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)
			AssetBundle? spellAssets = GojoSpells.SpellAssets;
			GameObject val = ((spellAssets != null) ? spellAssets.LoadAsset<GameObject>("RedBall") : null);
			AssetBundle? spellAssets2 = GojoSpells.SpellAssets;
			GameObject val2 = ((spellAssets2 != null) ? spellAssets2.LoadAsset<GameObject>("BlueBall") : null);
			redBall = Object.Instantiate<GameObject>(val);
			redBall.transform.localScale = Vector3.one * 1.5f;
			blueBall = Object.Instantiate<GameObject>(val2);
			blueBall.transform.localScale = Vector3.one * 1.5f;
			((MonoBehaviour)this).StartCoroutine(CoCast(playerObj));
		}

		[IteratorStateMachine(typeof(<CoCast>d__4))]
		private IEnumerator CoCast(GameObject playerObj)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoCast>d__4(0)
			{
				<>4__this = this,
				playerObj = playerObj
			};
		}

		[IteratorStateMachine(typeof(<CoFlashbang>d__5))]
		private IEnumerator CoFlashbang(GameObject sauce, GameObject playerObj)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoFlashbang>d__5(0)
			{
				sauce = sauce,
				playerObj = playerObj
			};
		}
	}
	internal class RedData : SpellData
	{
		public override string Name => "Red";

		public override float Cooldown => 15f;

		public override Color GlowColor => Color.red;

		public override bool CanSpawnInColoseum => true;

		public override bool CanSpawnInTeamChest => true;

		public override bool DebugForceSpawn => true;
	}
	internal class RedLogic : SpellLogic
	{
		[CompilerGenerated]
		private sealed class <CoAnimate1>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public RedLogic <>4__this;

			private float <value>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//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_0063: 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_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Expected O, but got Unknown
				int num = <>1__state;
				RedLogic redLogic = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					if (<value>5__2 >= 0.1f)
					{
						goto IL_00a6;
					}
				}
				else
				{
					<>1__state = -1;
					<value>5__2 = 0f;
				}
				if (!((Object)(object)redLogic.magicBall == (Object)null))
				{
					<value>5__2 += Time.deltaTime;
					redLogic.magicBall.transform.localScale = Vector3.Lerp(Vector3.zero, Vector3.one * 0.1f, <value>5__2 / 0.1f);
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				goto IL_00a6;
				IL_00a6:
				((MonoBehaviour)redLogic).StartCoroutine(redLogic.CoAnimate2());
				return false;
			}

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

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

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

			private object <>2__current;

			public RedLogic <>4__this;

			private float <value>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0054: 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_0063: 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_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Expected O, but got Unknown
				int num = <>1__state;
				RedLogic redLogic = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					if (<value>5__2 >= 0.1f)
					{
						goto IL_00a6;
					}
				}
				else
				{
					<>1__state = -1;
					<value>5__2 = 0f;
				}
				if (!((Object)(object)redLogic.magicBall == (Object)null))
				{
					<value>5__2 += Time.deltaTime;
					redLogic.magicBall.transform.localScale = Vector3.Lerp(Vector3.one * 0.1f, Vector3.zero, <value>5__2 / 0.1f);
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				goto IL_00a6;
				IL_00a6:
				Object.Destroy((Object)(object)redLogic.magicBall);
				return false;
			}

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

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

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

			private object <>2__current;

			public RedLogic <>4__this;

			public GameObject playerObj;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Expected O, but got Unknown
				//IL_008a: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_013f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0149: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				RedLogic redLogic = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					GojoSpells.Logger.LogInfo((object)"Tacos");
					((MonoBehaviour)redLogic).StartCoroutine(redLogic.CoAnimate1());
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
					foreach (GameObject val in array)
					{
						if ((Object)(object)val == (Object)(object)playerObj)
						{
							continue;
						}
						float num2 = Vector3.Distance(val.transform.position, redLogic.magicBall.transform.position);
						if (!(num2 > 10f))
						{
							Vector3 val2 = val.transform.position - redLogic.magicBall.transform.position;
							Vector3 normalized = ((Vector3)(ref val2)).normalized;
							float num3 = 10f * (1f - num2 / 10f);
							PlayerMovement component = val.GetComponent<PlayerMovement>();
							if (!((Object)(object)component == (Object)null))
							{
								component.DamagePlayer(10f, playerObj, "gojo");
								component.ShakeCam(num3 / 10f, 0.2f);
								component.MushroomJump();
								component.velocity = normalized * num3 * 40f;
								component.velocity.y = 30f;
							}
						}
					}
					return false;
				}
				}
			}

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

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

		private GameObject magicBall;

		public override void CastSpell(GameObject playerObj, PageController page, Vector3 spawnPos, Vector3 viewDirectionVector, int castingLevel)
		{
			//IL_0019: 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_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_0034: Unknown result type (might be due to invalid IL or missing references)
			AssetBundle? spellAssets = GojoSpells.SpellAssets;
			GameObject val = ((spellAssets != null) ? spellAssets.LoadAsset<GameObject>("RedBall") : null);
			magicBall = Object.Instantiate<GameObject>(val, spawnPos - playerObj.transform.right * 0.18f, Quaternion.identity);
			((MonoBehaviour)this).StartCoroutine(CoCast(playerObj));
		}

		[IteratorStateMachine(typeof(<CoCast>d__2))]
		private IEnumerator CoCast(GameObject playerObj)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoCast>d__2(0)
			{
				<>4__this = this,
				playerObj = playerObj
			};
		}

		[IteratorStateMachine(typeof(<CoAnimate1>d__3))]
		private IEnumerator CoAnimate1()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoAnimate1>d__3(0)
			{
				<>4__this = this
			};
		}

		[IteratorStateMachine(typeof(<CoAnimate2>d__4))]
		private IEnumerator CoAnimate2()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CoAnimate2>d__4(0)
			{
				<>4__this = this
			};
		}
	}
}