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 CoolerOxydeShip v0.0.1
CoolerOxydeShip.dll
Decompiled 4 days agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CodeRebirth; using CodeRebirth.src.Content.Maps; using CodeRebirth.src.Util; using CoolerOxydeShip.NetcodePatcher; using Dawn; using Dawn.Utils; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("CodeRebirth")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CoolerOxydeShip")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CoolerOxydeShip")] [assembly: AssemblyTitle("CoolerOxydeShip")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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; } } } namespace CoolerOxydeShip { internal class ConfigHandler : MonoBehaviour { public static ConfigEntry<float> chanceToDespawn; public static ConfigEntry<bool> shouldSpawnScrap; public static ConfigEntry<bool> shouldSpawnScrapOnFirstCrash; public static ConfigEntry<int> scrapMin; public static ConfigEntry<int> scrapMax; public static ConfigEntry<float> scrapValueMultiplier; public static ConfigEntry<float> scrapDistanceMin; public static ConfigEntry<float> scrapDistanceMax; public static ConfigEntry<bool> shouldSpawnMasked; public static ConfigEntry<bool> shouldSpawnMaskedOnFirstCrash; public static ConfigEntry<int> maskedMin; public static ConfigEntry<int> maskedMax; public static ConfigEntry<float> maskedDistanceMin; public static ConfigEntry<float> maskedDistanceMax; public static ConfigEntry<bool> muteShipOnTabletCollection; public static ConfigEntry<float> shipWaitTimeMin; public static ConfigEntry<float> shipWaitTimeMax; public static void Init(ConfigFile config) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Expected O, but got Unknown //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Expected O, but got Unknown //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Expected O, but got Unknown //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Expected O, but got Unknown //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Expected O, but got Unknown chanceToDespawn = config.Bind<float>("Ship", "Chance to Despawn", 33f, new ConfigDescription("An additional chance that if the ship 'spawns' (See the CodeRebirth spawn curve config for it), it will despawn anyways. Only applies once Oxyde is unlocked. This can be used to make the Crashing Ship less common once Oxyde is unlocked. A higher value increases the chance it will despawn, making it rarer once Oxyde is unlocked. At 0, the chance will never decrease. At 100, the ship will never spawn once Oxyde is unlocked like in Base CodeRebirth.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); shipWaitTimeMin = config.Bind<float>("Ship", "Minimum Wait Time", 180f, new ConfigDescription("The minimum time (in seconds) the ship will wait before crashing.", (AcceptableValueBase)null, Array.Empty<object>())); shipWaitTimeMax = config.Bind<float>("Ship", "Maximum Wait Time", 360f, new ConfigDescription("The maximum time (in seconds) the ship will wait before crashing.", (AcceptableValueBase)null, Array.Empty<object>())); muteShipOnTabletCollection = config.Bind<bool>("Ship", "Mute Ship on Tablet Collection", true, new ConfigDescription("If true, the alarm noise from the ship will be muted when the tablet is collected.", (AcceptableValueBase)null, Array.Empty<object>())); shouldSpawnScrap = config.Bind<bool>("Scrap Spawning", "Should Scrap Spawn", true, new ConfigDescription("If true, extra scrap will spawn when a ship crashes. If false, no extra scraps will spawn.", (AcceptableValueBase)null, Array.Empty<object>())); shouldSpawnScrapOnFirstCrash = config.Bind<bool>("Scrap Spawning", "Should Scrap Spawn on First Crash", false, new ConfigDescription("If true, extra scrap will always spawn at a crashed ship. If false, then only crashed ships encountered after Oxyde has been unlocked will spawn scrap.", (AcceptableValueBase)null, Array.Empty<object>())); scrapMin = config.Bind<int>("Scrap Spawning", "Minimum Scrap to Spawn", 3, new ConfigDescription("The minimum number of scrap items (inclusive) to spawn when a ship crashes. Shouldn't be higher than the maximum.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 20), Array.Empty<object>())); scrapMax = config.Bind<int>("Scrap Spawning", "Maximum Scrap to Spawn", 6, new ConfigDescription("The maximum number of scrap items (inclusive) to spawn when a ship crashes. Shouldn't be lower than the minimum.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); scrapValueMultiplier = config.Bind<float>("Scrap Spawning", "Scrap Value Multiplier", 1f, new ConfigDescription("A multiplier for the value of scrap spawned when a ship crashes. This should stack with existing multipliers, such as moon scrap value multipliers or weather multipliers with WeatherRegistry.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); scrapDistanceMin = config.Bind<float>("Scrap Spawning", "Minimum Scrap Distance", 7f, new ConfigDescription("The minimum distance from the ship's crash site that scrap can spawn. A higher value will make scrap spawn further away from the crash site. Shouldn't be higher than the maximum.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>())); scrapDistanceMax = config.Bind<float>("Scrap Spawning", "Maximum Scrap Distance", 12f, new ConfigDescription("The maximum distance from the ship's crash site that scrap can spawn. A higher value will make scrap spawn further away from the crash site. Shouldn't be lower than the minimum.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>())); shouldSpawnMasked = config.Bind<bool>("Masked Spawning", "Should Masked Spawn", true, new ConfigDescription("If true, Masked enemies will spawn when a ship crashes.", (AcceptableValueBase)null, Array.Empty<object>())); shouldSpawnMaskedOnFirstCrash = config.Bind<bool>("Masked Spawning", "Should Masked Spawn on First Crash", false, new ConfigDescription("If true, Masked enemies will always spawn at a crashed ship. If false, then only crashed ships encountered after Oxyde has been unlocked will spawn Masked enemies.", (AcceptableValueBase)null, Array.Empty<object>())); maskedMin = config.Bind<int>("Masked Spawning", "Minimum Masked to Spawn", 1, new ConfigDescription("The minimum number of Masked enemies (inclusive) to spawn when a ship crashes. Shouldn't be higher than the maximum.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 20), Array.Empty<object>())); maskedMax = config.Bind<int>("Masked Spawning", "Maximum Masked to Spawn", 3, new ConfigDescription("The maximum number of Masked enemies (inclusive) to spawn when a ship crashes. Shouldn't be lower than the minimum.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); maskedDistanceMin = config.Bind<float>("Masked Spawning", "Minimum Masked Distance", 7f, new ConfigDescription("The minimum distance from the ship's crash site that Masked enemies can spawn. A higher value will make Masked enemies spawn further away from the crash site. Shouldn't be higher than the maximum. Be careful to not make it too low, or they might be killed by the initial explosion.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>())); maskedDistanceMax = config.Bind<float>("Masked Spawning", "Maximum Masked Distance", 12f, new ConfigDescription("The maximum distance from the ship's crash site that Masked enemies can spawn. A higher value will make Masked enemies spawn further away from the crash site. Shouldn't be lower than the minimum. Be carefful to not make it too low, or they might be killed by the initial explosion.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>())); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("ZetaArcade.CoolerOxydeShip", "CoolerOxydeShip", "0.0.1")] public class CoolerOxydeShipPatch : BaseUnityPlugin { [HarmonyPatch(typeof(OxydeCrashingShip), "OnNetworkSpawn")] internal static class OxydeCrashingShipSpawnPatch { [HarmonyPrefix] private static bool Prefix(OxydeCrashingShip __instance) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) bool flag = false; DawnMoonInfo val = default(DawnMoonInfo); if (!((Registry<DawnMoonInfo>)(object)LethalContent.Moons).TryGetValue(CodeRebirthMoonKeys.Oxyde, ref val) || (object)val.DawnPurchaseInfo.PurchasePredicate.CanPurchase() == TerminalPurchaseResult.Success() || (object)val.DawnPurchaseInfo.PurchasePredicate.CanPurchase() == TerminalPurchaseResult.Hidden()) { flag = true; } if (((NetworkBehaviour)__instance).IsServer && flag && new Random(StartOfRound.Instance.randomMapSeed).NextDouble() * 100.0 < (double)ConfigHandler.chanceToDespawn.Value) { ((NetworkBehaviour)__instance).NetworkObject.Despawn(true); return false; } Vector3 position = ((Component)__instance).transform.position; ((Component)__instance).transform.position = new Vector3(9999f, 9999f, 9999f); if (!((NetworkBehaviour)__instance).IsServer) { return false; } ((MonoBehaviour)__instance).StartCoroutine(__instance.WaitToDoYourThing(position, Mathf.Lerp(ConfigHandler.shipWaitTimeMin.Value, ConfigHandler.shipWaitTimeMax.Value, (float)new Random(StartOfRound.Instance.randomMapSeed).NextDouble()))); Logger.LogDebug((object)$"Ship spawned at {position}"); return false; } } [HarmonyPatch(typeof(OxydeCrashingShip), "OnImpact")] internal static class OxydeCrashingShipImpactPatch { [HarmonyPostfix] private static void Postfix(OxydeCrashingShip __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_003c: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)__instance).IsServer) { Vector3 position = ((Component)__instance).transform.position; Vector3 value; Vector3 val = ((!TargetPositions.TryGetValue(__instance, out value)) ? position : value); Logger.LogDebug((object)$"Ship crashed at {position}"); Logger.LogDebug((object)$"Ship target was {val}"); bool flag = false; DawnMoonInfo val2 = default(DawnMoonInfo); if (!((Registry<DawnMoonInfo>)(object)LethalContent.Moons).TryGetValue(CodeRebirthMoonKeys.Oxyde, ref val2) || (object)val2.DawnPurchaseInfo.PurchasePredicate.CanPurchase() == TerminalPurchaseResult.Success() || (object)val2.DawnPurchaseInfo.PurchasePredicate.CanPurchase() == TerminalPurchaseResult.Hidden()) { flag = true; } if (ConfigHandler.shouldSpawnScrap.Value && (flag || ConfigHandler.shouldSpawnScrapOnFirstCrash.Value)) { SpawnOxydeScrap(val); } if (ConfigHandler.shouldSpawnMasked.Value && (flag || ConfigHandler.shouldSpawnMaskedOnFirstCrash.Value)) { SpawnMasked(val); } } } public static void StopAlarm(OxydeCrashingShip shipRef) { shipRef._CloseTravelAudio.Stop(); shipRef._NormalTravelAudio.Stop(); shipRef._ImpactAudio.Stop(); shipRef._CloseTravelAudio.volume = 0f; shipRef._NormalTravelAudio.volume = 0f; shipRef._ImpactAudio.volume = 0f; shipRef._CloseTravelAudio.mute = true; shipRef._NormalTravelAudio.mute = true; shipRef._ImpactAudio.mute = true; ((Behaviour)shipRef._CloseTravelAudio).enabled = false; ((Behaviour)shipRef._NormalTravelAudio).enabled = false; ((Behaviour)shipRef._ImpactAudio).enabled = false; Logger.LogDebug((object)"StopAlarm ran"); } private static void SpawnOxydeScrap(Vector3 spawnPosition) { //IL_0124: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) List<SpawnableItemWithRarity> list = RoundManager.Instance.currentLevel.spawnableScrap.Where((SpawnableItemWithRarity x) => x.rarity > 0).ToList(); if (list.Count == 0) { Logger.LogWarning((object)"WARNING: Couldn't find any scrap to spawn???"); return; } Random random = new Random(StartOfRound.Instance.randomMapSeed); int num = random.Next(ConfigHandler.scrapMin.Value, ConfigHandler.scrapMax.Value + 1); Logger.LogDebug((object)$"Ship spawning {num} scrap."); RaycastHit val4 = default(RaycastHit); for (int num2 = 0; num2 < num; num2++) { SpawnableItemWithRarity val = RandomExtensions.NextItem<SpawnableItemWithRarity>(random, (IList<SpawnableItemWithRarity>)list); Item spawnableItem = val.spawnableItem; if ((Object)(object)spawnableItem == (Object)null || (Object)(object)spawnableItem.spawnPrefab == (Object)null) { continue; } float num3 = (float)(random.NextDouble() * 3.1415927410125732 * 2.0); float num4 = Mathf.Lerp(ConfigHandler.scrapDistanceMin.Value, ConfigHandler.scrapDistanceMax.Value, (float)random.NextDouble()); Vector3 val2 = spawnPosition + new Vector3(Mathf.Cos(num3) * num4, 1f, Mathf.Sin(num3) * num4); Vector3 val3 = val2; if (Physics.Raycast(val2 + Vector3.up * 1f, Vector3.down, ref val4, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { val3 = ((RaycastHit)(ref val4)).point + Vector3.up * spawnableItem.verticalOffset; } GameObject val5 = Object.Instantiate<GameObject>(spawnableItem.spawnPrefab, val3, Quaternion.identity, (Transform)null); GrabbableObject component = val5.GetComponent<GrabbableObject>(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)("Ship spawned " + ((Object)spawnableItem).name + ", but it has no GrabbableObject component so its being killed")); Object.Destroy((Object)(object)val5); continue; } NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject; if ((Object)(object)networkObject == (Object)null) { Logger.LogWarning((object)("Ship spawned " + ((Object)spawnableItem).name + ", but it has no NetworkObject so its being killed")); Object.Destroy((Object)(object)val5); } else { networkObject.Spawn(false); int num5 = (int)(Mathf.Lerp((float)spawnableItem.minValue, (float)spawnableItem.maxValue, (float)random.NextDouble()) * RoundManager.Instance.scrapValueMultiplier * ConfigHandler.scrapValueMultiplier.Value); CodeRebirthUtils.Instance.SyncScanNodeParentRotationsAndFallRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)component), val2, val3, Quaternion.Euler(spawnableItem.restingRotation), num5); } } } private static void SpawnMasked(Vector3 spawnPosition) { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)StartOfRound.Instance).IsServer) { return; } EnemyType val = null; foreach (SpawnableEnemyWithRarity enemy in RoundManager.Instance.currentLevel.Enemies) { if (enemy.enemyType.enemyName == "Masked") { val = enemy.enemyType; break; } } if ((Object)(object)val == (Object)null) { Logger.LogWarning((object)"Could not find Masked EnemyType."); return; } Random random = new Random(StartOfRound.Instance.randomMapSeed); int num = random.Next(ConfigHandler.maskedMin.Value, ConfigHandler.maskedMax.Value + 1); Logger.LogDebug((object)$"Ship spawning {num} Masked."); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < num; i++) { float num2 = (float)(random.NextDouble() * 3.1415927410125732 * 2.0); float num3 = Mathf.Lerp(ConfigHandler.maskedDistanceMin.Value, ConfigHandler.maskedDistanceMax.Value, (float)random.NextDouble()); Vector3 val2 = spawnPosition + new Vector3(Mathf.Cos(num2) * num3, 2f, Mathf.Sin(num2) * num3); if (Physics.Raycast(val2, Vector3.down, ref val3, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val3)).point; } GameObject val4 = Object.Instantiate<GameObject>(val.enemyPrefab, val2, Quaternion.identity); NetworkObject component = val4.GetComponent<NetworkObject>(); if ((Object)(object)component == (Object)null) { Logger.LogWarning((object)"Masked prefab has no NetworkObject."); Object.Destroy((Object)(object)val4); } else { component.Spawn(true); } } } } [HarmonyPatch(typeof(GrabbableObject), "GrabItem")] public static class OxydeTabletGrabPatch { private const float ShipSearchRange = 30f; public static void Postfix(GrabbableObject __instance) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.itemProperties == (Object)null || __instance.itemProperties.itemName != "Oxyde Tablet") { return; } Logger.LogDebug((object)"Oxyde Tablet detected!"); Vector3 position = ((Component)__instance).transform.position; OxydeCrashingShip val = null; float num = 30f; foreach (KeyValuePair<OxydeCrashingShip, Vector3> targetPosition in TargetPositions) { OxydeCrashingShip key = targetPosition.Key; Vector3 value = targetPosition.Value; if (!((Object)(object)key == (Object)null)) { float num2 = Vector3.Distance(position, value); if (num2 <= num) { num = num2; val = key; } } } if ((Object)(object)val != (Object)null) { OxydeCrashingShipImpactPatch.StopAlarm(val); Logger.LogDebug((object)("Oxyde Tablet picked up near ship. " + $"Distance from ship: {num}")); } else { Logger.LogDebug((object)"Oxyde Tablet was picked up, but no ship was found nearby :c"); } } } private Harmony harmony = new Harmony("ZetaArcade.CoolerOxydeShip"); public static ManualLogSource Logger; public static CoolerOxydeShipPatch Instance; private static readonly Dictionary<OxydeCrashingShip, Vector3> TargetPositions = new Dictionary<OxydeCrashingShip, Vector3>(); private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Logger = ((BaseUnityPlugin)this).Logger; ConfigHandler.Init(((BaseUnityPlugin)this).Config); Logger.LogInfo((object)"Plugin is loaded!"); harmony.PatchAll(); } } internal class PluginInfo { public const string modGUID = "ZetaArcade.CoolerOxydeShip"; public const string modName = "CoolerOxydeShip"; public const string modVersion = "0.0.1"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace CoolerOxydeShip.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }