Decompiled source of PataponMeditate v1.0.0

PataponMeditate/PataponMeditate.dll

Decompiled 4 hours 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.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Seeker;
using IL.EntityStates.Seeker;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Seeker;
using On.RoR2;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PataponMeditate")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PataponMeditate")]
[assembly: AssemblyTitle("PataponMeditate")]
[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 PataponMeditate
{
	internal static class DebugLog
	{
		private static ManualLogSource _logger;

		internal static void Init(ManualLogSource logger)
		{
			_logger = logger;
		}

		internal static void Log(object data)
		{
			_logger.LogInfo(data);
		}
	}
	[BepInPlugin("RigsInRags.PataponMeditate", "PataponMeditate", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class PataponMeditate : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_UpdateUIInputSequence <>9__13_2;

			public static Manipulator <>9__13_3;

			internal void <Awake>b__13_2(orig_UpdateUIInputSequence orig, MeditationUI self)
			{
			}

			internal void <Awake>b__13_3(ILContext il)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: 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_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: 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_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: 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)
				ILCursor val = new ILCursor(il);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldstr, "");
				val.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "inputCorrectSoundString"));
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldstr, "");
				val.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "inputFailSoundString"));
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldstr, "");
				val.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "successSoundString"));
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldstr, "");
				val.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "timeoutSoundString"));
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldstr, "");
				val.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "startSoundString"));
			}
		}

		public const string P_GUID = "RigsInRags.PataponMeditate";

		public const string P_Author = "RigsInRags";

		public const string P_Name = "PataponMeditate";

		public const string P_Version = "1.0.0";

		public static AssetBundle MainAssets;

		private PataponAnimator pataponAnimator;

		private GameObject wormFace;

		private float beatLifeTime;

		private int perfectBeats;

		private static string[] backdropString = new string[5] { "InputBackDrop1", "InputBackDrop2", "InputBackDrop", "InputBackDrop1 (3)", "InputBackDrop1 (2)" };

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

		public void Awake()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			DebugLog.Init(((BaseUnityPlugin)this).Logger);
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PataponMeditate.patassets"))
			{
				MainAssets = AssetBundle.LoadFromStream(stream);
			}
			EnablePerfectBeatBonusDamage = ((BaseUnityPlugin)this).Config.Bind<bool>("Bonus Damage on Perfect Beat", "EnablePerfectBeatDamage", false, "Toggle to increase Meditate's AOE base damage by +50% if every input was a perfect beat.");
			if (RiskOfOptionsCompatibility.enabled)
			{
				RiskOfOptionsCompatibility.SetupRiskOfOptionsConfigs();
			}
			MeditationUI.SetupInputUIIcons += (hook_SetupInputUIIcons)delegate(orig_SetupInputUIIcons orig, MeditationUI self)
			{
				//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0202: Unknown result type (might be due to invalid IL or missing references)
				//IL_024f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_012a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0177: Unknown result type (might be due to invalid IL or missing references)
				Color color = default(Color);
				for (int i = 0; i < 5; i++)
				{
					switch (self.seekerController.meditationStepAndSequence[i + 1])
					{
					case 0:
						((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("Chaka");
						break;
					case 1:
						((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("Don");
						break;
					case 2:
						((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("Pon");
						break;
					case 3:
						((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("Pata");
						break;
					}
					RectTransform component3 = ((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<RectTransform>();
					((Transform)component3).localScale = ((Transform)component3).localScale * 1.75f;
					((Graphic)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>()).color = Color.white;
					Image component4 = ((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i]).parent.Find(backdropString[i])).GetComponent<Image>();
					((Color)(ref color))..ctor(0f, 0f, 0f, 0f);
					((Graphic)component4).color = color;
				}
				((Graphic)((Component)self.overlayInstanceChildLocator.FindChild("MeditationBarTimer").parent.Find("BackgroundWhite")).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0f);
				((Graphic)((Component)self.overlayInstanceChildLocator.FindChild("MeditationBarTimer").parent.Find("BackgroundBlack")).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0f);
				Image component5 = ((Component)self.overlayInstanceChildLocator.FindChild("MeditationBarTimer")).GetComponent<Image>();
				((Component)component5).GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("Worm2");
				((Component)component5).transform.rotation = Quaternion.Euler(0f, 180f, 0f);
				wormFace = Object.Instantiate<GameObject>(MainAssets.LoadAsset<GameObject>("WormFace"), self.overlayInstanceChildLocator.FindChild("MeditationBarTimer").parent);
				wormFace.transform.localPosition = new Vector3(-505f, 0f, 0f);
				if (!Object.op_Implicit((Object)(object)pataponAnimator))
				{
					pataponAnimator = ((EntityState)self).gameObject.AddComponent<PataponAnimator>();
				}
				((MonoBehaviour)pataponAnimator).StartCoroutine(MoveWormHead(105f, wormFace.GetComponent<RectTransform>()));
				if (EnablePerfectBeatBonusDamage.Value)
				{
					self.damageCoefficient = 5f;
				}
				self.UpdateUIInputSequence();
			};
			MeditationUI.Update += (hook_Update)delegate(orig_Update orig, MeditationUI self)
			{
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0486: Unknown result type (might be due to invalid IL or missing references)
				//IL_049a: Unknown result type (might be due to invalid IL or missing references)
				//IL_049f: Unknown result type (might be due to invalid IL or missing references)
				if (perfectBeats > 0)
				{
					beatLifeTime += Time.deltaTime;
				}
				sbyte meditationInputStep = self.seekerController.meditationInputStep;
				orig.Invoke(self);
				if (meditationInputStep != self.seekerController.meditationInputStep)
				{
					RectTransform component = ((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[meditationInputStep])).GetComponent<RectTransform>();
					((Transform)component).localScale = ((Transform)component).localScale * 0.8f;
					if (!Object.op_Implicit((Object)(object)pataponAnimator))
					{
						pataponAnimator = ((EntityState)self).gameObject.AddComponent<PataponAnimator>();
					}
					((MonoBehaviour)pataponAnimator).StartCoroutine(NotesFlyAndDisappear(2f, self.overlayInstanceChildLocator.FindChild(MeditationUI.c[meditationInputStep])));
					if (perfectBeats == 0)
					{
						perfectBeats++;
						switch (((Object)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[meditationInputStep])).GetComponent<Image>().sprite).name)
						{
						case "Pata":
							Util.PlaySound("Pata", ((EntityState)self).gameObject);
							break;
						case "Pon":
							Util.PlaySound("Pon", ((EntityState)self).gameObject);
							break;
						case "Chaka":
							Util.PlaySound("Chaka", ((EntityState)self).gameObject);
							break;
						case "Don":
							Util.PlaySound("Don", ((EntityState)self).gameObject);
							break;
						}
					}
					else if (perfectBeats > 0 && beatLifeTime > 0.425f && beatLifeTime < 0.575f)
					{
						perfectBeats++;
						switch (((Object)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[meditationInputStep])).GetComponent<Image>().sprite).name)
						{
						case "Pata":
							Util.PlaySound("Pata", ((EntityState)self).gameObject);
							break;
						case "Pon":
							Util.PlaySound("Pon", ((EntityState)self).gameObject);
							break;
						case "Chaka":
							Util.PlaySound("Chaka", ((EntityState)self).gameObject);
							break;
						case "Don":
							Util.PlaySound("Don", ((EntityState)self).gameObject);
							break;
						}
					}
					else
					{
						perfectBeats = 1;
						switch (((Object)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[meditationInputStep])).GetComponent<Image>().sprite).name)
						{
						case "Pata":
							Util.PlaySound("PataMiss", ((EntityState)self).gameObject);
							break;
						case "Pon":
							Util.PlaySound("PonMiss", ((EntityState)self).gameObject);
							break;
						case "Chaka":
							Util.PlaySound("ChakaMiss", ((EntityState)self).gameObject);
							break;
						case "Don":
							Util.PlaySound("DonMiss", ((EntityState)self).gameObject);
							break;
						}
					}
					beatLifeTime = 0f;
					if (perfectBeats >= 5)
					{
						if (EnablePerfectBeatBonusDamage.Value)
						{
							self.damageCoefficient = 7.5f;
						}
						switch (((Object)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[meditationInputStep])).GetComponent<Image>().sprite).name)
						{
						case "Pata":
						case "Chaka":
							Util.PlaySound("PataChakaSheen", ((EntityState)self).gameObject);
							break;
						case "Pon":
						case "Don":
							Util.PlaySound("PonDonSheen", ((EntityState)self).gameObject);
							break;
						}
					}
					if (perfectBeats >= 2)
					{
						wormFace.GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("WormFaceC" + perfectBeats);
					}
					else
					{
						wormFace.GetComponent<Image>().sprite = MainAssets.LoadAsset<Sprite>("WormFace");
					}
				}
				else if (((meditationInputStep == self.seekerController.meditationInputStep && ((ButtonState)(ref ((EntityState)self).inputBank.rawMoveDown)).justPressed) || ((ButtonState)(ref ((EntityState)self).inputBank.rawMoveUp)).justPressed || ((ButtonState)(ref ((EntityState)self).inputBank.rawMoveLeft)).justPressed || ((ButtonState)(ref ((EntityState)self).inputBank.rawMoveRight)).justPressed) && Object.op_Implicit((Object)(object)wormFace))
				{
					RectTransform component2 = wormFace.GetComponent<RectTransform>();
					((Transform)component2).localPosition = ((Transform)component2).localPosition + new Vector3(105f, 0f, 0f);
				}
			};
			object obj = <>c.<>9__13_2;
			if (obj == null)
			{
				hook_UpdateUIInputSequence val = delegate
				{
				};
				<>c.<>9__13_2 = val;
				obj = (object)val;
			}
			MeditationUI.UpdateUIInputSequence += (hook_UpdateUIInputSequence)obj;
			object obj2 = <>c.<>9__13_3;
			if (obj2 == null)
			{
				Manipulator val2 = delegate(ILContext il)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					//IL_0013: Unknown result type (might be due to invalid IL or missing references)
					//IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0044: Unknown result type (might be due to invalid IL or missing references)
					//IL_004f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					//IL_0060: Unknown result type (might be due to invalid IL or missing references)
					//IL_0061: Unknown result type (might be due to invalid IL or missing references)
					//IL_0080: 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_008c: Unknown result type (might be due to invalid IL or missing references)
					//IL_008d: Unknown result type (might be due to invalid IL or missing references)
					//IL_009d: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
					//IL_00be: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ca: 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_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
					//IL_0106: Unknown result type (might be due to invalid IL or missing references)
					//IL_0107: 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)
					ILCursor val3 = new ILCursor(il);
					val3.Emit(OpCodes.Ldarg_0);
					val3.Emit(OpCodes.Ldstr, "");
					val3.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "inputCorrectSoundString"));
					val3.Emit(OpCodes.Ldarg_0);
					val3.Emit(OpCodes.Ldstr, "");
					val3.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "inputFailSoundString"));
					val3.Emit(OpCodes.Ldarg_0);
					val3.Emit(OpCodes.Ldstr, "");
					val3.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "successSoundString"));
					val3.Emit(OpCodes.Ldarg_0);
					val3.Emit(OpCodes.Ldstr, "");
					val3.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "timeoutSoundString"));
					val3.Emit(OpCodes.Ldarg_0);
					val3.Emit(OpCodes.Ldstr, "");
					val3.Emit(OpCodes.Stfld, Reflection.GetFieldCached(typeof(MeditationUI), "startSoundString"));
				};
				<>c.<>9__13_3 = val2;
				obj2 = (object)val2;
			}
			MeditationUI.OnEnter += (Manipulator)obj2;
			SeekerController.RandomizeMeditationInputs += (hook_RandomizeMeditationInputs)delegate(orig_RandomizeMeditationInputs orig, SeekerController self)
			{
				List<sbyte[]> list = new List<sbyte[]>
				{
					new sbyte[4] { 3, 3, 3, 2 },
					new sbyte[4] { 2, 2, 3, 2 },
					new sbyte[4] { 0, 0, 3, 2 },
					new sbyte[4] { 2, 2, 0, 0 },
					new sbyte[4] { 1, 1, 0, 0 },
					new sbyte[4] { 2, 3, 2, 3 },
					new sbyte[4] { 3, 2, 1, 0 },
					new sbyte[4] { 0, 3, 0, 3 }
				};
				sbyte[] array = new sbyte[6]
				{
					0,
					(sbyte)Random.Range(0, 4),
					0,
					0,
					0,
					0
				};
				list[Random.Range(0, list.Count)].CopyTo(array, 2);
				self.meditationStepAndSequence = array;
				self.CallCmdUpdateMeditationInput(self.meditationStepAndSequence);
				perfectBeats = 0;
				beatLifeTime = 0f;
			};
		}

		public IEnumerator NotesFlyAndDisappear(float duration, Transform note)
		{
			float timeElapsed = 0f;
			float xMove = 0f;
			float yMove = 0f;
			Color invisColour = new Color(1f, 1f, 1f, 0f);
			switch (((Object)((Component)note).GetComponent<Image>().sprite).name)
			{
			case "Pata":
				xMove = Random.Range(-300f, -100f);
				yMove = Random.Range(-50f, 200f);
				break;
			case "Pon":
				xMove = Random.Range(100f, 300f);
				yMove = Random.Range(-50f, 200f);
				break;
			case "Chaka":
				xMove = Random.Range(-100f, 100f);
				yMove = Random.Range(200f, 350f);
				break;
			case "Don":
				xMove = Random.Range(-150f, 150f);
				yMove = Random.Range(50f, 150f);
				break;
			default:
				DebugLog.Log("Invalid sprite name: " + ((Object)((Component)note).GetComponent<Image>().sprite).name);
				break;
			}
			RectTransform rect = ((Component)note).GetComponent<RectTransform>();
			Vector3 finalScale = ((Transform)rect).localScale * 3f;
			while (timeElapsed < duration)
			{
				timeElapsed += Time.deltaTime;
				if (!Object.op_Implicit((Object)(object)rect))
				{
					break;
				}
				rect.anchoredPosition += new Vector2(xMove * Time.deltaTime, yMove * Time.deltaTime);
				((Transform)rect).localScale = Vector3.Lerp(note.localScale, finalScale, timeElapsed / duration);
				((Graphic)((Component)note).GetComponent<Image>()).color = Color.Lerp(((Graphic)((Component)note).GetComponent<Image>()).color, invisColour, timeElapsed / duration);
				yield return null;
			}
		}

		public IEnumerator MoveWormHead(float moveSpeed, RectTransform wormHead, float duration = 5f)
		{
			float timeElapsed = 0f;
			while (timeElapsed < duration && Object.op_Implicit((Object)(object)wormHead))
			{
				timeElapsed += Time.deltaTime;
				wormHead.anchoredPosition += new Vector2(moveSpeed * Time.deltaTime, 0f);
				yield return null;
			}
		}
	}
	public class PataponAnimator : MonoBehaviour
	{
		private static PataponAnimator _instance;

		public static PataponAnimator instance
		{
			get
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)_instance))
				{
					_instance = new GameObject("PataponAnimator").AddComponent<PataponAnimator>();
				}
				return _instance;
			}
		}
	}
	internal class RiskOfOptionsCompatibility
	{
		public static bool enabled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetupRiskOfOptionsConfigs()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			ModSettingsManager.SetModDescription("Visually and audibly adjusts Seeker's Meditate skill to be Patapon-themed.", "RigsInRags.PataponMeditate", "Patapon Meditate");
			ModSettingsManager.SetModIcon(PataponMeditate.MainAssets.LoadAsset<Sprite>("modIcon.png"));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(PataponMeditate.EnablePerfectBeatBonusDamage));
		}
	}
}