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 LaserScopeCritChance v1.0.3
plugins/LaserScopeCritChance/LaserScopeCritChance.dll
Decompiled 5 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using R2API; using R2API.Utils; using RoR2; [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("quasikyo")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.3.0")] [assembly: AssemblyInformationalVersion("1.0.3+d6c4e0c83c8b138b944e8e96fbd83ba91c8c77cf")] [assembly: AssemblyProduct("LaserScopeCritChance")] [assembly: AssemblyTitle("LaserScopeCritChance")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/quasikyo/ror2-mods/tree/main/LaserScopeCritChance")] [assembly: AssemblyVersion("1.0.0.0")] namespace LaserScopeCritChance; [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("quasikyo.LaserScopeCritChance", "LaserScopeCritChance", "1.0.3")] public class LaserScopeCritChance : BaseUnityPlugin { private const string laserScopeInternalName = "CritDamage"; private ItemIndex LaserScopeItemIndex { get; set; } public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); Run.onRunStartGlobal += delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown LaserScopeItemIndex = ItemCatalog.FindItemIndex("CritDamage"); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AddLaserScopeCritChance); }; Run.onRunDestroyGlobal += delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(AddLaserScopeCritChance); }; } private void AddLaserScopeCritChance(CharacterBody body, StatHookEventArgs args) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) int? obj; if (body == null) { obj = null; } else { Inventory inventory = body.inventory; obj = ((inventory != null) ? new int?(inventory.GetItemCountEffective(LaserScopeItemIndex)) : null); } int? num = obj; if (num.GetValueOrDefault() > 0) { args.critAdd += 5f; } } } internal static class Log { private static ManualLogSource Logger { get; set; } internal static void Init(ManualLogSource logger) { Logger = logger; } [Conditional("DEBUG")] internal static void Debug(object data) { Logger.LogDebug(data); } internal static void Info(object data) { Logger.LogInfo(data); } internal static void Message(object data) { Logger.LogMessage(data); } internal static void Warning(object data) { Logger.LogWarning(data); } internal static void Error(object data) { Logger.LogError(data); } internal static void Fatal(object data) { Logger.LogFatal(data); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "quasikyo.LaserScopeCritChance"; public const string PLUGIN_NAME = "LaserScopeCritChance"; public const string PLUGIN_VERSION = "1.0.3"; }