Decompiled source of WarpedEchoBugFixes v2.0.1

WarpedEchoBugFixes.dll

Decompiled 7 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
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: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.1.0")]
[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 RiskOfResources
{
	[BepInPlugin("com.riskofresources.fix.echo", "WarpedEchoBugFixes", "2.0.1")]
	internal class WarpedEchoBugFixes : BaseUnityPlugin
	{
		public const string version = "2.0.1";

		public const string identifier = "com.riskofresources.fix.echo";

		protected void Awake()
		{
			Harmony.CreateAndPatchAll(typeof(WarpedEchoBugFixes), (string)null);
		}

		[HarmonyPatch(typeof(CharacterBody), "RecalculateStats")]
		[HarmonyPostfix]
		private static void CheckOneShotProtection(CharacterBody __instance)
		{
			__instance.hasOneShotProtection &= __instance.oneShotProtectionFraction > 0f;
		}

		[HarmonyPatch(typeof(CharacterBody), "SecondHalfOfDelayedDamage")]
		[HarmonyPrefix]
		private static void SetDamageType(CharacterBody __instance, DamageInfo __0)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			__0.damageType |= DamageTypeCombo.op_Implicit((DamageType)64);
			__0.damageType |= DamageTypeCombo.op_Implicit((DamageTypeExtended)262144);
		}
	}
}