namespace Harmony.ElectricWireControllerPatches { [HarmonyPatch(typeof(ElectricWireController))] [HarmonyPatch("touched")] public class touchedPatches { public static bool Prefix(ElectricWireController __instance, Collider collider) { if (__instance.TileEntityParent == null || __instance.TileEntityChild == null || __instance.WireNode == null || collider == null) { return false; } if (__instance.TileEntityParent.IsPowered && __instance.TileEntityChild.IsPowered && collider.transform != null) { global::EntityAlive entityAlive = collider.transform.GetComponent(); if (entityAlive == null) { entityAlive = collider.transform.GetComponentInParent(); } if (entityAlive == null && collider.transform.parent != null) { entityAlive = collider.transform.parent.GetComponentInChildren(); } if (entityAlive == null) { entityAlive = collider.transform.GetComponentInChildren(); } if (entityAlive != null && entityAlive.IsAlive()) { if (entityAlive.Buffs.HasBuff("FuriousRamsayResistShock")) { return false; } } } return true; } } }