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 SurePotential v1.0.0
plugins\TeflonTed.SurePotential.dll
Decompiled 19 hours agousing System; 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 HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("assembly_guiutils")] [assembly: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("TeflonTed.SurePotential")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Teflon Ted's Sure Potential — Forge of Potential upgrades always succeed")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+aa3557958a7656958068f9c07e5ebb364e91eab7")] [assembly: AssemblyProduct("TeflonTed.SurePotential")] [assembly: AssemblyTitle("TeflonTed.SurePotential")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 TeflonTed.SurePotential { [BepInPlugin("com.teflonted.valheim.surepotential", "Teflon Ted's Sure Potential", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "com.teflonted.valheim.surepotential"; public const string PluginName = "Teflon Ted's Sure Potential"; public const string PluginVersion = "1.0.0"; private void Awake() { Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.teflonted.valheim.surepotential"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Teflon Ted's Sure Potential 1.0.0 loaded"); } internal static void ApplySurefire(ObjectDB db) { if (db?.m_items == null) { return; } int num = 0; foreach (GameObject item in db.m_items) { SharedData val = (((Object)(object)item != (Object)null) ? item.GetComponent<ItemDrop>() : null)?.m_itemData?.m_shared; if (val != null && (!(val.m_upgradeChance <= 0f) || !(val.m_breakChance <= 0f)) && (!(val.m_upgradeChance >= 1f) || !(val.m_breakChance <= 0f))) { val.m_upgradeChance = 1f; val.m_breakChance = 0f; num++; } } if (num > 0) { Logger.CreateLogSource("Teflon Ted's Sure Potential").LogInfo((object)$"Forced 100% upgrade success on {num} idol/upgrader item(s)"); } } } [HarmonyPatch(typeof(ObjectDB), "Awake")] internal static class ObjectDB_Awake_Patch { private static void Postfix(ObjectDB __instance) { Plugin.ApplySurefire(__instance); } } [HarmonyPatch(typeof(ObjectDB), "CopyOtherDB")] internal static class ObjectDB_CopyOtherDB_Patch { private static void Postfix(ObjectDB __instance) { Plugin.ApplySurefire(__instance); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }