Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of EarlyT2Elites v1.0.0
plugins/EarlyT2Elites/EarlyT2Elites.dll
Decompiled 6 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 On.RoR2; using R2API; using RoR2; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EarlyT2Elites")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+77911de85f58eb906740d7c3c4b0356c792b9e94")] [assembly: AssemblyProduct("EarlyT2Elites")] [assembly: AssemblyTitle("EarlyT2Elites")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.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 EarlyT2Elites { 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("EarlyT2Elites"); if (num >= 0) { callerPath = callerPath.Substring(num + "EarlyT2Elites".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } 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("Nuxlar.EarlyT2Elites", "EarlyT2Elites", "1.0.0")] public class Main : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_Init <0>__TweakT2s; } public const string PluginGUID = "Nuxlar.EarlyT2Elites"; public const string PluginAuthor = "Nuxlar"; public const string PluginName = "EarlyT2Elites"; public const string PluginVersion = "1.0.0"; public static ConfigEntry<int> minStages; public static ConfigEntry<float> healthCoeff; public static ConfigEntry<float> damageCoeff; public static ConfigEntry<float> costCoeff; internal static Main Instance { get; private set; } public static string PluginDirectory { get; private set; } private static ConfigFile ETEConfig { get; set; } public void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //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_00d4: Expected O, but got Unknown Instance = this; Stopwatch stopwatch = Stopwatch.StartNew(); Log.Init(((BaseUnityPlugin)this).Logger); ETEConfig = new ConfigFile(Paths.ConfigPath + "\\com.Nuxlar.EarlyT2Elites.cfg", true); minStages = ETEConfig.Bind<int>("General", "Minimum Stages", 4, "Which stage should Tier 2 elites start spawning? Vanilla 6."); healthCoeff = ETEConfig.Bind<float>("General", "Health Coefficient", 12f, "Health multiplier for Tier 2 elites. Vanilla 16."); damageCoeff = ETEConfig.Bind<float>("General", "Damage Coefficient", 4f, "Damage multiplier for Tier 2 elites. Vanilla 6."); costCoeff = ETEConfig.Bind<float>("General", "Cost Coefficient", 24f, "Cost for Tier 2 elites to spawn. Vanilla 36."); object obj = <>O.<0>__TweakT2s; if (obj == null) { hook_Init val = TweakT2s; <>O.<0>__TweakT2s = val; obj = (object)val; } CombatDirector.Init += (hook_Init)obj; stopwatch.Stop(); Log.Info_NoCallerPrefix($"EarlyT2Elites: Initialized in {stopwatch.Elapsed.TotalSeconds:F2} seconds"); } private static void TweakT2s(orig_Init orig) { orig.Invoke(); EliteTierDef val = EliteAPI.VanillaEliteTiers[5]; if (minStages.Value != 6) { val.isAvailable = (EliteRules eliteRules) => Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount >= minStages.Value - 1; } val.costMultiplier = costCoeff.Value; EliteDef[] eliteTypes = val.eliteTypes; foreach (EliteDef val2 in eliteTypes) { if ((Object)(object)val2 != (Object)null) { val2.healthBoostCoefficient = healthCoeff.Value; val2.damageBoostCoefficient = damageCoeff.Value; } } } } }