using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DobTweaks.Patches; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("DobTweaks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DobTweaks")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("14c5ffac-49dd-4285-b8e2-6b330fffcb1c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace DobTweaks { [BepInPlugin("Dob.DobTweaks", "Dob Tweaks", "1.0.0.0")] public class DobTweaksBase : BaseUnityPlugin { private const string modGUID = "Dob.DobTweaks"; private const string modname = "Dob Tweaks"; private const string modVersion = "1.0.0.0"; private readonly Harmony harmony = new Harmony("Dob.DobTweaks"); private static DobTweaksBase Instance; internal ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("Dob.DobTweaks"); mls.LogInfo((object)"Dob Tweaks online"); harmony.PatchAll(typeof(DobTweaksBase)); harmony.PatchAll(typeof(EnemyDropPatch)); } } } namespace DobTweaks.Patches { [HarmonyPatch(typeof(EnemyAI))] internal class EnemyDropPatch { [HarmonyPatch("HitEnemy")] [HarmonyPostfix] private static void EnemyDrops(ref Vector3 ___serverPosition) { //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) List spawnableScrap = Object.FindFirstObjectByType().currentLevel.spawnableScrap; Random random = new Random(); GameObject val = Object.Instantiate(spawnableScrap[random.Next(0, spawnableScrap.Count)].spawnableItem.spawnPrefab, ___serverPosition, Quaternion.identity); } } }