Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ILovePotion v1.0.2
plugins/ILovePotion.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.SceneManagement; [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: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("Yunis")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ILovePotion")] [assembly: AssemblyTitle("ILovePotion")] [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.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 ILovePotion { [HarmonyPatch(typeof(PlayerController))] internal static class ExamplePlayerControllerPatch { [HarmonyPrefix] [HarmonyPatch("Start")] private static void Start_Prefix(PlayerController __instance) { ILovePotion.Logger.LogDebug((object)$"{__instance} Start Prefix"); } [HarmonyPostfix] [HarmonyPatch("Start")] private static void Start_Postfix(PlayerController __instance) { ILovePotion.Logger.LogDebug((object)$"{__instance} Start Postfix"); } } [BepInPlugin("Yunis.ILovePotion", "ILovePotion", "1.0")] public class ILovePotion : BaseUnityPlugin { [CompilerGenerated] private sealed class <DelayedPatch>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ILovePotion <>4__this; private GameObject <lovePotionPrefab>5__1; private List<Level>.Enumerator <>s__2; private Level <level>5__3; private List<LevelValuables>.Enumerator <>s__4; private LevelValuables <preset>5__5; private List<Level>.Enumerator <>s__6; private Level <level>5__7; private List<LevelValuables>.Enumerator <>s__8; private LevelValuables <preset>5__9; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayedPatch>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <lovePotionPrefab>5__1 = null; <>s__2 = default(List<Level>.Enumerator); <level>5__3 = null; <>s__4 = default(List<LevelValuables>.Enumerator); <preset>5__5 = null; <>s__6 = default(List<Level>.Enumerator); <level>5__7 = null; <>s__8 = default(List<LevelValuables>.Enumerator); <preset>5__9 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)RunManager.instance == (Object)null || RunManager.instance.levels == null) { <>2__current = null; <>1__state = 1; return true; } <lovePotionPrefab>5__1 = null; <>s__2 = RunManager.instance.levels.GetEnumerator(); try { while (<>s__2.MoveNext()) { <level>5__3 = <>s__2.Current; <>s__4 = <level>5__3.ValuablePresets.GetEnumerator(); try { while (<>s__4.MoveNext()) { <preset>5__5 = <>s__4.Current; if (((Object)<preset>5__5).name != null && ((Object)<preset>5__5).name.Contains("Wizard", StringComparison.OrdinalIgnoreCase)) { <lovePotionPrefab>5__1 = ((IEnumerable<GameObject>)<preset>5__5.small).FirstOrDefault((Func<GameObject, bool>)((GameObject obj) => (Object)(object)obj != (Object)null && (Object)(object)obj.GetComponent<ValuableLovePotion>() != (Object)null)); if ((Object)(object)<lovePotionPrefab>5__1 != (Object)null) { Logger.LogInfo((object)("Found ValuableLovePotion prefab in preset '" + ((Object)<preset>5__5).name + "' from level '" + ((Object)<level>5__3).name + "'" + ((Object)<lovePotionPrefab>5__1).name + ".")); break; } } <preset>5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>s__4 = default(List<LevelValuables>.Enumerator); if ((Object)(object)<lovePotionPrefab>5__1 != (Object)null) { break; } <level>5__3 = null; } } finally { ((IDisposable)<>s__2).Dispose(); } <>s__2 = default(List<Level>.Enumerator); if ((Object)(object)<lovePotionPrefab>5__1 == (Object)null) { Logger.LogWarning((object)"ValuableLovePotion prefab not found."); return false; } <>s__6 = RunManager.instance.levels.GetEnumerator(); try { while (<>s__6.MoveNext()) { <level>5__7 = <>s__6.Current; <>s__8 = <level>5__7.ValuablePresets.GetEnumerator(); try { while (<>s__8.MoveNext()) { <preset>5__9 = <>s__8.Current; if (<preset>5__9.small != null && !<preset>5__9.small.Contains(<lovePotionPrefab>5__1)) { <preset>5__9.small.Add(<lovePotionPrefab>5__1); Logger.LogInfo((object)("Added ValuableLovePotion to small list in preset '" + ((Object)<preset>5__9).name + "' of level '" + ((Object)<level>5__7).name + "'.")); } <preset>5__9 = null; } } finally { ((IDisposable)<>s__8).Dispose(); } <>s__8 = default(List<LevelValuables>.Enumerator); <level>5__7 = null; } } finally { ((IDisposable)<>s__6).Dispose(); } <>s__6 = default(List<Level>.Enumerator); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static ILovePotion Instance { get; private set; } internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; SceneManager.sceneLoaded += OnSceneLoaded; ((MonoBehaviour)this).StartCoroutine(DelayedPatch()); Logger.LogInfo((object)"ILovePotion loaded."); } [IteratorStateMachine(typeof(<DelayedPatch>d__9))] private IEnumerator DelayedPatch() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayedPatch>d__9(0) { <>4__this = this }; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { ((MonoBehaviour)this).StartCoroutine(DelayedPatch()); } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; } } }