Decompiled source of BloodEffectDisabler v1.0.0

BepInEx/plugins/BloodEffectDisabler.v5.4.23.5.dll

Decompiled a week 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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("BloodEffectDisabler")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BloodEffectDisabler")]
[assembly: AssemblyTitle("BloodEffectDisabler")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 BloodEffectDisabler
{
	[BepInPlugin("com.Jake.bloodeffectdisabler", "Blood Effect Disabler", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const bool IS_DEBUG = false;

		private static readonly string[] BlockedEffects = new string[55]
		{
			"arrow4Leech", "biteLeech", "bleed", "bleedLeech", "BleedLeechTrail", "bloodrain", "Bloodcast", "BloodTornado", "bluntpunchBossBleedPA", "CastLeech",
			"coldslashbleed", "dtfaceLeech", "holyslashbleed", "iceclawsbleed", "Leech VFX", "LeechBurst", "LeechBurstwBleed", "leechbleed2", "Leechslash", "Leechslash01",
			"LeechTrail01", "markLeech", "mindLeechimpact2", "rangedcast4Leech", "rangedimpact3Leechbleed", "rangedimpact7mindBleed", "shadowborn leech idle", "shadowborn_leech_attack", "shadowborn_leech_cast", "shadowborn_leech_hard_movement",
			"shadowborn_leech_hit", "shadowcast5Leech", "shadowimpact4Leech", "shadowimpact4LeechCold", "slashcarnage", "slashcleave", "slashdevast", "slashevisc", "slashfurious", "slashgreenbleed",
			"slashimpact", "slashimpactbleed", "slashmeat", "slashmeatcast", "slashred1", "slashredbleed1", "slashredbleed2", "slashredbleed3", "slashslow", "slashsweep",
			"slashwhirl", "slashwhirlimpact", "smellblood", "yoggermeat", "yoggermeati"
		};

		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Blood Effect Disabler loaded!");
		}

		private static bool IsBlocked(string effectName, string[] blockedList)
		{
			foreach (string text in blockedList)
			{
				if (effectName == text)
				{
					return true;
				}
			}
			return false;
		}

		private static void DebugLog(string message)
		{
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffectAC", new Type[]
		{
			typeof(string),
			typeof(bool),
			typeof(Transform),
			typeof(bool),
			typeof(float),
			typeof(bool)
		})]
		[HarmonyPrefix]
		private static bool PlayEffectAC_Prefix(string effect)
		{
			DebugLog("[EffectAC] " + effect);
			return !IsBlocked(effect, BlockedEffects);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(CardData),
			typeof(bool),
			typeof(bool),
			typeof(Transform),
			typeof(float)
		})]
		[HarmonyPrefix]
		private static bool PlayEffect_CardData_Prefix(CardData card, bool isCaster)
		{
			string text = (isCaster ? card.EffectCaster : card.EffectTarget);
			DebugLog("[CardEffect] Card=" + card.CardName + " | isCaster=" + isCaster + " | Effect=" + text);
			return !IsBlocked(text, BlockedEffects);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(string),
			typeof(float)
		})]
		[HarmonyPrefix]
		private static void PlayEffect_Float_Prefix(string effectName)
		{
			DebugLog("[Effect_Float] " + effectName);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(string),
			typeof(Transform)
		})]
		[HarmonyPrefix]
		private static void PlayEffect_Transform_Prefix(string effectName)
		{
			DebugLog("[Effect_Transform] " + effectName);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(string),
			typeof(Transform),
			typeof(bool),
			typeof(bool),
			typeof(float)
		})]
		[HarmonyPrefix]
		private static void PlayEffect_Full_Prefix(string TargetEffect)
		{
			DebugLog("[Effect_Full] " + TargetEffect);
		}
	}
}

BepInEx/plugins/BloodEffectDisabler.v6.0.0.dll

Decompiled a week 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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("BloodEffectDisabler")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BloodEffectDisabler")]
[assembly: AssemblyTitle("BloodEffectDisabler")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 BloodEffectDisabler
{
	[BepInPlugin("com.Jake.bloodeffectdisabler", "Blood Effect Disabler", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const bool IS_DEBUG = true;

		private static readonly string[] BlockedEffects = new string[55]
		{
			"arrow4Leech", "biteLeech", "bleed", "bleedLeech", "BleedLeechTrail", "bloodrain", "Bloodcast", "BloodTornado", "bluntpunchBossBleedPA", "CastLeech",
			"coldslashbleed", "dtfaceLeech", "holyslashbleed", "iceclawsbleed", "Leech VFX", "LeechBurst", "LeechBurstwBleed", "leechbleed2", "Leechslash", "Leechslash01",
			"LeechTrail01", "markLeech", "mindLeechimpact2", "rangedcast4Leech", "rangedimpact3Leechbleed", "rangedimpact7mindBleed", "shadowborn leech idle", "shadowborn_leech_attack", "shadowborn_leech_cast", "shadowborn_leech_hard_movement",
			"shadowborn_leech_hit", "shadowcast5Leech", "shadowimpact4Leech", "shadowimpact4LeechCold", "slashcarnage", "slashcleave", "slashdevast", "slashevisc", "slashfurious", "slashgreenbleed",
			"slashimpact", "slashimpactbleed", "slashmeat", "slashmeatcast", "slashred1", "slashredbleed1", "slashredbleed2", "slashredbleed3", "slashslow", "slashsweep",
			"slashwhirl", "slashwhirlimpact", "smellblood", "yoggermeat", "yoggermeati"
		};

		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Blood Effect Disabler loaded!");
		}

		private static bool IsBlocked(string effectName, string[] blockedList)
		{
			foreach (string text in blockedList)
			{
				if (effectName == text)
				{
					return true;
				}
			}
			return false;
		}

		private static void DebugLog(string message)
		{
			Log.LogDebug((object)message);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffectAC", new Type[]
		{
			typeof(string),
			typeof(bool),
			typeof(Transform),
			typeof(bool),
			typeof(float),
			typeof(bool)
		})]
		[HarmonyPrefix]
		private static bool PlayEffectAC_Prefix(string effect)
		{
			DebugLog("[EffectAC] " + effect);
			return !IsBlocked(effect, BlockedEffects);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(CardData),
			typeof(bool),
			typeof(bool),
			typeof(Transform),
			typeof(float)
		})]
		[HarmonyPrefix]
		private static bool PlayEffect_CardData_Prefix(CardData card, bool isCaster)
		{
			string text = (isCaster ? card.EffectCaster : card.EffectTarget);
			DebugLog("[CardEffect] Card=" + card.CardName + " | isCaster=" + isCaster + " | Effect=" + text);
			return !IsBlocked(text, BlockedEffects);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(string),
			typeof(float)
		})]
		[HarmonyPrefix]
		private static void PlayEffect_Float_Prefix(string effectName)
		{
			DebugLog("[Effect_Float] " + effectName);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(string),
			typeof(Transform)
		})]
		[HarmonyPrefix]
		private static void PlayEffect_Transform_Prefix(string effectName)
		{
			DebugLog("[Effect_Transform] " + effectName);
		}

		[HarmonyPatch(typeof(EffectsManager), "PlayEffect", new Type[]
		{
			typeof(string),
			typeof(Transform),
			typeof(bool),
			typeof(bool),
			typeof(float)
		})]
		[HarmonyPrefix]
		private static void PlayEffect_Full_Prefix(string TargetEffect)
		{
			DebugLog("[Effect_Full] " + TargetEffect);
		}
	}
}