Decompiled source of ConductionFix v1.0.0

ConductionFix.dll

Decompiled a day ago
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.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ConductionFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ConductionFix")]
[assembly: AssemblyTitle("ConductionFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ConductionFix;

[BepInPlugin("ali.uk.conductionfix", "Conduction Fix", "1.0.0")]
public class ConductionFixPlugin : BaseUnityPlugin
{
	internal static ManualLogSource Log;

	private readonly Harmony _harmony = new Harmony("ali.uk.conductionfix");

	private void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		_harmony.PatchAll();
		Log.LogInfo((object)"A shocking turn of events :3 (Conduction fixed!!)");
	}
}
[HarmonyPatch(typeof(EnemyIdentifier), "DelayedAfterShock")]
public static class DelayedAfterShockPatch
{
	private static bool Prefix(EnemyIdentifier __instance, float delay, Vector3 pos, ref bool ___afterShockFromZap, List<Magnet> ___stuckMagnets, int ___nailsAmount, HashSet<Water> ___touchingWaters, bool ___waterOnlyAftershock)
	{
		//IL_00a9: 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)
		float num = Mathf.Min(6f, (float)___nailsAmount / 15f);
		___afterShockFromZap = false;
		if (___stuckMagnets.Count > 0)
		{
			num += (float)___stuckMagnets.Count;
			foreach (Magnet ___stuckMagnet in ___stuckMagnets)
			{
				if ((Object)(object)___stuckMagnet != (Object)null)
				{
					___stuckMagnet.health -= 1f;
				}
			}
		}
		if (num < 1f && ___touchingWaters.Count > 0)
		{
			num = 1f;
		}
		Aftershock val = new GameObject().AddComponent<Aftershock>();
		val.delay = delay;
		((Component)val).transform.position = pos;
		val.waterOnly = ___waterOnlyAftershock;
		val.extraDamage = num;
		val.ZapFrom(__instance);
		return false;
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "ali.uk.conductionfix";

	public const string PLUGIN_NAME = "Conduction Fix";

	public const string PLUGIN_VERSION = "1.0.0";
}