Decompiled source of BLOODWORKS v1.0.0

Mods/BetterBloodAlpha.dll

Decompiled a week ago
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BetterBloodAlpha;
using HarmonyLib;
using MelonLoader;
using StressLevelZero.Props.Weapons;
using UnityEngine;
using ch.sycoforge.Decal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("BetterBloodProtoType")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany(null)]
[assembly: AssemblyProduct("BetterBloodProtoType")]
[assembly: AssemblyCopyright("Created by thebonerworks")]
[assembly: AssemblyTrademark(null)]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: MelonInfo(typeof(global::BetterBloodAlpha.BetterBloodAlpha), "BetterBloodProtoType", "1.0.0", "thebonerworks", null)]
[assembly: MelonGame("Stress Level Zero", "BONEWORKS")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BetterBloodAlpha;

public static class BuildInfo
{
	public const string Name = "BetterBloodProtoType";

	public const string Author = "thebonerworks";

	public const string Company = null;

	public const string Version = "1.0.0";

	public const string DownloadLink = null;
}
public class BetterBloodAlpha : MelonMod
{
	public static bool firstgunfired = false;

	public static bool canrunagain = true;

	public static GameObject getdecal;

	public static GameObject secondblood;

	public override void OnUpdate()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Expected O, but got Unknown
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_023b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0287: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0336: Unknown result type (might be due to invalid IL or missing references)
		//IL_034e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_037e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)getdecal != (Object)null)
		{
			GameObject val = new GameObject("BloodSpawnPlace");
			GameObject val2 = new GameObject("BloodSpawnPlace2");
			GameObject val3 = new GameObject("BloodSpawnPlace3");
			GameObject val4 = new GameObject("BloodSpawnPlace4");
			val.transform.position = new Vector3(getdecal.transform.position.x + Random.Range(1f, 1.5f), getdecal.transform.position.y, getdecal.transform.position.z);
			val2.transform.position = new Vector3(getdecal.transform.position.x + Random.Range(-1f, -1.5f), getdecal.transform.position.y, getdecal.transform.position.z);
			val3.transform.position = new Vector3(getdecal.transform.position.x, getdecal.transform.position.y, getdecal.transform.position.z + Random.Range(1f, 1.5f));
			val4.transform.position = new Vector3(getdecal.transform.position.x, getdecal.transform.position.y, getdecal.transform.position.z + Random.Range(-1f, -1.5f));
			GameObject val5 = Object.Instantiate<GameObject>(getdecal.gameObject);
			GameObject val6 = Object.Instantiate<GameObject>(getdecal.gameObject);
			GameObject val7 = Object.Instantiate<GameObject>(getdecal.gameObject);
			GameObject val8 = Object.Instantiate<GameObject>(getdecal.gameObject);
			((Behaviour)val5.GetComponent<DecalController>()).enabled = false;
			val5.transform.position = val.transform.position;
			((Behaviour)val6.GetComponent<DecalController>()).enabled = false;
			val6.transform.position = val.transform.position;
			((Behaviour)val7.GetComponent<DecalController>()).enabled = false;
			val7.transform.position = val.transform.position;
			((Behaviour)val7.GetComponent<DecalController>()).enabled = false;
			val8.transform.position = val.transform.position;
			((Behaviour)val8.GetComponent<DecalController>()).enabled = false;
			val5.transform.position = val.transform.position;
			val6.transform.position = val2.transform.position;
			val7.transform.position = val3.transform.position;
			val8.transform.position = val4.transform.position;
			float num = Random.Range(1, 3);
			float num2 = Random.Range(1, 3);
			float num3 = Random.Range(1, 3);
			float num4 = Random.Range(1, 3);
			val5.transform.localScale = new Vector3(num, num, num);
			val6.transform.localScale = new Vector3(num2, num2, num2);
			val7.transform.localScale = new Vector3(num3, num3, num3);
			val8.transform.localScale = new Vector3(num4, num4, num4);
			canrunagain = false;
			getdecal = null;
		}
	}
}
[HarmonyPatch(typeof(Gun), "OnFire")]
internal class assballscum : MonoBehaviour
{
	private static void Postfix(EasyDecal __instance)
	{
		BetterBloodAlpha.firstgunfired = true;
	}
}
[HarmonyPatch(typeof(DecalController), "OnEnable")]
internal class assballscum2 : MonoBehaviour
{
	private static void Postfix(DecalController __instance)
	{
		if (BetterBloodAlpha.firstgunfired)
		{
			BetterBloodAlpha.getdecal = ((Component)__instance).gameObject;
		}
	}
}

Mods/BloodWorks.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BloodWorks;
using HarmonyLib;
using MelonLoader;
using ProjectBloodAndTears.ResourceLoading;
using PuppetMasta;
using StressLevelZero.AI;
using StressLevelZero.Combat;
using StressLevelZero.Props.Weapons;
using UnhollowerBaseLib;
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(MainMod), "BloodWorks", "1.0.0", "BonerWorks", null)]
[assembly: MelonGame("Stress Level Zero", "BONEWORKS")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace BloodWorks
{
	public class MainMod : MelonMod
	{
		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			if (sceneName == "scene_mainMenu")
			{
				AssetLoader.SetUpAssets();
			}
		}
	}
}
namespace ProjectBloodAndTears
{
	internal class Functions
	{
		public static int getBloodType(GameObject objectinsideenemy)
		{
			if (((Object)((Component)objectinsideenemy.transform.root).gameObject).name.Contains("BrettEnemy"))
			{
				return 0;
			}
			if (((Object)((Component)objectinsideenemy.transform.root).gameObject).name.Contains("NullBodyCorrupted"))
			{
				return 1;
			}
			if (((Object)((Component)objectinsideenemy.transform.root).gameObject).name.Contains("NullBody"))
			{
				return 3;
			}
			if (((Object)((Component)objectinsideenemy.transform.root).gameObject).name.Contains("NullRat"))
			{
				return 3;
			}
			if (((Object)((Component)objectinsideenemy.transform.root).gameObject).name.Contains("Ford_EarlyExit"))
			{
				return 2;
			}
			if (((Object)((Component)objectinsideenemy.transform.root).gameObject).name.Contains("Crablet"))
			{
				return 4;
			}
			return 0;
		}

		public static void createBloodSplatter(Vector3 startpos, Vector3 dir, int type)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = AssetList.BloodSplatter;
			switch (type)
			{
			case 0:
				val = AssetList.BloodSplatter;
				break;
			case 1:
				val = AssetList.NullCurBloodSplatter;
				break;
			case 2:
				val = AssetList.EarlyBloodSplatter;
				break;
			case 3:
				val = AssetList.NullBloodSplatter;
				break;
			case 4:
				val = AssetList.OilBloodSplatter;
				break;
			}
			RaycastHit[] array = Il2CppArrayBase<RaycastHit>.op_Implicit((Il2CppArrayBase<RaycastHit>)(object)Physics.RaycastAll(startpos, dir, 2f));
			float num = Random.Range(0.05f, 0.1f);
			Array.Sort(array, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance));
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val2 = array2[i];
				if (!Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref val2)).collider).transform.root).gameObject.GetComponent<AIBrain>()) && !Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref val2)).collider).transform.root).gameObject.GetComponent<Gun>()) && !Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref val2)).collider).transform.root).gameObject.GetComponent<Player_Health>()))
				{
					GameObject val3 = Object.Instantiate<GameObject>(val);
					val3.transform.position = ((RaycastHit)(ref val2)).point;
					val3.transform.rotation = Quaternion.LookRotation(((RaycastHit)(ref val2)).normal);
					Transform transform = val3.transform;
					transform.rotation *= Quaternion.Euler(Vector3.forward * Random.Range(0.1f, 360f));
					val3.transform.localScale = new Vector3(num + Random.Range(0f, 0.05f), num + Random.Range(0f, 0.05f), num + Random.Range(0f, 0.05f));
					Transform transform2 = val3.transform;
					transform2.position += val3.transform.forward * 0.01f;
					val3.transform.parent = ((Component)((RaycastHit)(ref val2)).collider).transform;
					return;
				}
			}
			RaycastHit[] array3 = Il2CppArrayBase<RaycastHit>.op_Implicit((Il2CppArrayBase<RaycastHit>)(object)Physics.RaycastAll(startpos + dir * 2f, Vector3.down, 99999f));
			Array.Sort(array3, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance));
			RaycastHit[] array4 = array3;
			for (int j = 0; j < array4.Length; j++)
			{
				RaycastHit val4 = array4[j];
				if (!Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref val4)).collider).transform.root).gameObject.GetComponent<AIBrain>()) && !Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref val4)).collider).transform.root).gameObject.GetComponent<Gun>()) && !Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref val4)).collider).transform.root).gameObject.GetComponent<Player_Health>()))
				{
					GameObject val5 = Object.Instantiate<GameObject>(val);
					val5.transform.position = ((RaycastHit)(ref val4)).point;
					val5.transform.rotation = Quaternion.LookRotation(((RaycastHit)(ref val4)).normal);
					Transform transform3 = val5.transform;
					transform3.rotation *= Quaternion.Euler(Vector3.forward * Random.Range(0.1f, 360f));
					val5.transform.localScale = new Vector3(num + Random.Range(0f, 0.05f), num + Random.Range(0f, 0.05f), num + Random.Range(0f, 0.05f));
					Transform transform4 = val5.transform;
					transform4.position += val5.transform.forward * 0.01f;
					val5.transform.parent = ((Component)((RaycastHit)(ref val4)).collider).transform;
					break;
				}
			}
		}

		public static void addBloodEffectsToShot(Gun gun, RaycastHit raycastHit, int type, Ray ray)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			Material material = AssetList.CubeMat;
			GameObject val = AssetList.BloodCloudCubeMat;
			RaycastHit[] array = Il2CppArrayBase<RaycastHit>.op_Implicit((Il2CppArrayBase<RaycastHit>)(object)Physics.RaycastAll(((RaycastHit)(ref raycastHit)).point + ((Component)gun.firePointTransform).transform.forward * (((RaycastHit)(ref raycastHit)).distance + 50f), -((Ray)(ref ray)).direction, 10000f));
			switch (type)
			{
			case 0:
				material = AssetList.CubeMat;
				val = AssetList.BloodCloudCubeMat;
				break;
			case 1:
				material = AssetList.CorruptedNullBody;
				val = AssetList.BloodCloudCorruptedNullBody;
				break;
			case 2:
				material = AssetList.EarlyExit;
				val = AssetList.BloodCloudEarlyExit;
				break;
			case 3:
				material = AssetList.NullBody;
				val = AssetList.BloodCloudNullBody;
				break;
			case 4:
				material = AssetList.OilBlood;
				val = AssetList.BloodCloudOil;
				break;
			}
			GameObject val2 = Object.Instantiate<GameObject>(AssetList.BloodDrip);
			ParticleSystem component = val2.GetComponent<ParticleSystem>();
			((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material.shader = AssetList.SLZFILLCOLORShader;
			val2.transform.position = ((RaycastHit)(ref raycastHit)).point;
			val2.transform.parent = ((Component)((RaycastHit)(ref raycastHit)).collider).transform;
			val2.transform.LookAt(gun.firePointTransform);
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val3 = array2[i];
				if ((Object)(object)((Component)((Component)((RaycastHit)(ref val3)).collider).transform.root).gameObject == (Object)(object)((Component)((Component)((RaycastHit)(ref raycastHit)).collider).transform.root).gameObject)
				{
					GameObject val4 = Object.Instantiate<GameObject>(AssetList.BloodStream);
					ParticleSystem component2 = val4.GetComponent<ParticleSystem>();
					((Renderer)((Component)component2).GetComponent<ParticleSystemRenderer>()).material = material;
					((Renderer)((Component)component2).GetComponent<ParticleSystemRenderer>()).material.shader = AssetList.SLZFILLCOLORShader;
					val4.transform.position = ((RaycastHit)(ref val3)).point;
					val4.transform.parent = ((Component)((RaycastHit)(ref val3)).collider).transform;
					val4.transform.LookAt(((RaycastHit)(ref raycastHit)).point + ((Component)gun.firePointTransform).transform.forward * (((RaycastHit)(ref raycastHit)).distance + 50f));
					GameObject val5 = new GameObject("aafasdflk");
					val5.transform.LookAt(((RaycastHit)(ref raycastHit)).point + ((Component)gun.firePointTransform).transform.forward * (((RaycastHit)(ref raycastHit)).distance + 50f));
					createBloodSplatter(((RaycastHit)(ref val3)).point, val5.transform.forward, type);
					Object.Destroy((Object)(object)val5);
					GameObject val6 = Object.Instantiate<GameObject>(val);
					ParticleSystem component3 = val6.GetComponent<ParticleSystem>();
					((Renderer)((Component)component3).GetComponent<ParticleSystemRenderer>()).material.shader = AssetList.AlphaBlended;
					val6.transform.position = ((RaycastHit)(ref val3)).point;
					val6.transform.localScale = new Vector3(0.05f, 0.05f, 0.05f);
					val6.transform.parent = ((Component)((RaycastHit)(ref val3)).collider).transform;
					val6.transform.LookAt(((RaycastHit)(ref raycastHit)).point + ((Component)gun.firePointTransform).transform.forward * (((RaycastHit)(ref raycastHit)).distance + 50f));
					break;
				}
			}
		}
	}
}
namespace ProjectBloodAndTears.ResourceLoading
{
	internal class AssetList
	{
		public static Material CubeMat;

		public static Material CorruptedNullBody;

		public static Material EarlyExit;

		public static Material NullBody;

		public static Material OilBlood;

		public static GameObject TestingCube;

		public static GameObject BloodStream;

		public static GameObject BloodDripPunch;

		public static GameObject BloodDrip;

		public static GameObject BloodCloud;

		public static Shader defaultValveVRShader;

		public static Shader SLZFILLCOLORShader;

		public static Shader LitGarbageShader;

		public static Shader Standard;

		public static Shader AlphaBlended;

		public static GameObject BloodCloudOil;

		public static GameObject BloodCloudNullBody;

		public static GameObject BloodCloudEarlyExit;

		public static GameObject BloodCloudCubeMat;

		public static GameObject BloodCloudCorruptedNullBody;

		public static GameObject OilBloodSplatter;

		public static GameObject BloodSplatter;

		public static GameObject EarlyBloodSplatter;

		public static GameObject NullBloodSplatter;

		public static GameObject NullCurBloodSplatter;

		public static void ShittyAssetLoadingSystem()
		{
			EarlyBloodSplatter = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("EarlyBloodSplatter");
			NullBloodSplatter = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("NullBloodSplatter");
			NullCurBloodSplatter = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("NullCurBloodSplatter");
			OilBloodSplatter = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("OilBloodSplatter");
			BloodSplatter = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodSplatter");
			defaultValveVRShader = Shader.Find("Valve/vr_standard");
			SLZFILLCOLORShader = Shader.Find("SLZ/Fill Color");
			Standard = Shader.Find("Standard");
			AlphaBlended = Shader.Find("Legacy Shaders/Particles/Alpha Blended");
			BloodCloudOil = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodCloudOil");
			BloodCloudNullBody = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodCloudNullBody");
			BloodCloudEarlyExit = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodCloudEarlyExit");
			BloodCloudCubeMat = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodCloudCubeMat");
			BloodCloudCorruptedNullBody = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodCloudCorruptedNullBody");
			BloodCloud = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodCloud");
			TestingCube = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("Cube");
			BloodDripPunch = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("PunchBloodDrip");
			CorruptedNullBody = AssetLoader.myLoadedAssetBundle.LoadAsset<Material>("CorruptedNullBody");
			EarlyExit = AssetLoader.myLoadedAssetBundle.LoadAsset<Material>("EarlyExit");
			NullBody = AssetLoader.myLoadedAssetBundle.LoadAsset<Material>("NullBody");
			OilBlood = AssetLoader.myLoadedAssetBundle.LoadAsset<Material>("OilBlood");
			CubeMat = AssetLoader.myLoadedAssetBundle.LoadAsset<Material>("CubeMat");
			BloodStream = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodStream");
			BloodDrip = AssetLoader.myLoadedAssetBundle.LoadAsset<GameObject>("BloodDrip");
			LitGarbageShader = AssetLoader.myLoadedAssetBundle.LoadAsset<Shader>("Shader");
		}
	}
	internal class AssetLoader
	{
		public static AssetBundle myLoadedAssetBundle;

		public static bool Completed;

		public static void SetUpAssets()
		{
			if (!Completed)
			{
				string text = MelonUtils.UserDataDirectory.Replace("\\", "/");
				myLoadedAssetBundle = AssetBundle.LoadFromFile(text + "/BloodWorks.pbt");
				if ((Object)(object)myLoadedAssetBundle == (Object)null)
				{
					MelonLogger.Msg("Failed to load AssetBundle!");
					return;
				}
				AssetList.ShittyAssetLoadingSystem();
				Completed = true;
			}
		}
	}
}
namespace ProjectBloodAndTears.HarmonyPatches
{
	[HarmonyPatch(typeof(Gun), "Update")]
	internal class AssetLoadFix
	{
		private static void Prefix(Gun __instance)
		{
			if (!Object.op_Implicit((Object)(object)AssetList.BloodStream))
			{
				AssetList.ShittyAssetLoadingSystem();
			}
		}
	}
	[HarmonyPatch(typeof(PuppetMaster), "OnDisable")]
	internal class BloodStreamDeleterFix
	{
		private static void Prefix(PuppetMaster __instance)
		{
			foreach (Transform componentsInChild in ((Component)((Component)__instance).transform).GetComponentsInChildren<Transform>())
			{
				if (((Object)((Component)componentsInChild).gameObject).name.Contains("BloodStream"))
				{
					Object.Destroy((Object)(object)((Component)componentsInChild).gameObject);
				}
				if (((Object)((Component)componentsInChild).gameObject).name.Contains("BloodDrip"))
				{
					Object.Destroy((Object)(object)((Component)componentsInChild).gameObject);
				}
				if (((Object)((Component)componentsInChild).gameObject).name.Contains("BloodCloud"))
				{
					Object.Destroy((Object)(object)((Component)componentsInChild).gameObject);
				}
				if (((Object)((Component)componentsInChild).gameObject).name.Contains("PunchBloodDrip"))
				{
					Object.Destroy((Object)(object)((Component)componentsInChild).gameObject);
				}
			}
		}
	}
	[HarmonyPatch(typeof(VisualDamageReceiver), "ReceiveAttack")]
	internal class PunchEffects
	{
		private static void Prefix(VisualDamageReceiver __instance)
		{
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			Material material = AssetList.CubeMat;
			foreach (Transform componentsInChild in ((Component)((Component)__instance).transform).GetComponentsInChildren<Transform>())
			{
				if (((Object)componentsInChild).name.Contains("Jaw_M") && Object.op_Implicit((Object)(object)((Component)((Component)componentsInChild).transform.root).gameObject.GetComponent<AIBrain>()))
				{
					GameObject gameObject = ((Component)componentsInChild).gameObject;
					switch (Functions.getBloodType(gameObject))
					{
					case 0:
						material = AssetList.CubeMat;
						break;
					case 1:
						material = AssetList.CorruptedNullBody;
						break;
					case 2:
						material = AssetList.EarlyExit;
						break;
					case 3:
						material = AssetList.NullBody;
						break;
					case 4:
						material = AssetList.OilBlood;
						break;
					}
					GameObject val = Object.Instantiate<GameObject>(AssetList.BloodDripPunch);
					ParticleSystem component = val.GetComponent<ParticleSystem>();
					((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material = material;
					((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material.shader = AssetList.SLZFILLCOLORShader;
					val.transform.position = gameObject.transform.position;
					val.transform.parent = gameObject.transform;
				}
				else if (((Object)componentsInChild).name.Contains("Head") && Object.op_Implicit((Object)(object)((Component)((Component)componentsInChild).transform.root).gameObject.GetComponent<AIBrain>()))
				{
					GameObject gameObject2 = ((Component)componentsInChild).gameObject;
					switch (Functions.getBloodType(gameObject2))
					{
					case 0:
						material = AssetList.CubeMat;
						break;
					case 1:
						material = AssetList.CorruptedNullBody;
						break;
					case 2:
						material = AssetList.EarlyExit;
						break;
					case 3:
						material = AssetList.NullBody;
						break;
					case 4:
						material = AssetList.OilBlood;
						break;
					}
					GameObject val2 = Object.Instantiate<GameObject>(AssetList.BloodDripPunch);
					ParticleSystem component2 = val2.GetComponent<ParticleSystem>();
					((Renderer)((Component)component2).GetComponent<ParticleSystemRenderer>()).material = material;
					((Renderer)((Component)component2).GetComponent<ParticleSystemRenderer>()).material.shader = AssetList.SLZFILLCOLORShader;
					val2.transform.position = gameObject2.transform.position;
					val2.transform.parent = gameObject2.transform;
				}
			}
		}
	}
	[HarmonyPatch(typeof(StabPoint), "UnStab")]
	internal class StabEffect
	{
		private static void Prefix(StabPoint __instance)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			Material material = AssetList.CubeMat;
			Collider[] array = Il2CppArrayBase<Collider>.op_Implicit((Il2CppArrayBase<Collider>)(object)Physics.OverlapSphere(__instance.pointTran.position, 0.1f));
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				if (Object.op_Implicit((Object)(object)((Component)((Component)val).transform.root).gameObject.GetComponent<VisualDamageController>()) && Object.op_Implicit((Object)(object)((Component)((Component)val).transform.root).gameObject.GetComponent<AIBrain>()))
				{
					switch (Functions.getBloodType(((Component)val).gameObject))
					{
					case 0:
						material = AssetList.CubeMat;
						break;
					case 1:
						material = AssetList.CorruptedNullBody;
						break;
					case 2:
						material = AssetList.EarlyExit;
						break;
					case 3:
						material = AssetList.NullBody;
						break;
					case 4:
						material = AssetList.OilBlood;
						break;
					}
					GameObject val2 = Object.Instantiate<GameObject>(AssetList.BloodDrip);
					ParticleSystem component = val2.GetComponent<ParticleSystem>();
					((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material = material;
					((Renderer)((Component)component).GetComponent<ParticleSystemRenderer>()).material.shader = AssetList.SLZFILLCOLORShader;
					val2.transform.position = __instance.pointTran.position;
					val2.transform.parent = ((Component)val).transform;
					val2.transform.LookAt(__instance.pointTran.position);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Gun), "OnFire")]
	internal class WeaponFirePatch
	{
		private static void Prefix(Gun __instance)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(__instance.firePointTransform.position, ((Component)__instance).transform.forward);
			RaycastHit raycastHit = default(RaycastHit);
			if (Physics.Raycast(val, ref raycastHit, 999999f) && Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref raycastHit)).collider).transform.root).gameObject.GetComponent<AIBrain>()) && Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref raycastHit)).collider).transform.root).gameObject.GetComponent<VisualDamageController>()))
			{
				int num = 0;
				num = Functions.getBloodType(((Component)((RaycastHit)(ref raycastHit)).collider).gameObject);
				Functions.addBloodEffectsToShot(__instance, raycastHit, num, val);
			}
		}
	}
}