Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of ScheduleGore v1.0.0
Mods/ScheduleGore.IL2CPP.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.Combat; using Il2CppScheduleOne.NPCs; using MelonLoader; using Microsoft.CodeAnalysis; using ScheduleGore; using ScheduleGore.Blood; using ScheduleGore.Embedded; using ScheduleGore.Helpers; using ScheduleGore.Utils; using UnityEngine; using UnityEngine.Rendering.Universal; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(ModMain), "ScheduleGore", "1.0.0", "joeswanson.", null)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("ScheduleGore.IL2CPP")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ScheduleGore.IL2CPP")] [assembly: AssemblyTitle("ScheduleGore.IL2CPP")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] 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 ScheduleGore { public class ModMain : MelonMod { public override void OnInitializeMelon() { Assets.InitializeBundle(); } } } namespace ScheduleGore.Utils { internal class Logging { public static bool NullSanity([NotNullWhen(true)] object? inQuestion, string nameForObject = "Something (Unspecified)") { if (inQuestion == null) { Melon<ModMain>.Logger.Error(nameForObject + " was null."); } return inQuestion != null; } } } namespace ScheduleGore.Patches { [HarmonyPatch(typeof(NPC))] internal class NPCPatches { [HarmonyPostfix] [HarmonyPatch("ReceiveImpact")] public static void ReceiveImpact(NPC __instance, Impact impact) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 EImpactType impactType = impact.ImpactType; EImpactType val = impactType; if ((int)val != 1) { if ((int)val == 3) { GunshotController.Hit(__instance, impact); } } else { BluntController.Hit(__instance, impact); } } [HarmonyPostfix] [HarmonyPatch("Start")] public static void Start(NPC __instance) { ((Component)__instance).gameObject.AddComponent<VisualDamageController>(); ((Component)__instance).gameObject.AddComponent<SplatController>(); ((Component)__instance).gameObject.AddComponent<SoundController>(); ((Component)__instance).gameObject.AddComponent<PoolController>(); } } } namespace ScheduleGore.Helpers { internal class BluntController { public static void Hit(NPC impacted, Impact impact) { ((Component)impacted).GetComponentInParent<VisualDamageController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<SoundController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<PoolController>()?.ImpactRecieved(impacted, impact); } } internal class GunshotController { public static void Hit(NPC impacted, Impact impact) { ((Component)impacted).GetComponentInParent<VisualDamageController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<SplatController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<SoundController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<PoolController>()?.ImpactRecieved(impacted, impact); } } } namespace ScheduleGore.Embedded { internal class Assets { public class Object<T> where T : Object { public string? name; private T? _obj; public T? Instance { get { if ((Object)(object)_obj == (Object)null) { Il2CppAssetBundle? bundle = Bundle; _obj = ((bundle != null) ? bundle.LoadAsset<T>(name) : default(T)); } else { object obj = _obj; GameObject val = (GameObject)((obj is GameObject) ? obj : null); if (val != null) { ShaderFix.FixShaders(val); } } return _obj; } set { _obj = value; } } public Object(string name) { this.name = name; } public T? Instantiate() { return Object.op_Implicit((Object)(object)Instance) ? Object.Instantiate<T>(Instance) : default(T); } } public const string GoreBundleName = "schedulegore.fx"; public static Object<GameObject> Splat = new Object<GameObject>("BloodSplat.prefab"); public static Il2CppAssetBundle? Bundle { get; private set; } public static Il2CppAssetBundle? InitializeBundle() { Bundle = EAB.LoadFromAssembly(Assembly.GetExecutingAssembly(), "ScheduleGore.IL2CPP.Resources.schedulegore.fx"); if (Bundle == null) { Melon<ModMain>.Logger.Error("Failed to load schedulegore.fx. Many things will break"); } else { ShaderFix.FixShaders(Bundle); } return Bundle; } } internal class EAB { public static Il2CppAssetBundle? LoadFromAssembly(Assembly assembly, string name) { string[] manifestResourceNames = assembly.GetManifestResourceNames(); if (manifestResourceNames.Contains(name)) { byte[] array; using (Stream stream = assembly.GetManifestResourceStream(name)) { using MemoryStream memoryStream = new MemoryStream(); stream?.CopyTo(memoryStream); array = memoryStream.ToArray(); } return Il2CppAssetBundleManager.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array)); } return null; } } public class ShaderFix { public static Material? bodySearchDecal; public static void FixShaders(Il2CppAssetBundle obj) { foreach (Material item in (Il2CppArrayBase<Material>)(object)obj.LoadAllAssets<Material>()) { Shader val = Shader.Find(((Object)item.shader).name); if ((Object)(object)val != (Object)null) { item.shader = val; } } } public static void FixShaders(GameObject obj) { if ((Object)(object)bodySearchDecal == (Object)null) { bodySearchDecal = ((IEnumerable<DecalProjector>)Object.FindObjectsOfType<DecalProjector>()).Where(delegate(DecalProjector proj) { Material material = proj.material; return material != null && ((Object)material).name.Contains("Police arrest circle mat"); }).First().material; } foreach (DecalProjector componentsInChild in obj.GetComponentsInChildren<DecalProjector>(true)) { componentsInChild.material.SetTexture("_Base_Map", componentsInChild.material.GetTexture("Base_Map")); componentsInChild.material.SetTexture("_Normal_Map", componentsInChild.material.GetTexture("Normal_Map")); componentsInChild.material.shader = Shader.Find("Shader Graphs/Tyler Decal"); } } } } namespace ScheduleGore.Blood { [RegisterTypeInIl2Cpp] internal class PoolController : MonoBehaviour { [RegisterTypeInIl2Cpp] internal class SplatSpout : MonoBehaviour { [CompilerGenerated] private sealed class <DripDrop>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SplatSpout <>4__this; private int <i>5__1; private RaycastHit <hitInfo>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DripDrop>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; goto IL_00fa; } <>1__state = -1; <i>5__1 = 0; goto IL_010b; IL_00fa: <i>5__1++; goto IL_010b; IL_010b: if (<i>5__1 < Random.Range(5, 10)) { if (Physics.Raycast(((Component)<>4__this).transform.position, Vector3.down, ref <hitInfo>5__2, 3f, 1 << LayerMask.NameToLayer("Default"))) { SplatController.Splat(((RaycastHit)(ref <hitInfo>5__2)).point, Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref <hitInfo>5__2)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref <hitInfo>5__2)).normal), 0.1f, null, 0.85f, staticOpacity: true); <>2__current = (object)new WaitForSeconds(Random.Range(1f, 2f)); <>1__state = 1; return true; } goto IL_00fa; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <RunCountdown>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Rigidbody part; public SplatSpout <>4__this; private float <t>5__1; private RaycastHit <hitInfo>5__2; private float <scale>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RunCountdown>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_00e7: 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_0106: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_016e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <t>5__1 = 1f; break; case 1: <>1__state = -1; goto IL_01a3; case 2: { <>1__state = -1; goto IL_01a3; } IL_01a3: <t>5__1 -= 1f / 150f; break; } if (<t>5__1 >= 0f) { if (Physics.Raycast(((Component)<>4__this).transform.position, Vector3.down, ref <hitInfo>5__2, 3f, 1 << LayerMask.NameToLayer("Default")) && Time.time - <>4__this.timeSinceMove <= 2f) { <scale>5__3 = Mathf.Lerp(0.75f, 0.1f, 1f - <t>5__1); if (Random.Range(1, 10) == 10) { <scale>5__3 *= 3f; } Vector3 point = ((RaycastHit)(ref <hitInfo>5__2)).point; Quaternion rotation = Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref <hitInfo>5__2)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref <hitInfo>5__2)).normal); float scale = <scale>5__3; float opacity = Mathf.Lerp(0.5f, 0.1f, 1f - <t>5__1); SplatController.Splat(point, rotation, scale, null, opacity); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Rigidbody rb; private float timeSinceMove = Time.time; public SplatSpout(IntPtr ptr) : base(ptr) { } public void Spout(Rigidbody part) { rb = part; MelonCoroutines.Start(RunCountdown(part)); MelonCoroutines.Start(DripDrop()); } private void Update() { //IL_0015: 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) if ((Object)(object)rb != (Object)null) { Vector3 velocity = rb.velocity; if (((Vector3)(ref velocity)).magnitude >= 0.1f) { timeSinceMove = Time.time; } } } [IteratorStateMachine(typeof(<RunCountdown>d__5))] private IEnumerator RunCountdown(Rigidbody part) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RunCountdown>d__5(0) { <>4__this = this, part = part }; } [IteratorStateMachine(typeof(<DripDrop>d__6))] private IEnumerator DripDrop() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DripDrop>d__6(0) { <>4__this = this }; } } private float timeSinceSplatted = Time.time; public NPC NPC { get; private set; } = null; private void Start() { NPC componentInParent = ((Component)this).GetComponentInParent<NPC>(); if (Object.op_Implicit((Object)(object)componentInParent)) { NPC = componentInParent; } else { Object.Destroy((Object)(object)this); } } public PoolController(IntPtr ptr) : base(ptr) { } public void ImpactRecieved(NPC npc, Impact impact) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (Time.time - timeSinceSplatted > 1f) { timeSinceSplatted = Time.time; GameObject val = new GameObject("SplatSpout"); Transform transform = val.transform; RaycastHit hit = impact.Hit; transform.SetParent(((Component)((RaycastHit)(ref hit)).collider).transform); Transform transform2 = val.transform; hit = impact.Hit; transform2.position = ((RaycastHit)(ref hit)).point; SplatSpout splatSpout = val.AddComponent<SplatSpout>(); hit = impact.Hit; splatSpout.Spout(((RaycastHit)(ref hit)).rigidbody); } } } [RegisterTypeInIl2Cpp] internal class SoundController : MonoBehaviour { public NPC NPC { get; private set; } = null; private void Start() { NPC componentInParent = ((Component)this).GetComponentInParent<NPC>(); if (Object.op_Implicit((Object)(object)componentInParent)) { NPC = componentInParent; } else { Object.Destroy((Object)(object)this); } } public SoundController(IntPtr ptr) : base(ptr) { } public void ImpactRecieved(NPC npc, Impact impact) { } } [RegisterTypeInIl2Cpp] internal class SplatController : MonoBehaviour { [RegisterTypeInIl2Cpp] public class Cleaner : MonoBehaviour { [CompilerGenerated] private sealed class <Dispose>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Cleaner <>4__this; private float <t>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Dispose>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(30f); <>1__state = 1; return true; case 1: <>1__state = -1; <t>5__1 = 1f; break; case 2: <>1__state = -1; <t>5__1 -= 0.025f; break; } if (<t>5__1 >= 0f) { if ((Object)(object)<>4__this.projector != (Object)null) { <>4__this.projector.fadeFactor = Mathf.Lerp(<>4__this.projector.fadeFactor, 0f, 1f - <t>5__1); } <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 2; return true; } Object.Destroy((Object)(object)<>4__this.projector); Object.Destroy((Object)(object)<>4__this); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public DecalProjector? projector; public Cleaner(IntPtr ptr) : base(ptr) { } private void Start() { MelonCoroutines.Start(Dispose()); projector = projector ?? ((Component)this).GetComponent<DecalProjector>(); } [IteratorStateMachine(typeof(<Dispose>d__3))] private IEnumerator Dispose() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Dispose>d__3(0) { <>4__this = this }; } } private DecalProjector? decalProjector; public NPC NPC { get; private set; } = null; private void Start() { NPC componentInParent = ((Component)this).GetComponentInParent<NPC>(); if (Object.op_Implicit((Object)(object)componentInParent)) { NPC = componentInParent; } else { Object.Destroy((Object)(object)this); } } public SplatController(IntPtr ptr) : base(ptr) { } public static DecalProjector Splat(Vector3 position, Vector3 eulerRotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) return Splat(position, Quaternion.Euler(eulerRotation)); } public static DecalProjector Splat(Vector3 position, Quaternion rotation, float scale = 1f, Color? color = null, float opacity = 1f, bool staticOpacity = false) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0115: 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_0176: Unknown result type (might be due to invalid IL or missing references) DecalProjector val = null; GameObject val2 = Assets.Splat.Instantiate(); if (!Logging.NullSanity(val2, "Splat Decal")) { return null; } val2.layer = LayerMask.NameToLayer("Default"); val = val2.GetComponent<DecalProjector>(); Texture texture = val.material.GetTexture("Base_Map"); Texture texture2 = val.material.GetTexture("Normal_Map"); val.material = Object.Instantiate<Material>(ShaderFix.bodySearchDecal) ?? val.material; val.material.SetTexture("_Base_Map", texture); val.material.SetTexture("_Normal_Map", texture2); val.material.color = (Color)(((??)color) ?? new Color(0.5573585f, 0f, 0f)); float num = Random.Range(1f, 3f); val.size = new Vector3(val.size.x * num * scale, val.size.y * num * scale, val.size.z); val.fadeFactor = (staticOpacity ? opacity : ((0.6f + Random.Range(0f, 0.4f)) * opacity)); val.startAngleFade = 0f; ((Behaviour)val).enabled = false; ((Behaviour)val).enabled = true; ((Component)val).transform.position = position; ((Component)val).transform.rotation = rotation; ((Component)val).gameObject.AddComponent<Cleaner>().projector = val; return val; } public void ImpactRecieved(NPC npc, Impact impact) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) RaycastHit hit = impact.Hit; Vector3 point = ((RaycastHit)(ref hit)).point; Vector3 impactForceDirection = impact.ImpactForceDirection; RaycastHit val = default(RaycastHit); if (Physics.Raycast(point, ((Vector3)(ref impactForceDirection)).normalized, ref val, 3f, 1 << LayerMask.NameToLayer("Default"))) { Splat(((RaycastHit)(ref val)).point, Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref val)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref val)).normal)); return; } hit = impact.Hit; Vector3 point2 = ((RaycastHit)(ref hit)).point; Vector3 down = Vector3.down; impactForceDirection = impact.ImpactForceDirection; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(point2, Vector3.Lerp(down, ((Vector3)(ref impactForceDirection)).normalized, 0.25f), ref val2, 3f, 1 << LayerMask.NameToLayer("Default"))) { Splat(((RaycastHit)(ref val2)).point, Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref val2)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref val2)).normal)); } } } [RegisterTypeInIl2Cpp] internal class VisualDamageController : MonoBehaviour { public NPC NPC { get; private set; } = null; private void Start() { NPC componentInParent = ((Component)this).GetComponentInParent<NPC>(); if (Object.op_Implicit((Object)(object)componentInParent)) { NPC = componentInParent; } else { Object.Destroy((Object)(object)this); } } public VisualDamageController(IntPtr ptr) : base(ptr) { } public void ImpactRecieved(NPC npc, Impact impact) { } } } namespace ScheduleGore.Blood.Generics { public class CallbackInfo { public string note = "made this as a gag but i put time into making this so im keeping it. never gunna be used though lmao"; internal bool _cancelled = false; public MethodInfo TargetMethod { get; private set; } public bool IsCancellable { get; private set; } public CallbackInfo(MethodInfo callback, bool isCancellable, bool cancelled = false) { TargetMethod = callback; IsCancellable = isCancellable; _cancelled = cancelled; } public void Cancel() { _cancelled = true; } public void Resume() { _cancelled = false; } public bool Status() { return _cancelled; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }
Mods/ScheduleGore.Mono.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using HarmonyLib; using MelonLoader; using Microsoft.CodeAnalysis; using ScheduleGore; using ScheduleGore.Blood; using ScheduleGore.Blood.Generics; using ScheduleGore.Embedded; using ScheduleGore.Helpers; using ScheduleGore.Utils; using ScheduleOne.Combat; using ScheduleOne.NPCs; using UnityEngine; using UnityEngine.Rendering.Universal; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(ModMain), "ScheduleGore", "1.0.0", "joeswanson.", null)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ScheduleGore.Mono")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ScheduleGore.Mono")] [assembly: AssemblyTitle("ScheduleGore.Mono")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] 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; } } } internal class SplatController : GenericImpactReciever { public class Cleaner : MonoBehaviour { [CompilerGenerated] private sealed class <Dispose>d__2 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Cleaner <>4__this; private float <t>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Dispose>d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(30f); <>1__state = 1; return true; case 1: <>1__state = -1; <t>5__1 = 1f; break; case 2: <>1__state = -1; <t>5__1 -= 0.025f; break; } if (<t>5__1 >= 0f) { if ((Object)(object)<>4__this.projector != (Object)null) { <>4__this.projector.fadeFactor = Mathf.Lerp(<>4__this.projector.fadeFactor, 0f, 1f - <t>5__1); } <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 2; return true; } Object.Destroy((Object)(object)<>4__this.projector); Object.Destroy((Object)(object)<>4__this); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public DecalProjector? projector; private void Start() { MelonCoroutines.Start(Dispose()); projector = projector ?? ((Component)this).GetComponent<DecalProjector>(); } [IteratorStateMachine(typeof(<Dispose>d__2))] private IEnumerator Dispose() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Dispose>d__2(0) { <>4__this = this }; } } private DecalProjector? decalProjector; public static DecalProjector Splat(Vector3 position, Vector3 eulerRotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) return Splat(position, Quaternion.Euler(eulerRotation)); } public static DecalProjector Splat(Vector3 position, Quaternion rotation, float scale = 1f, Color? color = null, float opacity = 1f, bool staticOpacity = false) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0115: 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_0176: Unknown result type (might be due to invalid IL or missing references) DecalProjector val = null; GameObject val2 = Assets.Splat.Instantiate(); if (!Logging.NullSanity(val2, "Splat Decal")) { return null; } val2.layer = LayerMask.NameToLayer("Default"); val = val2.GetComponent<DecalProjector>(); Texture texture = val.material.GetTexture("Base_Map"); Texture texture2 = val.material.GetTexture("Normal_Map"); val.material = Object.Instantiate<Material>(ShaderFix.bodySearchDecal) ?? val.material; val.material.SetTexture("_Base_Map", texture); val.material.SetTexture("_Normal_Map", texture2); val.material.color = (Color)(((??)color) ?? new Color(0.5573585f, 0f, 0f)); float num = Random.Range(1f, 3f); val.size = new Vector3(val.size.x * num * scale, val.size.y * num * scale, val.size.z); val.fadeFactor = (staticOpacity ? opacity : ((0.6f + Random.Range(0f, 0.4f)) * opacity)); val.startAngleFade = 0f; ((Behaviour)val).enabled = false; ((Behaviour)val).enabled = true; ((Component)val).transform.position = position; ((Component)val).transform.rotation = rotation; ((Component)val).gameObject.AddComponent<Cleaner>().projector = val; return val; } public override void ImpactRecieved(NPC npc, Impact impact) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((RaycastHit)(ref impact.Hit)).point, ((Vector3)(ref impact.ImpactForceDirection)).normalized, ref val, 3f, 1 << LayerMask.NameToLayer("Default"))) { Splat(((RaycastHit)(ref val)).point, Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref val)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref val)).normal)); } else if (Physics.Raycast(((RaycastHit)(ref impact.Hit)).point, Vector3.Lerp(Vector3.down, ((Vector3)(ref impact.ImpactForceDirection)).normalized, 0.25f), ref val2, 3f, 1 << LayerMask.NameToLayer("Default"))) { Splat(((RaycastHit)(ref val2)).point, Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref val2)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref val2)).normal)); } } } namespace ScheduleGore { public class ModMain : MelonMod { public override void OnInitializeMelon() { Assets.InitializeBundle(); } } } namespace ScheduleGore.Utils { internal class Logging { public static bool NullSanity([NotNullWhen(true)] object? inQuestion, string nameForObject = "Something (Unspecified)") { if (inQuestion == null) { Melon<ModMain>.Logger.Error(nameForObject + " was null."); } return inQuestion != null; } } } namespace ScheduleGore.Patches { [HarmonyPatch(typeof(NPC))] internal class NPCPatches { [HarmonyPostfix] [HarmonyPatch("ReceiveImpact")] public static void ReceiveImpact(NPC __instance, Impact impact) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 EImpactType impactType = impact.ImpactType; EImpactType val = impactType; if ((int)val != 1) { if ((int)val == 3) { GunshotController.Hit(__instance, impact); } } else { BluntController.Hit(__instance, impact); } } [HarmonyPostfix] [HarmonyPatch("Start")] public static void Start(NPC __instance) { ((Component)__instance).gameObject.AddComponent<VisualDamageController>(); ((Component)__instance).gameObject.AddComponent<SplatController>(); ((Component)__instance).gameObject.AddComponent<SoundController>(); ((Component)__instance).gameObject.AddComponent<PoolController>(); } } } namespace ScheduleGore.Helpers { internal class BluntController { public static void Hit(NPC impacted, Impact impact) { ((Component)impacted).GetComponentInParent<VisualDamageController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<SoundController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<PoolController>()?.ImpactRecieved(impacted, impact); } } internal class GunshotController { public static void Hit(NPC impacted, Impact impact) { ((Component)impacted).GetComponentInParent<VisualDamageController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<SplatController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<SoundController>()?.ImpactRecieved(impacted, impact); ((Component)impacted).GetComponentInParent<PoolController>()?.ImpactRecieved(impacted, impact); } } } namespace ScheduleGore.Embedded { internal class Assets { public class Object<T> where T : Object { public string? name; private T? _obj; public T? Instance { get { if ((Object)(object)_obj == (Object)null) { AssetBundle? bundle = Bundle; _obj = ((bundle != null) ? bundle.LoadAsset<T>(name) : default(T)); } else { object obj = _obj; GameObject val = (GameObject)((obj is GameObject) ? obj : null); if (val != null) { ShaderFix.FixShaders(val); } } return _obj; } set { _obj = value; } } public Object(string name) { this.name = name; } public T? Instantiate() { return Object.op_Implicit((Object)(object)Instance) ? Object.Instantiate<T>(Instance) : default(T); } } public const string GoreBundleName = "schedulegore.fx"; public static Object<GameObject> Splat = new Object<GameObject>("BloodSplat.prefab"); public static AssetBundle? Bundle { get; private set; } public static AssetBundle? InitializeBundle() { Bundle = EAB.LoadFromAssembly(Assembly.GetExecutingAssembly(), "ScheduleGore.Mono.Resources.schedulegore.fx"); if ((Object)(object)Bundle == (Object)null) { Melon<ModMain>.Logger.Error("Failed to load schedulegore.fx. Many things will break"); } else { ShaderFix.FixShaders(Bundle); } return Bundle; } } internal class EAB { public static AssetBundle? LoadFromAssembly(Assembly assembly, string name) { string[] manifestResourceNames = assembly.GetManifestResourceNames(); if (manifestResourceNames.Contains(name)) { byte[] array; using (Stream stream = assembly.GetManifestResourceStream(name)) { using MemoryStream memoryStream = new MemoryStream(); stream?.CopyTo(memoryStream); array = memoryStream.ToArray(); } return AssetBundle.LoadFromMemory(array); } return null; } } public class ShaderFix { public static Material? bodySearchDecal; public static void FixShaders(AssetBundle obj) { Material[] array = obj.LoadAllAssets<Material>(); foreach (Material val in array) { Shader val2 = Shader.Find(((Object)val.shader).name); if ((Object)(object)val2 != (Object)null) { val.shader = val2; } } } public static void FixShaders(GameObject obj) { if ((Object)(object)bodySearchDecal == (Object)null) { bodySearchDecal = Object.FindObjectsOfType<DecalProjector>().Where(delegate(DecalProjector proj) { Material material = proj.material; return material != null && ((Object)material).name.Contains("Police arrest circle mat"); }).First() .material; } DecalProjector[] componentsInChildren = obj.GetComponentsInChildren<DecalProjector>(true); foreach (DecalProjector val in componentsInChildren) { val.material.SetTexture("_Base_Map", val.material.GetTexture("Base_Map")); val.material.SetTexture("_Normal_Map", val.material.GetTexture("Normal_Map")); val.material.shader = Shader.Find("Shader Graphs/Tyler Decal"); } } } } namespace ScheduleGore.Blood { internal class PoolController : GenericImpactReciever { internal class SplatSpout : MonoBehaviour { [CompilerGenerated] private sealed class <DripDrop>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SplatSpout <>4__this; private int <i>5__1; private RaycastHit <hitInfo>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DripDrop>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; goto IL_00fa; } <>1__state = -1; <i>5__1 = 0; goto IL_010b; IL_00fa: <i>5__1++; goto IL_010b; IL_010b: if (<i>5__1 < Random.Range(5, 10)) { if (Physics.Raycast(((Component)<>4__this).transform.position, Vector3.down, ref <hitInfo>5__2, 3f, 1 << LayerMask.NameToLayer("Default"))) { SplatController.Splat(((RaycastHit)(ref <hitInfo>5__2)).point, Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref <hitInfo>5__2)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref <hitInfo>5__2)).normal), 0.1f, null, 0.85f, staticOpacity: true); <>2__current = (object)new WaitForSeconds(Random.Range(1f, 2f)); <>1__state = 1; return true; } goto IL_00fa; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <RunCountdown>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Rigidbody part; public SplatSpout <>4__this; private float <t>5__1; private RaycastHit <hitInfo>5__2; private float <scale>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RunCountdown>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_00e7: 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_0106: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_016e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <t>5__1 = 1f; break; case 1: <>1__state = -1; goto IL_01a3; case 2: { <>1__state = -1; goto IL_01a3; } IL_01a3: <t>5__1 -= 1f / 150f; break; } if (<t>5__1 >= 0f) { if (Physics.Raycast(((Component)<>4__this).transform.position, Vector3.down, ref <hitInfo>5__2, 3f, 1 << LayerMask.NameToLayer("Default")) && Time.time - <>4__this.timeSinceMove <= 2f) { <scale>5__3 = Mathf.Lerp(0.75f, 0.1f, 1f - <t>5__1); if (Random.Range(1, 10) == 10) { <scale>5__3 *= 3f; } Vector3 point = ((RaycastHit)(ref <hitInfo>5__2)).point; Quaternion rotation = Quaternion.AngleAxis(Random.Range(0f, 360f), -((RaycastHit)(ref <hitInfo>5__2)).normal) * Quaternion.LookRotation(-((RaycastHit)(ref <hitInfo>5__2)).normal); float scale = <scale>5__3; float opacity = Mathf.Lerp(0.5f, 0.1f, 1f - <t>5__1); SplatController.Splat(point, rotation, scale, null, opacity); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Rigidbody rb; private float timeSinceMove = Time.time; public void Spout(Rigidbody part) { rb = part; MelonCoroutines.Start(RunCountdown(part)); MelonCoroutines.Start(DripDrop()); } private void Update() { //IL_0015: 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) if ((Object)(object)rb != (Object)null) { Vector3 velocity = rb.velocity; if (((Vector3)(ref velocity)).magnitude >= 0.1f) { timeSinceMove = Time.time; } } } [IteratorStateMachine(typeof(<RunCountdown>d__4))] private IEnumerator RunCountdown(Rigidbody part) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RunCountdown>d__4(0) { <>4__this = this, part = part }; } [IteratorStateMachine(typeof(<DripDrop>d__5))] private IEnumerator DripDrop() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DripDrop>d__5(0) { <>4__this = this }; } } private float timeSinceSplatted = Time.time; public override void ImpactRecieved(NPC npc, Impact impact) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (Time.time - timeSinceSplatted > 1f) { timeSinceSplatted = Time.time; GameObject val = new GameObject("SplatSpout"); val.transform.SetParent(((Component)((RaycastHit)(ref impact.Hit)).collider).transform); val.transform.position = ((RaycastHit)(ref impact.Hit)).point; val.AddComponent<SplatSpout>().Spout(((RaycastHit)(ref impact.Hit)).rigidbody); } } } internal class SoundController : GenericImpactReciever { public override void ImpactRecieved(NPC npc, Impact impact) { } } internal class VisualDamageController : GenericImpactReciever { public override void ImpactRecieved(NPC npc, Impact impact) { } } } namespace ScheduleGore.Blood.Generics { public class CallbackInfo { public string note = "made this as a gag but i put time into making this so im keeping it. never gunna be used though lmao"; internal bool _cancelled = false; public MethodInfo TargetMethod { get; private set; } public bool IsCancellable { get; private set; } public CallbackInfo(MethodInfo callback, bool isCancellable, bool cancelled = false) { TargetMethod = callback; IsCancellable = isCancellable; _cancelled = cancelled; } public void Cancel() { _cancelled = true; } public void Resume() { _cancelled = false; } public bool Status() { return _cancelled; } } internal abstract class GenericImpactReciever : MonoBehaviour { public NPC NPC { get; private set; } = null; private void Start() { NPC componentInParent = ((Component)this).GetComponentInParent<NPC>(); if (Object.op_Implicit((Object)(object)componentInParent)) { NPC = componentInParent; } else { Object.Destroy((Object)(object)this); } } public abstract void ImpactRecieved(NPC npc, Impact impact); } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }