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 HexOfMelancholy v1.0.0
HexOfMelancholy.dll
Decompiled a day agousing System; 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 BepInEx; using BepInEx.Logging; using HG; using HG.Reflection; using Microsoft.CodeAnalysis; using R2API; using RoR2; using RoR2.Items; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HexOfMelancholy")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f1f69bb97d0b5655edc8b6210f923cf600518dd5")] [assembly: AssemblyProduct("HexOfMelancholy")] [assembly: AssemblyTitle("HexOfMelancholy")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 HexOfMelancholy { internal class Assets { private static AssetBundle bundle; public static Sprite hexMelancholyIcon; public static GameObject hexMelancholyDisplay; public static GameObject hexMelancholyPickup; public static void Initialize() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Melancholy.assets"); bundle = AssetBundle.LoadFromStream(stream); Log.Info("Loaded AssetBundle Melancholy.assets:", "E:\\Programming\\Game Modding\\Risk of Rain 2\\Hex of Melancholy\\HexOfMelancholy\\Assets.cs", 23); Log.Info(string.Join(", ", bundle.GetAllAssetNames()), "E:\\Programming\\Game Modding\\Risk of Rain 2\\Hex of Melancholy\\HexOfMelancholy\\Assets.cs", 24); hexMelancholyIcon = bundle.LoadAsset<Sprite>("assets/bundles/melancholy/items/melancholy/texicon.png"); hexMelancholyDisplay = bundle.LoadAsset<GameObject>("assets/bundles/melancholy/items/melancholy/displaymelancholy.prefab"); hexMelancholyPickup = bundle.LoadAsset<GameObject>("assets/bundles/melancholy/items/melancholy/pickupmelancholy.prefab"); } } internal class MelancholyBehavior : BaseItemBodyBehavior { public static PostProcessProfile profile; public static ColorGrading grading; private GameObject volumeObject; [ItemDefAssociation(useOnServer = false, useOnClient = true)] public static ItemDef GetItemDef() { return Items.hexMelancholy; } private void OnEnable() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown if (((BaseItemBodyBehavior)this).body.hasEffectiveAuthority && ((BaseItemBodyBehavior)this).body.isPlayerControlled) { if ((Object)(object)profile == (Object)null) { BuildProfile(); } volumeObject = new GameObject("MelancholyPostProcess") { layer = LayerIndex.postProcess.intVal }; volumeObject.SetActive(false); PostProcessVolume val = volumeObject.AddComponent<PostProcessVolume>(); val.isGlobal = true; val.priority = 100f; val.weight = 1f; val.sharedProfile = profile; volumeObject.SetActive(true); } } public override void OnInventoryRefresh() { if (!((Object)(object)volumeObject == (Object)null)) { Plugin.Instance.PluginLogger.LogInfo($"Hex of Melancholy equipped ({base.stack} stacks)"); ((ParameterOverride<float>)(object)grading.postExposure).Override(0f + -0.15f * (float)(base.stack - 1)); ((ParameterOverride<float>)(object)grading.contrast).Override(10f + 20f * (float)(base.stack - 1)); PostProcessVolume.DispatchVolumeSettingsChangedEvent(); } } private void OnDisable() { Plugin.Instance.PluginLogger.LogInfo("Hex of Melancholy unequipped!"); if ((Object)(object)volumeObject != (Object)null) { Object.Destroy((Object)(object)volumeObject); } } private static void BuildProfile() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) profile = ScriptableObject.CreateInstance<PostProcessProfile>(); grading = profile.AddSettings<ColorGrading>(); ((ParameterOverride<Tonemapper>)(object)grading.tonemapper).Override((Tonemapper)3); ((ParameterOverride<float>)(object)grading.toneCurveGamma).Override(2f); ((ParameterOverride<float>)(object)grading.postExposure).Override(0f); ((ParameterOverride<Color>)(object)grading.colorFilter).Override(new Color(0f, 0.2f, 1f)); ((ParameterOverride<float>)(object)grading.saturation).Override(100f); ((ParameterOverride<float>)(object)grading.contrast).Override(10f); } } public class Items { public static ItemDef hexMelancholy; public static void Initialize() { HexMelancholyAsHexItem(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnPostAppLoad)); } private static void OnPostAppLoad() { } private static void HexMelancholyAsHexItem() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown hexMelancholy = ScriptableObject.CreateInstance<ItemDef>(); SetItemTierToHex(hexMelancholy); SetLocalizationKey(hexMelancholy, "ELITEMASTERERIC_MELANCHOLY"); hexMelancholy.canRemove = true; hexMelancholy.hidden = false; hexMelancholy.pickupIconSprite = Assets.hexMelancholyIcon; hexMelancholy.pickupModelPrefab = Assets.hexMelancholyPickup; ItemAPI.Add(new CustomItem(hexMelancholy, BuildHexDisplayRules(Assets.hexMelancholyDisplay))); ApplyItemDisplay(Assets.hexMelancholyDisplay); ApplyLogbookDisplay(hexMelancholy); } private static void SetItemTierToHex(ItemDef itemDef) { SetItemTierByPath(itemDef, "RoR2/DLC4/HexDef.asset"); } private static void SetItemTierToHallowed(ItemDef itemDef) { SetItemTierByPath(itemDef, "RoR2/DLC4/CursedTierDef.asset"); } private static void SetItemTierToPage(ItemDef itemDef) { SetItemTierByPath(itemDef, "RoR2/DLC4/PageTierDef.asset"); } private static void SetItemTierByPath(ItemDef itemDef, string path) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) itemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)path).WaitForCompletion(); } private static void UsePlaceholderModel(ItemDef itemDef) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) itemDef.pickupIconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion(); itemDef.pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion(); } private static void LogPlacementRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) ItemDef val = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC4/HexCurse/HexCurse.asset").WaitForCompletion(); foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { CharacterModel componentInChildren = allBodyPrefab.GetComponentInChildren<CharacterModel>(); if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)componentInChildren.itemDisplayRuleSet)) { continue; } DisplayRuleGroup itemDisplayRuleGroup = componentInChildren.itemDisplayRuleSet.GetItemDisplayRuleGroup(val.itemIndex); if (!((DisplayRuleGroup)(ref itemDisplayRuleGroup)).isEmpty) { ItemDisplayRule[] rules = itemDisplayRuleGroup.rules; foreach (ItemDisplayRule val2 in rules) { Log.Info("rules.Add(\"" + ((Object)componentInChildren).name + "\", Rule(displayPrefab, \"" + val2.childName + "\", " + $"new Vector3({val2.localPos.x}f, {val2.localPos.y}f, {val2.localPos.z}f), " + $"new Vector3({val2.localAngles.x}f, {val2.localAngles.y}f, {val2.localAngles.z}f), " + $"new Vector3({val2.localScale.x}f, {val2.localScale.y}f, {val2.localScale.z}f)));", "E:\\Programming\\Game Modding\\Risk of Rain 2\\Hex of Melancholy\\HexOfMelancholy\\Item\\Items.cs", 92); } } } } private static void ApplyItemDisplay(GameObject displayPrefab) { ItemDisplay val = displayPrefab.AddComponent<ItemDisplay>(); val.rendererInfos = ((IEnumerable<Renderer>)displayPrefab.GetComponentsInChildren<Renderer>()).Select((Func<Renderer, RendererInfo>)((Renderer renderer) => new RendererInfo { renderer = renderer, defaultMaterial = renderer.sharedMaterial, defaultShadowCastingMode = (ShadowCastingMode)1 })).ToArray(); } private static void ApplyLogbookDisplay(ItemDef itemDef) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) GameObject pickupModelPrefab = itemDef.pickupModelPrefab; if (Object.op_Implicit((Object)(object)pickupModelPrefab)) { ModelPanelParameters val = UnityObjectExtensions.EnsureComponent<ModelPanelParameters>(pickupModelPrefab); if (!Object.op_Implicit((Object)(object)val.focusPointTransform)) { val.focusPointTransform = new GameObject("FocusPoint").transform; val.focusPointTransform.SetParent(itemDef.pickupModelPrefab.transform); } if (!Object.op_Implicit((Object)(object)val.cameraPositionTransform)) { val.cameraPositionTransform = new GameObject("CameraPosition").transform; val.cameraPositionTransform.SetParent(itemDef.pickupModelPrefab.transform); } } } private static ItemDisplayRuleDict BuildPlaceholderDisplayRules() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown return new ItemDisplayRuleDict((ItemDisplayRule[])null); } private static ItemDisplayRuleDict BuildHexDisplayRules(GameObject displayPrefab) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_073e: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07ea: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_087c: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_0937: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_097e: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Unknown result type (might be due to invalid IL or missing references) //IL_099c: Unknown result type (might be due to invalid IL or missing references) //IL_09ca: Unknown result type (might be due to invalid IL or missing references) //IL_09de: Unknown result type (might be due to invalid IL or missing references) //IL_09f2: Unknown result type (might be due to invalid IL or missing references) //IL_09f7: Unknown result type (might be due to invalid IL or missing references) //IL_09fc: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(0f, 0.2f, 0.2f), Vector3.zero, Vector3.one * 0.2f) }); val.Add("mdlAcolyteUnion", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.0796f, 0.146f, 0.1377f), new Vector3(20.27105f, 180f, 0f), new Vector3(0.16915f, 0.16915f, 0.16915f)) }); val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.1162f, 0.2323f, 0.1467f), new Vector3(-1.067752E-05f, 150f, -6.861771E-06f), new Vector3(0.1123359f, 0.1123359f, 0.1123359f)) }); val.Add("mdlBrother", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "LowerArmL", new Vector3(0.01846562f, 0.328752f, 0.0252654f), new Vector3(348.6916f, 38.38824f, 341.5876f), new Vector3(0.1f, 0.1f, 0.1f)) }); val.Add("mdlBrotherLogbook", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "LowerArmL", new Vector3(0.01846562f, 0.328752f, 0.0252654f), new Vector3(348.6916f, 38.38824f, 341.5876f), new Vector3(0.1f, 0.1f, 0.1f)) }); val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.108f, 0.1822f, 0.1866f), new Vector3(-1.510187E-05f, 148.5006f, 9.359778E-06f), new Vector3(0.1341257f, 0.1341257f, 0.1341258f)) }); val.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "OvenDoor", new Vector3(-0.4751f, 0.1282f, 0.0431f), new Vector3(-3.415093E-06f, 180f, 3.415095E-06f), new Vector3(0.2045f, 0.2045002f, 0.2045001f)) }); val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.1008f, 0.267f, 0.2021f), new Vector3(2.63528f, 165.5602f, 359.8929f), new Vector3(0.1f, 0.1f, 0.1f)) }); val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(0.907f, -0.53f, -2.178f), new Vector3(5.887945f, 334.4505f, 135.641f), new Vector3(1f, 0.9999994f, 1f)) }); val.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(0f, 0.201f, 0.201f), new Vector3(59.08591f, 148.8019f, 152.5459f), new Vector3(0.15147f, 0.15147f, 0.15147f)) }); val.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.0113f, -0.0939f, -0.1067f), new Vector3(294.7293f, 344.9807f, 15.31535f), new Vector3(0.1332682f, 0.1332682f, 0.1332682f)) }); val.Add("mdlEnforcer", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.1298f, 0.0359f, 0.2206f), new Vector3(4.434507E-13f, 152.9228f, 1.025943E-13f), new Vector3(0.1f, 0.1f, 0.09999996f)) }); val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.2004f, 0.1233f, 0.1867f), new Vector3(335.1944f, 148.3727f, 10.98021f), new Vector3(0.2751999f, 0.2751999f, 0.2752002f)) }); val.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "LegBar1", new Vector3(0f, 0.115f, 0.14f), new Vector3(4.656899f, 180f, 180f), new Vector3(0.4343099f, 0.4343099f, 0.4343099f)) }); val.Add("mdlEngiWalkerTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Head", new Vector3(-0.688f, 0.273f, 0.222f), new Vector3(350.5228f, 137.4514f, 1.298382E-06f), new Vector3(1f, 1f, 1f)) }); val.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.3109f, 0.1481f, 0.2457f), new Vector3(-8.67894E-13f, 150f, -1.503236E-12f), new Vector3(0.34593f, 0.34593f, 0.34593f)) }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.1439f, 0.1299f, 0.1233f), new Vector3(23.60964f, 119.0085f, -7.454135E-06f), new Vector3(0.1380912f, 0.1380912f, 0.1380912f)) }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.1006f, 0.1782f, 0.1945f), new Vector3(6.403304E-07f, 180f, -4.28554E-07f), new Vector3(0.25754f, 0.2575398f, 0.2575397f)) }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.0737f, 0.1016f, 0.1336f), new Vector3(-1.419108E-05f, 157.0628f, 7.343848E-06f), new Vector3(0.13377f, 0.1337701f, 0.13377f)) }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.084f, 0.1045f, 0.1878f), new Vector3(2.311238E-05f, 158.2706f, -1.008681E-05f), new Vector3(0.1373105f, 0.1373105f, 0.1373105f)) }); val.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.0712f, 0.0545f, 0.1393f), new Vector3(-4.268868E-07f, 180f, -1.838448E-07f), new Vector3(0.09841302f, 0.098413f, 0.09841298f)) }); val.Add("mdlScav", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(4.026f, 1.2f, -8.191f), new Vector3(12.17085f, 329.157f, 1.310107E-06f), new Vector3(2.2375f, 2.237627f, 2.237519f)) }); val.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.0897f, 0.0818f, 0.091f), new Vector3(4.698512f, 163.9156f, -1.606223E-07f), new Vector3(0.1397001f, 0.1397001f, 0.1397001f)) }); val.Add("mdlSquidTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "LegBar1", new Vector3(0f, 0.115f, 0.14f), new Vector3(4.656899f, 180f, 180f), new Vector3(0.4343099f, 0.4343099f, 0.4343099f)) }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-1.872f, 1.384f, 3.4f), new Vector3(-8.132429E-06f, 180f, -4.600729E-07f), new Vector3(1.442002f, 1.442f, 1.442f)) }); val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "PlatformBase", new Vector3(-0.2956f, -0.0484f, 0.522f), new Vector3(0f, 145.7062f, 0f), new Vector3(0.23986f, 0.2398602f, 0.2398601f)) }); val.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { BuildRule(displayPrefab, "Chest", new Vector3(-0.1246f, 0.0421f, 0.1705f), new Vector3(347.4507f, 156.0442f, 4.154682E-06f), new Vector3(0.1867999f, 0.1867999f, 0.1867999f)) }); return val; } private static ItemDisplayRule BuildRule(GameObject followerPrefab, string childName, Vector3 localPos, Vector3 localAngles, Vector3 localScale) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = followerPrefab, childName = childName, localPos = localPos, localAngles = localAngles, localScale = localScale }; } private static void SetLocalizationKey(ItemDef itemDef, string baseKey) { ((Object)itemDef).name = baseKey + "_NAME"; itemDef.nameToken = baseKey + "_NAME"; itemDef.pickupToken = baseKey + "_PICKUP"; itemDef.descriptionToken = baseKey + "_DESC"; itemDef.loreToken = baseKey + "_LORE"; } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string Format(object data, string file, int line) { string fileName = Path.GetFileName(file); return $"[{fileName}:{line}] {data}"; } internal static void Debug(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogDebug((object)Format(data, file, line)); } internal static void Error(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogError((object)Format(data, file, line)); } internal static void Fatal(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogFatal((object)Format(data, file, line)); } internal static void Info(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogInfo((object)Format(data, file, line)); } internal static void Message(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogMessage((object)Format(data, file, line)); } internal static void Warning(object data, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) { _logSource.LogWarning((object)Format(data, file, line)); } } public static class PluginInfo { public const string PLUGIN_ID = "HexOfMelancholy"; public const string PLUGIN_NAME = "Hex Of Melancholy"; public const string PLUGIN_AUTHOR = "EliteMasterEric"; public const string PLUGIN_VERSION = "1.0.0"; public const string PLUGIN_GUID = "com.elitemastereric.melancholy"; } [BepInPlugin("com.elitemastereric.melancholy", "Hex Of Melancholy", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public PluginLogger PluginLogger; public static Plugin Instance { get; private set; } public void Awake() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); PluginLogger = new PluginLogger(((BaseUnityPlugin)this).Logger); Assets.Initialize(); Items.Initialize(); } } public class PluginLogger { private ManualLogSource manualLogSource; public PluginLogger(ManualLogSource manualLogSource) { this.manualLogSource = manualLogSource; } public void LogFatal(object data) { manualLogSource.LogFatal(data); } public void LogError(object data) { manualLogSource.LogError(data); } public void LogWarning(object data) { manualLogSource.LogWarning(data); } public void LogMessage(object data) { manualLogSource.LogMessage(data); } public void LogInfo(object data) { manualLogSource.LogInfo(data); } public void LogDebug(object data) { manualLogSource.LogDebug(data); } } }