Decompiled source of NoLavaDamage v1.0.0

plugins/NoLavaDamage/NoLavaDamage.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RoR2;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NoLavaDamage")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoLavaDamage")]
[assembly: AssemblyTitle("NoLavaDamage")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NoLavaDamage
{
	[HarmonyPatch]
	public static class HarmonyPatches
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(CharacterBody), "SetInLava")]
		public static bool SetInLava(ref bool b, CharacterBody __instance)
		{
			return false;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CharacterBody), "HandleLavaDamage")]
		public static bool HandleLavaDamage(ref float deltaTime, CharacterBody __instance)
		{
			return false;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CharacterBody), "InflictLavaDamage")]
		public static bool InflictLavaDamage(CharacterBody __instance)
		{
			return false;
		}
	}
	[BepInPlugin("AvarianKnight.NoLavaDamage", "NoLavaDamage", "1.0.0")]
	public class NoLavaDamage : BaseUnityPlugin
	{
		private bool m_enabled;

		private Harmony m_harmony;

		private void OnEnable()
		{
			if (!m_enabled)
			{
				m_enabled = true;
				m_harmony = Harmony.CreateAndPatchAll(typeof(HarmonyPatches), (string)null);
				((BaseUnityPlugin)this).Logger.LogMessage((object)"Enabling NoLavaDamage");
			}
		}

		private void OnDisable()
		{
			if (m_enabled)
			{
				m_enabled = false;
				m_harmony.UnpatchSelf();
				((BaseUnityPlugin)this).Logger.LogMessage((object)"Disabling NoLavaDamage");
			}
		}

		private void Awake()
		{
			OnEnable();
		}
	}
}