Please disclose if your mod was created primarily 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 LethalLootBug v1.0.4
LethalLootBug.dll
Decompiled a year agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalLootBug")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A LootBug mod for Lethal Company")] [assembly: AssemblyFileVersion("1.0.4.0")] [assembly: AssemblyInformationalVersion("1.0.4")] [assembly: AssemblyProduct("LethalLootBug")] [assembly: AssemblyTitle("LethalLootBug")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LethalLootBug { [BepInPlugin("LethalLootBug", "LethalLootBug", "1.0.4")] public class Plugin : BaseUnityPlugin { public class FakeItem : GrabbableObject { private Vector3? initialPosition = null; private Quaternion? initialRotation = null; private float? grabHeightDiff = null; private bool grabbedLastFrame = false; public override void Start() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown base.grabbableToEnemies = true; base.grabbable = true; base.propColliders = (Collider[])(object)new Collider[0]; base.itemProperties = new Item(); base.itemProperties.isScrap = false; } public override void Update() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!initialPosition.HasValue) { initialPosition = ((Component)this).transform.position; } if (!initialRotation.HasValue) { initialRotation = ((Component)this).transform.rotation; } } public override void LateUpdate() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); if ((Object)(object)base.parentObject != (Object)null) { if (!grabbedLastFrame) { grabbedLastFrame = true; } else if (!grabHeightDiff.HasValue) { grabHeightDiff = ((Component)this).transform.position.y - initialPosition.Value.y; } } else if (grabbedLastFrame) { ((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y - grabHeightDiff.Value, ((Component)this).transform.position.z); ((Component)this).transform.rotation = initialRotation.Value; initialPosition = ((Component)this).transform.position; grabHeightDiff = null; grabbedLastFrame = false; } } } private Harmony _harmony = new Harmony("LethalLootBug"); public static ManualLogSource Logger; public static ConfigEntry<bool> CanGrabTurret; public static ConfigEntry<bool> CanGrabMine; private void Awake() { Logger = Logger.CreateLogSource("LethalLootBug"); Logger.LogInfo((object)"Plugin LethalLootBug is loading."); CanGrabTurret = ((BaseUnityPlugin)this).Config.Bind<bool>("Can Grab Turret", "GrabTurret", true, "Whether or not the Lootbugs can grab Turrets"); CanGrabMine = ((BaseUnityPlugin)this).Config.Bind<bool>("Can Grab Mine", "GrabMine", true, "Whether or not the Lootbugs can grab Mines"); Logger.LogInfo((object)"Loaded LethalLootBug. Patching."); _harmony.PatchAll(typeof(Plugin)); } [HarmonyPatch(typeof(RoundManager), "LoadNewLevel")] [HarmonyPrefix] public static void GameStart(RoundManager __instance, int randomSeed, SelectableLevel newLevel) { Logger.LogInfo((object)"Game Start"); SpawnableMapObject[] spawnableMapObjects = newLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { Logger.LogInfo((object)((Object)val.prefabToSpawn).name); if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Turret>() != (Object)null) { Logger.LogInfo((object)"Found Turret"); if (CanGrabTurret.Value && (Object)(object)val.prefabToSpawn.GetComponent<FakeItem>() == (Object)null) { val.prefabToSpawn.AddComponent<FakeItem>(); } } else if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Landmine>() != (Object)null) { Logger.LogInfo((object)"Found Landmine"); if (CanGrabMine.Value && (Object)(object)val.prefabToSpawn.GetComponent<FakeItem>() == (Object)null) { val.prefabToSpawn.AddComponent<FakeItem>(); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "LethalLootBug"; public const string PLUGIN_NAME = "LethalLootBug"; public const string PLUGIN_VERSION = "1.0.4"; } }