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 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.CountryRoadCreatureIntegration;
using CoronerIntegrations.Patch.LockerIntegration;
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 CountryRoadCreature.Scripts;
using DroneEnemy;
using GameNetcodeStuff;
using HarmonyLib;
using LethalSirenHead.Enemy;
using Locker;
using Locker.MonoBehaviours;
using Microsoft.CodeAnalysis;
using RollingGiant;
using ShyGuy.AI;
using TheCabinet;
using UnityEngine;
using UsualScrap.Behaviors;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("com.github.biodiversitylc.Biodiversity")]
[assembly: IgnoresAccessChecksTo("Coroner-publicized")]
[assembly: IgnoresAccessChecksTo("DroneEnemy")]
[assembly: IgnoresAccessChecksTo("Locker")]
[assembly: IgnoresAccessChecksTo("UsualScrap")]
[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")]
[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.*/)]
public class Plugin : BaseUnityPlugin
{
public ManualLogSource PluginLogger;
public static Plugin Instance { get; private set; }
private void Awake()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
Instance = this;
PluginLogger = ((BaseUnityPlugin)this).Logger;
Harmony val = new Harmony("Turkeysteaks.coroner.integrations");
PluginLogger.LogInfo((object)"Plugin Coroner - Integrations (Turkeysteaks.coroner.integrations) is loaded!");
PluginLogger.LogInfo((object)$"Biodiversity Found: {BiodiversitySoftDep.enabled}");
if (BiodiversitySoftDep.enabled)
{
val.PatchAll(typeof(AloeBludgeonPatch));
val.PatchAll(typeof(AloeCrushPatch));
val.PatchAll(typeof(AloeSlapPatch));
val.PatchAll(typeof(CoilCrabPatch));
val.PatchAll(typeof(LandmineSpawnExplosionPatchPatch));
val.PatchAll(typeof(PrototaxPatch));
val.PatchAll(typeof(OgopogoPatch));
val.PatchAll(typeof(VerminPatch));
BiodiversitySoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"Scopophobia Found: {ScopophobiaSoftDep.enabled}");
if (ScopophobiaSoftDep.enabled)
{
val.PatchAll(typeof(KillPlayerAnimationPatch));
ScopophobiaSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"LethalSirenHead Found: {SirenHeadSoftDep.enabled}");
if (SirenHeadSoftDep.enabled)
{
val.PatchAll(typeof(SirenHeadEatPlayerPatch));
SirenHeadSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"The Cabinet Found: {TheCabinetSoftDep.enabled}");
if (TheCabinetSoftDep.enabled)
{
val.PatchAll(typeof(CoronerIntegrations.Patch.TheCabinetIntegration.KillPlayerPatch));
TheCabinetSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"Locker Found: {LockerSoftDep.enabled}");
if (LockerSoftDep.enabled)
{
val.PatchAll(typeof(CoronerIntegrations.Patch.LockerIntegration.KillPlayerPatch));
val.PatchAll(typeof(ExplodePatch));
LockerSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"CountryRoadCreature Found: {CountryRoadCreatureSoftDep.enabled}");
if (CountryRoadCreatureSoftDep.enabled)
{
val.PatchAll(typeof(GrabAnimationPatch));
val.PatchAll(typeof(ParanoidAnimationPatch));
CountryRoadCreatureSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"RollingGiant Found: {RollingGiantSoftDep.enabled}");
if (RollingGiantSoftDep.enabled)
{
val.PatchAll(typeof(OnCollideWithPlayerPatch));
RollingGiantSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"ShockwaveDrone Found: {ShockwaveDroneSoftDep.enabled}");
if (ShockwaveDroneSoftDep.enabled)
{
val.PatchAll(typeof(ShockScanPatch));
val.PatchAll(typeof(ShockCreateExplosionPatch));
ShockwaveDroneSoftDep.CoronerRegister();
}
PluginLogger.LogInfo((object)$"UsualScrap Found: {UsualScrapSoftDep.enabled}");
if (UsualScrapSoftDep.enabled)
{
val.PatchAll(typeof(RosePatchEquip));
val.PatchAll(typeof(RosePatchPocket));
val.PatchAll(typeof(ScissorPatch));
val.PatchAll(typeof(RadioactiveCellPatch));
UsualScrapSoftDep.CoronerRegister();
}
}
}
}
namespace CoronerIntegrations.Patch
{
public class SimpleEnumerator : IEnumerable
{
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();
}
public IEnumerator GetEnumerator()
{
prefixAction();
while (enumerator.MoveNext())
{
object item = enumerator.Current;
preItemAction(item);
yield return itemAction(item);
postItemAction(item);
}
postfixAction();
}
}
}
namespace CoronerIntegrations.Patch.UsualScrapIntegration
{
[HarmonyPatch(typeof(BloodyCapsuleScript))]
[HarmonyPatch("AbsorbBlood")]
public class BloodyCapsulePatch
{
}
[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_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 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(ScissorsScript))]
[HarmonyPatch("RollForDamage")]
public class ScissorPatch
{
private static PlayerControllerB player;
private static readonly int scissorRunDamage = 15;
public static void Postfix(ScissorsScript __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.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.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.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.PluginLogger.LogError((object)("Error in VerminPatch.Postfix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
private static void HandleVerminKill(Collider other)
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
Plugin.Instance.PluginLogger.LogDebug((object)"Player was eaten by Vermin! Processing...");
PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
if (component.isPlayerDead)
{
Plugin.Instance.PluginLogger.LogDebug((object)$"Player {component.playerClientId} was eaten by Vermin! Setting cause of death...");
API.SetCauseOfDeath(component, (AdvancedCauseOfDeath?)BiodiversitySoftDep.VERMIN);
}
}
}
}
namespace CoronerIntegrations.Patch.BiodiversityIntegration.Critters
{
[HarmonyPatch(typeof(CoilCrabAI))]
[HarmonyPatch("SpawnExpolosionClientRpc")]
public class CoilCrabPatch
{
private static Collider[] lastExplosionColliderArr = (Collider[])(object)new Collider[0];
public static List<PlayerControllerB> lastExplosionPlayerArr = new List<PlayerControllerB>(4);
public static void Prefix(CoilCrabAI __instance, Vector3 explosionPosition, float killRange, float damageRange)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
try
{
lastExplosionColliderArr = Physics.OverlapSphere(explosionPosition, damageRange, 2621448, (QueryTriggerInteraction)2);
lastExplosionPlayerArr.Clear();
Collider[] array = lastExplosionColliderArr;
foreach (Collider val in array)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null))
{
PlayerControllerB component = ((Component)val).gameObject.GetComponent<PlayerControllerB>();
if (!((Object)(object)component == (Object)null))
{
lastExplosionPlayerArr.Add(component);
}
}
}
}
catch (Exception ex)
{
Plugin.Instance.PluginLogger.LogError((object)("Error in CoilCrabPatch.Prefix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
}
[HarmonyPatch(typeof(LandmineSpawnExplosionPatch))]
[HarmonyPatch("RewriteCauseOfDeath")]
public class LandmineSpawnExplosionPatchPatch
{
public static void Prefix(LandmineSpawnExplosionPatch __instance, PlayerControllerB targetPlayer, float killRange, float physicsForce)
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
try
{
if (targetPlayer.isPlayerDead && CoilCrabPatch.lastExplosionPlayerArr.Contains(targetPlayer))
{
Plugin.Instance.PluginLogger.LogDebug((object)$"Player {targetPlayer.playerClientId} was blown up by a CoilCrab! Setting cause of death...");
API.SetCauseOfDeath(targetPlayer, (AdvancedCauseOfDeath?)null);
API.SetCauseOfDeath(targetPlayer, (AdvancedCauseOfDeath?)BiodiversitySoftDep.COILCRAB_EXPLODE);
}
}
catch (Exception ex)
{
Plugin.Instance.PluginLogger.LogError((object)("Error in LandmineSpawnExplosionPatchPatch.Prefix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
}
[HarmonyPatch(typeof(DamageTrigger))]
[HarmonyPatch("Update")]
public class PrototaxPatch
{
private static PlayerControllerB player;
public static void Postfix(DamageTrigger __instance, ref bool ___hitLocalPlayer)
{
try
{
if (___hitLocalPlayer)
{
HandleToxinKill();
}
}
catch (Exception ex)
{
Plugin.Instance.PluginLogger.LogError((object)("Error in PrototaxPatch.Postfix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
private static void HandleToxinKill()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
Plugin.Instance.PluginLogger.LogDebug((object)"Player was poisoned by a Prototax! Processing...");
player = GameNetworkManager.Instance.localPlayerController;
if (player.isPlayerDead)
{
Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was poisoned by a Prototax! Setting cause of death...");
API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)BiodiversitySoftDep.PROTOTAX);
}
}
}
}
namespace CoronerIntegrations.Patch.BiodiversityIntegration.Aloe
{
[HarmonyPatch(typeof(AloeClient))]
[HarmonyPatch("HandleDamagePlayer")]
internal class AloeBludgeonPatch
{
public static void Postfix(AloeClient __instance, ulong playerId, int damage)
{
try
{
HandleAloeKill(playerId);
}
catch (Exception ex)
{
Plugin.Instance.PluginLogger.LogError((object)("Error in AloeBludgeonPatch.Postfix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
private static void HandleAloeKill(ulong playerId)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
Plugin.Instance.PluginLogger.LogDebug((object)"Player was bludgeoned to death by The Aloe! Processing...");
PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId];
if (val.isPlayerDead)
{
Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerId} was bludgeoned to death by The Aloe! Setting cause of death...");
API.SetCauseOfDeath(val, (AdvancedCauseOfDeath?)BiodiversitySoftDep.ALOE_BLUDGEON);
}
}
}
[HarmonyPatch(typeof(AloeClient))]
[HarmonyPatch("CrushPlayerAnimation")]
internal class AloeCrushPatch
{
public static void Postfix(AloeClient __instance, PlayerControllerB player, ref IEnumerator __result)
{
PlayerControllerB player2 = player;
try
{
Action prefixAction = delegate
{
Console.WriteLine("--> beginning");
};
Action postfixAction = delegate
{
HandleAloeKill(player2);
};
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 AloeSlapPatch.Postfix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
private static void HandleAloeKill(PlayerControllerB player)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
Plugin.Instance.PluginLogger.LogDebug((object)"Player was crushed by The Aloe! Processing...");
Plugin.Instance.PluginLogger.LogDebug((object)$"Player {player.playerClientId} was crushed by The Aloe! Setting cause of death...");
API.SetCauseOfDeath(player, (AdvancedCauseOfDeath?)BiodiversitySoftDep.ALOE_CRUSH);
}
}
[HarmonyPatch(typeof(SlapCollisionDetection))]
[HarmonyPatch("SlapPlayerServerRpc")]
internal class AloeSlapPatch
{
public static void Postfix(SlapCollisionDetection __instance, ulong playerId)
{
try
{
HandleAloeKill(playerId);
}
catch (Exception ex)
{
Plugin.Instance.PluginLogger.LogError((object)("Error in AloeSlapPatch.Postfix: " + ex));
Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace);
}
}
private static void HandleAloeKill(ulong playerId)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
Plugin.Instance.PluginLogger.LogDebug((object)"Player was slapped to death by The Aloe! Processing...");
PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId];
if (val.isPlayerDead)
{
Plugin.Instance.PluginLogger.LogDebug((object)$"Player {playerId} was slapped to death by The Aloe! Setting cause of death...");
API.SetCauseOfDeath(val, (AdvancedCauseOfDeath?)BiodiversitySoftDep.ALOE_SLAP);
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}