using 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 Il2CppFishNet.Connection; using Il2CppFishNet.Object; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.AvatarFramework.Equipping; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Employees; using Il2CppScheduleOne.GameTime; using Il2CppScheduleOne.NPCs; using Il2CppScheduleOne.NPCs.Behaviour; using Il2CppScheduleOne.Persistence; using Il2CppScheduleOne.PlayerScripts; using Il2CppScheduleOne.Police; using MelonLoader; using TheIncident; 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::TheIncident.TheIncident), "TheIncident", "1.1", "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("TheIncident-IL2Cpp")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TheIncident-IL2Cpp")] [assembly: AssemblyTitle("TheIncident-IL2Cpp")] [assembly: AssemblyVersion("1.0.0.0")] namespace TheIncident; public static class BuildInfo { public const string Name = "TheIncident"; public const string Description = "A deadly disease hits the Hyland Point"; public const string Author = "XOWithSauce"; public const string Company = null; public const string Version = "1.1"; public const string DownloadLink = null; } public class TheIncident : MelonMod { [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TheIncident <>4__this; private int 5__1; private EDay 5__2; private int 5__3; private Player[] 5__4; private PoliceOfficer[] 5__5; private List 5__6; private PoliceOfficer[] <>s__7; private int <>s__8; private PoliceOfficer 5__9; private Player 5__10; private List.Enumerator <>s__11; private NPC 5__12; private float 5__13; private List.Enumerator <>s__14; private NPC 5__15; private Vector3 5__16; private Vector3 5__17; private int 5__18; private int 5__19; private List.Enumerator <>s__20; private NPC 5__21; private float 5__22; private float 5__23; private Vector3 5__24; private Vector3 5__25; private List.Enumerator <>s__26; private NPC 5__27; private PoliceOfficer[] <>s__28; private int <>s__29; private PoliceOfficer 5__30; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 4: try { } finally { <>m__Finally1(); } break; case -4: case 5: try { } finally { <>m__Finally2(); } break; case -5: case 6: try { } finally { <>m__Finally3(); } break; case -6: case 7: try { } finally { <>m__Finally4(); } break; } 5__4 = null; 5__5 = null; 5__6 = null; <>s__7 = null; 5__9 = null; 5__10 = null; <>s__11 = default(List.Enumerator); 5__12 = null; <>s__14 = default(List.Enumerator); 5__15 = null; <>s__20 = default(List.Enumerator); 5__21 = null; <>s__26 = default(List.Enumerator); 5__27 = null; <>s__28 = null; 5__30 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_08a3: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_097f: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Unknown result type (might be due to invalid IL or missing references) //IL_0995: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09ac: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) bool result; try { switch (<>1__state) { default: result = false; goto end_IL_0000; case 0: <>1__state = -1; 5__1 = 1730; goto IL_0079; case 1: <>1__state = -1; if (!<>4__this.registered) { result = false; } else { 5__2 = NetworkSingleton.Instance.CurrentDay; 5__3 = NetworkSingleton.Instance.CurrentTime; if (!((object)(EDay)(ref 5__2)).ToString().Contains("Sunday") || 5__1 > 5__3) { goto IL_0079; } <>4__this.coros.Add(MelonCoroutines.Start(<>4__this.LightsRed())); 5__4 = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); 5__5 = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); <>2__current = Wait01; <>1__state = 2; result = true; } goto end_IL_0000; case 2: <>1__state = -1; if (<>4__this.registered) { <>s__7 = 5__5; for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++) { 5__9 = <>s__7[<>s__8]; if ((Object)(object)<>4__this.gunPref == (Object)null && (Object)(object)5__9.GunPrefab != (Object)null) { <>4__this.gunPref = 5__9.GunPrefab; } if ((Object)(object)<>4__this.taser == (Object)null && (Object)(object)5__9.TaserPrefab != (Object)null) { <>4__this.taser = 5__9.TaserPrefab; } 5__9.GunPrefab = null; 5__9.TaserPrefab = null; ((NPC)5__9).Health.MaxHealth = 300f; ((NPC)5__9).Health.Health = 300f; ((NPC)5__9).Health.Revive(); 5__9.PursuitBehaviour.arrestingEnabled = false; ((NPC)5__9).Awareness.VisionCone.VisionEnabled = false; 5__9 = null; } <>s__7 = null; 5__6 = new List(); goto IL_0aba; } result = false; goto end_IL_0000; case 3: <>1__state = -1; if (<>4__this.registered) { 5__2 = NetworkSingleton.Instance.CurrentDay; 5__3 = NetworkSingleton.Instance.CurrentTime; 5__10 = 5__4[Random.Range(0, 5__4.Length)]; if ((Object)(object)5__10.CurrentProperty != (Object)null) { goto IL_0aba; } <>s__11 = <>4__this.npcs.GetEnumerator(); <>1__state = -3; goto IL_04e9; } result = false; goto end_IL_0000; case 4: <>1__state = -3; if (<>4__this.registered) { 5__13 = Vector3.Distance(((Component)5__12).transform.position, ((Component)5__10).transform.position); if (5__13 < 50f) { 5__6.Add(5__12); 5__12.Avatar.Effects.SetZombified(true, true); } if (5__12.Health.IsDead) { 5__12.Health.Revive(); } if (5__12.Health.IsKnockedOut) { ((Behaviour)5__12.Behaviour.UnconsciousBehaviour).Disable_Networked((NetworkConnection)null); } if (5__6.Count >= 16) { goto IL_04f9; } 5__12 = null; goto IL_04e9; } result = false; <>m__Finally1(); goto end_IL_0000; case 5: <>1__state = -4; if (<>4__this.registered) { 5__15.Movement.RunSpeed = Random.Range(6f, 13f); if ((Object)(object)5__15.Behaviour.CombatBehaviour.currentWeapon != (Object)null) { 5__15.Behaviour.CombatBehaviour.currentWeapon = null; } 5__15.Behaviour.CombatBehaviour.VirtualPunchWeapon.Damage = Random.Range(0.08f, 0.15f); 5__15.Avatar.Effects.SetZombified(true, true); 5__15.Avatar.Effects.GurgleSound.Play(); 5__15.Movement.Disoriented = true; if (5__15.isInBuilding) { 5__15.ExitBuilding(""); 5__15.Movement.GetClosestReachablePoint(((Component)5__10).transform.position, ref 5__16); 5__15.Movement.SetDestination(5__16); } if (5__15.IsInVehicle) { 5__15.ExitVehicle(); 5__15.Movement.GetClosestReachablePoint(((Component)5__10).transform.position, ref 5__17); 5__15.Movement.SetDestination(5__17); } if (5__15.Behaviour.CombatBehaviour.Target == null) { 5__15.Behaviour.CombatBehaviour.SetTarget(((NetworkBehaviour)5__10).NetworkObject); } if (!((Behaviour)5__15.Behaviour.CombatBehaviour).isActiveAndEnabled) { ((Behaviour)5__15.Behaviour.CombatBehaviour).Enable_Networked((NetworkConnection)null); } 5__15 = null; goto IL_07a1; } result = false; <>m__Finally2(); goto end_IL_0000; case 6: <>1__state = -5; if (<>4__this.registered) { if (Vector3.Distance(((Component)5__21).transform.position, ((Component)5__10).transform.position) < 100f) { 5__19++; 5__22 = Random.Range(15f, 30f); 5__23 = Random.Range(15f, 30f); 5__22 *= ((Random.Range(0f, 1f) > 0.5f) ? 1f : (-1f)); 5__23 *= ((Random.Range(0f, 1f) > 0.5f) ? 1f : (-1f)); 5__24 = ((Component)5__10).transform.position + new Vector3(5__22, 0f, 5__23); 5__21.Movement.GetClosestReachablePoint(5__24, ref 5__25); if (5__25 == Vector3.zero) { goto IL_0a73; } 5__21.Movement.Warp(5__25); if (5__21.Health.IsDead || 5__21.Health.IsKnockedOut) { 5__21.Health.Revive(); } if (5__21.Behaviour.CombatBehaviour.Target == null) { 5__21.Behaviour.CombatBehaviour.SetTarget(((NetworkBehaviour)5__10).NetworkObject); } ((Behaviour)5__21.Behaviour.CombatBehaviour).Enable_Networked((NetworkConnection)null); } 5__21 = null; goto IL_0a73; } result = false; <>m__Finally3(); goto end_IL_0000; case 7: <>1__state = -6; if (<>4__this.registered) { 5__27.ResetAggression(); 5__27.Movement.RunSpeed = 7f; 5__27.Behaviour.CombatBehaviour.VirtualPunchWeapon.Damage = 0.25f; ((Behaviour)5__27.Behaviour.CombatBehaviour).SendEnd(); ((Behaviour)5__27.Behaviour.CombatBehaviour).Disable_Networked((NetworkConnection)null); 5__27.Movement.Disoriented = false; if (5__27.Health.IsDead || 5__27.Health.IsKnockedOut) { 5__27.Health.Revive(); } 5__27 = null; goto IL_0c35; } result = false; <>m__Finally4(); goto end_IL_0000; case 8: { <>1__state = -1; if (<>4__this.registered) { 5__30.GunPrefab = <>4__this.gunPref; 5__30.TaserPrefab = <>4__this.taser; if ((Object)(object)<>4__this.gunPref != (Object)null && (Object)(object)5__30.GunPrefab == (Object)null) { 5__30.GunPrefab = <>4__this.gunPref; } ((NPC)5__30).ResetAggression(); if ((Object)(object)<>4__this.taser != (Object)null && (Object)(object)5__30.TaserPrefab == (Object)null) { 5__30.TaserPrefab = <>4__this.taser; } ((NPC)5__30).Awareness.VisionCone.VisionEnabled = true; 5__30.PursuitBehaviour.arrestingEnabled = false; 5__30 = null; <>s__29++; break; } result = false; goto end_IL_0000; } IL_0c35: if (!<>s__26.MoveNext()) { <>m__Finally4(); <>s__26 = default(List.Enumerator); <>s__28 = 5__5; <>s__29 = 0; break; } 5__27 = <>s__26.Current; <>2__current = eval; <>1__state = 7; result = true; goto end_IL_0000; IL_0a73: if (!<>s__20.MoveNext()) { goto IL_0a83; } 5__21 = <>s__20.Current; if (5__19 > 3) { goto IL_0a83; } <>2__current = eval; <>1__state = 6; result = true; goto end_IL_0000; IL_0aba: if (!((object)(EDay)(ref 5__2)).ToString().Contains("Sunday") && !((object)(EDay)(ref 5__2)).ToString().Contains("Monday")) { <>s__26 = <>4__this.npcs.GetEnumerator(); <>1__state = -6; goto IL_0c35; } <>2__current = evalLong; <>1__state = 3; result = true; goto end_IL_0000; IL_0a83: <>m__Finally3(); <>s__20 = default(List.Enumerator); goto IL_0aa6; IL_0aa6: 5__6.Clear(); 5__10 = null; goto IL_0aba; IL_04e9: if (!<>s__11.MoveNext()) { goto IL_04f9; } 5__12 = <>s__11.Current; <>2__current = eval; <>1__state = 4; result = true; goto end_IL_0000; IL_07a1: if (!<>s__14.MoveNext()) { <>m__Finally2(); <>s__14 = default(List.Enumerator); goto IL_0aa6; } 5__15 = <>s__14.Current; <>2__current = eval; <>1__state = 5; result = true; goto end_IL_0000; IL_04f9: <>m__Finally1(); <>s__11 = default(List.Enumerator); if (5__6.Count > 0) { <>s__14 = 5__6.GetEnumerator(); <>1__state = -4; goto IL_07a1; } 5__18 = Random.Range(1, 100); 5__19 = 0; if (5__18 > 95) { <>s__20 = <>4__this.npcs.GetEnumerator(); <>1__state = -5; goto IL_0a73; } goto IL_0aa6; IL_0079: <>2__current = Wait30; <>1__state = 1; result = true; goto end_IL_0000; } if (<>s__29 < <>s__28.Length) { 5__30 = <>s__28[<>s__29]; <>2__current = eval; <>1__state = 8; result = true; } else { <>s__28 = null; <>4__this.coros.Add(MelonCoroutines.Start(<>4__this.LightsClear())); result = false; } end_IL_0000:; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__11).Dispose(); } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>s__14).Dispose(); } private void <>m__Finally3() { <>1__state = -1; ((IDisposable)<>s__20).Dispose(); } private void <>m__Finally4() { <>1__state = -1; ((IDisposable)<>s__26).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TheIncident <>4__this; private int 5__1; private Light 5__2; private Exception 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0; break; case 1: <>1__state = -1; if (!<>4__this.registered) { return false; } try { 5__2 = <>4__this.lightsColors.ElementAt(5__1).Key; if ((Object)(object)5__2 != (Object)null) { 5__2.color = <>4__this.lightsColors.ElementAt(5__1).Value; } 5__2 = null; } catch (Exception ex) { 5__3 = ex; } 5__1++; break; } if (5__1 < <>4__this.lightsColors.Count) { <>2__current = Wait01; <>1__state = 1; 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(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TheIncident <>4__this; private int 5__1; private Light 5__2; private Exception 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!<>4__this.registered) { return false; } try { 5__2 = <>4__this.lightsColors.ElementAt(5__1).Key; if ((Object)(object)5__2 != (Object)null) { 5__2.color = Color.red; } 5__2 = null; } catch (Exception ex) { 5__3 = ex; } 5__1++; } else { <>1__state = -1; if (<>4__this.lightsColors.Count <= 0) { goto IL_010d; } 5__1 = 0; } if (5__1 < <>4__this.lightsColors.Count) { <>2__current = Wait01; <>1__state = 1; return true; } goto IL_010d; IL_010d: 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 List npcs = new List(); private List coros = new List(); private AvatarEquippable taser; private AvatarEquippable gunPref; private Dictionary lightsColors = new Dictionary(); public static float sleepTime = 0.05f; private bool registered = false; private bool firstTimeLoad = true; public static WaitForSeconds Wait01 = new WaitForSeconds(0.1f); public static WaitForSeconds Wait30 = new WaitForSeconds(30f); public static WaitForSeconds evalLong = new WaitForSeconds(sleepTime * 10f); public static WaitForSeconds eval = new WaitForSeconds(sleepTime); public override void OnInitializeMelon() { MelonLogger.Msg(ConsoleColor.Red, "An Unknown Incident looms over the Hyland Point..."); } public override void OnSceneWasInitialized(int buildIndex, string sceneName) { if (buildIndex == 1) { if ((Object)(object)Singleton.Instance != (Object)null && !registered && firstTimeLoad) { Singleton.Instance.onLoadComplete.AddListener(UnityAction.op_Implicit((Action)OnLoadCompleteCb)); registered = true; firstTimeLoad = false; } return; } registered = false; foreach (object coro in coros) { MelonCoroutines.Stop(coro); } coros.Clear(); lightsColors.Clear(); npcs.Clear(); taser = null; gunPref = null; } private void OnLoadCompleteCb() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) npcs = ((IEnumerable)Object.FindObjectsOfType(true)).ToList(); Light[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType(true)); for (int i = 0; i < array.Length; i++) { lightsColors.Add(array[i], array[i].color); } List list = new List(); Employee val = null; for (int j = 0; j < npcs.Count; j++) { val = ((Il2CppObjectBase)npcs[j]).TryCast(); if ((Object)(object)val != (Object)null) { val = null; } else { list.Add(npcs[j]); } } npcs = list; coros.Add(MelonCoroutines.Start(IncidentBegin())); } [IteratorStateMachine(typeof(d__15))] private IEnumerator LightsRed() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__16))] private IEnumerator LightsClear() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__17))] private IEnumerator IncidentBegin() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this }; } }