Decompiled source of WispDistance v1.0.1

WispDistance.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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: AssemblyTitle("WispDistance")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WispDistance")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("89bcfd4f-c3da-430a-8465-db630b8e5f61")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace WispDistance;

[BepInPlugin("Turbero.WispDistance", "Wisp Distance", "1.0.1")]
public class WispDistance : BaseUnityPlugin
{
	public const string GUID = "Turbero.WispDistance";

	public const string NAME = "Wisp Distance";

	public const string VERSION = "1.0.1";

	private readonly Harmony harmony = new Harmony("Turbero.WispDistance");

	private void Awake()
	{
		harmony.PatchAll();
	}

	private void onDestroy()
	{
		harmony.UnpatchSelf();
	}
}
[HarmonyPatch]
public class MistlandsPatch
{
	public static float demisterRange;

	private static MethodBase TargetMethod()
	{
		return AccessTools.Method(typeof(Demister), "OnEnable", (Type[])null, (Type[])null);
	}

	private static void Postfix(ref Demister __instance)
	{
		if (!((Object)(object)Player.m_localPlayer == (Object)null))
		{
			StatusEffect val = ((IEnumerable<StatusEffect>)((Character)Player.m_localPlayer).GetSEMan().GetStatusEffects()).FirstOrDefault((Func<StatusEffect, bool>)((StatusEffect effect) => ((Object)effect).name == "Demister"));
			if ((Object)(object)val != (Object)null)
			{
				val.m_name = "$item_demister" + $": {__instance.m_forceField.endRange} m.";
			}
		}
	}
}