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 UsualScrap v2.1.1
UsualScrap.dll
Decompiled 3 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using Dawn; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; using UsualScrap.Behaviors; using UsualScrap.Behaviors.Effects; using UsualScrap.NetcodePatcher; using UsualScrap.Patches; [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("UsualScrap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Adds many new unique items that expand on the available scrap items and interactions!")] [assembly: AssemblyFileVersion("2.1.0.0")] [assembly: AssemblyInformationalVersion("2.1.0")] [assembly: AssemblyProduct("UsualScrap")] [assembly: AssemblyTitle("UsualScrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 UsualScrap { [BepInPlugin("Emil.UsualScrap", "UsualScrap", "2.0.9")] public class Plugin : BaseUnityPlugin { public static class ScrapPackKeys { public static NamespacedKey<DawnItemInfo> US_PocketWatch = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Pocket_Watch"); public static NamespacedKey<DawnItemInfo> US_ServantBell = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Servant_Bell"); public static NamespacedKey<DawnItemInfo> US_ChessPieces = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Chess_Pieces"); public static NamespacedKey<DawnItemInfo> US_GoldenChessPieces = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Golden_Chess_Pieces"); public static NamespacedKey<DawnItemInfo> US_TrafficCone = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Traffic_Cone"); public static NamespacedKey<DawnItemInfo> US_MereGear = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Mere_Gear"); } public static class ScrapItemKeys { public static NamespacedKey<DawnItemInfo> US_Ticket = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Ticket"); public static NamespacedKey<DawnItemInfo> US_GoldenTicket = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Golden_Ticket"); public static NamespacedKey<DawnItemInfo> US_Rose = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Rose"); public static NamespacedKey<DawnItemInfo> US_SizableScissors = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Sizable_Scissors"); public static NamespacedKey<DawnItemInfo> US_WalkingCane = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Walking_Cane"); public static NamespacedKey<DawnItemInfo> US_GumballMachine = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Gumball_Machine"); public static NamespacedKey<DawnItemInfo> US_Gumball = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Gumball"); public static NamespacedKey<DawnItemInfo> US_FuelCylinder = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Fuel_Cylinder"); public static NamespacedKey<DawnItemInfo> US_RadioactiveCell = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Radioactive_Cell"); public static NamespacedKey<DawnItemInfo> US_GloomyCapsule = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Gloomy_Capsule"); public static NamespacedKey<DawnItemInfo> US_FrigidCapsule = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Frigid_Capsule"); public static NamespacedKey<DawnItemInfo> US_BloodyCapsule = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Bloody_Capsule"); public static NamespacedKey<DawnItemInfo> US_Padlock = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Padlock"); public static NamespacedKey<DawnItemInfo> US_Crowbar = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Crowbar"); public static NamespacedKey<DawnItemInfo> US_FireAxe = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Fire_Axe"); public static NamespacedKey<DawnItemInfo> US_Sledgehammer = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Sledgehammer"); public static NamespacedKey<DawnItemInfo> US_AntiqueSword = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_AntiqueSword"); public static NamespacedKey<DawnItemInfo> US_RegalScepter = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_RegalScepter"); } public static class StoreItemKeys { public static NamespacedKey<DawnItemInfo> US_HandLamp = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Hand_Lamp"); public static NamespacedKey<DawnItemInfo> US_Bandages = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Bandages"); public static NamespacedKey<DawnItemInfo> US_MedicalKit = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Medical_Kit"); public static NamespacedKey<DawnItemInfo> US_Defibrillator = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Defibrillator"); public static NamespacedKey<DawnItemInfo> US_ProductivityAutoinjector = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Productivity_Autoinjector"); public static NamespacedKey<DawnItemInfo> US_ShiftController = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Shift_Controller"); public static NamespacedKey<DawnItemInfo> US_Blowtorch = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Blowtorch"); public static NamespacedKey<DawnItemInfo> US_Padlock = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Store_Padlock"); public static NamespacedKey<DawnItemInfo> US_Crowbar = NamespacedKey<DawnItemInfo>.From("Usual_Scrap", "US_Store_Crowbar"); } public static class EffectLoader { private static AssetBundle assetBundle; private static readonly Dictionary<string, GameObject> loadedEffects = new Dictionary<string, GameObject>(); public static void Initialize(AssetBundle bundle) { assetBundle = bundle; } public static GameObject Get(string path) { if (!loadedEffects.TryGetValue(path, out var value)) { value = assetBundle.LoadAsset<GameObject>(path); if ((Object)(object)value == (Object)null) { Debug.LogError((object)("USUAL SCRAP - Failed to load effect: " + path)); return null; } loadedEffects[path] = value; } return value; } } public const string PLUGIN_GUID = "Emil.UsualScrap"; public const string PLUGIN_NAME = "UsualScrap"; public const string PLUGIN_VERSION = "2.0.9"; public static Plugin instance; private List<KeyValuePair<NamespacedKey<DawnMoonInfo>, DawnMoonInfo>> FinalMoons = new List<KeyValuePair<NamespacedKey<DawnMoonInfo>, DawnMoonInfo>>(); private List<string> FinalMoonNames = new List<string>(); internal static UsualScrapConfigs BoundConfig { get; private set; } public void InitializeItem(GrabbableObject itemScript, bool grabbable, bool grabbableToEnemies, Item itemProperties) { DawnLib.RegisterNetworkPrefab(itemProperties.spawnPrefab); Utilities.FixMixerGroups(itemProperties.spawnPrefab); itemScript.grabbable = grabbable; itemScript.grabbableToEnemies = grabbableToEnemies; itemScript.itemProperties = itemProperties; } public void Awake() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } List<Item> list = new List<Item>(); instance = this; BoundConfig = new UsualScrapConfigs(((BaseUnityPlugin)this).Config); new UsualScrapConfigs(((BaseUnityPlugin)this).Config); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "usualscrapassetbundle")); EffectLoader.Initialize(val); try { if (BoundConfig.HandlampLoaded.Value) { Item val2 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/HandlampAssets/US_HandlampItem.asset"); list.Add(val2); TerminalNode US_HandlampNode = val.LoadAsset<TerminalNode>("Assets/Items/HandlampAssets/US_HandlampNode.asset"); HandlampScript itemScript = val2.spawnPrefab.AddComponent<HandlampScript>(); InitializeItem((GrabbableObject)(object)itemScript, grabbable: true, grabbableToEnemies: true, val2); if (BoundConfig.HandlampIsStoreItem.Value && BoundConfig.HandlampStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_HandLamp, val2, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.HandlampStorePrice.Value).OverrideInfoNode(US_HandlampNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Handlamp experienced an error while loading. Skipping..."); } try { if (BoundConfig.BandagesLoaded.Value) { Item val3 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/BandagesAssets/US_BandagesItem.asset"); list.Add(val3); TerminalNode US_BandagesNode = val.LoadAsset<TerminalNode>("Assets/Items/BandagesAssets/US_BandagesNode.asset"); BandagesScript itemScript2 = val3.spawnPrefab.AddComponent<BandagesScript>(); InitializeItem((GrabbableObject)(object)itemScript2, grabbable: true, grabbableToEnemies: true, val3); if (BoundConfig.BandagesIsStoreItem.Value && BoundConfig.BandagesStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Bandages, val3, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.BandagesStorePrice.Value).OverrideInfoNode(US_BandagesNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Bandages experienced an error while loading. Skipping..."); } try { if (BoundConfig.MedicalKitLoaded.Value) { Item val4 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/MedicalKitAssets/US_MedicalKitItem.asset"); list.Add(val4); TerminalNode US_MedicalKitNode = val.LoadAsset<TerminalNode>("Assets/Items/MedicalKitAssets/US_MedicalKitNode.asset"); MedicalKitScript itemScript3 = val4.spawnPrefab.AddComponent<MedicalKitScript>(); InitializeItem((GrabbableObject)(object)itemScript3, grabbable: true, grabbableToEnemies: true, val4); if (BoundConfig.MedicalKitIsStoreItem.Value && BoundConfig.MedicalKitStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_MedicalKit, val4, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.MedicalKitStorePrice.Value).OverrideInfoNode(US_MedicalKitNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Medical Kit experienced an error while loading. Skipping..."); } try { if (BoundConfig.DefibrillatorLoaded.Value) { Item val5 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/DefibrillatorAssets/US_DefibrillatorItem.asset"); list.Add(val5); TerminalNode US_DefibrillatorNode = val.LoadAsset<TerminalNode>("Assets/Items/DefibrillatorAssets/US_DefibrillatorNode.asset"); DefibrillatorScript itemScript4 = val5.spawnPrefab.AddComponent<DefibrillatorScript>(); InitializeItem((GrabbableObject)(object)itemScript4, grabbable: true, grabbableToEnemies: true, val5); if (BoundConfig.DefibrillatorIsStoreItem.Value && BoundConfig.DefibrillatorStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Defibrillator, val5, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.DefibrillatorStorePrice.Value).OverrideInfoNode(US_DefibrillatorNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Defibrillator experienced an error while loading. Skipping..."); } try { if (BoundConfig.ProductivityAutoinjectorLoaded.Value) { Item val6 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/ProductivityAutoinjectorAssets/US_ProductivityAutoinjectorItem.asset"); list.Add(val6); TerminalNode US_ProductivityAutoinjectorNode = val.LoadAsset<TerminalNode>("Assets/Items/ProductivityAutoinjectorAssets/US_ProductivityAutoinjectorNode.asset"); ProductivityAutoinjectorScript itemScript5 = val6.spawnPrefab.AddComponent<ProductivityAutoinjectorScript>(); InitializeItem((GrabbableObject)(object)itemScript5, grabbable: true, grabbableToEnemies: true, val6); if (BoundConfig.ProductivityAutoinjectorIsStoreItem.Value && BoundConfig.ProductivityAutoinjectorStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_ProductivityAutoinjector, val6, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.ProductivityAutoinjectorStorePrice.Value).OverrideInfoNode(US_ProductivityAutoinjectorNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Productivity Autoinjector experienced an error while loading. Skipping..."); } try { if (BoundConfig.BlowtorchLoaded.Value) { Item val7 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/BlowtorchAssets/US_BlowtorchItem.asset"); list.Add(val7); TerminalNode US_BlowtorchNode = val.LoadAsset<TerminalNode>("Assets/Items/BlowtorchAssets/US_BlowtorchNode.asset"); RedoneBlowtorch itemScript6 = val7.spawnPrefab.AddComponent<RedoneBlowtorch>(); InitializeItem((GrabbableObject)(object)itemScript6, grabbable: true, grabbableToEnemies: true, val7); if (BoundConfig.BlowtorchIsStoreItem.Value && BoundConfig.BlowtorchStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Blowtorch, val7, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.BlowtorchStorePrice.Value).OverrideInfoNode(US_BlowtorchNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Blowtorch experienced an error while loading. Skipping..."); } try { if (BoundConfig.ShiftControllerLoaded.Value) { Item val8 = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/ShiftControllerAssets/US_ShiftControllerItem.asset"); list.Add(val8); TerminalNode US_ShiftControllerNode = val.LoadAsset<TerminalNode>("Assets/Items/ShiftControllerAssets/US_ShiftControllerNode.asset"); ShiftControllerScript itemScript7 = val8.spawnPrefab.AddComponent<ShiftControllerScript>(); InitializeItem((GrabbableObject)(object)itemScript7, grabbable: true, grabbableToEnemies: true, val8); if (BoundConfig.ShiftControllerIsStoreItem.Value && BoundConfig.ShiftControllerStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_ShiftController, val8, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.ShiftControllerStorePrice.Value).OverrideInfoNode(US_ShiftControllerNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Shift Controller experienced an error while loading. Skipping..."); } Item US_Ticket = null; Item US_GoldenTicket = null; Item US_Rose = null; Item US_SizableScissors = null; Item US_WalkingCane = null; Item US_GumballMachine = null; Item US_Gumball = null; Item US_FuelCylinder = null; Item US_RadioactiveCell = null; Item US_GloomyCapsule = null; Item US_FrigidCapsule = null; Item US_BloodyCapsule = null; Item US_Padlock = null; Item US_Crowbar = null; Item US_FireAxe = null; Item US_Sledgehammer = null; Item US_AntiqueSword = null; Item US_RegalScepter = null; Item US_PocketWatch = null; Item US_ServantBell = null; Item US_ChessPieces = null; Item US_GoldenChessPieces = null; Item US_TrafficCone = null; Item US_MereGear = null; ((Registry<DawnMoonInfo>)(object)LethalContent.Moons).BeforeFreeze += DetectMoons; ((Registry<DawnMoonInfo>)(object)LethalContent.Moons).BeforeFreeze += SetWeights; if (BoundConfig.TicketLoaded.Value) { try { US_Ticket = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/TicketAssets/US_TicketItem.asset"); list.Add(US_Ticket); TicketScript itemScript8 = US_Ticket.spawnPrefab.AddComponent<TicketScript>(); InitializeItem((GrabbableObject)(object)itemScript8, grabbable: true, grabbableToEnemies: true, US_Ticket); } catch { Debug.LogError((object)"USUAL SCRAP - Ticket experienced an error while loading. Skipping..."); } } if (BoundConfig.GoldenTicketLoaded.Value) { try { US_GoldenTicket = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/GoldenTicketAssets/US_GoldenTicketItem.asset"); list.Add(US_GoldenTicket); GoldenTicketScript itemScript9 = US_GoldenTicket.spawnPrefab.AddComponent<GoldenTicketScript>(); InitializeItem((GrabbableObject)(object)itemScript9, grabbable: true, grabbableToEnemies: true, US_GoldenTicket); } catch { Debug.LogError((object)"USUAL SCRAP - Golden Ticket experienced an error while loading. Skipping..."); } } if (BoundConfig.RoseLoaded.Value) { try { US_Rose = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/RoseAssets/US_RoseItem.asset"); list.Add(US_Rose); RoseScript itemScript10 = US_Rose.spawnPrefab.AddComponent<RoseScript>(); InitializeItem((GrabbableObject)(object)itemScript10, grabbable: true, grabbableToEnemies: true, US_Rose); } catch { Debug.LogError((object)"USUAL SCRAP - Rose experienced an error while loading. Skipping..."); } } if (BoundConfig.SizableScissorsLoaded.Value) { try { US_SizableScissors = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/SizableScissorsAssets/US_SizableScissorsItem.asset"); list.Add(US_SizableScissors); SizableScissorsScript itemScript11 = US_SizableScissors.spawnPrefab.AddComponent<SizableScissorsScript>(); InitializeItem((GrabbableObject)(object)itemScript11, grabbable: true, grabbableToEnemies: true, US_SizableScissors); } catch { Debug.LogError((object)"USUAL SCRAP - Scissors experienced an error while loading. Skipping..."); } } if (BoundConfig.WalkingCaneLoaded.Value) { try { US_WalkingCane = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/WalkingCaneAssets/US_WalkingCaneItem.asset"); list.Add(US_WalkingCane); WalkingCaneScript itemScript12 = US_WalkingCane.spawnPrefab.AddComponent<WalkingCaneScript>(); InitializeItem((GrabbableObject)(object)itemScript12, grabbable: true, grabbableToEnemies: true, US_WalkingCane); } catch { Debug.LogError((object)"USUAL SCRAP - Walking Cane experienced an error while loading. Skipping..."); } } if (BoundConfig.GumballMachineLoaded.Value) { try { US_GumballMachine = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/GumballMachineAssets/US_GumballMachineItem.asset"); list.Add(US_GumballMachine); GumballMachineScript itemScript13 = US_GumballMachine.spawnPrefab.AddComponent<GumballMachineScript>(); InitializeItem((GrabbableObject)(object)itemScript13, grabbable: true, grabbableToEnemies: true, US_GumballMachine); US_Gumball = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/GumballAssets/US_GumballItem.asset"); list.Add(US_Gumball); GumballScript itemScript14 = US_Gumball.spawnPrefab.AddComponent<GumballScript>(); InitializeItem((GrabbableObject)(object)itemScript14, grabbable: true, grabbableToEnemies: true, US_Gumball); } catch { Debug.LogError((object)"USUAL SCRAP - Gumball Machine or Gumball experienced an error while loading. Skipping..."); } } else if (BoundConfig.GumballLoaded.Value && !BoundConfig.GumballMachineLoaded.Value) { try { US_Gumball = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/GumballAssets/US_GumballItem.asset"); list.Add(US_Gumball); GumballScript itemScript15 = US_Gumball.spawnPrefab.AddComponent<GumballScript>(); InitializeItem((GrabbableObject)(object)itemScript15, grabbable: true, grabbableToEnemies: true, US_Gumball); } catch { Debug.LogError((object)"USUAL SCRAP - Gumball experienced an error while loading. Skipping..."); } } if (BoundConfig.FuelCylinderLoaded.Value) { try { US_FuelCylinder = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/FuelCylinderAssets/US_FuelCylinderItem.asset"); list.Add(US_FuelCylinder); FuelCylinderScript itemScript16 = US_FuelCylinder.spawnPrefab.AddComponent<FuelCylinderScript>(); InitializeItem((GrabbableObject)(object)itemScript16, grabbable: true, grabbableToEnemies: true, US_FuelCylinder); } catch { Debug.LogError((object)"USUAL SCRAP - Fuel Cylinder experienced an error while loading. Skipping..."); } } if (BoundConfig.RadioactiveCellLoaded.Value) { try { US_RadioactiveCell = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/RadioactiveCellAssets/US_RadioactiveCellItem.asset"); list.Add(US_RadioactiveCell); RadioactiveCellScript itemScript17 = US_RadioactiveCell.spawnPrefab.AddComponent<RadioactiveCellScript>(); InitializeItem((GrabbableObject)(object)itemScript17, grabbable: true, grabbableToEnemies: true, US_RadioactiveCell); } catch { Debug.LogError((object)"USUAL SCRAP - Radioactive Cell experienced an error while loading. Skipping..."); } } if (BoundConfig.GloomyCapsuleLoaded.Value) { try { US_GloomyCapsule = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/GloomyCapsuleAssets/US_GloomyCapsuleItem.asset"); list.Add(US_GloomyCapsule); GloomyCapsuleScript itemScript18 = US_GloomyCapsule.spawnPrefab.AddComponent<GloomyCapsuleScript>(); InitializeItem((GrabbableObject)(object)itemScript18, grabbable: true, grabbableToEnemies: true, US_GloomyCapsule); } catch { Debug.LogError((object)"USUAL SCRAP - Gloomy Capsule experienced an error while loading. Skipping..."); } } if (BoundConfig.FrigidCapsuleLoaded.Value) { try { US_FrigidCapsule = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/FrigidCapsuleAssets/US_FrigidCapsuleItem.asset"); list.Add(US_FrigidCapsule); FrigidCapsuleScript itemScript19 = US_FrigidCapsule.spawnPrefab.AddComponent<FrigidCapsuleScript>(); InitializeItem((GrabbableObject)(object)itemScript19, grabbable: true, grabbableToEnemies: true, US_FrigidCapsule); } catch { Debug.LogError((object)"USUAL SCRAP - Frigid Capsule experienced an error while loading. Skipping..."); } } if (BoundConfig.BloodyCapsuleLoaded.Value) { try { US_BloodyCapsule = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/BloodyCapsuleAssets/US_BloodyCapsuleItem.asset"); list.Add(US_BloodyCapsule); BloodyCapsuleScript itemScript20 = US_BloodyCapsule.spawnPrefab.AddComponent<BloodyCapsuleScript>(); InitializeItem((GrabbableObject)(object)itemScript20, grabbable: true, grabbableToEnemies: true, US_BloodyCapsule); } catch { Debug.LogError((object)"USUAL SCRAP - Bloody Capsule experienced an error while loading. Skipping..."); } } if (BoundConfig.PadlockLoaded.Value) { try { US_Padlock = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/PadlockAssets/US_PadlockItem.asset"); list.Add(US_Padlock); PadlockScript itemScript21 = US_Padlock.spawnPrefab.AddComponent<PadlockScript>(); InitializeItem((GrabbableObject)(object)itemScript21, grabbable: true, grabbableToEnemies: true, US_Padlock); try { ScanNodeProperties componentInChildren = US_Padlock.spawnPrefab.GetComponentInChildren<ScanNodeProperties>(true); if ((Object)(object)componentInChildren == (Object)null) { Debug.LogWarning((object)"USUAL SCRAP - Padlock has no ScanNode. Skipping store variant."); } else { Item val9 = Object.Instantiate<Item>(US_Padlock); ((Object)val9).name = "US_StorePadlock"; val9.isScrap = false; val9.minValue = 0; val9.maxValue = 0; val9.spawnPrefab = NetworkPrefabs.CloneNetworkPrefab(US_Padlock.spawnPrefab, "US_StorePadlockPrefab"); PadlockScript component = val9.spawnPrefab.GetComponent<PadlockScript>(); ScanNodeProperties componentInChildren2 = val9.spawnPrefab.GetComponentInChildren<ScanNodeProperties>(true); if ((Object)(object)component == (Object)null || (Object)(object)componentInChildren2 == (Object)null) { Debug.LogWarning((object)"USUAL SCRAP - Store Padlock clone is missing its script or ScanNode. Skipping store registration."); } else { ((GrabbableObject)component).itemProperties = val9; componentInChildren2.nodeType = 0; componentInChildren2.subText = ""; componentInChildren2.scrapValue = 0; if (BoundConfig.PadlockIsStoreItem.Value && BoundConfig.PadlockStorePrice.Value >= 0) { TerminalNode US_PadlockNode = val.LoadAsset<TerminalNode>("Assets/UsualScrapContent/Items/PadlockAssets/US_PadlockNode.asset"); if ((Object)(object)US_PadlockNode == (Object)null) { Debug.LogWarning((object)"USUAL SCRAP - Store Padlock TerminalNode is missing. Skipping store registration."); } else { list.Add(val9); DawnLib.DefineItem(StoreItemKeys.US_Padlock, val9, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.PadlockStorePrice.Value).OverrideInfoNode(US_PadlockNode); }); }); } } } } } catch (Exception arg) { Debug.LogError((object)$"USUAL SCRAP - Store Padlock registration failed: {arg}"); } } catch { Debug.LogError((object)"USUAL SCRAP - Padlock experienced an error while loading. Skipping..."); } } if (BoundConfig.CrowbarLoaded.Value) { try { US_Crowbar = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/CrowbarAssets/US_CrowbarItem.asset"); list.Add(US_Crowbar); CrowbarScript itemScript22 = US_Crowbar.spawnPrefab.AddComponent<CrowbarScript>(); InitializeItem((GrabbableObject)(object)itemScript22, grabbable: true, grabbableToEnemies: true, US_Crowbar); try { ScanNodeProperties componentInChildren3 = US_Crowbar.spawnPrefab.GetComponentInChildren<ScanNodeProperties>(true); if ((Object)(object)componentInChildren3 == (Object)null) { Debug.LogWarning((object)"USUAL SCRAP - Crowbar has no ScanNode. Skipping store variant."); } else { Item val10 = Object.Instantiate<Item>(US_Crowbar); ((Object)val10).name = "US_StoreCrowbar"; val10.isScrap = false; val10.minValue = 0; val10.maxValue = 0; val10.spawnPrefab = NetworkPrefabs.CloneNetworkPrefab(US_Crowbar.spawnPrefab, "US_StoreCrowbarPrefab"); CrowbarScript component2 = val10.spawnPrefab.GetComponent<CrowbarScript>(); ScanNodeProperties componentInChildren4 = val10.spawnPrefab.GetComponentInChildren<ScanNodeProperties>(true); if ((Object)(object)component2 == (Object)null || (Object)(object)componentInChildren4 == (Object)null) { Debug.LogWarning((object)"USUAL SCRAP - Store Crowbar clone is missing its script or ScanNode. Skipping store registration."); } else { ((GrabbableObject)component2).itemProperties = val10; componentInChildren4.nodeType = 0; componentInChildren4.subText = ""; componentInChildren4.scrapValue = 0; if (BoundConfig.CrowbarIsStoreItem.Value && BoundConfig.CrowbarStorePrice.Value >= 0) { TerminalNode US_CrowbarNode = val.LoadAsset<TerminalNode>("Assets/UsualScrapContent/Items/CrowbarAssets/US_CrowbarNode.asset"); if ((Object)(object)US_CrowbarNode == (Object)null) { Debug.LogWarning((object)"USUAL SCRAP - Store Crowbar TerminalNode is missing. Skipping store registration."); } else { list.Add(val10); DawnLib.DefineItem(StoreItemKeys.US_Crowbar, val10, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action<ShopBuilder>)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.CrowbarStorePrice.Value).OverrideInfoNode(US_CrowbarNode); }); }); } } } } } catch (Exception arg2) { Debug.LogError((object)$"USUAL SCRAP - Store Crowbar registration failed: {arg2}"); } } catch { Debug.LogError((object)"USUAL SCRAP - Crowbar experienced an error while loading. Skipping..."); } } if (BoundConfig.FireAxeLoaded.Value) { try { US_FireAxe = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/FireAxeAssets/US_FireAxeItem.asset"); list.Add(US_FireAxe); FireAxeScript itemScript23 = US_FireAxe.spawnPrefab.AddComponent<FireAxeScript>(); InitializeItem((GrabbableObject)(object)itemScript23, grabbable: true, grabbableToEnemies: true, US_FireAxe); } catch { Debug.LogError((object)"USUAL SCRAP - Fire Axe experienced an error while loading. Skipping..."); } } if (BoundConfig.SledgehammerLoaded.Value) { try { US_Sledgehammer = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/SledgehammerAssets/US_SledgehammerItem.asset"); list.Add(US_Sledgehammer); SledgehammerScript itemScript24 = US_Sledgehammer.spawnPrefab.AddComponent<SledgehammerScript>(); InitializeItem((GrabbableObject)(object)itemScript24, grabbable: true, grabbableToEnemies: true, US_Sledgehammer); } catch { Debug.LogError((object)"USUAL SCRAP - Sledgehammer experienced an error while loading. Skipping..."); } } if (BoundConfig.AntiqueSwordLoaded.Value) { try { US_AntiqueSword = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/AntiqueSwordAssets/US_AntiqueSwordItem.asset"); list.Add(US_AntiqueSword); AntiqueSwordScript itemScript25 = US_AntiqueSword.spawnPrefab.AddComponent<AntiqueSwordScript>(); InitializeItem((GrabbableObject)(object)itemScript25, grabbable: true, grabbableToEnemies: true, US_AntiqueSword); } catch { Debug.LogError((object)"USUAL SCRAP - Antique Sword experienced an error while loading. Skipping..."); } } if (BoundConfig.RegalScepterLoaded.Value) { try { US_RegalScepter = val.LoadAsset<Item>("Assets/UsualScrapContent/Items/RegalScepterAssets/US_RegalScepterItem.asset"); list.Add(US_RegalScepter); RegalScepterScript itemScript26 = US_RegalScepter.spawnPrefab.AddComponent<RegalScepterScript>(); InitializeItem((GrabbableObject)(object)itemScript26, grabbable: true, grabbableToEnemies: true, US_RegalScepter); } catch { Debug.LogError((object)"USUAL SCRAP - Regal Scepter experienced an error while loading. Skipping..."); } } if (BoundConfig.MansionScrapPackEnabled.Value) { try { US_PocketWatch = val.LoadAsset<Item>("Assets/UsualScrapContent/ScrapPackItems/PocketWatchAssets/US_PocketWatchItem.asset"); list.Add(US_PocketWatch); PhysicsProp itemScript27 = US_PocketWatch.spawnPrefab.AddComponent<PhysicsProp>(); InitializeItem((GrabbableObject)(object)itemScript27, grabbable: true, grabbableToEnemies: true, US_PocketWatch); } catch { Debug.LogError((object)"USUAL SCRAP - Pocket Watch scrap pack item experienced an error while loading. Skipping..."); } try { US_ServantBell = val.LoadAsset<Item>("Assets/UsualScrapContent/ScrapPackItems/ServantBellAssets/US_ServantBellItem.asset"); list.Add(US_ServantBell); NoiseMakerScript itemScript28 = US_ServantBell.spawnPrefab.AddComponent<NoiseMakerScript>(); InitializeItem((GrabbableObject)(object)itemScript28, grabbable: true, grabbableToEnemies: true, US_ServantBell); } catch { Debug.LogError((object)"USUAL SCRAP - Servant Bell scrap pack item experienced an error while loading. Skipping..."); } try { US_ChessPieces = val.LoadAsset<Item>("Assets/UsualScrapContent/ScrapPackItems/ChessPiecesAssets/US_ChessPiecesItem.asset"); list.Add(US_ChessPieces); RandomModelBNWScript randomModelBNWScript = US_ChessPieces.spawnPrefab.AddComponent<RandomModelBNWScript>(); randomModelBNWScript.changeColor = true; InitializeItem((GrabbableObject)(object)randomModelBNWScript, grabbable: true, grabbableToEnemies: true, US_ChessPieces); } catch { Debug.LogError((object)"USUAL SCRAP - Chess Pieces scrap pack item experienced an error while loading. Skipping..."); } try { US_GoldenChessPieces = val.LoadAsset<Item>("Assets/UsualScrapContent/ScrapPackItems/GoldenChessPiecesAssets/US_GoldenChessPiecesItem.asset"); list.Add(US_GoldenChessPieces); RandomModelBNWScript randomModelBNWScript2 = US_GoldenChessPieces.spawnPrefab.AddComponent<RandomModelBNWScript>(); randomModelBNWScript2.changeColor = false; InitializeItem((GrabbableObject)(object)randomModelBNWScript2, grabbable: true, grabbableToEnemies: true, US_GoldenChessPieces); } catch { Debug.LogError((object)"USUAL SCRAP - Golden Chess Pieces scrap pack item experienced an error while loading. Skipping..."); } } if (BoundConfig.FacilityScrapPackEnabled.Value) { try { US_TrafficCone = val.LoadAsset<Item>("Assets/UsualScrapContent/ScrapPackItems/TrafficConeAssets/US_TrafficConeItem.asset"); list.Add(US_TrafficCone); PhysicsProp itemScript29 = US_TrafficCone.spawnPrefab.AddComponent<PhysicsProp>(); InitializeItem((GrabbableObject)(object)itemScript29, grabbable: true, grabbableToEnemies: true, US_TrafficCone); } catch { Debug.LogError((object)"USUAL SCRAP - Traffic Cone scrap pack item experienced an error while loading. Skipping..."); } try { US_MereGear = val.LoadAsset<Item>("Assets/UsualScrapContent/ScrapPackItems/MereGearAssets/US_MereGearItem.asset"); list.Add(US_MereGear); PhysicsProp itemScript30 = US_MereGear.spawnPrefab.AddComponent<PhysicsProp>(); InitializeItem((GrabbableObject)(object)itemScript30, grabbable: true, grabbableToEnemies: true, US_MereGear); } catch { Debug.LogError((object)"USUAL SCRAP - Mere Gear scrap pack item experienced an error while loading. Skipping..."); } } if (BoundConfig.DisableItemIcons.Value) { foreach (Item item in list) { item.itemIcon = null; } } Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Emil.UsualScrap"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Emil.UsualScrap is loaded!"); void SetWeights() { if (BoundConfig.MansionScrapPackEnabled.Value) { try { if ((Object)(object)US_PocketWatch != (Object)null) { string[] pocketWatchMoonStrings = BoundConfig.PocketWatchMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_PocketWatch, US_PocketWatch, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, pocketWatchMoonStrings, US_PocketWatch, BoundConfig.PocketWatchMoonSpawnWeights, BoundConfig.PocketWatchGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_ServantBell != (Object)null) { string[] servantBellMoonStrings = BoundConfig.ServantBellMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_ServantBell, US_ServantBell, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, servantBellMoonStrings, US_ServantBell, BoundConfig.ServantBellMoonSpawnWeights, BoundConfig.ServantBellGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_ChessPieces != (Object)null) { string[] chessPiecesMoonStrings = BoundConfig.ChessPiecesMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_ChessPieces, US_ChessPieces, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, chessPiecesMoonStrings, US_ChessPieces, BoundConfig.ChessPiecesMoonSpawnWeights, BoundConfig.ChessPiecesGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_GoldenChessPieces != (Object)null) { string[] goldenChessPiecesMoonStrings = BoundConfig.GoldenChessPiecesMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_GoldenChessPieces, US_GoldenChessPieces, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, goldenChessPiecesMoonStrings, US_GoldenChessPieces, BoundConfig.GoldenChessPiecesMoonSpawnWeights, BoundConfig.GoldenChessPiecesGlobalSpawnWeight); }); }); }); } } catch { } } if (BoundConfig.FacilityScrapPackEnabled.Value) { try { if ((Object)(object)US_TrafficCone != (Object)null) { string[] trafficConeMoonStrings = BoundConfig.TrafficConeMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_TrafficCone, US_TrafficCone, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, trafficConeMoonStrings, US_TrafficCone, BoundConfig.TrafficConeMoonSpawnWeights, BoundConfig.TrafficConeGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_MereGear != (Object)null) { string[] mereGearMoonStrings = BoundConfig.MereGearMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_MereGear, US_MereGear, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, mereGearMoonStrings, US_MereGear, BoundConfig.MereGearMoonSpawnWeights, BoundConfig.MereGearGlobalSpawnWeight); }); }); }); } } catch { } } if (BoundConfig.TicketSpawnsAsScrap.Value && BoundConfig.TicketLoaded.Value) { try { if ((Object)(object)US_Ticket != (Object)null) { string[] ticketMoonStrings = BoundConfig.TicketMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Ticket, US_Ticket, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, ticketMoonStrings, US_Ticket, BoundConfig.TicketMoonSpawnWeights, BoundConfig.TicketGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.TicketSpawnsAsScrap.Value && BoundConfig.TicketLoaded.Value) { try { if ((Object)(object)US_Ticket != (Object)null) { Items.RegisterItem(US_Ticket); } } catch { } } if (BoundConfig.GoldenTicketSpawnsAsScrap.Value && BoundConfig.GoldenTicketLoaded.Value) { try { if ((Object)(object)US_GoldenTicket != (Object)null) { string[] goldenTicketMoonStrings = BoundConfig.GoldenTicketMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_GoldenTicket, US_GoldenTicket, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, goldenTicketMoonStrings, US_GoldenTicket, BoundConfig.GoldenTicketMoonSpawnWeights, BoundConfig.GoldenTicketGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.GoldenTicketSpawnsAsScrap.Value && BoundConfig.GoldenTicketLoaded.Value) { try { if ((Object)(object)US_GoldenTicket != (Object)null) { Items.RegisterItem(US_GoldenTicket); } } catch { } } if (BoundConfig.RoseSpawnsAsScrap.Value && BoundConfig.RoseLoaded.Value) { try { if ((Object)(object)US_Rose != (Object)null) { string[] roseMoonStrings = BoundConfig.RoseMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Rose, US_Rose, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, roseMoonStrings, US_Rose, BoundConfig.RoseMoonSpawnWeights, BoundConfig.RoseGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.RoseSpawnsAsScrap.Value && BoundConfig.RoseLoaded.Value) { try { if ((Object)(object)US_Rose != (Object)null) { Items.RegisterItem(US_Rose); } } catch { } } if (BoundConfig.SizableScissorsSpawnsAsScrap.Value && BoundConfig.SizableScissorsLoaded.Value) { try { if ((Object)(object)US_SizableScissors != (Object)null) { string[] sizableScissorsMoonStrings = BoundConfig.SizableScissorsMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_SizableScissors, US_SizableScissors, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, sizableScissorsMoonStrings, US_SizableScissors, BoundConfig.SizableScissorsMoonSpawnWeights, BoundConfig.SizableScissorsGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.SizableScissorsSpawnsAsScrap.Value && BoundConfig.SizableScissorsLoaded.Value) { try { if ((Object)(object)US_SizableScissors != (Object)null) { Items.RegisterItem(US_SizableScissors); } } catch { } } if (BoundConfig.WalkingCaneSpawnsAsScrap.Value && BoundConfig.WalkingCaneLoaded.Value) { try { if ((Object)(object)US_WalkingCane != (Object)null) { string[] walkingCaneMoonStrings = BoundConfig.WalkingCaneMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_WalkingCane, US_WalkingCane, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, walkingCaneMoonStrings, US_WalkingCane, BoundConfig.WalkingCaneMoonSpawnWeights, BoundConfig.WalkingCaneGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.WalkingCaneSpawnsAsScrap.Value && BoundConfig.WalkingCaneLoaded.Value) { try { if ((Object)(object)US_WalkingCane != (Object)null) { Items.RegisterItem(US_WalkingCane); } } catch { } } if ((BoundConfig.GumballMachineSpawnsAsScrap.Value && BoundConfig.GumballMachineLoaded.Value) || (BoundConfig.GumballSpawnsAsScrap.Value && BoundConfig.GumballLoaded.Value)) { try { if ((Object)(object)US_GumballMachine != (Object)null && (Object)(object)US_Gumball != (Object)null) { string[] gumballMachineMoonStrings = BoundConfig.GumballMachineMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_GumballMachine, US_GumballMachine, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, gumballMachineMoonStrings, US_GumballMachine, BoundConfig.GumballMachineMoonSpawnWeights, BoundConfig.GumballMachineGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_Gumball != (Object)null) { string[] gumballMoonStrings = BoundConfig.GumballMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Gumball, US_Gumball, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, gumballMoonStrings, US_Gumball, BoundConfig.GumballMoonSpawnWeights, BoundConfig.GumballGlobalSpawnWeight); }); }); }); } } catch { } } else if ((!BoundConfig.GumballMachineSpawnsAsScrap.Value && BoundConfig.GumballMachineLoaded.Value) || (!BoundConfig.GumballSpawnsAsScrap.Value && BoundConfig.GumballLoaded.Value)) { try { if ((Object)(object)US_GumballMachine != (Object)null && (Object)(object)US_Gumball != (Object)null) { Items.RegisterItem(US_GumballMachine); } if ((Object)(object)US_Gumball != (Object)null) { Items.RegisterItem(US_Gumball); } } catch { } } if (BoundConfig.FuelCylinderSpawnsAsScrap.Value && BoundConfig.FuelCylinderLoaded.Value) { try { if ((Object)(object)US_FuelCylinder != (Object)null) { string[] fuelCylinderMoonStrings = BoundConfig.FuelCylinderMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_FuelCylinder, US_FuelCylinder, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, fuelCylinderMoonStrings, US_FuelCylinder, BoundConfig.FuelCylinderMoonSpawnWeights, BoundConfig.FuelCylinderGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.FuelCylinderSpawnsAsScrap.Value && BoundConfig.FuelCylinderLoaded.Value) { try { if ((Object)(object)US_FuelCylinder != (Object)null) { Items.RegisterItem(US_FuelCylinder); } } catch { } } if (BoundConfig.RadioactiveCellSpawnsAsScrap.Value && BoundConfig.RadioactiveCellLoaded.Value) { try { if ((Object)(object)US_RadioactiveCell != (Object)null) { string[] radioactiveCellMoonStrings = BoundConfig.RadioactiveCellMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_RadioactiveCell, US_RadioactiveCell, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, radioactiveCellMoonStrings, US_RadioactiveCell, BoundConfig.RadioactiveCellMoonSpawnWeights, BoundConfig.RadioactiveCellGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.RadioactiveCellSpawnsAsScrap.Value && BoundConfig.RadioactiveCellLoaded.Value) { try { if ((Object)(object)US_RadioactiveCell != (Object)null) { Items.RegisterItem(US_RadioactiveCell); } } catch { } } if (BoundConfig.GloomyCapsuleSpawnsAsScrap.Value && BoundConfig.GloomyCapsuleLoaded.Value) { try { if ((Object)(object)US_GloomyCapsule != (Object)null) { string[] gloomyCapsuleMoonStrings = BoundConfig.GloomyCapsuleMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_GloomyCapsule, US_GloomyCapsule, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, gloomyCapsuleMoonStrings, US_GloomyCapsule, BoundConfig.GloomyCapsuleMoonSpawnWeights, BoundConfig.GloomyCapsuleGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.GloomyCapsuleSpawnsAsScrap.Value && BoundConfig.GloomyCapsuleLoaded.Value) { try { if ((Object)(object)US_GloomyCapsule != (Object)null) { Items.RegisterItem(US_GloomyCapsule); } } catch { } } if (BoundConfig.FrigidCapsuleSpawnsAsScrap.Value && BoundConfig.FrigidCapsuleLoaded.Value) { try { if ((Object)(object)US_FrigidCapsule != (Object)null) { string[] frigidCapsuleMoonStrings = BoundConfig.FrigidCapsuleMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_FrigidCapsule, US_FrigidCapsule, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, frigidCapsuleMoonStrings, US_FrigidCapsule, BoundConfig.FrigidCapsuleMoonSpawnWeights, BoundConfig.FrigidCapsuleGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.FrigidCapsuleSpawnsAsScrap.Value && BoundConfig.FrigidCapsuleLoaded.Value) { try { if ((Object)(object)US_FrigidCapsule != (Object)null) { Items.RegisterItem(US_FrigidCapsule); } } catch { } } if (BoundConfig.BloodyCapsuleSpawnsAsScrap.Value && BoundConfig.BloodyCapsuleLoaded.Value) { try { if ((Object)(object)US_BloodyCapsule != (Object)null) { string[] bloodyCapsuleMoonStrings = BoundConfig.BloodyCapsuleMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_BloodyCapsule, US_BloodyCapsule, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, bloodyCapsuleMoonStrings, US_BloodyCapsule, BoundConfig.BloodyCapsuleMoonSpawnWeights, BoundConfig.BloodyCapsuleGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.BloodyCapsuleSpawnsAsScrap.Value && BoundConfig.BloodyCapsuleLoaded.Value) { try { if ((Object)(object)US_BloodyCapsule != (Object)null) { Items.RegisterItem(US_BloodyCapsule); } } catch { } } if (BoundConfig.PadlockSpawnsAsScrap.Value && BoundConfig.PadlockLoaded.Value) { try { if ((Object)(object)US_Padlock != (Object)null) { string[] padlockMoonStrings = BoundConfig.PadlockMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Padlock, US_Padlock, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, padlockMoonStrings, US_Padlock, BoundConfig.PadlockMoonSpawnWeights, BoundConfig.PadlockGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.PadlockSpawnsAsScrap.Value && BoundConfig.PadlockLoaded.Value) { try { if ((Object)(object)US_Padlock != (Object)null) { Items.RegisterItem(US_Padlock); } } catch { } } if (BoundConfig.CrowbarSpawnsAsScrap.Value && BoundConfig.CrowbarLoaded.Value) { try { if ((Object)(object)US_Crowbar != (Object)null) { string[] crowbarMoonStrings = BoundConfig.CrowbarMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Crowbar, US_Crowbar, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, crowbarMoonStrings, US_Crowbar, BoundConfig.CrowbarMoonSpawnWeights, BoundConfig.CrowbarGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.CrowbarSpawnsAsScrap.Value && BoundConfig.CrowbarLoaded.Value) { try { if ((Object)(object)US_Crowbar != (Object)null) { Items.RegisterItem(US_Crowbar); } } catch { } } if (BoundConfig.FireAxeSpawnsAsScrap.Value && BoundConfig.FireAxeLoaded.Value) { try { if ((Object)(object)US_FireAxe != (Object)null) { string[] fireAxeMoonStrings = BoundConfig.FireAxeMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_FireAxe, US_FireAxe, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, fireAxeMoonStrings, US_FireAxe, BoundConfig.FireAxeMoonSpawnWeights, BoundConfig.FireAxeGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.FireAxeSpawnsAsScrap.Value && BoundConfig.FireAxeLoaded.Value) { try { if ((Object)(object)US_FireAxe != (Object)null) { Items.RegisterItem(US_FireAxe); } } catch { } } if (BoundConfig.SledgehammerSpawnsAsScrap.Value && BoundConfig.SledgehammerLoaded.Value) { try { if ((Object)(object)US_Sledgehammer != (Object)null) { string[] sledgehammerMoonStrings = BoundConfig.SledgehammerMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Sledgehammer, US_Sledgehammer, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, sledgehammerMoonStrings, US_Sledgehammer, BoundConfig.SledgehammerMoonSpawnWeights, BoundConfig.SledgehammerGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.SledgehammerSpawnsAsScrap.Value && BoundConfig.SledgehammerLoaded.Value) { try { if ((Object)(object)US_Sledgehammer != (Object)null) { Items.RegisterItem(US_Sledgehammer); } } catch { } } if (BoundConfig.AntiqueSwordSpawnsAsScrap.Value && BoundConfig.AntiqueSwordLoaded.Value) { try { if ((Object)(object)US_AntiqueSword != (Object)null) { string[] antiqueSwordMoonStrings = BoundConfig.AntiqueSwordMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_AntiqueSword, US_AntiqueSword, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, antiqueSwordMoonStrings, US_AntiqueSword, BoundConfig.AntiqueSwordMoonSpawnWeights, BoundConfig.AntiqueSwordGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.AntiqueSwordSpawnsAsScrap.Value && BoundConfig.AntiqueSwordLoaded.Value) { try { if ((Object)(object)US_AntiqueSword != (Object)null) { Items.RegisterItem(US_AntiqueSword); } } catch { } } if (BoundConfig.RegalScepterSpawnsAsScrap.Value && BoundConfig.RegalScepterLoaded.Value) { try { if ((Object)(object)US_RegalScepter != (Object)null) { string[] regalScepterMoonStrings = BoundConfig.RegalScepterMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_RegalScepter, US_RegalScepter, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { buildallweights(weightBuilder, regalScepterMoonStrings, US_RegalScepter, BoundConfig.RegalScepterMoonSpawnWeights, BoundConfig.RegalScepterGlobalSpawnWeight); }); }); }); } return; } catch { return; } } if (!BoundConfig.RegalScepterSpawnsAsScrap.Value && BoundConfig.RegalScepterLoaded.Value) { try { if ((Object)(object)US_RegalScepter != (Object)null) { Items.RegisterItem(US_RegalScepter); } } catch { } } } void buildallweights(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> builder, string[] moonStrings, Item item, ConfigEntry<string> moonWeightConfig, ConfigEntry<int> globalWeightConfig) { MonoBehaviour.print((object)$"Building moon weights for {item}"); bool flag = false; List<string> list2 = new List<string>(); Dictionary<string, int> dictionary = new Dictionary<string, int>(); List<string> list3 = new List<string>(); foreach (KeyValuePair<NamespacedKey<DawnMoonInfo>, DawnMoonInfo> finalMoon in FinalMoons) { foreach (string text in moonStrings) { try { string[] array3 = text.Split('='); string text2 = array3[0].Trim().ToLowerInvariant(); string s = array3[1].Trim(); int num = int.Parse(s); string text3 = Regex.Replace(finalMoon.Value.Level.PlanetName, "[\\d\\s]", "").Trim().ToLowerInvariant(); if (text3 == text2 && num >= 0) { if (BoundConfig.DebugLogging.Value) { MonoBehaviour.print((object)$"Setting moon {finalMoon}'s weight to moon weight {num} for {item}"); } dictionary[text2] = num; try { builder.AddWeight(finalMoon.Key, num); } catch (Exception ex) { Debug.LogWarning((object)$"Failed to add specified weight for {item} to {text2}, Attempted weight -> {num}"); Debug.LogWarning((object)ex); } list2.Add(text2); } else if (text3 == text2 && num <= -1 && globalWeightConfig.Value >= 0) { if (BoundConfig.DebugLogging.Value) { MonoBehaviour.print((object)$"Setting moon {finalMoon}'s weight to global weight {globalWeightConfig} for {item}"); } dictionary[text2] = -1; try { builder.AddWeight(finalMoon.Key, globalWeightConfig.Value); } catch (Exception ex2) { Debug.LogWarning((object)$"Failed to add global weight for {item} to {text2}, Attempted weight -> {globalWeightConfig.Value}"); Debug.LogWarning((object)ex2); } list2.Add(text2); } else if (text3 == text2 && num <= -1 && globalWeightConfig.Value <= -1) { list2.Add(text2); dictionary[text2] = -1; } else if ((text2 == null || !(text3 != text2)) && !list3.Contains(text)) { Debug.LogWarning((object)$"Usual Scrap - Moon weight config entry [{text2}] from [{item}] is unreadable and returned an error. Reformatting and resetting entry..."); list3.Add(text); } } catch { if (!list3.Contains(text)) { Debug.LogWarning((object)$"Usual Scrap - Moon weight config entry [{text}] from [{item}] is unreadable and returned an error. Reformatting and resetting entry..."); list3.Add(text); } } } } foreach (string text4 in moonStrings) { try { string text5 = text4.Split('=')[0].Trim().ToLowerInvariant(); if (!list2.Contains(text5) && !string.IsNullOrWhiteSpace(text5)) { Debug.LogWarning((object)$"Usual Scrap - Config entry '{text5}' for [{item}] does not match any loaded moons or is formatted incorrectly. Reformatting and resetting entry..."); } } catch { } } foreach (KeyValuePair<NamespacedKey<DawnMoonInfo>, DawnMoonInfo> finalMoon2 in FinalMoons) { string text6 = Regex.Replace(finalMoon2.Value.Level.PlanetName, "[\\d\\s]", "").Trim().ToLowerInvariant(); if (!list2.Contains(text6)) { if (BoundConfig.DebugLogging.Value) { Debug.LogWarning((object)$"{item} config does not contain {text6}, adding it to the config.. Weight setting skipped for this moon.."); } bool flag2 = false; foreach (string text7 in moonStrings) { if (text7.ToLowerInvariant().Contains(text6)) { flag2 = true; break; } } if (!flag2) { string text8 = moonWeightConfig.Value; if (!string.IsNullOrWhiteSpace(text8) && !text8.EndsWith(",")) { text8 += ", "; } text8 = text8 + text6 + "=-1"; moonWeightConfig.Value = text8; flag = true; list2.Add(text6); } } } List<string> list4 = new List<string>(); foreach (string item2 in list2) { int num2 = (dictionary.ContainsKey(item2) ? dictionary[item2] : (-1)); list4.Add($"{item2}={num2}"); } string value = string.Join(", ", list4); moonWeightConfig.Value = value; ((BaseUnityPlugin)this).Config.Save(); if (flag) { MonoBehaviour.print((object)$"USUALS SCRAP - Detected new moon(s) while processing '{item}'."); } string text9 = $"USUAL SCRAP - {item} spawn weights successfully set for "; foreach (string item3 in list2) { text9 = text9 + item3 + ", "; } if (BoundConfig.DebugLogging.Value) { MonoBehaviour.print((object)text9); } MonoBehaviour.print((object)$"Moon weights for {item} set."); } } private void DetectMoons() { TaggedRegistry<DawnMoonInfo> moons = LethalContent.Moons; List<TerminalKeyword> list = new List<TerminalKeyword>(); TerminalKeyword[] allKeywords = Object.FindObjectOfType<Terminal>().terminalNodes.allKeywords; TerminalKeyword[] array = allKeywords; foreach (TerminalKeyword val in array) { if (!(((Object)val).name == "route") && !(((Object)val).name == "Route")) { continue; } CompatibleNoun[] compatibleNouns = val.compatibleNouns; foreach (CompatibleNoun val2 in compatibleNouns) { if (!list.Contains(val2.noun)) { list.Add(val2.noun); } } } foreach (KeyValuePair<NamespacedKey<DawnMoonInfo>, DawnMoonInfo> item in (Registry<DawnMoonInfo>)(object)moons) { foreach (TerminalKeyword item2 in list) { if ((Object)(object)item.Value.NameKeyword == (Object)(object)item2 && item.Value.Level.spawnEnemiesAndScrap) { FinalMoons.Add(item); FinalMoonNames.Add(((object)item.Value.NameKeyword).ToString().ToLowerInvariant().Trim()); } } } } } internal class UsualScrapConfigs { public readonly ConfigEntry<string> ConfigInfo; public readonly ConfigEntry<string> ConfigBackup; public readonly ConfigEntry<string> ConfigLayout; public readonly ConfigEntry<bool> MansionScrapPackEnabled; public readonly ConfigEntry<bool> FacilityScrapPackEnabled; public readonly ConfigEntry<bool> TicketLoaded; public readonly ConfigEntry<bool> TicketSpawnsAsScrap; public readonly ConfigEntry<string> TicketMoonSpawnWeights; public readonly ConfigEntry<int> TicketGlobalSpawnWeight; public readonly ConfigEntry<bool> GoldenTicketLoaded; public readonly ConfigEntry<bool> GoldenTicketSpawnsAsScrap; public readonly ConfigEntry<string> GoldenTicketMoonSpawnWeights; public readonly ConfigEntry<int> GoldenTicketGlobalSpawnWeight; public readonly ConfigEntry<bool> RoseLoaded; public readonly ConfigEntry<bool> RoseSpawnsAsScrap; public readonly ConfigEntry<string> RoseMoonSpawnWeights; public readonly ConfigEntry<int> RoseGlobalSpawnWeight; public readonly ConfigEntry<bool> SizableScissorsLoaded; public readonly ConfigEntry<bool> SizableScissorsSpawnsAsScrap; public readonly ConfigEntry<string> SizableScissorsMoonSpawnWeights; public readonly ConfigEntry<int> SizableScissorsGlobalSpawnWeight; public readonly ConfigEntry<bool> WalkingCaneLoaded; public readonly ConfigEntry<bool> WalkingCaneSpawnsAsScrap; public readonly ConfigEntry<string> WalkingCaneMoonSpawnWeights; public readonly ConfigEntry<int> WalkingCaneGlobalSpawnWeight; public readonly ConfigEntry<bool> GumballMachineLoaded; public readonly ConfigEntry<bool> GumballMachineSpawnsAsScrap; public readonly ConfigEntry<string> GumballMachineMoonSpawnWeights; public readonly ConfigEntry<int> GumballMachineGlobalSpawnWeight; public readonly ConfigEntry<bool> GumballLoaded; public readonly ConfigEntry<bool> GumballSpawnsAsScrap; public readonly ConfigEntry<string> GumballMoonSpawnWeights; public readonly ConfigEntry<int> GumballGlobalSpawnWeight; public ConfigEntry<bool> BasicGumballEffects; public readonly ConfigEntry<bool> FuelCylinderLoaded; public readonly ConfigEntry<bool> FuelCylinderSpawnsAsScrap; public readonly ConfigEntry<string> FuelCylinderMoonSpawnWeights; public readonly ConfigEntry<int> FuelCylinderGlobalSpawnWeight; public readonly ConfigEntry<bool> RadioactiveCellLoaded; public readonly ConfigEntry<bool> RadioactiveCellSpawnsAsScrap; public readonly ConfigEntry<string> RadioactiveCellMoonSpawnWeights; public readonly ConfigEntry<int> RadioactiveCellGlobalSpawnWeight; public readonly ConfigEntry<bool> GloomyCapsuleLoaded; public readonly ConfigEntry<bool> GloomyCapsuleSpawnsAsScrap; public readonly ConfigEntry<string> GloomyCapsuleMoonSpawnWeights; public readonly ConfigEntry<int> GloomyCapsuleGlobalSpawnWeight; public readonly ConfigEntry<bool> FrigidCapsuleLoaded; public readonly ConfigEntry<bool> FrigidCapsuleSpawnsAsScrap; public readonly ConfigEntry<string> FrigidCapsuleMoonSpawnWeights; public readonly ConfigEntry<int> FrigidCapsuleGlobalSpawnWeight; public readonly ConfigEntry<bool> BloodyCapsuleLoaded; public readonly ConfigEntry<bool> BloodyCapsuleSpawnsAsScrap; public readonly ConfigEntry<string> BloodyCapsuleMoonSpawnWeights; public readonly ConfigEntry<int> BloodyCapsuleGlobalSpawnWeight; public readonly ConfigEntry<bool> PadlockLoaded; public readonly ConfigEntry<bool> PadlockSpawnsAsScrap; public readonly ConfigEntry<bool> PadlockIsStoreItem; public readonly ConfigEntry<int> PadlockStorePrice; public readonly ConfigEntry<string> PadlockMoonSpawnWeights; public readonly ConfigEntry<int> PadlockGlobalSpawnWeight; public readonly ConfigEntry<bool> CrowbarLoaded; public readonly ConfigEntry<bool> CrowbarSpawnsAsScrap; public readonly ConfigEntry<bool> CrowbarIsStoreItem; public readonly ConfigEntry<int> CrowbarStorePrice; public readonly ConfigEntry<string> CrowbarMoonSpawnWeights; public readonly ConfigEntry<int> CrowbarGlobalSpawnWeight; public readonly ConfigEntry<bool> FireAxeLoaded; public readonly ConfigEntry<bool> FireAxeSpawnsAsScrap; public readonly ConfigEntry<string> FireAxeMoonSpawnWeights; public readonly ConfigEntry<int> FireAxeGlobalSpawnWeight; public readonly ConfigEntry<bool> SledgehammerLoaded; public readonly ConfigEntry<bool> SledgehammerSpawnsAsScrap; public readonly ConfigEntry<string> SledgehammerMoonSpawnWeights; public readonly ConfigEntry<int> SledgehammerGlobalSpawnWeight; public readonly ConfigEntry<bool> AntiqueSwordLoaded; public readonly ConfigEntry<bool> AntiqueSwordSpawnsAsScrap; public readonly ConfigEntry<string> AntiqueSwordMoonSpawnWeights; public readonly ConfigEntry<int> AntiqueSwordGlobalSpawnWeight; public readonly ConfigEntry<bool> RegalScepterLoaded; public readonly ConfigEntry<bool> RegalScepterSpawnsAsScrap; public readonly ConfigEntry<string> RegalScepterMoonSpawnWeights; public readonly ConfigEntry<int> RegalScepterGlobalSpawnWeight; public readonly ConfigEntry<bool> HandlampLoaded; public readonly ConfigEntry<bool> HandlampIsStoreItem; public readonly ConfigEntry<int> HandlampStorePrice; public readonly ConfigEntry<bool> BandagesLoaded; public readonly ConfigEntry<bool> BandagesIsStoreItem; public readonly ConfigEntry<int> BandagesStorePrice; public readonly ConfigEntry<bool> MedicalKitLoaded; public readonly ConfigEntry<bool> MedicalKitIsStoreItem; public readonly ConfigEntry<int> MedicalKitStorePrice; public readonly ConfigEntry<bool> DefibrillatorLoaded; public readonly ConfigEntry<bool> DefibrillatorIsStoreItem; public readonly ConfigEntry<int> DefibrillatorStorePrice; public readonly ConfigEntry<bool> DefibrillatorRequiresBattery; public readonly ConfigEntry<bool> DefibrillatorUsesLimited; public readonly ConfigEntry<int> DefibrillatorUseLimit; public readonly ConfigEntry<bool> DefibrillatorPermaDeathRule; public readonly ConfigEntry<bool> DefibrillatorRefillsOnLanding; public readonly ConfigEntry<bool> ProductivityAutoinjectorLoaded; public readonly ConfigEntry<bool> ProductivityAutoinjectorIsStoreItem; public readonly ConfigEntry<int> ProductivityAutoinjectorStorePrice; public readonly ConfigEntry<bool> BlowtorchLoaded; public readonly ConfigEntry<bool> BlowtorchIsStoreItem; public readonly ConfigEntry<int> BlowtorchStorePrice; public readonly ConfigEntry<bool> AllowSawTurretCutting; public readonly ConfigEntry<bool> AllowFlameTurretCutting; public readonly ConfigEntry<bool> AllowPlasmaTurretCutting; public readonly ConfigEntry<bool> AllowLRADTurretCutting; public readonly ConfigEntry<bool> AllowMissileTurretCutting; public readonly ConfigEntry<bool> ShiftControllerLoaded; public readonly ConfigEntry<bool> ShiftControllerIsStoreItem; public readonly ConfigEntry<int> ShiftControllerStorePrice; public readonly ConfigEntry<int> ShiftControllerGreatRange; public readonly ConfigEntry<int> ShiftControllerPoorRange; public readonly ConfigEntry<string> PocketWatchMoonSpawnWeights; public readonly ConfigEntry<int> PocketWatchGlobalSpawnWeight; public readonly ConfigEntry<string> ServantBellMoonSpawnWeights; public readonly ConfigEntry<int> ServantBellGlobalSpawnWeight; public readonly ConfigEntry<string> ChessPiecesMoonSpawnWeights; public readonly ConfigEntry<int> ChessPiecesGlobalSpawnWeight; public readonly ConfigEntry<string> GoldenChessPiecesMoonSpawnWeights; public readonly ConfigEntry<int> GoldenChessPiecesGlobalSpawnWeight; public readonly ConfigEntry<string> TrafficConeMoonSpawnWeights; public readonly ConfigEntry<int> TrafficConeGlobalSpawnWeight; public readonly ConfigEntry<string> MereGearMoonSpawnWeights; public readonly ConfigEntry<int> MereGearGlobalSpawnWeight; public readonly ConfigEntry<bool> CapsulesDisabledOnTheShip; public readonly ConfigEntry<bool> TicketsFunctionOnCheapItems; public readonly ConfigEntry<bool> DisableItemIcons; public readonly ConfigEntry<bool> DebugLogging; public UsualScrapConfigs(ConfigFile cfg) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown try { string configFilePath = cfg.ConfigFilePath; if (File.Exists(configFilePath)) { string destFileName = configFilePath + ".bak"; File.Copy(configFilePath, destFileName, overwrite: true); } } catch (Exception ex) { Debug.LogWarning((object)("Usual Scrap - Failed to create config backup: " + ex.Message)); } cfg.SaveOnConfigSet = false; ConfigInfo = cfg.Bind<string>("0. Important Information", "Modded Moon Generation", "Read Above", new ConfigDescription("Modded Moon Config Generation: If this is your first time using the mod, or you have added or removed moon mods, launch the game and enter a save with this installed to generate modded moon config entries", (AcceptableValueBase)null, Array.Empty<object>())); ConfigBackup = cfg.Bind<string>("0. Important Information", "Config backup", "Read Above", new ConfigDescription("Config Backup Saves: Configs will always be saved to a backup before being recreated, it can be found alongside your original config file", (AcceptableValueBase)null, Array.Empty<object>())); ConfigLayout = cfg.Bind<string>("0. Important Information", "Moon Config Formatting", "Read Above", new ConfigDescription("Moon Config Format: Moon=Weight, Moon=Weight, Moon=Weight,...\n• Unspecified or disabled moon weights will use the global weight setting instead, specified moon weights overwrite the global weight individually\n• Set a specific moon's weight to -1 to use the global weight (this is the Default setting)\n• Set the global weight to -1 to disable spawning on unspecified moons\n• Incorrectly formatted entries will be skipped, reset, and reported in the log\n• After adding or removing moon mods you must launch the game and enter a save once to generate config entries to edit for those new moons or clear old entries", (AcceptableValueBase)null, Array.Empty<object>())); DebugLogging = cfg.Bind<bool>("1. Debugging", "Log actions for debugging purposes", false, "Whether or not to log actions for debugging purposes"); DisableItemIcons = cfg.Bind<bool>("2. General Options", "Disable Item Icons", false, "Whether or not to disable this mod's items icons (For use with runtime icons or similar mods)"); MansionScrapPackEnabled = cfg.Bind<bool>("3. Scrap Packs", "Mansion Scrap Pack Enabled", false, "Whether or not the Mansion Scrap Pack is enabled, required for scrap pack items below to spawn. Scrap Packs include thematic items that have little to no function besides being scrap, they could be considered bloat and so they are in a pack"); FacilityScrapPackEnabled = cfg.Bind<bool>("3. Scrap Packs", "Facility Scrap Pack Enabled", false, "Whether or not the Facility Scrap Pack is enabled, required for scrap pack items below to spawn. Scrap Packs include thematic items that have little to no function besides being scrap, they could be considered bloat and so they are in a pack"); PocketWatchMoonSpawnWeights = cfg.Bind<string>("5. Scrap Pack Items", "Pocket Watch Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Pocket Watch will spawn, -1 to disable"); PocketWatchGlobalSpawnWeight = cfg.Bind<int>("5. Scrap Pack Items", "Pocket Watch Global Spawn Weight", 15, "How often the Pocket Watch will spawn globally, -1 to disable"); ServantBellMoonSpawnWeights = cfg.Bind<string>("5. Scrap Pack Items", "Servant Bell Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Servant Bell will spawn, -1 to disable"); ServantBellGlobalSpawnWeight = cfg.Bind<int>("5. Scrap Pack Items", "Servant Bell Global Spawn Weight", 15, "How often the Servant Bell will spawn globally, -1 to disable"); ChessPiecesMoonSpawnWeights = cfg.Bind<string>("5. Scrap Pack Items", "Chess Pieces Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often Chess Pieces will spawn, -1 to disable"); ChessPiecesGlobalSpawnWeight = cfg.Bind<int>("5. Scrap Pack Items", "Chess Pieces Global Spawn Weight", 30, "How often Chess Pieces will spawn globally, -1 to disable"); GoldenChessPiecesMoonSpawnWeights = cfg.Bind<string>("5. Scrap Pack Items", "Golden Chess Pieces Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often Golden Chess Pieces will spawn, -1 to disable"); GoldenChessPiecesGlobalSpawnWeight = cfg.Bind<int>("5. Scrap Pack Items", "Golden Chess Pieces Global Spawn Weight", 10, "How often Golden Chess Pieces will spawn globally, -1 to disable"); TrafficConeMoonSpawnWeights = cfg.Bind<string>("5. Scrap Pack Items", "Traffic Cone Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Traffic Cone will spawn, -1 to disable"); TrafficConeGlobalSpawnWeight = cfg.Bind<int>("5. Scrap Pack Items", "Traffic Cone Global Spawn Weight", 20, "How often the Traffic Cone will spawn globally, -1 to disable"); MereGearMoonSpawnWeights = cfg.Bind<string>("5. Scrap Pack Items", "Mere Gear Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Mere Gear will spawn, -1 to disable"); MereGearGlobalSpawnWeight = cfg.Bind<int>("5. Scrap Pack Items", "Mere Gear Global Spawn Weight", 25, "How often Mere Gear will spawn globally, -1 to disable"); TicketsFunctionOnCheapItems = cfg.Bind<bool>("Scrap Items - Tickets", "Tickets function on cheap items", true, "Whether or not tickets function when used on items with a value below 5 (Meaning tickets will no longer work on most equipment whose value is normally 0)"); TicketLoaded = cfg.Bind<bool>("Scrap Items - Tickets", "Ticket is loaded", true, "Whether or not the Ticket is loaded"); TicketSpawnsAsScrap = cfg.Bind<bool>("Scrap Items - Tickets", "Ticket is a scrap item", true, "Whether or not the Ticket spawns as scrap"); TicketMoonSpawnWeights = cfg.Bind<string>("Scrap Items - Tickets", "Ticket Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Ticket will spawn, -1 to disable"); TicketGlobalSpawnWeight = cfg.Bind<int>("Scrap Items - Tickets", "Ticket Global Spawning", 40, "How often the Ticket will spawn globally, -1 to disable"); GoldenTicketLoaded = cfg.Bind<bool>("Scrap Items - Tickets", "Golden Ticket is loaded", true, "Whether or not the Golden Ticket is loaded"); GoldenTicketSpawnsAsScrap = cfg.Bind<bool>("Scrap Items - Tickets", "Golden Ticket is a scrap item", true, "Whether or not the Golden Ticket spawns as scrap"); GoldenTicketMoonSpawnWeights = cfg.Bind<string>("Scrap Items - Tickets", "Golden Ticket Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Golden Ticket will spawn, -1 to disable"); GoldenTicketGlobalSpawnWeight = cfg.Bind<int>("Scrap Items - Tickets", "Golden Ticket Global Spawning", 5, "How often the Golden Ticket will spawn globally, -1 to disable"); RoseLoaded = cfg.Bind<bool>("Scrap Item - Rose", "Rose is loaded", true, "Whether or not the Rose is loaded"); RoseSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Rose", "Rose is a scrap item", true, "Whether or not the Rose spawns as scrap"); RoseMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Rose", "Rose Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Rose will spawn, -1 to disable"); RoseGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Rose", "Rose Global Spawning", 35, "How often the Rose will spawn globally, -1 to disable"); SizableScissorsLoaded = cfg.Bind<bool>("Scrap Item - Sizable Scissors", "Sizable Scissors is loaded", true, "Whether or not the Sizable Scissors is loaded"); SizableScissorsSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Sizable Scissors", "Sizable Scissors is a scrap item", true, "Whether or not the Sizable Scissors spawns as scrap"); SizableScissorsMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Sizable Scissors", "Sizable Scissors Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Sizable Scissors will spawn, -1 to disable"); SizableScissorsGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Sizable Scissors", "Sizable Scissors Global Spawning", 20, "How often the Sizable Scissors will spawn globally, -1 to disable"); WalkingCaneLoaded = cfg.Bind<bool>("Scrap Item - Walking Cane", "Walking Cane is loaded", true, "Whether or not the Walking Cane is loaded"); WalkingCaneSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Walking Cane", "Walking Cane is a scrap item", true, "Whether or not the Walking Cane spawns as scrap"); WalkingCaneMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Walking Cane", "Walking Cane Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Walking Cane will spawn, -1 to disable"); WalkingCaneGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Walking Cane", "Walking Cane Global Spawning", 15, "How often the Walking Cane will spawn globally, -1 to disable"); GumballMachineLoaded = cfg.Bind<bool>("Scrap Item - Gumball Machine", "Gumball Machine is loaded", true, "Whether or not the Gumball Machine is loaded"); GumballMachineSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Gumball Machine", "Gumball Machine is a scrap item", true, "Whether or not the Gumball Machine spawns as scrap"); GumballMachineMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Gumball Machine", "Gumball Machine Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Gumball Machine will spawn, -1 to disable"); GumballMachineGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Gumball Machine", "Gumball Machine Global Spawning", 15, "How often the Gumball Machine will spawn globally, -1 to disable"); GumballLoaded = cfg.Bind<bool>("Scrap Item - Gumball", "Gumball is loaded", true, "Whether or not the Gumball is loaded, this is ignored and set to true automatically if the candy dispenser is loaded"); GumballSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Gumball", "Gumball is a scrap item", true, "Whether or not the Gumball spawns as scrap"); GumballMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Gumball", "Gumball Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often Gumball will spawn, -1 to disable"); GumballGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Gumball", "Gumball Global Spawning", 20, "How often Gumball will spawn globally, -1 to disable"); BasicGumballEffects = cfg.Bind<bool>("Scrap Item - Gumball", "Basic Gumball Effects", false, "Restricts Gumball effects to sugar rush, sugar sickness, and endurance only (no semi-permanent effects)."); FuelCylinderLoaded = cfg.Bind<bool>("Scrap Item - Fuel Cylinder", "Fuel Cylinder is loaded", true, "Whether or not the Fuel Cylinder is loaded"); FuelCylinderSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Fuel Cylinder", "Fuel Cylinder is a scrap item", true, "Whether or not the Fuel Cylinder spawns as scrap"); FuelCylinderMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Fuel Cylinder", "Fuel Cylinder Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Fuel Cylinder will spawn, -1 to disable"); FuelCylinderGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Fuel Cylinder", "Fuel Cylinder Global Spawning", 25, "How often the Fuel Cylinder will spawn globally, -1 to disable"); RadioactiveCellLoaded = cfg.Bind<bool>("Scrap Item - Radioactive Cell", "Radioactive Cell is loaded", true, "Whether or not the Radioactive Cell is loaded"); RadioactiveCellSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Radioactive Cell", "Radioactive Cell is a scrap item", true, "Whether or not the Radioactive Cell spawns as scrap"); RadioactiveCellMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Radioactive Cell", "Radioactive Cell Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Radioactive Cell will spawn, -1 to disable"); RadioactiveCellGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Radioactive Cell", "Radioactive Cell Global Spawning", 20, "How often the Radioactive Cell will spawn globally, -1 to disable"); CapsulesDisabledOnTheShip = cfg.Bind<bool>("Scrap Items - Capsules", "Capsules Disabled On The Ship", true, "Whether or not capsules are disabled inside the ship when landed (Capsules are disabled in orbit always)"); GloomyCapsuleLoaded = cfg.Bind<bool>("Scrap Items - Capsules", "Gloomy Capsule is loaded", true, "Whether or not the Gloomy Capsule is loaded"); GloomyCapsuleSpawnsAsScrap = cfg.Bind<bool>("Scrap Items - Capsules", "Gloomy Capsule is a scrap item", true, "Whether or not the Gloomy Capsule spawns as scrap"); GloomyCapsuleMoonSpawnWeights = cfg.Bind<string>("Scrap Items - Capsules", "Gloomy Capsule Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Gloomy Capsule will spawn, -1 to disable"); GloomyCapsuleGlobalSpawnWeight = cfg.Bind<int>("Scrap Items - Capsules", "Gloomy Capsule Global Spawning", 15, "How often the Gloomy Capsule will spawn globally, -1 to disable"); FrigidCapsuleLoaded = cfg.Bind<bool>("Scrap Items - Capsules", "Frigid Capsule is loaded", true, "Whether or not the Frigid Capsule is loaded"); FrigidCapsuleSpawnsAsScrap = cfg.Bind<bool>("Scrap Items - Capsules", "Frigid Capsule is a scrap item", true, "Whether or not the Frigid Capsule spawns as scrap"); FrigidCapsuleMoonSpawnWeights = cfg.Bind<string>("Scrap Items - Capsules", "Frigid Capsule Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Frigid Capsule will spawn, -1 to disable"); FrigidCapsuleGlobalSpawnWeight = cfg.Bind<int>("Scrap Items - Capsules", "Frigid Capsule Global Spawning", 15, "How often the Frigid Capsule will spawn globally, -1 to disable"); BloodyCapsuleLoaded = cfg.Bind<bool>("Scrap Items - Capsules", "Bloody Capsule is loaded", true, "Whether or not the Bloody Capsule is loaded"); BloodyCapsuleSpawnsAsScrap = cfg.Bind<bool>("Scrap Items - Capsules", "Bloody Capsule is a scrap item", true, "Whether or not the Bloody Capsule spawns as scrap"); BloodyCapsuleMoonSpawnWeights = cfg.Bind<string>("Scrap Items - Capsules", "Bloody Capsule Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Bloody Capsule will spawn, -1 to disable"); BloodyCapsuleGlobalSpawnWeight = cfg.Bind<int>("Scrap Items - Capsules", "Bloody Capsule Global Spawning", 15, "How often the Bloody Capsule will spawn globally, -1 to disable"); PadlockLoaded = cfg.Bind<bool>("Scrap Item - Padlock", "Padlock is loaded", true, "Whether or not the Padlock is loaded"); PadlockSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Padlock", "Padlock is a scrap item", true, "Whether or not the Padlock spawns as scrap"); PadlockMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Padlock", "Padlock Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Padlock will spawn, -1 to disable"); PadlockGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Padlock", "Padlock Global Spawning", 35, "How often the Padlock will spawn globally, -1 to disable"); PadlockIsStoreItem = cfg.Bind<bool>("Scrap Item - Padlock", "Padlock is a store item", false, "Whether or not the Padlock is a store item"); PadlockStorePrice = cfg.Bind<int>("Scrap Item - Padlock", "Padlock store price", 25, "The store price of the Padlock (Cannot be a negative number)"); CrowbarLoaded = cfg.Bind<bool>("Scrap Item - Crowbar", "Crowbar is loaded", true, "Whether or not the Crowbar is loaded"); CrowbarSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Crowbar", "Crowbar is a scrap item", true, "Whether or not the Crowbar spawns as scrap"); CrowbarMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Crowbar", "Crowbar Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Crowbar will spawn, -1 to disable"); CrowbarGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Crowbar", "Crowbar Global Spawning", 25, "How often the Crowbar will spawn globally, -1 to disable"); CrowbarIsStoreItem = cfg.Bind<bool>("Scrap Item - Crowbar", "Crowbar is a store item", false, "Whether or not the Crowbar is a store item"); CrowbarStorePrice = cfg.Bind<int>("Scrap Item - Crowbar", "Crowbar store price", 75, "The store price of the Crowbar (Cannot be a negative number)"); FireAxeLoaded = cfg.Bind<bool>("Scrap Item - Fire Axe", "Fire Axe is loaded", true, "Whether or not the Fire Axe is loaded"); FireAxeSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Fire Axe", "Fire Axe is a scrap item", true, "Whether or not the Fire Axe spawns as scrap"); FireAxeMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Fire Axe", "Fire Axe Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Fire Axe will spawn, -1 to disable"); FireAxeGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Fire Axe", "Fire Axe Global Spawning", 20, "How often the Fire Axe will spawn globally, -1 to disable"); SledgehammerLoaded = cfg.Bind<bool>("Scrap Item - Sledgehammer", "Sledgehammer is loaded", true, "Whether or not the Sledgehammer is loaded"); SledgehammerSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Sledgehammer", "Sledgehammer is a scrap item", true, "Whether or not the Sledgehammer spawns as scrap"); SledgehammerMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Sledgehammer", "Sledgehammer Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Sledgehammer will spawn, -1 to disable"); SledgehammerGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Sledgehammer", "Sledgehammer Global Spawning", 20, "How often the Sledgehammer will spawn globally, -1 to disable"); AntiqueSwordLoaded = cfg.Bind<bool>("Scrap Item - Antique Sword", "Antique Sword is loaded", true, "Whether or not the Antique Sword is loaded"); AntiqueSwordSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Antique Sword", "Antique Sword is a scrap item", true, "Whether or not the Antique Sword spawns as scrap"); AntiqueSwordMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Antique Sword", "Antique Sword Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Antique Sword will spawn, -1 to disable"); AntiqueSwordGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Antique Sword", "Antique Sword Global Spawning", 15, "How often the Antique Sword will spawn globally, -1 to disable"); RegalScepterLoaded = cfg.Bind<bool>("Scrap Item - Regal Scepter", "Regal Scepter is loaded", true, "Whether or not the Regal Scepter is loaded"); RegalScepterSpawnsAsScrap = cfg.Bind<bool>("Scrap Item - Regal Scepter", "Regal Scepter is a scrap item", true, "Whether or not the Regal Scepter spawns as scrap"); RegalScepterMoonSpawnWeights = cfg.Bind<string>("Scrap Item - Regal Scepter", "Regal Scepter Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Regal Scepter will spawn, -1 to disable"); RegalScepterGlobalSpawnWeight = cfg.Bind<int>("Scrap Item - Regal Scepter", "Regal Scepter Global Spawning", 10, "How often the Regal Scepter will spawn globally, -1 to disable"); HandlampLoaded = cfg.Bind<bool>("Store Item - Handlamp", "Handlamp is loaded", true, "Whether or not the Handlamp is loaded"); HandlampIsStoreItem = cfg.Bind<bool>("Store Item - Handlamp", "Handlamp is a store item", true, "Whether or not the Handlamp is a store item"); HandlampStorePrice = cfg.Bind<int>("Store Item - Handlamp", "Handlamp store price", 25, "The store price of the Handlamp (Cannot be a negative number)"); BandagesLoaded = cfg.Bind<bool>("Store Item - Bandages", "Bandages are loaded", true, "Whether or not the Bandages are loaded"); BandagesIsStoreItem = cfg.Bind<bool>("Store Item - Bandages", "Bandages are a store item", true, "Whether or not the Bandages are a store it