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 CustomMonsterLevelCap v1.0.0
plugins/CustomMonsterLevelCap/CustomMonsterLevelCap.dll
Decompiled 3 months 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.Configuration; using BepInEx.Logging; using HG.Reflection; using Microsoft.CodeAnalysis; using RoR2; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CustomMonsterLevelCap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+fc42879ecd13b9e392d1c202fc9c9f185f05375d")] [assembly: AssemblyProduct("CustomMonsterLevelCap")] [assembly: AssemblyTitle("CustomMonsterLevelCap")] [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 CustomMonsterLevelCap { internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber) { int num = callerPath.LastIndexOf("CustomMonsterLevelCap"); if (num >= 0) { callerPath = callerPath.Substring(num + "CustomMonsterLevelCap".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } internal static void Debug(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogDebug((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Debug_NoCallerPrefix(object data) { _logSource.LogDebug(data); } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Error_NoCallerPrefix(object data) { _logSource.LogError(data); } internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Fatal_NoCallerPrefix(object data) { _logSource.LogFatal(data); } internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Info_NoCallerPrefix(object data) { _logSource.LogInfo(data); } internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Message_NoCallerPrefix(object data) { _logSource.LogMessage(data); } internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } } [BepInPlugin("ZetaArcade.CustomMonsterLevelCap", "CustomMonsterLevelCap", "1.0.0")] public class Main : BaseUnityPlugin { public const string PluginGUID = "ZetaArcade.CustomMonsterLevelCap"; public const string PluginAuthor = "ZetaArcade"; public const string PluginName = "CustomMonsterLevelCap"; public const string PluginVersion = "1.0.0"; public static AssetBundle assetBundle; public static ConfigEntry<int> NewCap { get; set; } internal static Main Instance { get; private set; } public static string PluginDirectory { get; private set; } public void Awake() { Instance = this; NewCap = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Custom Monster Level Cap", 99, "Overwrites the Ambient Monster Level Cap"); Log.Init(((BaseUnityPlugin)this).Logger); } public void Update() { OverwriteLevelCap(); } private void OverwriteLevelCap() { if (Run.ambientLevelCap != NewCap.Value) { if (NewCap.Value > 0) { Run.ambientLevelCap = NewCap.Value; Log.Info(" Monster level overwritten to: Lvl."?.ToString() + Run.ambientLevelCap, "C:\\Users\\Zeta\\source\\repos\\Ror2\\CustomMonsterLevelCap\\CustomMonsterLevelCap\\Main.cs", "OverwriteLevelCap", 45); } else { Log.Error("Error: Monster Level Cap value is invalid", "C:\\Users\\Zeta\\source\\repos\\Ror2\\CustomMonsterLevelCap\\CustomMonsterLevelCap\\Main.cs", "OverwriteLevelCap", 49); } } } } }