Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of CashDrops IL2CPP v1.3.0
CashDrops-IL2Cpp.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using CashDrops_IL2Cpp; using HarmonyLib; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.Cartel; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Economy; using Il2CppScheduleOne.Employees; using Il2CppScheduleOne.GameTime; using Il2CppScheduleOne.Map; using Il2CppScheduleOne.Money; using Il2CppScheduleOne.NPCs; using Il2CppScheduleOne.NPCs.CharacterClasses; using Il2CppScheduleOne.ObjectScripts.Cash; using Il2CppScheduleOne.Persistence; using Il2CppScheduleOne.Police; using Il2CppScheduleOne.UI; using Il2CppScheduleOne.UI.MainMenu; using MelonLoader; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(global::CashDrops_IL2Cpp.CashDrops_IL2Cpp), "CashDrops-IL2Cpp", "1.3", "XOWithSauce", null)] [assembly: MelonColor] [assembly: MelonOptionalDependencies(new string[] { "FishNet.Runtime" })] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("CashDrops-IL2Cpp")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CashDrops-IL2Cpp")] [assembly: AssemblyTitle("CashDrops-IL2Cpp")] [assembly: AssemblyVersion("1.0.0.0")] namespace CashDrops_IL2Cpp; public static class BuildInfo { public const string Name = "CashDrops-IL2Cpp"; public const string Description = "NPC Cash Drops"; public const string Author = "XOWithSauce"; public const string Company = null; public const string Version = "1.3"; public const string DownloadLink = null; } public class CashDrops_IL2Cpp : MelonMod { [HarmonyPatch(typeof(NPCHealth), "KnockOut")] public static class NPC_KnockOut_Patch { public static bool Prefix(NPCHealth __instance) { if (waitedLoadFlag) { coros.Add(MelonCoroutines.Start(PreNPCKnockOut(__instance))); } return true; } } [HarmonyPatch(typeof(NPCHealth), "Die")] public static class NPC_Die_Patch { public static bool Prefix(NPCHealth __instance) { if (waitedLoadFlag) { coros.Add(MelonCoroutines.Start(PreNPCKnockOut(__instance))); } return true; } } [HarmonyPatch(typeof(LoadManager), "ExitToMenu")] public static class LoadManager_ExitToMenu_Patch { public static bool Prefix(SaveInfo autoLoadSave = null, Data mainMenuPopup = null, bool preventLeaveLobby = false) { lastSaveLoad = false; ExitPreTask(); return true; } } [HarmonyPatch(typeof(DeathScreen), "LoadSaveClicked")] public static class DeathScreen_LoadSaveClicked_Patch { public static bool Prefix(DeathScreen __instance) { lastSaveLoad = true; ExitPreTask(); return true; } } [RegisterTypeInIl2Cpp] public class CashCollisionHandler : MonoBehaviour { public int value; public CashCollisionHandler(IntPtr ptr) : base(ptr) { } public CashCollisionHandler() : base(ClassInjector.DerivedConstructorPointer<CashCollisionHandler>()) { ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } private void OnTriggerEnter(Collider collision) { GameObject gameObject = ((Component)collision).gameObject; int layer = gameObject.layer; if (layer == 6) { float num = value switch { 1 => (!(Random.Range(0f, 1f) > 0.9f)) ? Mathf.Round(Random.Range(1f, 10f)) : Mathf.Round(Random.Range(10f, 30f)), 2 => (!(Random.Range(0f, 1f) > 0.8f)) ? Mathf.Round(Random.Range(10f, 30f)) : Mathf.Round(Random.Range(30f, 50f)), 3 => (!(Random.Range(0f, 1f) > 0.5f)) ? Mathf.Round(Random.Range(30f, 50f)) : Mathf.Round(Random.Range(40f, 90f)), 4 => (!(Random.Range(0f, 1f) > 0.5f)) ? Mathf.Round(Random.Range(60f, 90f)) : Mathf.Round(Random.Range(60f, 150f)), 5 => (!(Random.Range(0f, 1f) > 0.5f)) ? Mathf.Round(Random.Range(100f, 200f)) : Mathf.Round(Random.Range(100f, 450f)), 6 => (!(Random.Range(0f, 1f) > 0.5f)) ? Mathf.Round(Random.Range(250f, 500f)) : Mathf.Round(Random.Range(200f, 650f)), _ => 1f, }; NetworkSingleton<MoneyManager>.Instance.ChangeCashBalance(num, true, true); totalGain += num; Object.Destroy((Object)(object)((Component)((Component)this).transform.parent).gameObject); } } } [RegisterTypeInIl2Cpp] public class CashPickup : MonoBehaviour { public CashPickup(IntPtr ptr) : base(ptr) { } public CashPickup() : base(ClassInjector.DerivedConstructorPointer<CashPickup>()) { ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this); } public void SetupPickup(int value) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("CashPickupTrigger"); val.transform.SetParent(((Component)this).transform); val.transform.localPosition = Vector3.zero; BoxCollider val2 = val.AddComponent<BoxCollider>(); val2.size = new Vector3(0.5f, 0.5f, 0.5f); ((Collider)val2).isTrigger = true; CashCollisionHandler cashCollisionHandler = val.AddComponent<CashCollisionHandler>(); cashCollisionHandler.value = value; } } [CompilerGenerated] private sealed class <CashDespawnHandler>d__21 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject go; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CashDespawnHandler>d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(240f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!registered) { return false; } if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; 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 <CashPickupDelay>d__22 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject go; public int value; private CashPickup <pickupComp>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CashPickupDelay>d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <pickupComp>5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!registered) { return false; } <pickupComp>5__1 = go.GetComponent<CashPickup>(); if ((Object)(object)<pickupComp>5__1 != (Object)null) { <pickupComp>5__1.SetupPickup(value); } 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 <CashSpawnRoutine>d__23 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 pos; public GameObject baseObj; public int lowerAmnt; public int upperAmnt; public int value; private GameObject <bunchBase>5__1; private int <i>5__2; private GameObject <go>5__3; private Rigidbody <rb>5__4; private Vector3 <force>5__5; private float <torqueX>5__6; private float <torqueZ>5__7; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CashSpawnRoutine>d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <bunchBase>5__1 = null; <go>5__3 = null; <rb>5__4 = null; <>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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <bunchBase>5__1 = new GameObject("CashBunchBase"); <i>5__2 = 0; break; case 1: <>1__state = -1; if (!registered) { return false; } <go>5__3 = Object.Instantiate<GameObject>(baseObj, pos, Quaternion.identity, <bunchBase>5__1.transform); if (!<go>5__3.activeInHierarchy) { <go>5__3.SetActive(true); } <rb>5__4 = <go>5__3.GetComponent<Rigidbody>(); if ((Object)(object)<rb>5__4 != (Object)null) { <force>5__5 = Vector3.up * 6f; <rb>5__4.AddForce(<force>5__5, (ForceMode)1); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } goto IL_01d1; case 2: { <>1__state = -1; if (Random.Range(0, 100) >= 50) { <force>5__5 = Vector3.right; } else { <force>5__5 = Vector3.left; } <rb>5__4.AddForce(<force>5__5, (ForceMode)1); <torqueX>5__6 = Random.Range(-5f, 5f); <torqueZ>5__7 = Random.Range(-5f, 5f); <rb>5__4.AddTorque(new Vector3(<torqueX>5__6, 0f, <torqueZ>5__7), (ForceMode)1); MelonCoroutines.Start(CashPickupDelay(<go>5__3, value)); goto IL_01d1; } IL_01d1: <go>5__3 = null; <rb>5__4 = null; <i>5__2++; break; } if (<i>5__2 < Random.Range(lowerAmnt, upperAmnt)) { <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } MelonCoroutines.Start(CashDespawnHandler(<bunchBase>5__1)); 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 <DropsCooldown>d__19 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NPCHealth __instance; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DropsCooldown>d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; onCooldown.Add(__instance); <>2__current = (object)new WaitForSeconds(60f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!registered) { return false; } if (onCooldown.Contains(__instance)) { onCooldown.Remove(__instance); } 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 <OnLoadTimer>d__18 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OnLoadTimer>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(10f); <>1__state = 1; return true; case 1: <>1__state = -1; if (registered) { waitedLoadFlag = 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(); } } [CompilerGenerated] private sealed class <PreNPCKnockOut>d__20 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NPCHealth __instance; private NPC <npc>5__1; private int <npcStatus>5__2; private int <npcType>5__3; private int <bonusValue>5__4; private EDay <currentDay>5__5; private int <currentTime>5__6; private EMapRegion <>s__7; private Vector3 <topNpc>5__8; private int <leastMaxRoll>5__9; private int <roll>5__10; private int <>s__11; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PreNPCKnockOut>d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <npc>5__1 = null; <>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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00aa: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected I4, but got Unknown //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Invalid comparison between Unknown and I4 //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Invalid comparison between Unknown and I4 //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Invalid comparison between Unknown and I4 //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: { <>1__state = -1; if (!registered) { return false; } if (onCooldown.Contains(__instance)) { return false; } DropsCooldown(__instance); <npc>5__1 = ((Component)__instance).GetComponent<NPC>(); <npcStatus>5__2 = 0; EMapRegion region = <npc>5__1.Region; <>s__7 = region; EMapRegion val = <>s__7; switch ((int)val) { case 0: <npcStatus>5__2 = 0; break; case 1: <npcStatus>5__2 = 1; break; case 2: <npcStatus>5__2 = 2; break; case 3: <npcStatus>5__2 = 3; break; case 4: <npcStatus>5__2 = 4; break; case 5: <npcStatus>5__2 = 5; break; } <npcType>5__3 = 1; if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Employee>())) { <npcType>5__3 = 0; } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<CartelGoon>())) { if (Random.Range(0f, 1f) < 0.05f) { <npcStatus>5__2 = 4; <npcType>5__3 = 4; } else { <npcType>5__3 = 2; } } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<PoliceOfficer>())) { if (Random.Range(0f, 1f) < 0.5f) { <npcType>5__3 = 1; } else { <npcType>5__3 = 2; } } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Dealer>())) { <npcType>5__3 = 3; } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Herbert>())) { if (Random.Range(0f, 1f) < 0.05f) { <npcType>5__3 = 5; } else { <npcType>5__3 = 3; } } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Jeremy>())) { <npcType>5__3 = 3; } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Mick>())) { <npcStatus>5__2 = 3; if (Random.Range(0f, 1f) < 0.1f) { <npcType>5__3 = 5; <npcStatus>5__2 = 4; } else { <npcType>5__3 = 3; } } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Tobias>())) { <npcType>5__3 = 4; } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Stan>())) { <npcStatus>5__2 = 2; if (Random.Range(0f, 1f) < 0.2f) { <npcStatus>5__2 = 3; } else { <npcType>5__3 = 4; } } if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)<npc>5__1).TryCast<Fixer>())) { <npcStatus>5__2 = 2; if (Random.Range(0f, 1f) < 0.2f) { <npcStatus>5__2 = 4; } else { <npcType>5__3 = 5; } } <bonusValue>5__4 = 0; <currentDay>5__5 = NetworkSingleton<TimeManager>.Instance.CurrentDay; <currentTime>5__6 = NetworkSingleton<TimeManager>.Instance.CurrentTime; if ((int)<currentDay>5__5 == 5 || (int)<currentDay>5__5 == 4) { <bonusValue>5__4++; if (<currentTime>5__6 > 2000 && <currentTime>5__6 < 2300) { <bonusValue>5__4++; } } else if ((int)<currentDay>5__5 == 6) { if (<currentTime>5__6 > 1100 && <currentTime>5__6 < 1300) { <bonusValue>5__4++; } } else if (<currentTime>5__6 > 1300 && <currentTime>5__6 < 1900) { <bonusValue>5__4++; } else { <bonusValue>5__4 = 0; } if ((Object)(object)<npc>5__1 != (Object)null && <npcType>5__3 != 0) { <topNpc>5__8 = new Vector3(((Component)__instance).transform.position.x, ((Component)__instance).transform.position.y + 1f, ((Component)__instance).transform.position.z); <leastMaxRoll>5__9 = 3 + <npcStatus>5__2; <roll>5__10 = Random.Range(<npcStatus>5__2, <leastMaxRoll>5__9); int num = <roll>5__10; <>s__11 = num; switch (<>s__11) { case 0: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Note, 1 + <npcType>5__3, 2 + <npcType>5__3, 1 + <bonusValue>5__4)); break; case 1: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Note, 2 + <npcType>5__3, 4 + <npcType>5__3, 1 + <bonusValue>5__4)); break; case 2: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Note, 4 + <npcType>5__3, 8 + <npcType>5__3, 1 + <bonusValue>5__4)); break; case 3: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Note, 6 + <npcType>5__3, 10 + <npcType>5__3, 1 + <bonusValue>5__4)); break; case 4: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Bill, 1 + <npcType>5__3, 3 + <npcType>5__3, 2 + <bonusValue>5__4)); break; case 5: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Bill, 3 + <npcType>5__3, 6 + <npcType>5__3, 2 + <bonusValue>5__4)); break; case 6: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Visuals_Under100, 1, 3 + <npcType>5__3, 3 + <bonusValue>5__4)); break; case 7: MelonCoroutines.Start(CashSpawnRoutine(<topNpc>5__8, Visuals_Over100, 1, 3 + <npcType>5__3, 4 + <bonusValue>5__4)); break; } } <>2__current = null; <>1__state = 2; return true; } case 2: <>1__state = -1; 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 <Setup>d__27 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CashDrops_IL2Cpp <>4__this; private CashStackVisuals[] <csv>5__1; private CashStackVisuals[] <>s__2; private int <>s__3; private CashStackVisuals <inst>5__4; private GameObject <go>5__5; private GameObject <go2>5__6; private GameObject <go3>5__7; private GameObject <go4>5__8; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Setup>d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <csv>5__1 = null; <>s__2 = null; <inst>5__4 = null; <go>5__5 = null; <go2>5__6 = null; <go3>5__7 = null; <go4>5__8 = null; <>1__state = -2; } private bool MoveNext() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_011a: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (<>4__this.IsAssignedObjects()) { return false; } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; <csv>5__1 = Il2CppArrayBase<CashStackVisuals>.op_Implicit(Object.FindObjectsOfType<CashStackVisuals>(true)); if (<csv>5__1.Length != 0) { <>s__2 = <csv>5__1; <>s__3 = 0; goto IL_02ff; } goto IL_031a; case 2: <>1__state = -1; if ((Object)(object)Visuals_Over100 == (Object)null) { GameObject visuals_Over = <inst>5__4.Visuals_Over100; <go>5__5 = ((visuals_Over != null) ? ((Il2CppObjectBase)visuals_Over).Cast<GameObject>() : null); if (<go>5__5 != null) { Visuals_Over100 = Object.Instantiate<GameObject>(<go>5__5, Vector3.zero, Quaternion.identity, (Transform)null); Visuals_Over100.SetActive(false); <>4__this.PrepareObject(Visuals_Over100); } } if ((Object)(object)Visuals_Under100 == (Object)null) { GameObject visuals_Under = <inst>5__4.Visuals_Under100; <go2>5__6 = ((visuals_Under != null) ? ((Il2CppObjectBase)visuals_Under).Cast<GameObject>() : null); if (<go2>5__6 != null) { Visuals_Under100 = Object.Instantiate<GameObject>(<go2>5__6, Vector3.zero, Quaternion.identity, (Transform)null); Visuals_Under100.SetActive(false); <>4__this.PrepareObject(Visuals_Under100); } } if ((Object)(object)Bill == (Object)null) { GameObject? obj = ((IEnumerable<GameObject>)<inst>5__4.Bills).FirstOrDefault(); <go3>5__7 = ((obj != null) ? ((Il2CppObjectBase)obj).Cast<GameObject>() : null); if (<go3>5__7 != null) { Bill = Object.Instantiate<GameObject>(<go3>5__7, Vector3.zero, Quaternion.identity, (Transform)null); Bill.SetActive(false); <>4__this.PrepareObject(Bill); } } if ((Object)(object)Note == (Object)null) { GameObject? obj2 = ((IEnumerable<GameObject>)<inst>5__4.Notes).FirstOrDefault(); <go4>5__8 = ((obj2 != null) ? ((Il2CppObjectBase)obj2).Cast<GameObject>() : null); if (<go4>5__8 != null) { Note = Object.Instantiate<GameObject>(<go4>5__8, Vector3.zero, Quaternion.identity, (Transform)null); Note.SetActive(false); <>4__this.PrepareObject(Note); } } if (<>4__this.IsAssignedObjects()) { return false; } <go>5__5 = null; <go2>5__6 = null; <go3>5__7 = null; <go4>5__8 = null; <inst>5__4 = null; <>s__3++; goto IL_02ff; case 3: { <>1__state = -1; return false; } IL_031a: <>2__current = null; <>1__state = 3; return true; IL_02ff: if (<>s__3 < <>s__2.Length) { <inst>5__4 = <>s__2[<>s__3]; <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 2; return true; } <>s__2 = null; goto IL_031a; } } 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 static List<object> coros = new List<object>(); public static GameObject Visuals_Over100 = null; public static GameObject Visuals_Under100 = null; public static GameObject Bill = null; public static GameObject Note = null; private static HashSet<NPCHealth> onCooldown = new HashSet<NPCHealth>(); private static bool registered = false; private static bool firstTimeLoad = false; private static bool lastSaveLoad = false; private static float totalGain = 0f; private static bool waitedLoadFlag = false; private void OnLoadCompleteCb() { if (!registered) { coros.Add(MelonCoroutines.Start(Setup())); coros.Add(MelonCoroutines.Start(OnLoadTimer())); registered = true; } } public override void OnSceneWasInitialized(int buildIndex, string sceneName) { if (buildIndex == 1 && (Object)(object)Singleton<LoadManager>.Instance != (Object)null && !registered && !lastSaveLoad && !firstTimeLoad) { firstTimeLoad = true; Singleton<LoadManager>.Instance.onLoadComplete.AddListener(UnityAction.op_Implicit((Action)OnLoadCompleteCb)); } } private static void ExitPreTask() { registered = false; waitedLoadFlag = false; foreach (object coro in coros) { if (coro != null) { MelonCoroutines.Stop(coro); } } onCooldown.Clear(); coros.Clear(); } [IteratorStateMachine(typeof(<OnLoadTimer>d__18))] private static IEnumerator OnLoadTimer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OnLoadTimer>d__18(0); } [IteratorStateMachine(typeof(<DropsCooldown>d__19))] private static IEnumerator DropsCooldown(NPCHealth __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DropsCooldown>d__19(0) { __instance = __instance }; } [IteratorStateMachine(typeof(<PreNPCKnockOut>d__20))] private static IEnumerator PreNPCKnockOut(NPCHealth __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PreNPCKnockOut>d__20(0) { __instance = __instance }; } [IteratorStateMachine(typeof(<CashDespawnHandler>d__21))] private static IEnumerator CashDespawnHandler(GameObject go) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CashDespawnHandler>d__21(0) { go = go }; } [IteratorStateMachine(typeof(<CashPickupDelay>d__22))] private static IEnumerator CashPickupDelay(GameObject go, int value) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CashPickupDelay>d__22(0) { go = go, value = value }; } [IteratorStateMachine(typeof(<CashSpawnRoutine>d__23))] private static IEnumerator CashSpawnRoutine(Vector3 pos, GameObject baseObj, int lowerAmnt, int upperAmnt, int value) { //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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CashSpawnRoutine>d__23(0) { pos = pos, baseObj = baseObj, lowerAmnt = lowerAmnt, upperAmnt = upperAmnt, value = value }; } private bool IsAssignedObjects() { return (Object)(object)Note != (Object)null && (Object)(object)Bill != (Object)null && (Object)(object)Visuals_Under100 != (Object)null && (Object)(object)Visuals_Over100 != (Object)null; } [IteratorStateMachine(typeof(<Setup>d__27))] private IEnumerator Setup() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Setup>d__27(0) { <>4__this = this }; } private void PrepareObject(GameObject go) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) CashPickup cashPickup = go.AddComponent<CashPickup>(); BoxCollider val = default(BoxCollider); if (!go.TryGetComponent<BoxCollider>(ref val)) { val = go.AddComponent<BoxCollider>(); val.size = new Vector3(0.2f, 0.2f, 0.2f); } Rigidbody val2 = default(Rigidbody); if (!go.TryGetComponent<Rigidbody>(ref val2)) { val2 = go.AddComponent<Rigidbody>(); val2.useGravity = true; val2.excludeLayers = LayerMask.op_Implicit(6); } } }