Decompiled source of JizzLab v1.0.0

Mods/JizzLab.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSLZ.Combat;
using Il2CppSLZ.Marrow;
using Il2CppSLZ.Marrow.Data;
using Il2CppSLZ.VFX;
using JizzLabBL;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(JizzLab), "JizzLab", "1.0.0", "@joeswanson.", "https://discord.gg/aNc2vNk7Ub")]
[assembly: MelonPriority(1200000)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("JizzLab")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JizzLab")]
[assembly: AssemblyTitle("JizzLab")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace JizzLabBL
{
	[HarmonyPatch(typeof(VisualDamageReceiver))]
	internal class DamageReceiverPatches
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void Postfix(VisualDamageReceiver __instance)
		{
			((Behaviour)__instance).enabled = false;
		}
	}
	[HarmonyPatch(typeof(DecalProjector))]
	internal class DecalPatches
	{
		private static bool IsBloodProjector(DecalProjector decalProjector)
		{
			return ((Object)decalProjector.decalMaterial).name == "BloodSplatter";
		}

		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void Postfix(DecalProjector __instance)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (IsBloodProjector(__instance))
			{
				__instance.vertexColor = Color.white;
				__instance.decalSize *= 2f;
				__instance.ApplyDecal();
			}
		}

		[HarmonyPatch("ApplyDecal")]
		[HarmonyPrefix]
		public static void Prefix1(DecalProjector __instance)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (IsBloodProjector(__instance))
			{
				__instance.vertexColor = Color.white;
			}
		}

		[HarmonyPatch("ApplyDecalImmediate")]
		[HarmonyPrefix]
		public static void Prefix2(DecalProjector __instance)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (IsBloodProjector(__instance))
			{
				__instance.vertexColor = Color.white;
			}
		}
	}
	public class JizzLab : MelonMod
	{
		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg(ConsoleColor.Red, "im sorry for this");
		}
	}
	[HarmonyPatch(typeof(ParticleTint))]
	internal class TintPatches
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void Postfix(ParticleTint __instance)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)((Component)__instance).gameObject).name.StartsWith("Impact_Liquid"))
			{
				return;
			}
			__instance.TintParticles(Color.white);
			GameObject gameObject = ((Component)__instance).gameObject;
			object obj;
			if (gameObject == null)
			{
				obj = null;
			}
			else
			{
				Transform transform = gameObject.transform;
				if (transform == null)
				{
					obj = null;
				}
				else
				{
					Transform obj2 = transform.FindChild("Large Splat");
					if (obj2 == null)
					{
						obj = null;
					}
					else
					{
						GameObject gameObject2 = ((Component)obj2).gameObject;
						obj = ((gameObject2 != null) ? ((Il2CppObjectBase)gameObject2.GetComponent<ParticleImpactSpawn>().spawnable.policyData).Cast<VFXSpawnPolicyData>() : null);
					}
				}
			}
			VFXSpawnPolicyData val = (VFXSpawnPolicyData)obj;
			if (!((Object)(object)val == (Object)null))
			{
				val.spawnDistance = 0f;
				val.spawnFrequency = 0.1f;
				val.spawnStackDistance = 0f;
				((SpawnPolicyData)val).maxSize = 100;
			}
		}

		[HarmonyPatch("TintParticles")]
		[HarmonyPostfix]
		public static void Postfix(Color TintColor, ParticleTint __instance)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)((Component)__instance).gameObject).name.StartsWith("Impact_Liquid") && TintColor != Color.white)
			{
				__instance.TintParticles(Color.white);
			}
		}
	}
}