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 CoronerIntegrations v0.5.1
Coroner - Integrations.dll
Decompiled a week 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using Biodiversity.Behaviours; using Biodiversity.Creatures.Aloe; using Biodiversity.Creatures.CoilCrab; using Biodiversity.Creatures.Ogopogo; using ChillaxScraps.CustomEffects; using ChillaxScraps.Utils; using Coroner; using Coroner.Patch; using CoronerIntegrations.Patch.BiodiversityIntegration; using CoronerIntegrations.Patch.BiodiversityIntegration.Aloe; using CoronerIntegrations.Patch.BiodiversityIntegration.Critters; using CoronerIntegrations.Patch.BiodiversityIntegration.Ogopogo; using CoronerIntegrations.Patch.ChillaxScrapsIntegration; using CoronerIntegrations.Patch.CountryRoadCreatureIntegration; using CoronerIntegrations.Patch.JackensteinApparatusIntegration; using CoronerIntegrations.Patch.LegendWeathersIntegration; using CoronerIntegrations.Patch.LethalAnomaliesIntegration; using CoronerIntegrations.Patch.LethalDoorsFixedIntegration; using CoronerIntegrations.Patch.LockerIntegration; using CoronerIntegrations.Patch.PremiumScrapsIntegration; using CoronerIntegrations.Patch.RollingGiantIntegration; using CoronerIntegrations.Patch.ScopophobiaIntegration; using CoronerIntegrations.Patch.ShockwaveDroneIntegration; using CoronerIntegrations.Patch.SirenHeadIntegration; using CoronerIntegrations.Patch.TheCabinetIntegration; using CoronerIntegrations.Patch.UsualScrapIntegration; using CoronerIntegrations.Patch.ZeldaScrapsIntegration; using CountryRoadCreature.Scripts; using DroneEnemy; using GameNetcodeStuff; using HarmonyLib; using JackensteinApparatus; using LegendWeathers.BehaviourScripts; using LegendWeathers.Utils; using LegendWeathers.Weathers; using LethalAnomalies; using LethalAnomalies.External; using LethalSirenHead.Enemy; using Lethal_Doors.Patches; using Locker; using Locker.MonoBehaviours; using Microsoft.CodeAnalysis; using PremiumScraps.CustomEffects; using PremiumScraps.Utils; using RollingGiant; using ShyGuy.AI; using TheCabinet; using Unity.Netcode; using UnityEngine; using UsualScrap.Behaviors; using ZeldaScraps; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ChillaxScraps")] [assembly: IgnoresAccessChecksTo("com.github.biodiversitylc.Biodiversity")] [assembly: IgnoresAccessChecksTo("Coroner")] [assembly: IgnoresAccessChecksTo("DroneEnemy")] [assembly: IgnoresAccessChecksTo("LegendWeathers")] [assembly: IgnoresAccessChecksTo("Lethal_Doors")] [assembly: IgnoresAccessChecksTo("Lethal_Nuke")] [assembly: IgnoresAccessChecksTo("Locker")] [assembly: IgnoresAccessChecksTo("PremiumScraps")] [assembly: IgnoresAccessChecksTo("UsualScrap")] [assembly: IgnoresAccessChecksTo("Zeldahu.JackensteinApparatus")] [assembly: IgnoresAccessChecksTo("Zeldahu.LethalAnomalies")] [assembly: IgnoresAccessChecksTo("Zeldahu.ZeldaScraps")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Turkeysteaks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Provides integration between Coroner and many mods.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+2f1c4aca7457b790414aa334b33d388e1d817147")] [assembly: AssemblyProduct("Coroner - Integrations")] [assembly: AssemblyTitle("Coroner - Integrations")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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.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] [Microsoft.CodeAnalysis.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] [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 CoronerIntegrations { public static class PluginInfo { public const string PLUGIN_ID = "coroner.integrations"; public const string PLUGIN_NAME = "Coroner - Integrations"; public const string PLUGIN_VERSION = "1.0.0"; public const string PLUGIN_GUID = "Turkeysteaks.coroner.integrations"; } [BepInPlugin("Turkeysteaks.coroner.integrations", "Coroner - Integrations", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public ManualLogSource PluginLogger; public static Plugin Instance { get; private set; } internal Harmony Harmony { get; } = new Harmony("Turkeysteaks.coroner.integrations"); public void Awake() { Instance = this; PluginLogger = ((BaseUnityPlugin)this).Logger; PluginLogger.LogInfo((object)"Plugin Coroner - Integrations (Turkeysteaks.coroner.integrations) is loading..."); PluginLogger.LogInfo((object)$"Biodiversity Found: {BiodiversitySoftDep.enabled}"); if (BiodiversitySoftDep.enabled) { Harmony.PatchAll(typeof(AloeBludgeonPatch)); Harmony.PatchAll(typeof(AloeCrushPatch)); Harmony.PatchAll(typeof(AloeSlapPatch)); Harmony.PatchAll(typeof(CoilCrabPatch)); Harmony.PatchAll(typeof(LandmineSpawnExplosionPatchPatch)); Harmony.PatchAll(typeof(PrototaxPatch)); Harmony.PatchAll(typeof(OgopogoPatch)); Harmony.PatchAll(typeof(VerminPatch)); BiodiversitySoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"Scopophobia Found: {ScopophobiaSoftDep.enabled}"); if (ScopophobiaSoftDep.enabled) { Harmony.PatchAll(typeof(KillPlayerAnimationPatch)); ScopophobiaSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"LethalSirenHead Found: {SirenHeadSoftDep.enabled}"); if (SirenHeadSoftDep.enabled) { Harmony.PatchAll(typeof(SirenHeadEatPlayerPatch)); SirenHeadSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"The Cabinet Found: {TheCabinetSoftDep.enabled}"); if (TheCabinetSoftDep.enabled) { Harmony.PatchAll(typeof(CoronerIntegrations.Patch.TheCabinetIntegration.KillPlayerPatch)); TheCabinetSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"Locker Found: {LockerSoftDep.enabled}"); if (LockerSoftDep.enabled) { Harmony.PatchAll(typeof(CoronerIntegrations.Patch.LockerIntegration.KillPlayerPatch)); Harmony.PatchAll(typeof(ExplodePatch)); LockerSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"CountryRoadCreature Found: {CountryRoadCreatureSoftDep.enabled}"); if (CountryRoadCreatureSoftDep.enabled) { Harmony.PatchAll(typeof(GrabAnimationPatch)); Harmony.PatchAll(typeof(ParanoidAnimationPatch)); CountryRoadCreatureSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"LethalDoorsFixed Found: {LethalDoorsFixedSoftDep.enabled}"); if (LethalDoorsFixedSoftDep.enabled) { Harmony.PatchAll(typeof(DoorInteractionPatch)); LethalDoorsFixedSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"RollingGiant Found: {RollingGiantSoftDep.enabled}"); if (RollingGiantSoftDep.enabled) { Harmony.PatchAll(typeof(OnCollideWithPlayerPatch)); RollingGiantSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"ShockwaveDrone Found: {ShockwaveDroneSoftDep.enabled}"); if (ShockwaveDroneSoftDep.enabled) { Harmony.PatchAll(typeof(ShockScanPatch)); Harmony.PatchAll(typeof(ShockCreateExplosionPatch)); ShockwaveDroneSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"UsualScrap Found: {UsualScrapSoftDep.enabled}"); if (UsualScrapSoftDep.enabled) { Harmony.PatchAll(typeof(RosePatchEquip)); Harmony.PatchAll(typeof(RosePatchPocket)); Harmony.PatchAll(typeof(ScissorPatch)); Harmony.PatchAll(typeof(RadioactiveCellPatch)); UsualScrapSoftDep.CoronerRegister(); } PluginLogger.LogInfo((object)$"LegendWeathers Found: {LegendWeathersSoftDep.Enabled}"); if (LegendWeathersSoftDep.Enabled) { LegendWeathersSoftDep.Register(); } PluginLogger.LogInfo((object)$"PremiumScraps Found: {PremiumScrapsSoftDep.Enabled}"); if (PremiumScrapsSoftDep.Enabled) { PremiumScrapsSoftDep.Register(); } PluginLogger.LogInfo((object)$"ChillaxScraps Found: {ChillaxScrapsSoftDep.Enabled}"); if (ChillaxScrapsSoftDep.Enabled) { ChillaxScrapsSoftDep.Register(); } PluginLogger.LogInfo((object)$"JackensteinApparatus Found: {JackensteinApparatusSoftDep.Enabled}"); if (JackensteinApparatusSoftDep.Enabled) { JackensteinApparatusSoftDep.Register(); } PluginLogger.LogInfo((object)$"LethalAnomalies Found: {LethalAnomaliesSoftDep.Enabled}"); if (LethalAnomaliesSoftDep.Enabled) { LethalAnomaliesSoftDep.Register(); } PluginLogger.LogInfo((object)$"ZeldaScraps Found: {ZeldaScrapsSoftDep.Enabled}"); if (ZeldaScrapsSoftDep.Enabled) { ZeldaScrapsSoftDep.Register(); } PluginLogger.LogInfo((object)"Plugin Coroner - Integrations (Turkeysteaks.coroner.integrations) is loaded!"); } } } namespace CoronerIntegrations.Patch { public class SimpleEnumerator : IEnumerable { [CompilerGenerated] private sealed class <GetEnumerator>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SimpleEnumerator <>4__this; private object <item>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GetEnumerator>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <item>5__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.prefixAction(); break; case 1: <>1__state = -1; <>4__this.postItemAction(<item>5__1); <item>5__1 = null; break; } if (<>4__this.enumerator.MoveNext()) { <item>5__1 = <>4__this.enumerator.Current; <>4__this.preItemAction(<item>5__1); <>2__current = <>4__this.itemAction(<item>5__1); <>1__state = 1; return true; } <>4__this.postfixAction(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public IEnumerator enumerator; public Action prefixAction; public Action postfixAction; public Action<object> preItemAction; public Action<object> postItemAction; public Func<object, object> itemAction; IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } [IteratorStateMachine(typeof(<GetEnumerator>d__7))] public IEnumerator GetEnumerator() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GetEnumerator>d__7(0) { <>4__this = this }; } } internal static class Utilities { public static AdvancedCauseOfDeath RegisterIntegrationKey(string key) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(key)) { return API.Register(key); } return AdvancedCauseOfDeath.Registry[key]; } public static void SetCauseOfDeath(PlayerControllerB player, AdvancedCauseOfDeath causeOfDeath, bool forceOverride = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) AdvancedDeathTracker.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)causeOfDeath, forceOverride); } public static void SetCauseOfDeath(int playerId, AdvancedCauseOfDeath causeOfDeath, bool forceOverride = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) AdvancedDeathTracker.SetCauseOfDeath(playerId, (AdvancedCauseOfDeath?)causeOfDeath, forceOverride); } public static PlayerControllerB? GetLocalPlayerInExplosionArea(Vector3 explosionPosition, float explosionRadius, bool shouldPlayerBeDead = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(explosionPosition, explosionRadius, 2621448, (QueryTriggerInteraction)2); for (int i = 0; i < array.Length; i++) { if (((Component)array[i]).gameObject.layer == 3) { PlayerControllerB component = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController && ((component.isPlayerDead && shouldPlayerBeDead) || (!component.isPlayerDead && !shouldPlayerBeDead))) { return component; } } } return null; } } } namespace CoronerIntegrations.Patch.ZeldaScrapsIntegration { [HarmonyPatch] internal class ZeldaScrapsPatches { [CompilerGenerated] private sealed class <FireworkExplosionPatch>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; public FireworkRocketVisual __instance; private int <i>5__1; private PlayerControllerB <player>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FireworkExplosionPatch>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; break; case 1: <>1__state = -1; break; } if (result.MoveNext()) { if (<i>5__1 == 1) { <player>5__2 = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position, __instance.explosionRange + __instance.explosionRange * 0.5f); if ((Object)(object)<player>5__2 != (Object)null) { Utilities.SetCauseOfDeath(<player>5__2, ZeldaScrapsSoftDep.FIREWORK); } <player>5__2 = null; } <i>5__1++; <>2__current = result.Current; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <RareBaubleExplosionPatch>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; public ChristmasBauble __instance; private PlayerControllerB <player>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RareBaubleExplosionPatch>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!__instance.isRare) { return false; } break; case 1: <>1__state = -1; <player>5__1 = null; break; } if (result.MoveNext()) { <player>5__1 = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position, 1f); if ((Object)(object)<player>5__1 != (Object)null) { Utilities.SetCauseOfDeath(<player>5__1, ZeldaScrapsSoftDep.CHRISTMAS_BAUBLE); } <>2__current = result.Current; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(<RareBaubleExplosionPatch>d__0))] [HarmonyPostfix] [HarmonyPatch(typeof(ChristmasBauble), "BreakBaubleCoroutine")] public static IEnumerator RareBaubleExplosionPatch(IEnumerator result, ChristmasBauble __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RareBaubleExplosionPatch>d__0(0) { result = result, __instance = __instance }; } [IteratorStateMachine(typeof(<FireworkExplosionPatch>d__1))] [HarmonyPostfix] [HarmonyPatch(typeof(FireworkRocketVisual), "FireworkExplosionTimer")] public static IEnumerator FireworkExplosionPatch(IEnumerator result, FireworkRocketVisual __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FireworkExplosionPatch>d__1(0) { result = result, __instance = __instance }; } } internal class ZeldaScrapsSoftDep { private static bool? _enabled; public static AdvancedCauseOfDeath CHRISTMAS_BAUBLE; public static AdvancedCauseOfDeath FIREWORK; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("Zeldahu.ZeldaScraps"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Register() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.Harmony.PatchAll(typeof(ZeldaScrapsPatches)); CHRISTMAS_BAUBLE = Utilities.RegisterIntegrationKey("DeathItemChristmasBauble"); FIREWORK = Utilities.RegisterIntegrationKey("DeathItemFirework"); } } } namespace CoronerIntegrations.Patch.UsualScrapIntegration { [HarmonyPatch(typeof(RadioactiveCellScript))] [HarmonyPatch("DamageHolder")] public class RadioactiveCellPatch { private static PlayerControllerB player; public static void Postfix(RadioactiveCellScript __instance, ref PlayerControllerB ___playerHeldBy) { if ((Object)(object)___playerHeldBy != (Object)null) { player = ___playerHeldBy; } } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static void Postfix_MoveNext(bool __result) { try { if (!__result) { HandleKill(); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in RadioactiveCellPatch.MoveNext Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (player.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by holding a radioactive cell! Processing..."); Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was killed by holding a radioactive cell! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)UsualScrapSoftDep.RADIOACTIVE_CELL); } } } [HarmonyPatch(typeof(RoseScript))] [HarmonyPatch("EquipItem")] public class RosePatchEquip { private static PlayerControllerB player; public static void Prefix(RoseScript __instance, ref PlayerControllerB ___player) { if (!((Object)(object)___player == (Object)null)) { player = ___player; } } public static void Postfix(RoseScript __instance) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) try { if (Object.op_Implicit((Object)(object)player) && player.isPlayerDead) { API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)UsualScrapSoftDep.ROSE); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in RosePatchEquip: " + ex.Message)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(RoseScript))] [HarmonyPatch("PocketItem")] public class RosePatchPocket { private static PlayerControllerB player; public static void Prefix(RoseScript __instance, ref PlayerControllerB ___player) { if (!((Object)(object)___player == (Object)null)) { player = ___player; } } public static void Postfix(RoseScript __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) try { if (player.isPlayerDead) { API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)UsualScrapSoftDep.ROSE); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in RosePatchPocket: " + ex.Message)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(SizableScissorsScript))] [HarmonyPatch("RollForDamage")] public class ScissorPatch { private static PlayerControllerB player; private static readonly int scissorRunDamage = 15; public static void Postfix(SizableScissorsScript __instance, ref PlayerControllerB ___playerHeldBy) { if ((Object)(object)___playerHeldBy != (Object)null) { player = ___playerHeldBy; } } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static void Postfix_MoveNext() { try { if ((Object)(object)player != (Object)null && (player.isPlayerDead || player.health <= scissorRunDamage)) { HandleKill(); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ScissorPatch.MoveNext Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by running with scissors! Processing..."); Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was killed by running with scissors! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)UsualScrapSoftDep.SCISSORS_RUNNING); } } public class UsualScrapSoftDep { private static bool? _enabled; public static string ROSE_KEY = "DeathSelectRose"; public static AdvancedCauseOfDeath ROSE; public static string SCISSORS_RUNNING_KEY = "DeathScissorsRunning"; public static AdvancedCauseOfDeath SCISSORS_RUNNING; public static string RADIOACTIVE_CELL_KEY = "DeathHoldRadioactiveCell"; public static AdvancedCauseOfDeath RADIOACTIVE_CELL; public static string INJECTOR_OD_KEY = "DeathEmergencyInjectorOverdose"; public static AdvancedCauseOfDeath INJECTOR_OD; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("Emil.UsualScrap"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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) if (!API.IsRegistered(ROSE_KEY)) { ROSE = API.Register(ROSE_KEY); } if (!API.IsRegistered(SCISSORS_RUNNING_KEY)) { SCISSORS_RUNNING = API.Register(SCISSORS_RUNNING_KEY); } if (!API.IsRegistered(RADIOACTIVE_CELL_KEY)) { RADIOACTIVE_CELL = API.Register(RADIOACTIVE_CELL_KEY); } if (!API.IsRegistered(INJECTOR_OD_KEY)) { INJECTOR_OD = API.Register(INJECTOR_OD_KEY); } } } } namespace CoronerIntegrations.Patch.TheCabinetIntegration { [HarmonyPatch(typeof(TheCabinetAI))] [HarmonyPatch("KillPlayer")] internal class KillPlayerPatch { public static void Postfix(TheCabinetAI __instance, ulong playerId, ref IEnumerator __result) { try { Action prefixAction = delegate { Console.WriteLine("--> beginning"); }; Action postfixAction = delegate { HandleCabinetKill(playerId); }; Action<object> preItemAction = delegate(object item) { Console.WriteLine($"--> before {item}"); }; Action<object> postItemAction = delegate(object item) { Console.WriteLine($"--> after {item}"); }; Func<object, object> itemAction = delegate(object item) { string text = item?.ToString() + "+"; Console.WriteLine($"--> item {item} => {text}"); return text; }; SimpleEnumerator simpleEnumerator = new SimpleEnumerator { enumerator = __result, prefixAction = prefixAction, postfixAction = postfixAction, preItemAction = preItemAction, postItemAction = postItemAction, itemAction = itemAction }; __result = simpleEnumerator.GetEnumerator(); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in KillPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleCabinetKill(ulong playerId) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by The Cabinet! Processing..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerId} was killed by The Cabinet! Setting cause of death..."); API.SetCauseOfDeath(val, (AdvancedCauseOfDeath?)TheCabinetSoftDep.CABINET); } } public class TheCabinetSoftDep { private static bool? _enabled; public static string CABINET_KEY = "DeathEnemyCabinet"; public static AdvancedCauseOfDeath CABINET; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("VectorV.TheCabinet"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(CABINET_KEY)) { CABINET = API.Register(CABINET_KEY); } } } } namespace CoronerIntegrations.Patch.SirenHeadIntegration { [HarmonyPatch(typeof(SirenHeadAI))] [HarmonyPatch("EatPlayer")] internal class SirenHeadEatPlayerPatch { private static ulong playerID; public static void Postfix(SirenHeadAI __instance, ulong player, ref IEnumerator __result) { playerID = player; } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static void Postfix_MoveNext(bool __result) { try { if (!__result) { HandleSirenHeadKill(playerID); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in SirenHeadEatPlayerPatch: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleSirenHeadKill(ulong playerId) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by Siren Head! Processing..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerId} was killed by Siren Head! Setting cause of death..."); API.SetCauseOfDeath(val, (AdvancedCauseOfDeath?)SirenHeadSoftDep.SIREN_HEAD); playerID = 100000uL; } } public class SirenHeadSoftDep { private static bool? _enabled; public static string SIREN_HEAD_KEY = "DeathEnemySirenHead"; public static AdvancedCauseOfDeath SIREN_HEAD; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("Ccode.SirenHead"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(SIREN_HEAD_KEY)) { SIREN_HEAD = API.Register(SIREN_HEAD_KEY); } } } } namespace CoronerIntegrations.Patch.ShockwaveDroneIntegration { [HarmonyPatch(typeof(DroneEnemyAI))] [HarmonyPatch("CreateExplosion")] public class ShockCreateExplosionPatch { private static Collider[] colliderArray = (Collider[])(object)new Collider[16]; public static void Postfix(DroneEnemyAI __instance, Vector3 explosionPosition, bool spawnExplosionEffect, int damage, float minDamageRange, float maxDamageRange) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) int num = Physics.OverlapSphereNonAlloc(explosionPosition, maxDamageRange, colliderArray, 2621448, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { if (((Component)colliderArray[i]).gameObject.layer == 3) { PlayerControllerB component = ((Component)colliderArray[i]).gameObject.GetComponent<PlayerControllerB>(); if (!((Object)(object)component == (Object)null) && component.isPlayerDead) { HandleDroneExplode(component); } } } } private static void HandleDroneExplode(PlayerControllerB player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by dying drone! Processing..."); if (player.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.actualClientId} was killed by dying drone! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)ShockwaveDroneSoftDep.SHOCKWAVE_DRONE_EXPLODE); } } } [HarmonyPatch(typeof(DroneEnemyAI))] [HarmonyPatch("Scan")] public class ShockScanPatch { private static int numB; private static int playerLayer = 8; private static Transform scanArea = new Transform(); private static Collider[] hitColliders = (Collider[])(object)new Collider[256]; public static void Postfix(DroneEnemyAI __instance, ref Transform ___scanArea) { numB = 0; scanArea = ___scanArea; } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static void Postfix_MoveNext(bool __result) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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) try { if (__result) { numB++; if (numB > 2) { hitColliders = Physics.OverlapBox(scanArea.position, scanArea.localScale, Quaternion.identity, playerLayer); HandleKill(); } } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ShockScanPatch.MoveNext Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < hitColliders.Length && !((Object)(object)hitColliders[i] == (Object)null); i++) { PlayerControllerB component = ((Component)hitColliders[i]).gameObject.GetComponent<PlayerControllerB>(); if (component.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {component.actualClientId} was killed by Shockwave! Setting cause of death..."); API.SetCauseOfDeath(component, (AdvancedCauseOfDeath?)ShockwaveDroneSoftDep.SHOCKWAVE_DRONE_SCAN); } } } } public class ShockwaveDroneSoftDep { private static bool? _enabled; public static string SHOCKWAVE_DRONE_SCAN_KEY = "DeathEnemyShockwaveDroneScan"; public static AdvancedCauseOfDeath SHOCKWAVE_DRONE_SCAN; public static string SHOCKWAVE_DRONE_EXPLODE_KEY = "DeathEnemyShockwaveDroneExplode"; public static AdvancedCauseOfDeath SHOCKWAVE_DRONE_EXPLODE; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("droneenemy"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_003f: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(SHOCKWAVE_DRONE_SCAN_KEY)) { SHOCKWAVE_DRONE_SCAN = API.Register(SHOCKWAVE_DRONE_SCAN_KEY); } if (!API.IsRegistered(SHOCKWAVE_DRONE_EXPLODE_KEY)) { SHOCKWAVE_DRONE_EXPLODE = API.Register(SHOCKWAVE_DRONE_EXPLODE_KEY); } } } } namespace CoronerIntegrations.Patch.ScopophobiaIntegration { [HarmonyPatch(typeof(ShyGuyAI))] [HarmonyPatch("killPlayerAnimation")] internal class KillPlayerAnimationPatch { public static void Postfix(ShyGuyAI __instance, ulong playerId, ref IEnumerator __result) { try { Action prefixAction = delegate { Console.WriteLine("--> beginning"); }; Action postfixAction = delegate { HandleShyGuyKill(playerId); }; Action<object> preItemAction = delegate(object item) { Console.WriteLine($"--> before {item}"); }; Action<object> postItemAction = delegate(object item) { Console.WriteLine($"--> after {item}"); }; Func<object, object> itemAction = delegate(object item) { string text = item?.ToString() + "+"; Console.WriteLine($"--> item {item} => {text}"); return text; }; SimpleEnumerator simpleEnumerator = new SimpleEnumerator { enumerator = __result, prefixAction = prefixAction, postfixAction = postfixAction, preItemAction = preItemAction, postItemAction = postItemAction, itemAction = itemAction }; __result = simpleEnumerator.GetEnumerator(); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in KillPlayerAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleShyGuyKill(ulong playerId) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by Shy Guy! Processing..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerId} was killed by Shy Guy! Setting cause of death..."); API.SetCauseOfDeath(val, (AdvancedCauseOfDeath?)ScopophobiaSoftDep.SHY_GUY); } } public class ScopophobiaSoftDep { private static bool? _enabled; public static string SHY_GUY_KEY = "DeathEnemyShyGuy"; public static AdvancedCauseOfDeath SHY_GUY; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("Scopophobia"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(SHY_GUY_KEY)) { SHY_GUY = API.Register(SHY_GUY_KEY); } } } } namespace CoronerIntegrations.Patch.RollingGiantIntegration { [HarmonyPatch(typeof(RollingGiantAI))] [HarmonyPatch("OnCollideWithPlayer")] public class OnCollideWithPlayerPatch { private static PlayerControllerB player; public static void Postfix(RollingGiantAI __instance, Collider other) { try { player = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)player != (Object)null && player.isPlayerDead) { HandleKill(player); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in RollingGiant OnCollideWithPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill(PlayerControllerB player) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (player.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was killed by the Rolling Giant! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)RollingGiantSoftDep.ROLLING_GIANT); } } } public class RollingGiantSoftDep { private static bool? _enabled; public static string ROLLING_GIANT_KEY = "DeathEnemyRollingGiant"; public static AdvancedCauseOfDeath ROLLING_GIANT; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("nomnomab.rollinggiant"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(ROLLING_GIANT_KEY)) { ROLLING_GIANT = API.Register(ROLLING_GIANT_KEY); } } } } namespace CoronerIntegrations.Patch.PremiumScrapsIntegration { [HarmonyPatch] internal class PremiumScrapsControllerPatches { [HarmonyPrefix] [HarmonyPatch(typeof(Controller), "Update")] public static void ControllerCheckForDeadTarget(Controller __instance) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null) && GameNetworkManager.Instance.localPlayerController.playerClientId == ((GrabbableObject)__instance).playerHeldBy.playerClientId && __instance.screenIsReady && !((Object)(object)__instance.targetPlayer == (Object)null) && (__instance.targetPlayer.disconnectedMidGame || !((NetworkBehaviour)__instance.targetPlayer).IsSpawned || !__instance.targetPlayer.isPlayerControlled || __instance.targetPlayer.isPlayerDead)) { Utilities.SetCauseOfDeath(__instance.targetPlayer, PremiumScrapsSoftDep.CONTROLLER); } } } [HarmonyPatch(typeof(Effects))] internal class PremiumScrapsEffectsPatches { [HarmonyPostfix] [HarmonyPatch("Explosion")] public static void ExplosionPatch(Vector3 position, float range, int damage, float physicsForce) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) PremiumScrapsExplosionLogic(position, range, damage, physicsForce); } [HarmonyPostfix] [HarmonyPatch("ExplosionLight")] public static void ExplosionLightPatch(Vector3 position, float range, int damage, float physicsForce) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) PremiumScrapsExplosionLogic(position, range, damage, physicsForce, isLight: true); } private static void PremiumScrapsExplosionLogic(Vector3 position, float range, int damage, float physicsForce, bool isLight = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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) PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(position, range * (isLight ? 1f : 2.5f)); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { if ((range == 2f && damage == 90 && physicsForce == 5f) || (range == 4f && damage == 100 && physicsForce == 20f)) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, PremiumScrapsSoftDep.BOMB); } else if (range == 3f && damage == 50 && physicsForce == 20f) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, PremiumScrapsSoftDep.KING); } else if (range == 3f && damage == 80 && physicsForce == 10f) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, PremiumScrapsSoftDep.CONTROLLER_UNLUCKY); } else if (range == 4.5f && damage == 40 && physicsForce == 2f) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, PremiumScrapsSoftDep.FAKE_AIRHORN_EXPLOSION); } else if (range == 1.5f && damage == 50 && physicsForce == 1f) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, PremiumScrapsSoftDep.HELM_DOMINATION); } else if (range == 2f && damage == 20 && physicsForce == 1f) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, PremiumScrapsSoftDep.GAZPACHO_EXPLOSION); } } } [HarmonyPostfix] [HarmonyPatch("Damage")] public static void DamagePatch(PlayerControllerB player, CauseOfDeath cause, int animation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) PremiumScrapsDamageLogic(player, cause, animation); } private static void PremiumScrapsDamageLogic(PlayerControllerB player, CauseOfDeath cause, int animation) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Invalid comparison between Unknown and I4 //IL_0063: 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_0095: Invalid comparison between Unknown and I4 //IL_0083: 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_00b7: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController && player.isPlayerDead) { if ((int)cause == 13 && animation == 6) { Utilities.SetCauseOfDeath(player, PremiumScrapsSoftDep.FAKE_AIRHORN_LIGHTNING); } else if ((int)cause == 16 && animation == 3) { Utilities.SetCauseOfDeath(player, PremiumScrapsSoftDep.JOB_APPLICATION); } else if ((int)cause == 5 && animation == 7) { Utilities.SetCauseOfDeath(player, PremiumScrapsSoftDep.GAZPACHO_DRUNK); } else if ((int)cause == 16 && animation == 0) { Utilities.SetCauseOfDeath(player, PremiumScrapsSoftDep.SQUARE_STEEL); } else if ((int)cause == 4 && animation == 1) { Utilities.SetCauseOfDeath(player, PremiumScrapsSoftDep.FRIENDSHIP_ENDER); } } } } public class PremiumScrapsSoftDep { private static bool? _enabled; public static AdvancedCauseOfDeath BOMB; public static AdvancedCauseOfDeath KING; public static AdvancedCauseOfDeath CONTROLLER; public static AdvancedCauseOfDeath CONTROLLER_UNLUCKY; public static AdvancedCauseOfDeath FAKE_AIRHORN_EXPLOSION; public static AdvancedCauseOfDeath FAKE_AIRHORN_LIGHTNING; public static AdvancedCauseOfDeath JOB_APPLICATION; public static AdvancedCauseOfDeath HELM_DOMINATION; public static AdvancedCauseOfDeath GAZPACHO_DRUNK; public static AdvancedCauseOfDeath GAZPACHO_EXPLOSION; public static AdvancedCauseOfDeath SQUARE_STEEL; public static AdvancedCauseOfDeath FRIENDSHIP_ENDER; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("zigzag.premiumscraps"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Register() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.Harmony.PatchAll(typeof(PremiumScrapsEffectsPatches)); Plugin.Instance.Harmony.PatchAll(typeof(PremiumScrapsControllerPatches)); BOMB = Utilities.RegisterIntegrationKey("DeathItemBomb"); KING = Utilities.RegisterIntegrationKey("DeathItemTheKing"); CONTROLLER = Utilities.RegisterIntegrationKey("DeathItemController"); CONTROLLER_UNLUCKY = Utilities.RegisterIntegrationKey("DeathItemControllerUnlucky"); FAKE_AIRHORN_EXPLOSION = Utilities.RegisterIntegrationKey("DeathItemFakeAirhornExplosion"); FAKE_AIRHORN_LIGHTNING = Utilities.RegisterIntegrationKey("DeathItemFakeAirhornLightning"); JOB_APPLICATION = Utilities.RegisterIntegrationKey("DeathItemJobApplication"); HELM_DOMINATION = Utilities.RegisterIntegrationKey("DeathItemHelmOfDomination"); GAZPACHO_DRUNK = Utilities.RegisterIntegrationKey("DeathItemGazpachoDrunk"); GAZPACHO_EXPLOSION = Utilities.RegisterIntegrationKey("DeathItemGazpachoUnlucky"); SQUARE_STEEL = Utilities.RegisterIntegrationKey("DeathItemSquareSteel"); FRIENDSHIP_ENDER = Utilities.RegisterIntegrationKey("DeathItemFriendshipEnder"); } } } namespace CoronerIntegrations.Patch.LockerIntegration { [HarmonyPatch(typeof(Utilities))] [HarmonyPatch("Explode")] public class ExplodePatch { private static Collider[] colliderArray = (Collider[])(object)new Collider[16]; public static void Postfix(Utilities __instance, Vector3 position, float minRange, float maxRange) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) int num = Physics.OverlapSphereNonAlloc(position, maxRange, colliderArray, 2621448, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { if (((Component)colliderArray[i]).gameObject.layer == 3) { PlayerControllerB component = ((Component)colliderArray[i]).gameObject.GetComponent<PlayerControllerB>(); if (!((Object)(object)component == (Object)null) && component.isPlayerDead) { HandleLockerExplode(component); } } } } private static void HandleLockerExplode(PlayerControllerB player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by colliding Lockers! Processing..."); if (player.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.actualClientId} was killed by colliding Lockers! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)LockerSoftDep.LOCKER_EXPLODE); } } } [HarmonyPatch(typeof(LockerAI))] [HarmonyPatch("KillPlayer")] internal class KillPlayerPatch { public static void Postfix(LockerAI __instance, ulong id, ref IEnumerator __result) { try { Action prefixAction = delegate { Console.WriteLine("--> beginning"); }; Action postfixAction = delegate { HandleLockerKill(id); }; Action<object> preItemAction = delegate(object item) { Console.WriteLine($"--> before {item}"); }; Action<object> postItemAction = delegate(object item) { Console.WriteLine($"--> after {item}"); }; Func<object, object> itemAction = delegate(object item) { string text = item?.ToString() + "+"; Console.WriteLine($"--> item {item} => {text}"); return text; }; SimpleEnumerator simpleEnumerator = new SimpleEnumerator { enumerator = __result, prefixAction = prefixAction, postfixAction = postfixAction, preItemAction = preItemAction, postItemAction = postItemAction, itemAction = itemAction }; __result = simpleEnumerator.GetEnumerator(); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in KillPlayerPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleLockerKill(ulong playerId) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by a Locker! Processing..."); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerId} was killed by a Locker! Setting cause of death..."); API.SetCauseOfDeath(val, (AdvancedCauseOfDeath?)LockerSoftDep.LOCKER); } } public class LockerSoftDep { private static bool? _enabled; public static string LOCKER_KEY = "DeathEnemyLocker"; public static AdvancedCauseOfDeath LOCKER; public static string LOCKER_EXPLODE_KEY = "DeathEnemyLockerExplode"; public static AdvancedCauseOfDeath LOCKER_EXPLODE; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.zealsprince.locker"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_003f: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(LOCKER_KEY)) { LOCKER = API.Register(LOCKER_KEY); } if (!API.IsRegistered(LOCKER_EXPLODE_KEY)) { LOCKER_EXPLODE = API.Register(LOCKER_EXPLODE_KEY); } } } } namespace CoronerIntegrations.Patch.LethalDoorsFixedIntegration { [HarmonyPatch(typeof(DoorInteractionPatch))] [HarmonyPatch("ApplyLethalDamageOrInjurePlayer")] public class DoorInteractionPatch { public static void Postfix(DoorInteractionPatch __instance, PlayerControllerB player) { try { if ((Object)(object)player != (Object)null && player.isPlayerDead) { HandleKill(player); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in LethalDoors DoorInteractionPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill(PlayerControllerB player) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (player.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was killed by Lethal Doors! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)LethalDoorsFixedSoftDep.LETHAL_DOORS); } } } public class LethalDoorsFixedSoftDep { private static bool? _enabled; public static string LETHAL_DOORS_KEY = "DeathLethalDoors"; public static AdvancedCauseOfDeath LETHAL_DOORS; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("Entity378.LethalDoorsFixed"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(LETHAL_DOORS_KEY)) { LETHAL_DOORS = API.Register(LETHAL_DOORS_KEY); } } } } namespace CoronerIntegrations.Patch.LethalAnomaliesIntegration { [HarmonyPatch] internal class LethalAnomaliesPatches { [CompilerGenerated] private sealed class <TourBusExplosionPatch>d__2 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; public TourBusAI __instance; private PlayerControllerB <player>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TourBusExplosionPatch>d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_006e: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0053; case 1: <>1__state = -1; goto IL_0053; case 2: { <>1__state = -1; return false; } IL_0053: if (result.MoveNext()) { <>2__current = result.Current; <>1__state = 1; return true; } <player>5__1 = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position + new Vector3(0f, 3f, 0f), 35f); if ((Object)(object)<player>5__1 != (Object)null) { Utilities.SetCauseOfDeath(<player>5__1, LethalAnomaliesSoftDep.TOUR_BUS); } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <TouristExplosionPatch>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; public TouristAI __instance; private int <i>5__1; private PlayerControllerB <player>5__2; private PlayerControllerB <player>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TouristExplosionPatch>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__2 = null; <player>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0110: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; goto IL_00db; case 1: <>1__state = -1; goto IL_00db; case 2: { <>1__state = -1; return false; } IL_00db: if (result.MoveNext()) { if (((NetworkBehaviour)__instance).IsServer && <i>5__1 == 1) { <player>5__2 = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position, 10f); if ((Object)(object)<player>5__2 != (Object)null) { Utilities.SetCauseOfDeath(<player>5__2, LethalAnomaliesSoftDep.TOURIST); } <player>5__2 = null; } <i>5__1++; <>2__current = result.Current; <>1__state = 1; return true; } if (!((NetworkBehaviour)__instance).IsServer) { <player>5__3 = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position, 10f); if ((Object)(object)<player>5__3 != (Object)null) { Utilities.SetCauseOfDeath(<player>5__3, LethalAnomaliesSoftDep.TOURIST); } <player>5__3 = null; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPostfix] [HarmonyPatch(typeof(ExternalScripts), "SpawnLightningBolt", new Type[] { typeof(Vector3), typeof(bool), typeof(Vector3) })] public static void LightningBoltPatch(ExternalScripts __instance, Vector3 strikePosition, bool isLethal) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) if (isLethal) { PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(strikePosition + Vector3.up * 0.25f, 5f); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, LethalAnomaliesSoftDep.SPARK_TOWER); } } } [IteratorStateMachine(typeof(<TouristExplosionPatch>d__1))] [HarmonyPostfix] [HarmonyPatch(typeof(TouristAI), "AttackCoroutine")] public static IEnumerator TouristExplosionPatch(IEnumerator result, TouristAI __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TouristExplosionPatch>d__1(0) { result = result, __instance = __instance }; } [IteratorStateMachine(typeof(<TourBusExplosionPatch>d__2))] [HarmonyPostfix] [HarmonyPatch(typeof(TourBusAI), "ExplosionCoroutine")] public static IEnumerator TourBusExplosionPatch(IEnumerator result, TourBusAI __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TourBusExplosionPatch>d__2(0) { result = result, __instance = __instance }; } } internal class LethalAnomaliesSoftDep { private static bool? _enabled; public static AdvancedCauseOfDeath SPARK_TOWER; public static AdvancedCauseOfDeath TOURIST; public static AdvancedCauseOfDeath TOUR_BUS; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("Zeldahu.LethalAnomalies"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Register() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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) //IL_0043: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.Harmony.PatchAll(typeof(LethalAnomaliesPatches)); SPARK_TOWER = Utilities.RegisterIntegrationKey("DeathEnemySparkTower"); TOURIST = Utilities.RegisterIntegrationKey("DeathEnemyTourist"); TOUR_BUS = Utilities.RegisterIntegrationKey("DeathEnemyTourBus"); } } } namespace CoronerIntegrations.Patch.LegendWeathersIntegration { [HarmonyPatch] internal class LegendWeathersPatches { public static bool localPlayerKilledByMoonThisTime; [HarmonyPostfix] [HarmonyPatch(typeof(MoonTearItem), "EnableFallingEffects")] public static void MoonTearFallingPatch(MoonTearItem __instance, bool enable) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!enable && !((GrabbableObject)__instance).isHeld) { PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(((GrabbableObject)__instance).targetFloorPosition, 7f); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, LegendWeathersSoftDep.MOON_TEAR); } } } [HarmonyPostfix] [HarmonyPatch(typeof(MajoraMoon), "UpdateImpact")] public static void MajoraMoonExplosionPatch(MajoraMoon __instance) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (__instance.impactStarted && (Object)(object)__instance.impact != (Object)null) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController.isPlayerDead && !localPlayerKilledByMoonThisTime && !localPlayerController.isInHangarShipRoom && !localPlayerController.isInElevator && Vector3.Distance(__instance.outsideNodeEndPosition, ((Component)localPlayerController).transform.position) <= __instance.impact.transform.localScale.x * (float)__instance.moonRadiusApprox * 0.9f) { Utilities.SetCauseOfDeath(localPlayerController, LegendWeathersSoftDep.MAJORA_MOON); localPlayerKilledByMoonThisTime = true; } } } [HarmonyPostfix] [HarmonyPatch(typeof(MajoraMoon), "StartMusic")] public static void MajoraMoonRestartStatePatch() { localPlayerKilledByMoonThisTime = false; } [HarmonyPostfix] [HarmonyPatch(typeof(MajoraMaskItem), "FinishAttachingMajoraMask")] public static void MajoraMaskKillPlayerPatch(MajoraMaskItem __instance) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)__instance).IsOwner && ((HauntedMaskItem)__instance).finishedAttaching && (Object)(object)((HauntedMaskItem)__instance).previousPlayerHeldBy != (Object)null && ((HauntedMaskItem)__instance).previousPlayerHeldBy.AllowPlayerDeath() && ((HauntedMaskItem)__instance).previousPlayerHeldBy.isPlayerDead) { Utilities.SetCauseOfDeath(((HauntedMaskItem)__instance).previousPlayerHeldBy, LegendWeathersSoftDep.MAJORA_MASK); } } [HarmonyPostfix] [HarmonyPatch(typeof(Effects), "SpawnLightningBolt")] public static void SpawnLightningBoltPatch(Vector3 destination, bool damage) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (damage) { PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(destination, 5f); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, LegendWeathersSoftDep.BLOOD_MOON_LIGHTNING); } } } } public class LegendWeathersSoftDep { private static bool? _enabled; public static AdvancedCauseOfDeath BLOOD_MOON_LIGHTNING; public static AdvancedCauseOfDeath MAJORA_MOON; public static AdvancedCauseOfDeath MOON_TEAR; public static AdvancedCauseOfDeath MAJORA_MASK; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("zigzag.legendweathers"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Register() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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) //IL_0043: 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_0052: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.Harmony.PatchAll(typeof(LegendWeathersPatches)); BLOOD_MOON_LIGHTNING = Utilities.RegisterIntegrationKey("DeathWeatherLightningBloodMoon"); MAJORA_MOON = Utilities.RegisterIntegrationKey("DeathWeatherMajoraMoon"); MOON_TEAR = Utilities.RegisterIntegrationKey("DeathItemMoonTear"); MAJORA_MASK = Utilities.RegisterIntegrationKey("DeathItemMajoraMask"); } } } namespace CoronerIntegrations.Patch.JackensteinApparatusIntegration { internal class JackensteinApparatusSoftDep { private static bool? _enabled; public static AdvancedCauseOfDeath JACKENSTEIN; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("Zeldahu.JackensteinApparatus"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Register() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.Harmony.PatchAll(typeof(JackensteinPatch)); JACKENSTEIN = Utilities.RegisterIntegrationKey("DeathEnemyJackenstein"); } } [HarmonyPatch] internal class JackensteinPatch { [HarmonyPostfix] [HarmonyPatch(typeof(JackensteinAI), "ExplosionClientRpc")] public static void JackensteinExplosionPatch(JackensteinAI __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position, 60f); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, JackensteinApparatusSoftDep.JACKENSTEIN); } } } } namespace CoronerIntegrations.Patch.CountryRoadCreatureIntegration { public class CountryRoadCreatureSoftDep { private static bool? _enabled; public static string COUNTRYROAD_KEY = "DeathEnemyCountryRoadCreature"; public static AdvancedCauseOfDeath COUNTRYROAD; public static string COUNTRYROAD_PARANOIA_KEY = "DeathEnemyCountryRoadCreatureHead"; public static AdvancedCauseOfDeath COUNTRYROAD_PARANOIA; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("wexop.country_road_creature"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_003f: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(COUNTRYROAD_KEY)) { COUNTRYROAD = API.Register(COUNTRYROAD_KEY); } if (!API.IsRegistered(COUNTRYROAD_PARANOIA_KEY)) { COUNTRYROAD_PARANOIA = API.Register(COUNTRYROAD_PARANOIA_KEY); } } } [HarmonyPatch(typeof(CountryRoadCreatureEnemyAI))] [HarmonyPatch("GrabAnimation")] public class GrabAnimationPatch { public static void Prefix(CountryRoadCreatureEnemyAI __instance, ref PlayerControllerB ___playerToKIll) { try { HandleKill(___playerToKIll); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in GrabAnimationPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill(PlayerControllerB player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was crushed to death by CountryRoadCreature! Processing..."); if (player.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was crushed to death by CountryRoadCreature! Setting cause of death..."); API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)CountryRoadCreatureSoftDep.COUNTRYROAD); } } } [HarmonyPatch(typeof(CountryRoadCreatureHeadItem))] [HarmonyPatch("ParanoidAnimation")] public class ParanoidAnimationPatch { [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static void Postfix_MoveNext(bool __result) { try { if (!__result) { HandleKill(); } } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in ParanoidAnimation.MoveNext Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } private static void HandleKill() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.PluginLogger.LogDebug((object)"Player was killed by CreatureHead paranoia! Processing..."); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {localPlayerController.playerClientId} was killed by CreatureHead paranoia! Setting cause of death..."); API.SetCauseOfDeath(localPlayerController, (AdvancedCauseOfDeath?)CountryRoadCreatureSoftDep.COUNTRYROAD_PARANOIA); } } } } namespace CoronerIntegrations.Patch.CodeRebirthIntegration { public class CodeRebirthSoftDep { private static bool? _enabled; public static string _KEY = "DeathEnemyxxx"; public static AdvancedCauseOfDeath DEATH; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("CodeRebirth"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(_KEY)) { DEATH = API.Register(_KEY); } } } } namespace CoronerIntegrations.Patch.ChillaxScrapsIntegration { [HarmonyPatch(typeof(Effects))] internal class ChillaxScrapsEffectsPatches { [HarmonyPostfix] [HarmonyPatch("Damage")] public static void DamagePatch(PlayerControllerB player, CauseOfDeath cause, int animation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ChillaxScrapsDamageLogic(player, cause, animation); } private static void ChillaxScrapsDamageLogic(PlayerControllerB player, CauseOfDeath cause, int animation) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController && player.isPlayerDead) { if ((int)cause == 0 && animation == 3) { Utilities.SetCauseOfDeath(player, ChillaxScrapsSoftDep.DEATH_NOTE); } else if ((int)cause == 6 && animation == 8) { Utilities.SetCauseOfDeath(player, ChillaxScrapsSoftDep.FREDDY); } } } } [HarmonyPatch] internal class ChillaxScrapsExplosionPatches { [HarmonyPostfix] [HarmonyPatch(typeof(DanceNote), "KillInAreaDanceNoteClientRpc")] public static void DanceNoteExplosionPatch(DanceNote __instance, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(position + Vector3.up * 0.25f, 6f); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, ChillaxScrapsSoftDep.DANCE_NOTE); } } [HarmonyPostfix] [HarmonyPatch(typeof(Nokia), "OnHitGround")] public static void NokiaKnockbackPatch(Nokia __instance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerInExplosionArea = Utilities.GetLocalPlayerInExplosionArea(((Component)__instance).transform.position, 1.5f); if ((Object)(object)localPlayerInExplosionArea != (Object)null) { Utilities.SetCauseOfDeath(localPlayerInExplosionArea, ChillaxScrapsSoftDep.NOKIA); } } } public class ChillaxScrapsSoftDep { private static bool? _enabled; public static AdvancedCauseOfDeath DANCE_NOTE; public static AdvancedCauseOfDeath DEATH_NOTE; public static AdvancedCauseOfDeath EMERGENCY_MEETING; public static AdvancedCauseOfDeath FREDDY; public static AdvancedCauseOfDeath NOKIA; public static AdvancedCauseOfDeath EPONA; public static AdvancedCauseOfDeath UNO_REVERSE; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("zigzag.chillaxscraps"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Register() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_009f: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) Plugin.Instance.Harmony.PatchAll(typeof(ChillaxScrapsEffectsPatches)); Plugin.Instance.Harmony.PatchAll(typeof(ChillaxScrapsExplosionPatches)); Plugin.Instance.Harmony.PatchAll(typeof(ChillaxScrapsTeleportationPatches)); DANCE_NOTE = Utilities.RegisterIntegrationKey("DeathItemDanceNote"); DEATH_NOTE = Utilities.RegisterIntegrationKey("DeathItemDeathNote"); EMERGENCY_MEETING = Utilities.RegisterIntegrationKey("DeathItemEmergencyMeeting"); FREDDY = Utilities.RegisterIntegrationKey("DeathItemFreddyFazbear"); NOKIA = Utilities.RegisterIntegrationKey("DeathItemNokia"); EPONA = Utilities.RegisterIntegrationKey("DeathItemOcarinaEpona"); UNO_REVERSE = Utilities.RegisterIntegrationKey("DeathItemUnoReverse"); } } [HarmonyPatch] internal class ChillaxScrapsTeleportationPatches { [HarmonyPostfix] [HarmonyPatch(typeof(EmergencyMeeting), "TeleportationClientRpc")] public static void MeetingTeleportationPatch(EmergencyMeeting __instance, ulong playerID) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; if ((Object)(object)val != (Object)null && (Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)__instance).StartCoroutine(__instance.CheckTeleportationDeath(val)); } } [HarmonyPostfix] [HarmonyPatch(typeof(UnoReverse), "TeleportationClientRpc")] public static void UnoTeleportationPatch(UnoReverse __instance, ulong playerID) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; if ((Object)(object)val != (Object)null && (Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)__instance).StartCoroutine(__instance.CheckTeleportationDeath(val)); } } [HarmonyPostfix] [HarmonyPatch(typeof(UnoReverseDX), "TeleportationClientRpc")] public static void UnoDxTeleportationPatch(UnoReverseDX __instance, ulong playerID) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; if ((Object)(object)val != (Object)null && (Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((MonoBehaviour)__instance).StartCoroutine(__instance.CheckTeleportationDeath(val)); } } } internal static class ChillaxScrapsExtensions { [CompilerGenerated] private sealed class <CheckTeleportationDeath>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EmergencyMeeting emergencyMeeting; public PlayerControllerB player; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckTeleportationDeath>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CheckTeleportationDeath(player, ChillaxScrapsSoftDep.EMERGENCY_MEETING); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CheckTeleportationDeath>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UnoReverse unoReverse; public PlayerControllerB player; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckTeleportationDeath>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CheckTeleportationDeath(player, ChillaxScrapsSoftDep.UNO_REVERSE); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CheckTeleportationDeath>d__2 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UnoReverseDX unoReverseDX; public PlayerControllerB player; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckTeleportationDeath>d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = CheckTeleportationDeath(player, ChillaxScrapsSoftDep.UNO_REVERSE); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CheckTeleportationDeath>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public AdvancedCauseOfDeath cause; private float <timer>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckTeleportationDeath>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <timer>5__1 = 0f; break; case 1: <>1__state = -1; Utilities.SetCauseOfDeath(player, cause); return false; case 2: <>1__state = -1; break; } if (<timer>5__1 < 3f) { if ((Object)(object)player != (Object)null && player.isPlayerDead) { <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } <timer>5__1 += Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(<CheckTeleportationDeath>d__0))] public static IEnumerator CheckTeleportationDeath(this EmergencyMeeting emergencyMeeting, PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckTeleportationDeath>d__0(0) { emergencyMeeting = emergencyMeeting, player = player }; } [IteratorStateMachine(typeof(<CheckTeleportationDeath>d__1))] public static IEnumerator CheckTeleportationDeath(this UnoReverse unoReverse, PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckTeleportationDeath>d__1(0) { unoReverse = unoReverse, player = player }; } [IteratorStateMachine(typeof(<CheckTeleportationDeath>d__2))] public static IEnumerator CheckTeleportationDeath(this UnoReverseDX unoReverseDX, PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckTeleportationDeath>d__2(0) { unoReverseDX = unoReverseDX, player = player }; } [IteratorStateMachine(typeof(<CheckTeleportationDeath>d__3))] private static IEnumerator CheckTeleportationDeath(PlayerControllerB player, AdvancedCauseOfDeath cause) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckTeleportationDeath>d__3(0) { player = player, cause = cause }; } } [HarmonyPatch] internal class MouthDogEponaPatch { [CompilerGenerated] private sealed class <MouthDogKillPlayerEponaCheckPatch>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; public MouthDogAI __instance; public int playerId; private PlayerControllerB <player>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <MouthDogKillPlayerEponaCheckPatch>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (result.MoveNext()) { <>2__current = result.Current; <>1__state = 1; return true; } <player>5__1 = StartOfRound.Instance.allPlayerScripts[playerId]; if ((Object)(object)<player>5__1 != (Object)null && <player>5__1.isPlayerDead) { Plugin.Instance.PluginLogger.LogDebug((object)(((Object)__instance.screamSFX).name + " " + ((Object)__instance.breathingSFX).name)); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(<MouthDogKillPlayerEponaCheckPatch>d__0))] [HarmonyPostfix] [HarmonyPatch(typeof(MouthDogAI), "KillPlayer")] public static IEnumerator MouthDogKillPlayerEponaCheckPatch(IEnumerator result, MouthDogAI __instance, int playerId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <MouthDogKillPlayerEponaCheckPatch>d__0(0) { result = result, __instance = __instance, playerId = playerId }; } } } namespace CoronerIntegrations.Patch.BiodiversityIntegration { public class BiodiversitySoftDep { private static bool? _enabled; public static string ALOE_SLAP_KEY = "DeathEnemyAloeSlap"; public static AdvancedCauseOfDeath ALOE_SLAP; public static string ALOE_CRUSH_KEY = "DeathEnemyAloeCrush"; public static AdvancedCauseOfDeath ALOE_CRUSH; public static string ALOE_BLUDGEON_KEY = "DeathEnemyAloeBludgeon"; public static AdvancedCauseOfDeath ALOE_BLUDGEON; public static string COILCRAB_EXPLODE_KEY = "DeathEnemyCoilCrabExplosion"; public static AdvancedCauseOfDeath COILCRAB_EXPLODE; public static string OGOPOGO_GRAVITY_KEY = "DeathEnemyOgopogoGravity"; public static AdvancedCauseOfDeath OGOPOGO_GRAVITY; public static string OGOPOGO_DROWNING_KEY = "DeathEnemyOgopogoDrowned"; public static AdvancedCauseOfDeath OGOPOGO_DROWNING; public static string VERMIN_KEY = "DeathEnemyVermin"; public static AdvancedCauseOfDeath VERMIN; public static string PROTOTAX_KEY = "DeathEnemyPrototax"; public static AdvancedCauseOfDeath PROTOTAX; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.github.biodiversitylc.Biodiversity"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerRegister() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if (!API.IsRegistered(ALOE_SLAP_KEY)) { ALOE_SLAP = API.Register(ALOE_SLAP_KEY); } if (!API.IsRegistered(ALOE_CRUSH_KEY)) { ALOE_CRUSH = API.Register(ALOE_CRUSH_KEY); } if (!API.IsRegistered(ALOE_BLUDGEON_KEY)) { ALOE_BLUDGEON = API.Register(ALOE_BLUDGEON_KEY); } if (!API.IsRegistered(COILCRAB_EXPLODE_KEY)) { COILCRAB_EXPLODE = API.Register(COILCRAB_EXPLODE_KEY); } if (!API.IsRegistered(VERMIN_KEY)) { VERMIN = API.Register(VERMIN_KEY); } if (!API.IsRegistered(PROTOTAX_KEY)) { PROTOTAX = API.Register(PROTOTAX_KEY); } if (!API.IsRegistered(OGOPOGO_GRAVITY_KEY)) { OGOPOGO_GRAVITY = API.Register(OGOPOGO_GRAVITY_KEY); } if (!API.IsRegistered(OGOPOGO_DROWNING_KEY)) { OGOPOGO_DROWNING = API.Register(OGOPOGO_DROWNING_KEY); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void CoronerSetCauseOfDeath(PlayerControllerB player) { } } } namespace CoronerIntegrations.Patch.BiodiversityIntegration.Ogopogo { [HarmonyPatch(typeof(OgopogoAI))] [HarmonyPatch("SetPlayerGrabbedClientRpc")] public class OgopogoPatch { public static List<PlayerControllerB> playersGrabbed = new List<PlayerControllerB>(); public static void Postfix(OgopogoAI __instance, int playerID) { try { PlayerControllerB component = ((Component)StartOfRound.Instance.allPlayerScripts[playerID]).gameObject.GetComponent<PlayerControllerB>(); Plugin.Instance.PluginLogger.LogDebug((object)$"Player {component} grabbed"); playersGrabbed.Add(component); } catch (Exception ex) { Plugin.Instance.PluginLogger.LogError((object)("Error in OgopogoPatch.Postfix: " + ex)); Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace); } } } [HarmonyPatch(typeof(PlayerControllerB))] [HarmonyPatch("PlayerHitGroundEffects")] public class PlayerHitGroundEffectsPatch { public static void Postfix(PlayerControllerB __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (__instance.isPlayerDead && OgopogoPatch.playersGrabbed.Contains(__instance)) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {__instance.playerClientId} was thrown to their death by the Ogopogo! Setting cause of death..."); API.SetCauseOfDeath(__instance, (AdvancedCauseOfDeath?)BiodiversitySoftDep.OGOPOGO_GRAVITY); } } } [HarmonyPatch(typeof(PlayerControllerB))] [HarmonyPatch("SetFaceUnderwaterFilters")] public class SetFaceUnderwaterFiltersPatch { public static void Postfix(PlayerControllerB __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (__instance.isPlayerDead && OgopogoPatch.playersGrabbed.Contains(__instance)) { Plugin.Instance.PluginLogger.LogDebug((object)$"Player {__instance.playerClientId} was drowned by the Ogopogo! Setting cause of death..."); API.SetCauseOfDeath(__instance, (AdvancedCauseOfDeath?)BiodiversitySoftDep.OGOPOGO_DROWNING); } } } [HarmonyPatch(typeof(VerminAI))] [HarmonyPatch("OnCollideWithPlayer")] public class VerminPatch { public static void Postfix(VerminAI __instance, Collider other) { try { HandleVerminKill(other); } catch (Exception ex) { Plugin.Instance.P