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 Huntdown Addon v1.2.0
plugins/HuntdownAddon/HuntdownAddon.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.ComponentModel; 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.Configuration; using BepInEx.Logging; using Huntdown; using Microsoft.CodeAnalysis; using UnityEngine; [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: AssemblyCompany("HuntdownAddon")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Yeah :D")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyInformationalVersion("1.2.0+e26360f7c96fa668bb8320c512c7b0f93350c8c4")] [assembly: AssemblyProduct("HuntdownAddon")] [assembly: AssemblyTitle("HuntdownAddon")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.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 HuntdownAddon { public static class ConfigSettings { private enum ConfigSections { [Description("1: Toggle Missions")] Toggle, [Description("2: Mission Weights")] Weight, [Description("3: Mission Rewards")] Reward } public enum ConfigIndexes { ToggleBaboonHawk, ToggleDuo, ToggleDen, ToggleOutbreak, ToggleHorde, WeightBaboonHawk, WeightDuo, WeightDen, WeightOutbreak, WeightHorde, RewardStupid } public static readonly ConfigurableSetting[] AllConfigSettings = (ConfigurableSetting[])(object)new ConfigurableSetting[11] { new ConfigurableSetting { Index = ConfigIndexes.ToggleBaboonHawk, Section = ConfigSections.Toggle.GetDescription(), Key = "Lone Baboon Hawk Mission Enabled", DefaultValue = false, Description = new ConfigDescription("Whether a Lone Baboon Hawk can be assigned as the hunt target target or not", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleDuo, Section = ConfigSections.Toggle.GetDescription(), Key = "Dynamic Duo Mission Enabled", DefaultValue = true, Description = new ConfigDescription("Whether a Dynamic Duo can be assigned as the hunt target target or not", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleDen, Section = ConfigSections.Toggle.GetDescription(), Key = "Monstrous Den Mission Enabled", DefaultValue = false, Description = new ConfigDescription("Whether a Monstrous Den can be assigned as the hunt target target or not", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleOutbreak, Section = ConfigSections.Toggle.GetDescription(), Key = "Mask Outbreak Mission Enabled", DefaultValue = true, Description = new ConfigDescription("Whether a Mask Outbreak can be assigned as the hunt target target or not", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.ToggleHorde, Section = ConfigSections.Toggle.GetDescription(), Key = "Left 4 Dead 2 Mission Enabled", DefaultValue = true, Description = new ConfigDescription("Whether a Massive Horde can be assigned as the hunt target target or not", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightBaboonHawk, Section = ConfigSections.Weight.GetDescription(), Key = "Lone Baboon Hawk Mission Weight", DefaultValue = 70, Description = new ConfigDescription("Higher value = more likely. The likelihood that a Lone Baboon Hawk will be the target.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightDuo, Section = ConfigSections.Weight.GetDescription(), Key = "Dynamic Duo Mission Weight", DefaultValue = 30, Description = new ConfigDescription("Higher value = more likely. The likelihood that a Dynamic Duo will be the target.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightDen, Section = ConfigSections.Weight.GetDescription(), Key = "Monstrous Den Mission Weight", DefaultValue = 20, Description = new ConfigDescription("Higher value = more likely. The likelihood that a Monstrous Den will be the target.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightOutbreak, Section = ConfigSections.Weight.GetDescription(), Key = "Mask Outbreak Mission Weight", DefaultValue = 6, Description = new ConfigDescription("Higher value = more likely. The likelihood that a Mask Outbreak will be the target.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.WeightHorde, Section = ConfigSections.Weight.GetDescription(), Key = "Left 4 Dead 2 Mission Weight", DefaultValue = 2, Description = new ConfigDescription("Higher value = more likely. The likelihood that a Massive Horde will be the target.", (AcceptableValueBase)null, Array.Empty<object>()) }, new ConfigurableSetting { Index = ConfigIndexes.RewardStupid, Section = ConfigSections.Reward.GetDescription(), Key = "Stupid Mission Reward", DefaultValue = 500, Description = new ConfigDescription("How much the scrap dropped from a stupid mission is worth (Left 4 Dead 2).", (AcceptableValueBase)null, Array.Empty<object>()) } }; public static ConfigEntryBase[] ConfigEntries = (ConfigEntryBase[])(object)new ConfigEntryBase[AllConfigSettings.Length]; private static string GetDescription(this Enum value) { FieldInfo field = value.GetType().GetField(value.ToString()); if (field.GetCustomAttributes(typeof(DescriptionAttribute), inherit: false) is DescriptionAttribute[] source && source.Any()) { return source.First().Description; } return value.ToString(); } public static void BindConfigSettings() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < AllConfigSettings.Length; i++) { HuntdownAddon._logger.LogInfo((object)$"[{i}] Binding - {AllConfigSettings[i].Key}"); BindAnyObject(AllConfigSettings[i], i); } } private static void BindAnyObject(ConfigurableSetting setting, int index) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (setting.DefaultValue is int || setting.DefaultValue is Enum) { ConfigEntryBase[] configEntries = ConfigEntries; string section = setting.Section; string key = setting.Key; int defaultValue = (int)setting.DefaultValue; ConfigDescription description = setting.Description; configEntries[index] = (ConfigEntryBase)(object)Bind(section, key, defaultValue, (description != null) ? description.Description : null); } else if (setting.DefaultValue is bool) { ConfigEntryBase[] configEntries2 = ConfigEntries; string section2 = setting.Section; string key2 = setting.Key; bool defaultValue2 = (bool)setting.DefaultValue; ConfigDescription description2 = setting.Description; configEntries2[index] = (ConfigEntryBase)(object)Bind(section2, key2, defaultValue2, (description2 != null) ? description2.Description : null); } } private static ConfigEntry<T> Bind<T>(string section, string key, T DefaultValue, string Description = null) { return ((BaseUnityPlugin)HuntdownAddon._instance).Config.Bind<T>(section, key, DefaultValue, Description); } } [BepInPlugin("HuntdownAddon", "HuntdownAddon", "1.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class HuntdownAddon : BaseUnityPlugin { public static HuntdownAddon _instance; public static RewardPool StupidRewardPool; public static ManualLogSource _logger; private void Awake() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { _instance = this; } _logger = ((BaseUnityPlugin)this).Logger; ConfigSettings.BindConfigSettings(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin HuntdownAddon is loaded!"); StoredItem[] storedItems = Huntdown._storedItems; StoredItem[] array = (StoredItem[])(object)new StoredItem[2] { storedItems[25], storedItems[49] }; int num = (int)ConfigSettings.ConfigEntries[10].BoxedValue; StupidRewardPool = new RewardPool(array, num); RewardPool[] possibleRewardPools = Huntdown._possibleRewardPools; Dictionary<EnemyKey, int> spawnDictionary = new Dictionary<EnemyKey, int> { { (EnemyKey)10, 1 } }; AddHunt(spawnDictionary, "Lone Baboon Hawk", (int)ConfigSettings.ConfigEntries[5].BoxedValue, possibleRewardPools[0], (bool)ConfigSettings.ConfigEntries[0].BoxedValue); Dictionary<EnemyKey, int> spawnDictionary2 = new Dictionary<EnemyKey, int> { { (EnemyKey)4, 1 }, { (EnemyKey)1, 1 } }; AddHunt(spawnDictionary2, "Dynamic Duo", (int)ConfigSettings.ConfigEntries[6].BoxedValue, possibleRewardPools[2], (bool)ConfigSettings.ConfigEntries[1].BoxedValue); Dictionary<EnemyKey, int> spawnDictionary3 = new Dictionary<EnemyKey, int> { { (EnemyKey)1, 2 }, { (EnemyKey)2, 2 } }; AddHunt(spawnDictionary3, "Monstrous Den", (int)ConfigSettings.ConfigEntries[7].BoxedValue, possibleRewardPools[2], (bool)ConfigSettings.ConfigEntries[2].BoxedValue); Dictionary<EnemyKey, int> spawnDictionary4 = new Dictionary<EnemyKey, int> { { (EnemyKey)6, 8 } }; AddHunt(spawnDictionary4, "Mask Outbreak", (int)ConfigSettings.ConfigEntries[8].BoxedValue, possibleRewardPools[5], (bool)ConfigSettings.ConfigEntries[3].BoxedValue); Dictionary<EnemyKey, int> spawnDictionary5 = new Dictionary<EnemyKey, int> { { (EnemyKey)6, 15 } }; AddHunt(spawnDictionary5, "Left 4 Dead 2", (int)ConfigSettings.ConfigEntries[9].BoxedValue, StupidRewardPool, (bool)ConfigSettings.ConfigEntries[4].BoxedValue); } public void AddHunt(Dictionary<EnemyKey, int> spawnDictionary, string name, int weight, RewardPool rewards, bool enabled = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown Array.Resize(ref Huntdown._possibleMissions, Huntdown._possibleMissions.Length + 1); Huntdown._possibleMissions[Huntdown._possibleMissions.Length - 1] = new Mission(name, weight, spawnDictionary, enabled, rewards); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Added " + (enabled ? "enabled" : "disabled") + " additional hunt '{name}' with a weight of {weight}.")); } } public static class PluginInfo { public const string PLUGIN_GUID = "HuntdownAddon"; public const string PLUGIN_NAME = "HuntdownAddon"; public const string PLUGIN_VERSION = "1.2.0"; } }