Decompiled source of ChaosMod v1.2.3
ChaosMod.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; 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 BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Photon.Pun; using Photon.Realtime; using REPOLib.Modules; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Lego0_77")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+a54106fab1741385dac87862bd23fd9f8e0bf6d3")] [assembly: AssemblyProduct("ChaosMod")] [assembly: AssemblyTitle("ChaosMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] 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; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ChaosMod { public class AdManager : MonoBehaviour { [CompilerGenerated] private sealed class <InAnimation>d__15 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AdManager <>4__this; private float <time>5__2; private Func<float, float> <ease>5__3; private float <startX>5__4; private float <endX>5__5; private float <ogY>5__6; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <InAnimation>d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <ease>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; AdManager adManager = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <time>5__2 = 0f; <ease>5__3 = delegate(float x) { float num3 = 1.70158f; float num4 = num3 + 1f; return 1f + num4 * Mathf.Pow(x - 1f, 3f) + num3 * Mathf.Pow(x - 1f, 2f); }; <startX>5__4 = 1230f; <endX>5__5 = 690f; <ogY>5__6 = ((Component)adManager).transform.localPosition.y; break; case 1: <>1__state = -1; break; } if (<time>5__2 < 1f) { float num2 = <ease>5__3(<time>5__2); ((Component)adManager).transform.localPosition = new Vector3(<startX>5__4 + num2 * (<endX>5__5 - <startX>5__4), <ogY>5__6, 0f); <time>5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Component)adManager).transform.localPosition = new Vector3(<endX>5__5, <ogY>5__6, 0f); adManager.playerImage.SetActive(true); adManager.video.Play(); ((Component)adManager.SkipButton).gameObject.SetActive(true); adManager.spawned = true; adManager.skipTimer = 6f; ((TMP_Text)adManager.SkipText).text = "Video Ends\nafter 5 seconds"; adManager.skipPressed = false; 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 <OutAnimation>d__16 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AdManager <>4__this; private float <time>5__2; private Func<float, float> <ease>5__3; private float <startX>5__4; private float <endX>5__5; private float <ogY>5__6; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OutAnimation>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <ease>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; AdManager adManager = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <time>5__2 = 0f; <ease>5__3 = (float x) => (x != 0f) ? Mathf.Pow(2f, 10f * x - 10f) : 0f; <startX>5__4 = 690f; <endX>5__5 = 1230f; <ogY>5__6 = ((Component)adManager).transform.localPosition.y; adManager.video.Stop(); adManager.playerImage.SetActive(false); break; case 1: <>1__state = -1; break; } if (<time>5__2 < 1f) { float num2 = <ease>5__3(<time>5__2); ((Component)adManager).transform.localPosition = new Vector3(Mathf.Lerp(<startX>5__4, <endX>5__5, num2), <ogY>5__6, 0f); <time>5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Component)adManager).transform.localPosition = new Vector3(<endX>5__5, <ogY>5__6, 0f); ((Component)adManager.SkipButton).gameObject.SetActive(false); adManager.spawned = false; 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 TextMeshProUGUI ADText; private Button SkipButton; private TextMeshProUGUI SkipText; private VideoPlayer video; private GameObject playerImage; public List<VideoClip> clips; private bool spawned; private float skipTimer = 6f; private bool skipPressed; private void SetupComponents() { if ((Object)(object)video == (Object)null) { video = ((Component)this).GetComponent<VideoPlayer>(); } Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(); Transform[] array = componentsInChildren; foreach (Transform val in array) { switch (((Object)val).name) { case "Skip Button": SkipButton = ((Component)val).GetComponent<Button>(); break; case "Skip Text": SkipText = ((Component)val).GetComponent<TextMeshProUGUI>(); break; case "Tab Text": ADText = ((Component)val).GetComponent<TextMeshProUGUI>(); break; case "Video": playerImage = ((Component)val).gameObject; break; } } } private void Start() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown SetupComponents(); ((TMP_Text)ADText).text = "AD"; ((UnityEvent)SkipButton.onClick).AddListener((UnityAction)delegate { if (skipTimer <= 0f) { skipPressed = true; } }); playerImage.SetActive(false); ((Component)SkipButton).gameObject.SetActive(false); video.Stop(); } public void SetVideo() { video.Stop(); video.clip = clips[Random.Range(0, clips.Count)]; video.Prepare(); video.Stop(); } public float GetLength() { return (float)video.length; } [ContextMenu("보이기")] public void Show() { ((MonoBehaviour)this).StartCoroutine(InAnimation()); } [ContextMenu("숨기기")] public void Hide() { ((MonoBehaviour)this).StartCoroutine(OutAnimation()); } [IteratorStateMachine(typeof(<InAnimation>d__15))] private IEnumerator InAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <InAnimation>d__15(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<OutAnimation>d__16))] private IEnumerator OutAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OutAnimation>d__16(0) { <>4__this = this }; } private void Update() { if (spawned) { if (skipTimer > 0f) { skipTimer -= Time.unscaledDeltaTime; } skipTimer = Mathf.Max(skipTimer, 0f); if (skipTimer <= 0f) { ((TMP_Text)SkipText).text = (skipPressed ? "no you cant" : "Skip AD"); } else { ((TMP_Text)SkipText).text = $"Video Ends\nafter {Mathf.FloorToInt(skipTimer)} seconds"; } } } } public class ChaosController : MonoBehaviour { internal PhotonView view; public static ChaosController instance; internal List<Modifier> events = new List<Modifier>(); internal float eventTimer; internal float timeScale = 1f; private TextMeshProUGUI DebugText => ChaosMod.Instance.DebugText; private void Start() { instance = this; view = ((Component)this).GetComponent<PhotonView>(); eventTimer = 20f; } [PunRPC] private void StartEventTimerRPC(float time, PhotonMessageInfo info = default(PhotonMessageInfo)) { eventTimer = time; } private void StartTimer(float time) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { view.RPC("StartEventTimerRPC", (RpcTarget)0, new object[1] { time }); } else { StartEventTimerRPC(time); } } [PunRPC] internal void SendEventRPC(int eventIndex, PhotonMessageInfo info = default(PhotonMessageInfo)) { List<Modifier> shopEvents = Modifiers.Events; if (SemiFunc.RunIsShop()) { shopEvents = Modifiers.ShopEvents; } if (eventIndex >= 0 && eventIndex < shopEvents.Count) { Modifier modifier = shopEvents[eventIndex]; Modifier modifier2 = modifier.Clone(); events.Add(modifier2); modifier2.Start(); ChaosMod.Instance.MakeText(modifier2.GetName(), modifier2.timerSelf); } } [PunRPC] private void AddTimeToEventRPC(int eventIndex, float time, PhotonMessageInfo info = default(PhotonMessageInfo)) { if (eventIndex >= 0 && eventIndex < events.Count) { events[eventIndex].timerSelf += time; if ((Object)(object)ChaosMod.Instance.eventTimerBars[eventIndex] != (Object)null) { ChaosMod.Instance.eventTimerBars[eventIndex].SetTime(events[eventIndex].timerSelf); } } } private void RandomEvent() { //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } for (int i = 0; i < 100; i++) { try { int num = 0; Modifier tempMod = null; if (SemiFunc.RunIsLevel()) { num = Random.Range(0, Modifiers.Events.Count); tempMod = Modifiers.Events[num]; } bool flag = Modifiers.CheckExcludes(tempMod.Instance); bool flag2 = Random.Range(0f, 1f) <= Mathf.Clamp01(tempMod.Instance.options.chance); bool flag3 = tempMod.isOnce || tempMod.timerSelf <= 0f; bool multiplayerOnly = tempMod.Instance.options.multiplayerOnly; bool singleplayerOnly = tempMod.Instance.options.singleplayerOnly; bool enabled = tempMod.enabled; bool flag4 = true; if ((multiplayerOnly && !GameManager.Multiplayer()) || (singleplayerOnly && GameManager.Multiplayer())) { flag4 = false; } if (ChaosMod.IsDebug) { MonoBehaviour.print((object)$"!isExcludedMod: {!flag} && chanceChoosen: {flag2} && hasTimerDoneOrIsOnce: {flag3} && isMultiplayerOnly: {multiplayerOnly} && !excludeOptions: {!enabled}"); } if (!(!flag && flag2 && flag3 && flag4 && enabled)) { continue; } if (!tempMod.isOnce) { Modifier modifier = events.Find((Modifier mod) => mod.name == tempMod.name && !mod.isOnce && mod.timerSelf > 0f); if (modifier != null) { if (GameManager.Multiplayer()) { view.RPC("AddTimeToEventRPC", (RpcTarget)0, new object[2] { events.IndexOf(modifier), modifier.GetTime() }); } else { AddTimeToEventRPC(events.IndexOf(modifier), modifier.GetTime()); } return; } } if (GameManager.Multiplayer()) { view.RPC("SendEventRPC", (RpcTarget)0, new object[1] { num }); } else { SendEventRPC(num); } return; } catch (Exception ex) { ChaosMod.Logger.LogError((object)(ex.Message + "\n" + ex.StackTrace)); } } ChaosMod.Logger.LogWarning((object)"적절한 이벤트를 찾지 못했습니다."); } public static Modifier FindModWithName(string name) { Modifier modifier = Modifiers.Events.Find((Modifier m) => m.GetName() == name); if (modifier == null) { if (ChaosMod.IsDebug) { ChaosMod.Logger.LogWarning((object)("이벤트 이름 '" + name + "'은 존재하지 않습니다.")); } return null; } return modifier.Clone(); } [PunRPC] private void OnEventFinishedRPC(string evtName, bool resetText = true, PhotonMessageInfo info = default(PhotonMessageInfo)) { try { Modifier modifier = FindModWithName(evtName); if (modifier != null) { if (ChaosMod.IsDebug) { ChaosMod.Logger.LogMessage((object)("모드 마침: " + modifier.name)); } if (!modifier.isOnce) { modifier.OnFinished(); } if (resetText) { ChaosMod.Instance.ResetText(); } } } catch (Exception ex) { ChaosMod.Logger.LogError((object)(ex.Message + "\n" + ex.StackTrace)); } } private void OnEventFinished(string modName, bool resetText) { //IL_0039: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { view.RPC("OnEventFinishedRPC", (RpcTarget)0, new object[2] { modName, resetText }); } else { OnEventFinishedRPC(modName, resetText); } } } private void Update() { if (!ChaosMod.Generated) { if (events.Count > 0) { foreach (Modifier @event in events) { OnEventFinished(@event.GetName(), resetText: false); } events.Clear(); } if (Modifiers.Excludes.Count > 0) { Modifiers.Excludes.Clear(); } if (SemiFunc.IsMasterClientOrSingleplayer() && eventTimer != 20f) { StartTimer(20f); } return; } if (!ChaosMod.DISABLE_TIMER) { if (eventTimer > 0f) { eventTimer = Mathf.Max(0f, eventTimer - Time.unscaledDeltaTime * timeScale); } else if (SemiFunc.IsMasterClientOrSingleplayer()) { StartTimer(20f); RandomEvent(); } } foreach (Modifier event2 in events) { if (event2 == null) { continue; } if (event2.timerSelf > 0f) { event2.timerSelf -= Time.unscaledDeltaTime; } else if (event2.timerSelf > -10f) { event2.timerSelf = -10f; if (!event2.isOnce) { OnEventFinished(event2.GetName(), resetText: true); } bool flag = !event2.isOnce && event2.timerSelf <= 0f; int item = events.IndexOf(event2); if (!ChaosMod.Instance.EventToRemove.Contains(item) && flag) { ChaosMod.Instance.EventToRemove.Add(item); } if (!ChaosMod.Instance.TextToRemove.Contains(item) && flag) { ChaosMod.Instance.TextToRemove.Add(item); } } event2.Update(); } if (ChaosMod.IsDebug) { string text = "디버깅 전용 텍스트"; text += $"\n살아있는 이벤트 개수: {events.Count}"; text += $"\n지울 예정인 이벤트 개수: {ChaosMod.Instance.EventToRemove.Count}"; text += $"\n살아있는 텍스트 개수: {ChaosMod.Instance.texts.Count}"; text += $"\n지울 예정인 텍스트 개수: {ChaosMod.Instance.TextToRemove.Count}"; ((TMP_Text)DebugText).text = text; } if (ChaosMod.Instance.EventToRemove.Count <= 0) { return; } IOrderedEnumerable<int> orderedEnumerable = from i in ChaosMod.Instance.EventToRemove.Distinct() orderby i descending select i; foreach (int item2 in orderedEnumerable) { if (item2 >= 0 && item2 < events.Count) { if (!events[item2].finihshed && !events[item2].isOnce) { OnEventFinished(events[item2].GetName(), resetText: false); } if (ChaosMod.IsDebug) { ChaosMod.Logger.LogMessage((object)("이벤트 삭제됨: " + events[item2].name)); } events.RemoveAt(item2); ChaosMod.Instance.ResetText(); } } ChaosMod.Instance.EventToRemove.Clear(); } [PunRPC] internal void GrenadeStunExplosionRPC(int viewID) { GameObject gameObject = ((Component)PhotonView.Find(viewID)).gameObject; ItemGrenade component = gameObject.GetComponent<ItemGrenade>(); component.tickTime = 0f; Util.GetInternalVar(component, "isActive").SetValue(component, true); } } [BepInPlugin("Lego0_77.ChaosMod", "ChaosMod", "1.2.3")] public class ChaosMod : BaseUnityPlugin { [CompilerGenerated] private sealed class <>c__DisplayClass43_0 { public string evt_enabled; public string evt_chance; public string evt_duration; public ChaosMod <>4__this; public string options_general; public string timebarColor; public string dizz; public string family; public string dev; internal void <MakeOptions>b__0(Modifier mod) { List<OptionsMenuController.OptionItem> list = new List<OptionsMenuController.OptionItem> { new OptionsMenuController.OptionItem(evt_enabled, OptionsMenuController.OptionType.Checkbox), new OptionsMenuController.OptionItem(evt_chance, OptionsMenuController.OptionType.Value, 0f, 100f) }; if (!mod.isOnce) { list.Add(new OptionsMenuController.OptionItem(evt_duration, OptionsMenuController.OptionType.Range, 0f, float.MaxValue)); } <>4__this.options.AddOption(mod.GetName(), list); <>4__this.options.SetValue(mod.GetName() + ":" + evt_enabled, mod.enabled, notify: false); <>4__this.options.SetValue(mod.GetName() + ":" + evt_chance, mod.options.chance * 100f, notify: false); if (!mod.isOnce) { <>4__this.options.SetValue(mod.GetName() + ":" + evt_duration, new float[2] { mod.minTimer, mod.maxTimer }, notify: false); } } internal void <MakeOptions>b__1(OptionsMenuController.OptionType type, string key, object value) { //IL_0034: 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_0045: Unknown result type (might be due to invalid IL or missing references) if (key.StartsWith(options_general)) { string text = key.Substring(options_general.Length + 1); if (text == timebarColor) { Color color = (Color)value; ((Graphic)<>4__this.barImg).color = color; <>4__this.hasChanges = true; } else if (text == dizz) { <>4__this.dizzyness = (bool)value; <>4__this.hasChanges = true; } else if (text == family) { <>4__this.familyFriendly = (bool)value; <>4__this.hasChanges = true; } else if (text == dev) { <>4__this.DevMode = (bool)value; <>4__this.hasChanges = true; } } else { foreach (Modifier @event in Modifiers.Events) { string name = @event.GetName(); if (key.StartsWith(name)) { string text2 = key.Substring(name.Length + 1); if (text2 == evt_enabled) { @event.enabled = (bool)value; } else if (text2 == evt_chance) { @event.options.chance = (float)value / 100f; } else if (text2 == evt_duration) { float[] array = (float[])value; @event.minTimer = array[0]; @event.maxTimer = array[1]; } <>4__this.hasChanges = true; break; } } } if (<>4__this.hasChanges && IsDebug) { Logger.LogInfo((object)"User has changed something"); } } } [CompilerGenerated] private sealed class <MakeOptions>d__43 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ChaosMod <>4__this; private <>c__DisplayClass43_0 <>8__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <MakeOptions>d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; ChaosMod chaosMod = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass43_0(); <>8__1.<>4__this = <>4__this; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: { <>1__state = -1; <>8__1.options_general = Language.GetText("options_general"); <>8__1.timebarColor = Language.GetText("options_gauge_color"); <>8__1.dizz = Language.GetText("options_dizzyness"); <>8__1.family = Language.GetText("options_family_friendly"); <>8__1.dev = Language.GetText("options_dev_mode"); chaosMod.options.AddOption(<>8__1.options_general, new List<OptionsMenuController.OptionItem> { new OptionsMenuController.OptionItem(<>8__1.timebarColor, OptionsMenuController.OptionType.Color), new OptionsMenuController.OptionItem(<>8__1.dizz, OptionsMenuController.OptionType.Checkbox), new OptionsMenuController.OptionItem(<>8__1.family, OptionsMenuController.OptionType.Checkbox), new OptionsMenuController.OptionItem(<>8__1.dev, OptionsMenuController.OptionType.Checkbox) }); chaosMod.options.SetValue(<>8__1.options_general + ":" + <>8__1.timebarColor, new Color(48f / 85f, 0f, 0f), notify: false); chaosMod.options.SetValue(<>8__1.options_general + ":" + <>8__1.dizz, enabled: false, notify: false); chaosMod.options.SetValue(<>8__1.options_general + ":" + <>8__1.family, enabled: false, notify: false); chaosMod.options.SetValue(<>8__1.options_general + ":" + <>8__1.dev, enabled: false, notify: false); string text = Language.GetText("options_lvl_evts"); <>8__1.evt_enabled = Language.GetText("options_evts_enabled"); <>8__1.evt_chance = Language.GetText("options_evts_chance"); <>8__1.evt_duration = Language.GetText("options_evts_range"); chaosMod.options.AddCategory(text); Modifiers.Init(delegate(Modifier mod) { List<OptionsMenuController.OptionItem> list = new List<OptionsMenuController.OptionItem> { new OptionsMenuController.OptionItem(<>8__1.evt_enabled, OptionsMenuController.OptionType.Checkbox), new OptionsMenuController.OptionItem(<>8__1.evt_chance, OptionsMenuController.OptionType.Value, 0f, 100f) }; if (!mod.isOnce) { list.Add(new OptionsMenuController.OptionItem(<>8__1.evt_duration, OptionsMenuController.OptionType.Range, 0f, float.MaxValue)); } <>8__1.<>4__this.options.AddOption(mod.GetName(), list); <>8__1.<>4__this.options.SetValue(mod.GetName() + ":" + <>8__1.evt_enabled, mod.enabled, notify: false); <>8__1.<>4__this.options.SetValue(mod.GetName() + ":" + <>8__1.evt_chance, mod.options.chance * 100f, notify: false); if (!mod.isOnce) { <>8__1.<>4__this.options.SetValue(mod.GetName() + ":" + <>8__1.evt_duration, new float[2] { mod.minTimer, mod.maxTimer }, notify: false); } }); chaosMod.LoadAndApplySettings(); chaosMod.options.onValueChanged.AddListener((UnityAction<OptionsMenuController.OptionType, string, object>)delegate(OptionsMenuController.OptionType type, string key, object value) { //IL_0034: 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_0045: Unknown result type (might be due to invalid IL or missing references) if (key.StartsWith(<>8__1.options_general)) { string text2 = key.Substring(<>8__1.options_general.Length + 1); if (text2 == <>8__1.timebarColor) { Color color = (Color)value; ((Graphic)<>8__1.<>4__this.barImg).color = color; <>8__1.<>4__this.hasChanges = true; } else if (text2 == <>8__1.dizz) { <>8__1.<>4__this.dizzyness = (bool)value; <>8__1.<>4__this.hasChanges = true; } else if (text2 == <>8__1.family) { <>8__1.<>4__this.familyFriendly = (bool)value; <>8__1.<>4__this.hasChanges = true; } else if (text2 == <>8__1.dev) { <>8__1.<>4__this.DevMode = (bool)value; <>8__1.<>4__this.hasChanges = true; } } else { foreach (Modifier @event in Modifiers.Events) { string name = @event.GetName(); if (key.StartsWith(name)) { string text3 = key.Substring(name.Length + 1); if (text3 == <>8__1.evt_enabled) { @event.enabled = (bool)value; } else if (text3 == <>8__1.evt_chance) { @event.options.chance = (float)value / 100f; } else if (text3 == <>8__1.evt_duration) { float[] array = (float[])value; @event.minTimer = array[0]; @event.maxTimer = array[1]; } <>8__1.<>4__this.hasChanges = true; break; } } } if (<>8__1.<>4__this.hasChanges && IsDebug) { Logger.LogInfo((object)"User has changed something"); } }); Logger.LogInfo((object)"Settings are created!"); 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 static readonly bool DISABLE_TIMER; internal const float MaxEventTimer = 20f; internal HashSet<EnemyParent> spawnedEnemys = new HashSet<EnemyParent>(); internal bool DevMode; internal Canvas UICanvas; internal RectTransform barRect; internal PhotonView view; internal AudioSource EnemyAS; internal AudioSource RumbleAS; internal AudioSource AudioSource; internal AudioSource ClubSource; internal PostProcessVolume shaderOverlay; internal ConfigEntry<KeyCode> ConfigOptionsMenu; internal List<GameObject> PrefabToAddNetwork = new List<GameObject>(); private float canvasHeight; private float canvasWidth; internal GameObject timeBar; internal RectTransform textGroup; internal AssetBundle assets; internal TextMeshProUGUI DebugText; internal Image barImg; internal OptionsMenuController options; private RawImage FakeCursor; private const string CONFIG_HEADER = "CHAOS_MOD_CONFIG"; private const int CONFIG_VERSION = 1; internal bool photonViewInited; internal GameObject carObject; internal CrazyCarAIScript car; internal AdManager adViewer; internal GameObject adObject; internal bool dizzyness = true; internal bool familyFriendly; private bool hasChanges; internal ChaosController controller; private float text_height = 40f; internal TMP_FontAsset pretendard; internal List<TextLerp> texts = new List<TextLerp>(); internal List<EventTimerBar> eventTimerBars = new List<EventTimerBar>(); internal List<int> EventToRemove = new List<int>(); internal List<int> TextToRemove = new List<int>(); private bool didReset; internal static ChaosMod Instance { get; private set; } internal static bool IsDebug { get { bool flag = false; return Instance.DevMode || flag; } } internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } public static bool Generated { get { if (LevelGenerator.Instance.Generated && !SemiFunc.IsMainMenu() && SemiFunc.RunIsLevel()) { return !SemiFunc.RunIsArena(); } return false; } } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Language.Load((CultureInfo.CurrentCulture.Name == "ko-KR") ? "ko" : "en-us"); ConfigOptionsMenu = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Option Key", (KeyCode)285, "AAAAAAAAAAAAAAAAAA"); Patch(); Logger.LogInfo((object)(((BaseUnityPlugin)this).Info.Metadata.Name + " has loaded!")); } internal void Patch() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0025: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Start() { //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Expected O, but got Unknown //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) string pluginDirectory = Util.GetPluginDirectory("assets"); Logger.LogInfo((object)("에셋 번들을 '" + pluginDirectory + "'에서 불러옵니다.")); assets = AssetBundle.LoadFromFile(pluginDirectory); if ((Object)(object)assets == (Object)null) { Logger.LogError((object)"에셋 번들 로드에 실패했습니다. 폰트가 깨지거나 몇 개의 에셋이 보이지 않을 수 있습니다."); } else { pretendard = assets.LoadAsset<TMP_FontAsset>("Pretendard-Bold SDF"); if ((Object)(object)pretendard == (Object)null) { Logger.LogError((object)"폰트 로드에 실패했습니다. 폰트가 깨질 수 있습니다."); } } GameObject val = Object.Instantiate<GameObject>(assets.LoadAsset<GameObject>("Chaos Controller")); UICanvas = val.GetComponent<Canvas>(); EnemyAS = ((Component)val.transform.Find("Audio Source").Find("Enemy Sound Source")).GetComponent<AudioSource>(); EnemyAS.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; RumbleAS = ((Component)val.transform.Find("Audio Source").Find("Rumble Sound Source")).GetComponent<AudioSource>(); RumbleAS.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; AudioSource = ((Component)val.transform.Find("Audio Source").Find("Master Sound Source")).GetComponent<AudioSource>(); AudioSource.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; ClubSource = ((Component)val.transform.Find("Audio Source").Find("Club Music Source")).GetComponent<AudioSource>(); ClubSource.outputAudioMixerGroup = AudioManager.instance.MusicMasterGroup; GameObject val2 = Object.Instantiate<GameObject>(Resources.Load<GameObject>("valuables/04 big/Valuable Museum Boombox"), new Vector3(9E+09f, 0f, 0f), Quaternion.identity); val2.SetActive(false); ClubSource.clip = val2.GetComponent<ValuableBoombox>().soundBoomboxMusic.Sounds[0]; Object.Destroy((Object)(object)val2); Rect rect = ((RectTransform)((Component)UICanvas).transform).rect; canvasHeight = ((Rect)(ref rect)).height; rect = ((RectTransform)((Component)UICanvas).transform).rect; canvasWidth = ((Rect)(ref rect)).width; Object.DontDestroyOnLoad((Object)(object)UICanvas); ThinkFast.scout = ((Component)val.transform.Find("Scout TF2")).GetComponent<Image>(); ThinkFast.text1 = ((Component)val.transform.Find("Upper Text")).gameObject; ThinkFast.text2 = ((Component)val.transform.Find("Lower Text")).gameObject; timeBar = ((Component)val.transform.Find("Time Bar")).gameObject; barImg = ((Component)timeBar.transform.Find("FG")).GetComponent<Image>(); barRect = (RectTransform)((Component)barImg).transform; textGroup = (RectTransform)((Component)val.transform.Find("Modifier Text Group")).transform; timeBar.SetActive(false); ((Component)ThinkFast.scout).gameObject.SetActive(false); ThinkFast.text1.SetActive(false); ThinkFast.text2.SetActive(false); ((TMP_Text)ThinkFast.text1.GetComponent<TextMeshProUGUI>()).text = Language.GetText("evt_text_think_fast"); ((TMP_Text)ThinkFast.text2.GetComponent<TextMeshProUGUI>()).text = Language.GetText("evt_text_chucklenuts"); SceneManager.sceneLoaded += OnSceneChange; photonViewInited = false; DebugText = ((Component)val.transform.Find("Debug Text")).GetComponent<TextMeshProUGUI>(); if (IsDebug) { ((TMP_Text)DebugText).font = pretendard; ((TMP_Text)DebugText).text = ""; ((TMP_Text)DebugText).fontSize = 20f; } ((Component)DebugText).gameObject.SetActive(IsDebug); GameObject val3 = Object.Instantiate<GameObject>(assets.LoadAsset<GameObject>("Settings"), ((Component)UICanvas).transform, false); options = val3.AddComponent<OptionsMenuController>(); FakeCursor = ((Component)val3.transform.Find("Mouse Cursor")).GetComponent<RawImage>(); RawImage component = ((Component)GameObject.Find("Cursor").transform.GetChild(0)).GetComponent<RawImage>(); FakeCursor.texture = component.texture; ((Graphic)FakeCursor).material = ((Graphic)component).material; ((Component)FakeCursor).gameObject.SetActive(false); ((Graphic)FakeCursor).rectTransform.sizeDelta = new Vector2(64f, 55.5f); ((Graphic)FakeCursor).raycastTarget = false; ((Graphic)FakeCursor).rectTransform.pivot = new Vector2(0.2f, 0.8f); if (IsDebug) { Logger.LogInfo((object)"프리팹을 풀에 추가하는 중..."); } foreach (GameObject item in PrefabToAddNetwork) { NetworkPrefabs.RegisterNetworkPrefab(item); if (IsDebug) { Logger.LogMessage((object)("프리팹 추가됨: " + ((Object)item).name)); } } Logger.LogMessage((object)"Setup Done. '-'"); ((MonoBehaviour)this).StartCoroutine(MakeOptions()); } [IteratorStateMachine(typeof(<MakeOptions>d__43))] private IEnumerator MakeOptions() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <MakeOptions>d__43(0) { <>4__this = this }; } private void LoadAndApplySettings() { //IL_01e3: Unknown result type (might be due to invalid IL or missing references) string pluginDirectory = Util.GetPluginDirectory("settings.bytes"); if (!File.Exists(pluginDirectory)) { Logger.LogWarning((object)"Settings File not found. Making a new one."); File.WriteAllText(pluginDirectory, ""); return; } using FileStream input = new FileStream(pluginDirectory, FileMode.Open); using BinaryReader binaryReader = new BinaryReader(input); try { if (binaryReader.ReadString() != "CHAOS_MOD_CONFIG") { Logger.LogError((object)Language.GetText("exception_config_invaild_header")); return; } } catch (Exception ex) { Logger.LogError((object)(ex.GetBaseException()?.ToString() + ": " + ex.Message + "\n" + ex.StackTrace)); if (ex.GetBaseException() is EndOfStreamException) { Logger.LogMessage((object)Language.GetText("exception_endofstream_config_1")); Logger.LogMessage((object)Language.GetText("exception_endofstream_config_2")); } return; } if (binaryReader.ReadInt32() > 1) { Logger.LogError((object)Language.GetText("exception_config_version_match")); return; } Color color = default(Color); for (int i = 0; i < binaryReader.ReadInt32(); i++) { string name = binaryReader.ReadString(); switch (binaryReader.ReadString()) { case "bool": options.SetValue(name, binaryReader.ReadBoolean()); break; case "float": options.SetValue(name, binaryReader.ReadSingle()); break; case "range": options.SetValue(name, new float[2] { binaryReader.ReadSingle(), binaryReader.ReadSingle() }); break; case "color": ((Color)(ref color))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); options.SetValue(name, color); break; } } } private void SaveSettings() { //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0154: Unknown result type (might be due to invalid IL or missing references) Logger.LogInfo((object)"Trying to save settings..."); using FileStream output = new FileStream(Util.GetPluginDirectory("settings.bytes"), FileMode.Create); using BinaryWriter binaryWriter = new BinaryWriter(output); binaryWriter.Write("CHAOS_MOD_CONFIG"); binaryWriter.Write(1); binaryWriter.Write(options.datas.Count); foreach (KeyValuePair<string, object> data in options.datas) { binaryWriter.Write(data.Key); if (data.Value is bool value) { binaryWriter.Write("bool"); binaryWriter.Write(value); } else if (data.Value is float value2) { binaryWriter.Write("float"); binaryWriter.Write(value2); } else if (data.Value is float[] array) { binaryWriter.Write("range"); binaryWriter.Write(array[0]); binaryWriter.Write(array[1]); } else if (data.Value is Color val) { binaryWriter.Write("color"); binaryWriter.Write(val.r); binaryWriter.Write(val.g); binaryWriter.Write(val.b); } } binaryWriter.Flush(); Logger.LogInfo((object)"Done!"); } private void OnSceneChange(Scene scene, LoadSceneMode mode) { photonViewInited = false; } internal bool InitPhotonView() { NetworkManager val = Object.FindAnyObjectByType<NetworkManager>(); if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)controller == (Object)null) { if (!((Component)val).gameObject.TryGetComponent<ChaosController>(ref controller)) { controller = ((Component)val).gameObject.AddComponent<ChaosController>(); } if (!GameManager.Multiplayer()) { view = null; photonViewInited = false; return false; } } if (!GameManager.Multiplayer()) { return false; } if ((Object)(object)view == (Object)null) { view = ((Component)val).GetComponent<PhotonView>(); if (IsDebug) { Logger.LogMessage((object)("PhotonView ID: " + view.ViewID)); } photonViewInited = (Object)(object)view != (Object)null; } return photonViewInited; } public TextMeshProUGUI MakeText(string text, float time) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0082: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(text.ToLower().Trim()); val.transform.parent = (Transform)(object)textGroup; RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = new Vector2(0f, 0.5f); val2.anchorMax = new Vector2(1f, 0.5f); val2.offsetMin = new Vector2(0f, (0f - text_height) / 2f); val2.offsetMax = new Vector2(0f, text_height / 2f); TextLerp textLerp = val.AddComponent<TextLerp>(); ((TMP_Text)textLerp).text = text; ((TMP_Text)textLerp).font = pretendard; ((TMP_Text)textLerp).fontSize = 30f; ((TMP_Text)textLerp).rectTransform.anchoredPosition = Vector2.zero; ((Vector2)(ref textLerp.targetPosition)).Set(0f, 0f); ((TMP_Text)textLerp).horizontalAlignment = (HorizontalAlignmentOptions)1; ((TMP_Text)textLerp).verticalAlignment = (VerticalAlignmentOptions)512; texts.Add(textLerp); if (Mathf.Max(0f, time) > 0f) { GameObject val3 = new GameObject("Time Text"); val3.transform.parent = val.transform; RectTransform val4 = val3.AddComponent<RectTransform>(); EventTimerBar eventTimerBar = val3.AddComponent<EventTimerBar>(); val4.anchoredPosition = Vector2.zero; ((Vector2)(ref eventTimerBar.targetPosition)).Set(100f, 0f); eventTimerBar.SetTime(time); ((TMP_Text)eventTimerBar).font = pretendard; ((TMP_Text)eventTimerBar).fontSize = 30f; ((TMP_Text)eventTimerBar).horizontalAlignment = (HorizontalAlignmentOptions)1; ((TMP_Text)eventTimerBar).verticalAlignment = (VerticalAlignmentOptions)512; eventTimerBars.Add(eventTimerBar); } else { eventTimerBars.Add(null); } ResetText(); return (TextMeshProUGUI)(object)textLerp; } public void ResetText() { //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; for (int i = 0; i < texts.Count; i++) { float num2 = 0f; bool flag = true; if (i >= 0 && i < controller.events.Count && controller.events[i] != null) { num2 = controller.events[i].timerSelf; flag = num2 <= 0f && !controller.events[i].isOnce; } if (!flag) { num++; } } int num3 = 0; for (int num4 = texts.Count - 1; num4 >= 0; num4--) { if (!EventToRemove.Contains(num4)) { TextLerp textLerp = texts[num4]; EventTimerBar eventTimerBar = eventTimerBars[num4]; float num5 = text_height * (float)num3; if (num5 >= 375f * controller.timeScale) { EventToRemove.Add(num4); TextToRemove.Add(num4); } else { textLerp.targetPosition = new Vector2(textLerp.targetPosition.x, num5); } num3++; } } } catch (Exception ex) { Logger.LogError((object)("텍스트의 위치를 리셋하던 중 오류가 발생했습니다: " + ex.Message + "\n" + ex.StackTrace)); } } public bool RemoveText(TextLerp text) { int num = texts.IndexOf(text); if (num == -1) { if (IsDebug) { Logger.LogWarning((object)("텍스트 \"" + ((TMP_Text)text).text + "\"의 인덱스를 찾지 못했습니다.")); } return false; } return RemoveText(num); } public bool RemoveText(int index) { if (index >= 0 && index < texts.Count) { TextLerp textLerp = texts[index]; Object.Destroy((Object)(object)((Component)textLerp).gameObject); EventTimerBar eventTimerBar = eventTimerBars[index]; if ((Object)(object)eventTimerBar != (Object)null) { Object.Destroy((Object)(object)((Component)eventTimerBar).gameObject); } texts.RemoveAt(index); eventTimerBars.RemoveAt(index); return true; } return false; } private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) if (timeBar.activeSelf != Generated) { timeBar.SetActive(Generated); } if (Input.GetKeyDown(ConfigOptionsMenu.Value)) { if (options.isShown) { ((Component)FakeCursor).gameObject.SetActive(false); options.Hide(); if (hasChanges) { hasChanges = false; SaveSettings(); } } else { options.Show(); ((Component)FakeCursor).gameObject.SetActive(true); } } ((Transform)((Graphic)FakeCursor).rectTransform).position = Input.mousePosition; if (!Generated) { if (texts.Count > 0) { for (int j = 0; j < texts.Count; j++) { Object.Destroy((Object)(object)texts[j]); } texts.Clear(); } if (eventTimerBars.Count > 0) { for (int k = 0; k < eventTimerBars.Count; k++) { Object.Destroy((Object)(object)eventTimerBars[k]); } eventTimerBars.Clear(); } photonViewInited = false; if (IsDebug) { ((TMP_Text)DebugText).text = ""; } if (!didReset) { didReset = true; ModVars.Reset(); } return; } if (didReset) { didReset = false; } if ((Object)(object)view == (Object)null || (Object)(object)controller == (Object)null) { photonViewInited = InitPhotonView(); } barRect.offsetMax = new Vector2(SemiFunc.Remap(0f, 20f, 0f, 0f - canvasWidth, controller.eventTimer), barRect.offsetMax.y); if (TextToRemove.Count <= 0) { return; } IOrderedEnumerable<int> orderedEnumerable = from i in TextToRemove.Distinct() orderby i descending select i; foreach (int item in orderedEnumerable) { if (item >= 0 && item < texts.Count) { RemoveText(item); } } TextToRemove.Clear(); } } public static class Commands { private static ChaosController cont => ChaosMod.Instance.controller; } public class CrazyCarAIScript : MonoBehaviour, IOnEventCallback { public PhotonView photonView; public List<Vector3> waypoints = new List<Vector3>(); public List<Sprite> exp_sprites = new List<Sprite>(); public float exp_anim_frame = 0.05f; public AudioClip honk; private MapCustom mapCustom; private AudioSource src; private AudioSource exp_src; private SpriteRenderer exp_rend; private List<Transform> FrontWheels = new List<Transform>(); private List<Transform> BackWheels = new List<Transform>(); private List<Light> frontLights = new List<Light>(); private List<Light> backLights = new List<Light>(); private List<Light> allLights = new List<Light>(); private NavMeshAgent agent; private ParticleSystem spawnParticles; private Transform root; private Vector3 startPos; private Vector3 startEuler; private HurtCollider hurt; private string[] hitMessages = new string[15] { "Wow, great driving.", "Nice driving, really.", "You're a real pro driver?", "Wow, did you get your license from a cereal box?", "10 out of 10 driving skills.", "Nice driving, genius.", "Wow, great driving.", "Did you get your license in a lucky draw?", "Ever heard of a turn signal?", "Call an Ambulance!", "This driver must be the reason for those warning signs.", "Was that a human driving or a blindfolded chimp?", "That’s supposed to be a human driving? A dog could’ve done a better job.", "That driver must be the reason for those warning signs.", "YOU DRIVE LIKE YOU'RE PLAYING GRAND THEFT AUTO." }; private bool yapping; private UnityEvent chat_callback; internal bool setupDone; internal bool isSpawned; private float rotateTimer; private float lastYRotation; private float rotationSpeed; private float lastAgentSpeed; private float curSpeedDelta; private int curAnimFrame; private float curAnimTime; private bool playAnimation; private bool needsToDestroy; private float honkTimer; private Vector3 targetPos; private Vector3 targetRot; private bool hasPosData; private void SetupComponents() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown if ((Object)(object)agent == (Object)null) { agent = ((Component)this).GetComponent<NavMeshAgent>(); } if ((Object)(object)agent == (Object)null) { ChaosMod.Logger.LogError((object)"NavMeshAgent가 없습니다."); return; } if ((Object)(object)src == (Object)null) { src = ((Component)this).GetComponent<AudioSource>(); } if ((Object)(object)src == (Object)null) { ChaosMod.Logger.LogError((object)"AudioSource가 없습니다."); return; } src.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; if ((Object)(object)photonView == (Object)null) { photonView = ((Component)this).GetComponent<PhotonView>(); } if ((Object)(object)photonView == (Object)null) { ChaosMod.Logger.LogError((object)"PhotonView가 없습니다."); return; } if (chat_callback == null) { chat_callback = new UnityEvent(); chat_callback.AddListener((UnityAction)delegate { yapping = false; }); } if ((Object)(object)hurt == (Object)null) { hurt = ((Component)this).GetComponent<HurtCollider>(); hurt.onImpactPlayer.AddListener((UnityAction)delegate { //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (GameManager.Multiplayer() && !yapping) { yapping = true; ChatManager.instance.PossessChatScheduleStart(int.MaxValue); ChatManager.instance.PossessChat((PossessChatID)2, hitMessages[Random.Range(0, hitMessages.Length)], 4f, Color.red, 0f, false, 0, chat_callback); ChatManager.instance.PossessChatScheduleEnd(); } }); } if ((Object)(object)mapCustom == (Object)null) { mapCustom = ((Component)this).GetComponent<MapCustom>(); } if ((Object)(object)mapCustom == (Object)null) { ChaosMod.Logger.LogError((object)"MapCustom가 없습니다."); return; } Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(); Transform[] array = componentsInChildren; foreach (Transform val in array) { if (((Object)val).name.Contains("Front Wheel")) { FrontWheels.Add(val); } else if (((Object)val).name.Contains("Back Wheel")) { BackWheels.Add(val); } else if (((Object)val).name.Contains("Front Light")) { Light component = ((Component)val).GetComponent<Light>(); frontLights.Add(component); allLights.Add(component); } else if (((Object)val).name.Contains("Back Light")) { Light component2 = ((Component)val).GetComponent<Light>(); backLights.Add(component2); allLights.Add(component2); } else if (((Object)val).name == "root") { root = val; } else if (((Object)val).name.Contains("Spawn")) { spawnParticles = ((Component)val).GetComponent<ParticleSystem>(); } else if (((Object)val).name.Contains("Explosion")) { exp_src = ((Component)val).GetComponent<AudioSource>(); exp_src.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; exp_rend = ((Component)val).GetComponent<SpriteRenderer>(); } } } internal void Start() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) SetupComponents(); if (SemiFunc.IsMasterClientOrSingleplayer()) { LevelPoint[] array = Object.FindObjectsByType<LevelPoint>((FindObjectsSortMode)0); foreach (LevelPoint val in array) { waypoints.Add(((Component)val).transform.position); } } ((Collider)((Component)this).GetComponent<BoxCollider>()).enabled = false; ((Behaviour)hurt).enabled = false; isSpawned = false; agent.isStopped = false; ((Component)root).gameObject.SetActive(false); ((Behaviour)agent).enabled = SemiFunc.IsMasterClientOrSingleplayer(); if (SemiFunc.IsMultiplayer() && PhotonNetwork.IsMasterClient) { photonView.TransferOwnership(PhotonNetwork.LocalPlayer); } MonoBehaviour.print((object)("agent.enabled: " + ((Behaviour)agent).enabled + ", Transform View: " + (object)((Component)this).GetComponent<PhotonTransformView>())); setupDone = true; } [PunRPC] private void SpawnRPC() { //IL_0053: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (GameManager.Multiplayer()) { int num = (ChaosMod.Instance.familyFriendly ? 1 : 0); } exp_src.Stop(); playAnimation = false; exp_rend.sprite = null; curAnimFrame = 0; isSpawned = true; src.Play(); startPos = ((Component)this).transform.position; startEuler = ((Component)this).transform.eulerAngles; spawnParticles.Play(); ((Component)root).gameObject.SetActive(true); if (SemiFunc.IsMasterClientOrSingleplayer()) { agent.isStopped = false; } ((Collider)((Component)this).GetComponent<BoxCollider>()).enabled = true; ((Behaviour)hurt).enabled = true; GoToNextPoint(); PhotonNetwork.AddCallbackTarget((object)this); } public void Spawn() { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { photonView.RPC("SpawnRPC", (RpcTarget)0, Array.Empty<object>()); } else { SpawnRPC(); } } } [PunRPC] private void DespawnRPC(bool slient = false) { if (!slient) { exp_src.Play(); curAnimTime = 0f; playAnimation = true; } else { PhotonNetwork.RemoveCallbackTarget((object)this); } ((Behaviour)hurt).enabled = false; isSpawned = false; } public void Despawn(bool slient = false) { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { photonView.RPC("DespawnRPC", (RpcTarget)0, new object[1] { slient }); } else { DespawnRPC(slient); } } } [PunRPC] private void HonkRPC() { if (isSpawned || !(honkTimer > 0f)) { honkTimer = 1f; exp_src.PlayOneShot(honk, 0.4f); } } private void Honk() { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { photonView.RPC("HonkRPC", (RpcTarget)0, Array.Empty<object>()); } else { HonkRPC(); } } } public void GoToNextPoint() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((waypoints.Count != 0 || isSpawned) && SemiFunc.IsMasterClientOrSingleplayer()) { if (Random.Range(0, 100) <= 25) { List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); SetDestination(((Component)list[Random.Range(0, list.Count)]).transform.position); } else { SetDestination(waypoints[Random.Range(0, waypoints.Count)]); } } } private void Hide() { src.Stop(); ((Component)root).gameObject.SetActive(false); if (SemiFunc.IsMasterClientOrSingleplayer()) { agent.isStopped = true; } ((Collider)((Component)this).GetComponent<BoxCollider>()).enabled = false; } private void OnDestroy() { if (GameManager.Multiplayer() || SemiFunc.IsMasterClient()) { PhotonNetwork.RemoveCallbackTarget((object)this); } } [PunRPC] private void SetDestinationRPC(float x, float y, float z) { //IL_0021: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { agent.destination = new Vector3(x, y, z); } lastYRotation = ((Component)this).transform.eulerAngles.y; } private void SetDestination(Vector3 pos) { //IL_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { photonView.RPC("SetDestinationRPC", (RpcTarget)0, new object[3] { pos.x, pos.y, pos.z }); } else { SetDestinationRPC(pos.x, pos.y, pos.z); } } } private void Update() { //IL_0048: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) if (honkTimer > 0f) { honkTimer -= Time.deltaTime; } if ((Object)(object)exp_rend == (Object)null) { SetupComponents(); } ((Component)exp_rend).transform.LookAt(((Component)Camera.main).transform, Vector3.up); if (spawnParticles.isPlaying) { ((Component)spawnParticles).transform.position = startPos; ((Component)spawnParticles).transform.eulerAngles = startEuler; } if (SemiFunc.IsMasterClientOrSingleplayer() && agent.isOnNavMesh && !agent.pathPending && agent.remainingDistance <= 1f && isSpawned) { GoToNextPoint(); } if (playAnimation) { if (curAnimTime > 0f) { curAnimTime -= Time.unscaledDeltaTime; } else { curAnimTime = exp_anim_frame; exp_rend.sprite = exp_sprites[curAnimFrame]; if (curAnimFrame == 5) { Hide(); } curAnimFrame = Mathf.Clamp(curAnimFrame + 1, 0, exp_sprites.Count - 1); } } if (!isSpawned && (Object)(object)mapCustom != (Object)null) { mapCustom.Hide(); } Vector3 velocity = agent.velocity; float num = ((Vector3)(ref velocity)).magnitude * 4f; float num2 = num - lastAgentSpeed; lastAgentSpeed = num; curSpeedDelta = Mathf.Floor(num2 * 100f) / 100f; if (Mathf.Abs(curSpeedDelta) <= 0.01f) { curSpeedDelta = 0f; } src.pitch = num / agent.speed + 1f; float num3 = Mathf.Sign(curSpeedDelta); foreach (Light backLight in backLights) { if (num3 >= 0f) { backLight.intensity = 0.5f; } else if (num3 < 0f) { backLight.intensity = 1f; } } float y = ((Component)this).transform.eulerAngles.y; float num4 = Mathf.DeltaAngle(lastYRotation, y); rotationSpeed = num4 / Time.deltaTime; lastYRotation = y; rotateTimer += Time.deltaTime * num; float num5 = ((Component)this).transform.eulerAngles.y - 90f; foreach (Transform frontWheel in FrontWheels) { frontWheel.eulerAngles = new Vector3(frontWheel.eulerAngles.x, num5 + Mathf.Clamp(rotationSpeed / agent.angularSpeed * 45f, -45f, 45f), 0f - rotateTimer); } foreach (Transform backWheel in BackWheels) { backWheel.eulerAngles = new Vector3(backWheel.eulerAngles.x, backWheel.eulerAngles.y, 0f - rotateTimer); } if (SemiFunc.IsNotMasterClient()) { if (hasPosData) { ((Component)this).transform.position = targetPos; ((Component)this).transform.eulerAngles = targetRot; } hasPosData = false; } } private Transform GetParentTransformByNameContains(Transform start, string name) { Transform parent = ((Component)start).transform.parent; while (!((Object)parent).name.Contains(name) && (Object)(object)parent.parent != (Object)null) { parent = parent.parent; } return parent; } private void FixedUpdate() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || !isSpawned) { return; } Vector3 val = ((Component)this).transform.position + ((Component)this).transform.forward * 7.5f + Vector3.up * 3f; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(1.25f, 1.25f, 0.5f); Vector3 forward = ((Component)this).transform.forward; float num = 20f; RaycastHit val3 = default(RaycastHit); if (Physics.BoxCast(val, val2, forward, ref val3, ((Component)this).transform.rotation, num)) { Transform parentTransformByNameContains = GetParentTransformByNameContains(((RaycastHit)(ref val3)).transform, "Player"); if ((Object)(object)parentTransformByNameContains != (Object)null && ((Object)parentTransformByNameContains).name.Contains("Player")) { SetDestination(((RaycastHit)(ref val3)).transform.position); if (honkTimer <= 0f) { Honk(); } } } if (SemiFunc.IsMultiplayer()) { PhotonNetwork.RaiseEvent((byte)1, (object)((Component)agent).transform.position, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendUnreliable); PhotonNetwork.RaiseEvent((byte)2, (object)((Component)agent).transform.eulerAngles, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendUnreliable); } } public void OnEvent(EventData photonEvent) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (photonEvent.Code == 1) { targetPos = (Vector3)photonEvent.CustomData; hasPosData = true; } if (photonEvent.Code == 2) { targetRot = (Vector3)photonEvent.CustomData; hasPosData = true; } } } public class SpawnMonster : Modifier { private string monsterPrefabPath = "enemies"; private GameObject[] monsters; public int count = 1; public SpawnMonster(int count) : base("evt_spawn_monsters", "evt_spawn_monsters_desc") { this.count = count; isOnce = true; ID = 1; monsters = Resources.LoadAll<GameObject>(monsterPrefabPath); } public override string GetName() { return Language.GetText(name).Replace("%f", count.ToString()); } public override void Start() { //IL_013d: 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) base.Start(); if (ChaosMod.IsDebug) { ChaosMod.Logger.LogInfo((object)("Spawn " + count + " enemys")); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } LevelPoint[] array = Object.FindObjectsByType<LevelPoint>((FindObjectsSortMode)0); foreach (Modifier @event in Modifiers.Events) { if (@event is SpawnMonster && !Modifiers.Excludes.Contains(@event.Instance)) { Modifiers.Excludes.Add(@event.Instance); } } int num = 0; List<EnemySetup> enemiesDifficulty = EnemyDirector.instance.enemiesDifficulty1; List<EnemySetup> enemiesDifficulty2 = EnemyDirector.instance.enemiesDifficulty2; List<EnemySetup> enemiesDifficulty3 = EnemyDirector.instance.enemiesDifficulty3; List<EnemySetup> list = new List<EnemySetup>(enemiesDifficulty.Count + enemiesDifficulty2.Count + enemiesDifficulty3.Count); list.AddRange(enemiesDifficulty); list.AddRange(enemiesDifficulty2); list.AddRange(enemiesDifficulty3); List<EnemySetup> list2 = list; foreach (EnemySetup item in list2) { if (num >= count) { break; } if (!(Random.Range(0f, 1f) <= 0.6f)) { Enemies.SpawnEnemy(item, ((Component)array[Random.Range(0, array.Length)]).transform.position, Quaternion.identity, false); ChaosMod.Logger.LogInfo((object)("적 스폰됨: " + ((Object)item).name)); num++; } } } public override Modifier Clone() { return new SpawnMonster(count) { isClone = true, Instance = this }; } } public class Tumble : Modifier { public Tumble() : base("evt_tumble", "evt_tumble_desc") { isOnce = true; ID = 2; } public override void Start() { base.Start(); if (SemiFunc.IsMasterClientOrSingleplayer()) { PlayerTumble[] array = Object.FindObjectsByType<PlayerTumble>((FindObjectsSortMode)0); foreach (PlayerTumble val in array) { val.TumbleSet(true, false); val.TumbleOverrideTime(Random.Range(2f, 3f)); } } } public override Modifier Clone() { return new Tumble { isClone = true, Instance = this }; } } public class GameSpeed : Modifier { public float mult = 1f; public GameSpeed(float mult) : base("evt_game_speed", "evt_game_speed_desc") { minTimer = 20f; maxTimer = 25f; this.mult = mult; ID = 3; } public override string GetName() { return Language.GetText(name).Replace("%f", mult.ToString()); } public override void Start() { base.Start(); foreach (Modifier @event in Modifiers.Events) { if (@event is GameSpeed) { Modifiers.Excludes.Add(@event.Instance); } } Time.timeScale = mult; } public override void OnFinished() { base.OnFinished(); foreach (Modifier @event in Modifiers.Events) { if (@event is GameSpeed) { Modifiers.Excludes.Remove(@event.Instance); } } while (Time.timeScale != 1f) { Time.timeScale = 1f; } } public override Modifier Clone() { return new GameSpeed(mult) { isClone = true, Instance = this }; } } public class KillAllMonsters : Modifier { public KillAllMonsters() : base("evt_kill_all_monsters", "evt_kill_all_monsters_desc") { isOnce = true; ID = 4; } public override void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) base.Start(); EnemyHealth[] array = Object.FindObjectsByType<EnemyHealth>((FindObjectsSortMode)0); foreach (EnemyHealth val in array) { val.Hurt(int.MaxValue, Vector3.zero); } } public override Modifier Clone() { return new KillAllMonsters { isClone = true, Instance = this }; } } public class QuakeFOV : Modifier { public QuakeFOV() : base("evt_quake_fov", "evt_quake_fov_desc") { minTimer = 20f; maxTimer = 30f; ID = 5; } public override void Update() { base.Update(); CameraZoom.Instance.OverrideZoomSet(ChaosMod.Instance.dizzyness ? 150f : 90f, 0.5f, 0.5f, 1f, ((Component)ChaosMod.Instance).gameObject, 10); } public override Modifier Clone() { return new QuakeFOV { isClone = true, Instance = this }; } } public class BrokeAllDoor : Modifier { public BrokeAllDoor() : base("evt_break_all_door", "evt_break_all_door_desc") { isOnce = true; ID = 6; } public override void Start() { //IL_0060: 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_0022: Unknown result type (might be due to invalid IL or missing references) base.Start(); if (ModVars.brokeAllDoor_didRun) { HingeJoint[] array = Object.FindObjectsByType<HingeJoint>((FindObjectsSortMode)0); foreach (HingeJoint val in array) { ((Component)val).GetComponent<PhysGrabObjectImpactDetector>().BreakHeavy(Vector3.zero, true, 0f); } return; } ModVars.brokeAllDoor_didRun = true; HingeJoint[] array2 = Object.FindObjectsByType<HingeJoint>((FindObjectsSortMode)0); foreach (HingeJoint val2 in array2) { Rigidbody component = ((Component)val2).GetComponent<Rigidbody>(); component.AddForce(Vector3.forward * 5000f, (ForceMode)1); } } public override Modifier Clone() { BrokeAllDoor brokeAllDoor = new BrokeAllDoor(); if (ModVars.brokeAllDoor_didRun) { base.Instance.name = "문 확인사살"; base.Instance.options.oncePerLevel = true; } brokeAllDoor.isClone = true; brokeAllDoor.Instance = this; return brokeAllDoor; } } public class MonsterSound : Modifier { public List<AudioClip> sounds; public MonsterSound() : base("evt_hallucination", "evt_hallucination_desc") { isOnce = true; ID = 7; sounds = new List<AudioClip>(); List<string> list = new List<string> { "duck", "animal", "hunter" }; foreach (string item in list) { for (int i = 1; i <= 3; i++) { sounds.Add(ChaosMod.Instance.assets.LoadAsset<AudioClip>($"{item}{i}")); } } sounds.Add(ChaosMod.Instance.assets.LoadAsset<AudioClip>("clown")); sounds.Add(ChaosMod.Instance.assets.LoadAsset<AudioClip>("rugurt")); } public override void Start() { base.Start(); ChaosMod.Instance.EnemyAS.PlayOneShot(sounds[Random.Range(1, sounds.Count)], 0.5f); } public override Modifier Clone() { return new MonsterSound { isClone = true, Instance = this }; } } public class AddHealth : Modifier { public int amount; public AddHealth(int amount) : base("체력 추가", "evt_health_desc") { this.amount = amount; name = ((amount > 0) ? "+" : "") + $"{amount} HP"; isOnce = true; options.oncePerLevel = true; ID = 8; } public override string GetName() { return name; } public override void Start() { base.Start(); if (amount == 0) { return; } if (SemiFunc.IsMasterClientOrSingleplayer()) { PlayerHealth[] array = Object.FindObjectsByType<PlayerHealth>((FindObjectsSortMode)0); foreach (PlayerHealth val in array) { if (Mathf.Sign((float)amount) < 0f) { val.Hurt(Mathf.Abs(amount), true, -1); } else { val.Heal(Mathf.Abs(amount), true); } } } foreach (Modifier @event in Modifiers.Events) { if (@event is AddHealth) { Modifiers.Excludes.Add(@event); } } } public override Modifier Clone() { return new AddHealth(amount) { isClone = true, Instance = this }; } } public class HideHealthUI : Modifier { public HideHealthUI() : base("evt_hide_health", "evt_hide_health_desc") { minTimer = 20f; maxTimer = 35f; ID = 9; } public override void Update() { base.Update(); HealthUI instance = HealthUI.instance; ((SemiUI)instance).Hide(); } public override void OnFinished() { base.OnFinished(); HealthUI instance = HealthUI.instance; ((SemiUI)instance).Show(); } public override Modifier Clone() { return new HideHealthUI { isClone = true, Instance = this }; } } public class HideSprintUI : Modifier { public HideSprintUI() : base("evt_hide_sprint", "evt_hide_sprint_desc") { minTimer = 20f; maxTimer = 35f; ID = 10; } public override void Update() { base.Update(); EnergyUI instance = EnergyUI.instance; ((SemiUI)instance).Hide(); } public override void OnFinished() { base.OnFinished(); HealthUI instance = HealthUI.instance; ((SemiUI)instance).Show(); } public override Modifier Clone() { return new HideSprintUI { isClone = true, Instance = this }; } } public class DisablePostProcessing : Modifier { public static GameObject post; public DisablePostProcessing() : base("evt_disable_post_processing", "evt_disable_post_processing_desc") { minTimer = 30f; maxTimer = 60f; ID = 11; } public override void Start() { base.Start(); if ((Object)(object)post == (Object)null) { post = ((Component)((Component)Object.FindAnyObjectByType<PostProcessing>()).transform.parent).gameObject; } post.SetActive(false); } public override Modifier Clone() { return new DisablePostProcessing { isClone = true, Instance = this }; } public override void OnFinished() { base.OnFinished(); post.SetActive(true); } } public class JointAreDoors : Modifier { public JointAreDoors() : base("evt_show_all_drawers_in_map", "evt_show_all_drawers_in_map_desc") { isOnce = true; options.oncePerLevel = true; ID = 12; } public override void Start() { base.Start(); DirtFinderMapDoorTarget val = Object.FindAnyObjectByType<DirtFinderMapDoorTarget>(); if ((Object)(object)val == (Object)null) { if (ChaosMod.IsDebug) { ChaosMod.Logger.LogWarning((object)"DirtFinderMapDoorTarget을 찾지 못하였습니다."); } return; } HingeJoint[] array = Object.FindObjectsByType<HingeJoint>((FindObjectsSortMode)0); DirtFinderMapDoor val3 = default(DirtFinderMapDoor); foreach (HingeJoint val2 in array) { if (!((Component)val2).TryGetComponent<DirtFinderMapDoor>(ref val3)) { DirtFinderMapDoor val4 = ((Component)val2).gameObject.AddComponent<DirtFinderMapDoor>(); val4.DoorPrefab = ((Component)val).gameObject; } } } public override Modifier Clone() { return new JointAreDoors { isClone = true, Instance = this }; } } public class DuckMadness : Modifier { private string rubberDuckPath = "items/Item Rubber Duck"; private GameObject rubberDuckPrefab; public List<ItemRubberDuck> ducks = new List<ItemRubberDuck>(); public DuckMadness() : base("evt_crazy_ducks", "evt_crazy_ducks_desc") { minTimer = 25f; maxTimer = 30f; ID = 13; rubberDuckPrefab = Resources.Load<GameObject>(rubberDuckPath); if ((Object)(object)rubberDuckPrefab == (Object)null) { ChaosMod.Logger.LogError((object)"rubberDuckPrefab이 존재하지 않습니다!"); } } public override void Start() { //IL_0050: 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_0099: 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_0085: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) base.Start(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (!Modifiers.Excludes.Contains(base.Instance)) { Modifiers.Excludes.Add(base.Instance); } List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); foreach (PlayerAvatar item in list) { Vector3 val = ((Component)item).transform.position + Vector3.up; Quaternion rotation = ((Component)item).transform.rotation; for (int i = 0; i < 9 - list.Count; i++) { GameObject val2 = null; val2 = ((!GameManager.Multiplayer()) ? Object.Instantiate<GameObject>(rubberDuckPrefab, val, rotation) : PhotonNetwork.Instantiate(rubberDuckPath, val, rotation, (byte)0, (object[])null)); Rigidbody component = val2.GetComponent<Rigidbody>(); component.isKinematic = false; component.AddForce(val2.transform.forward * 100f); val2.GetComponent<ItemBattery>().autoDrain = false; val2.GetComponent<ItemBattery>().batteryActive = false; ItemRubberDuck component2 = val2.GetComponent<ItemRubberDuck>(); ((DuckMadness)base.Instance).ducks.Add(component2); } } } public override void Update() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (ItemRubberDuck duck in ((DuckMadness)base.Instance).ducks) { PhysGrabObject component = ((Component)duck).GetComponent<PhysGrabObject>(); Rigidbody component2 = ((Component)duck).GetComponent<Rigidbody>(); component2.AddForce(((Component)duck).transform.forward * 100f); Vector3 velocity = component2.velocity; if (((Vector3)(ref velocity)).magnitude > 500f) { velocity = component2.velocity; component2.velocity = ((Vector3)(ref velocity)).normalized * 500f; } if (component.playerGrabbing.Count <= 0 || !SemiFunc.IsMasterClientOrSingleplayer()) { continue; } foreach (PhysGrabber item in component.playerGrabbing) { if (!((Object)(object)item == (Object)null)) { if (!GameManager.Multiplayer()) { item.ReleaseObject(((Component)duck).GetComponent<PhotonView>().ViewID, 0.1f); continue; } item.photonView.RPC("ReleaseObjectRPC", (RpcTarget)0, new object[3] { false, ((Component)duck).GetComponent<PhotonView>().ViewID, 0.1f }); } } } } public override void OnFinished() { base.OnFinished(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } for (int i = 0; i < ((DuckMadness)base.Instance).ducks.Count; i++) { GameObject gameObject = ((Component)((DuckMadness)base.Instance).ducks[i]).gameObject; if (!((Object)(object)gameObject == (Object)null)) { if (GameManager.Multiplayer()) { PhotonNetwork.Destroy(gameObject); } else { Object.Destroy((Object)(object)gameObject); } } } ((DuckMadness)base.Instance).ducks.Clear(); if (Modifiers.Excludes.Contains(base.Instance)) { Modifiers.Excludes.Remove(base.Instance); } } public override Modifier Clone() { return new DuckMadness { isClone = true, Instance = this }; } } public class SayRandomThnings : Modifier { public static string[] tries = new string[35] { "What the fuck did you just fucking say about me, you little bitch?", "You're suck at this game.", "git gud", "goo goo ga ga.", "AAAAAAAAAAAAAAAAAAAAAAAA", "OOOOOOOOOOOOOOOOOO", "I love you.", "I hate you.", "go fuck yourself.", "That monster I fucking hate", "That robot I fucking hate", "I love this game.", "You are an idiot.", "Do you have one digit IQ?", "son of a bitch.", "jaundice", "goo goo ga ga?", "I have nothing to say.", "I ran out of ideas.", "I LOOOVEEEE", "75000 DOLLARS?? OH MY GOSH", "I feel so REPO!", "Tung Tung Tung Tung Tung Tung Tung Tung Tung Sahur", "Brr Brr Patapim", "adorable", "I hate everything.", "The cake is a lie.", "This is Certified hood classic.", "This is the part where he kills you.", "skill issue", "CHICKEN JOCKEY", "skibidi", "I. AM. STEVE.", "THanks for playing my mod!", "six sevennn" }; public static string[] familyfriendly = new string[25] { "You're doing great!", "You're good at this game.", "goo goo ga ga.", "AAAAAAAAAAAAAAAAAAAAAAAA", "OOOOOOOOOOOOOOOOOO", "I love you.", "I hate that monster.", "I love this game.", "jaundice", "goo goo ga ga?", "I have nothing to say.", "I ran out of ideas.", "I LOOOVEEEE", "75000 DOLLARS?? OH MY GOSH", "I feel so REPO!", "Tung Tung Tung Tung Tung Tung Tung Tung Tung Sahur", "Brr Brr Patapim", "adorable", "The cake is a lie.", "This is Certified hood classic.", "This is the part where he kills you!", "CHICKEN JOCKEY", "skibidi", "I. AM. STEVE.", "Thanks for playing my mod!" }; public SayRandomThnings() : base("evt_say_random_thing", "evt_say_random_thing_desc") { isOnce = true; options.multiplayerOnly = true; ID = 14; } public override void Start() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) base.Start(); ChatManager instance = ChatManager.instance; string text = tries[Random.Range(0, tries.Length)]; if (ChaosMod.Instance.familyFriendly) { string[] array = new string[6] { "fuck", "fucking", "suck", "bitch", "idiot", "kill" }; string[] array2 = array; foreach (string text2 in array2) { if (text.Contains(text2)) { text = text.Replace(text2, "(REDACTED)"); } } } instance.PossessChatScheduleStart(4); instance.PossessChat((PossessChatID)0, text, 1.75f, Color.Lerp(Color.yellow, new Color(0f, 0.5f, 1f), Random.Range(0f, 1f)), 0f, false, 0, (UnityEvent)null); instance.PossessChatScheduleEnd(); } public override Modifier Clone() { return new SayRandomThnings { isClone = true, Instance = this }; } } public class ShakeScreen : Modifier { [CompilerGenerated] private sealed class <AudioFadeIn>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource <src>5__2; private Func<float, float> <ease>5__3; private float <step>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AudioFadeIn>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <src>5__2 = null; <ease>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <src>5__2 = ChaosMod.Instance.RumbleAS; <src>5__2.volume = 0f; <src>5__2.Play(); <ease>5__3 = (float t) => Mathf.Pow(t, 3.322f); <step>5__4 = 0f; break; case 1: <>1__state = -1; break; } if (<step>5__4 < 1f) { <src>5__2.volume = <ease>5__3(<step>5__4); <step>5__4 += Time.unscaledDeltaTime; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } <src>5__2.volume = 1f; 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 <AudioFadeOut>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private AudioSource <src>5__2; private Func<float, float> <ease>5__3; private float <step>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AudioFadeOut>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <src>5__2 = null; <ease>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <src>5__2 = ChaosMod.Instance.RumbleAS; <src>5__2.volume = 1f; <ease>5__3 = (float t) => Mathf.Pow(0f - t, 3.322f) + 1f; <step>5__4 = 0f; break; case 1: <>1__state = -1; break; } if (<step>5__4 < 1f) { <src>5__2.volume = <ease>5__3(<step>5__4); <step>5__4 += Time.unscaledDeltaTime; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } <src>5__2.volume = 0f; <src>5__2.Stop(); 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 ShakeScreen() : base("evt_earthquake", "evt_earthquake_desc") { minTimer = 15f; maxTimer = 20f; ID = 15; } public override Modifier Clone() { return new ShakeScreen { isClone = true, Instance = this }; } public override void Start() { base.Start(); if (ChaosMod.Instance.dizzyness) { ChaosMod.Instance.RumbleAS.volume = 1f; ChaosMod.Instance.RumbleAS.Play(); } } public override void Update() { base.Update(); if (ChaosMod.Instance.dizzyness) { GameDirector.instance.CameraShake.Shake(2f, 0.5f); GameDirector.instance.CameraImpact.Shake(2f, 0.5f); } } public override void OnFinished() { base.OnFinished(); if (ChaosMod.Instance.dizzyness) { ((MonoBehaviour)ChaosMod.Instance).StartCoroutine(AudioFadeOut()); } } [IteratorStateMachine(typeof(<AudioFadeIn>d__5))] private IEnumerator AudioFadeIn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AudioFadeIn>d__5(0); } [IteratorStateMachine(typeof(<AudioFadeOut>d__6))] private IEnumerator AudioFadeOut() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AudioFadeOut>d__6(0); } } public class IncreaseValuableWorth : Modifier { public float mult = 1f; public IncreaseValuableWorth(float mult) : base("귀중품 가격", "evt_increase_valuable_desc") { isOnce = true; this.mult = mult; ID = 16; } public override string GetName() { return Language.GetText("evt_increase_valuable").Replace("%f", mult.ToString()); } public override Modifier Clone() { return new IncreaseValuableWorth(mult) { isClone = true, Instance = this }; } public override void Start() { base.Start(); List<ValuableObject> valuableList = ValuableDirector.instance.valuableList; if (valuableList == null || valuableList.Count == 0) { if (ChaosMod.IsDebug) { Debug.LogWarning((object)"귀중품을 찾지 못했습니다. 가격 상승은 없습니다."); } return; } foreach (ValuableObject item in valuableList) { if ((Object)(object)item == (Object)null) { if (ChaosMod.IsDebug) { ChaosMod.Logger.LogWarning((object)"아이템 하나를 찾지 못하였습니다. 다음 아이템으로 스킵합니다."); } continue; } FieldInfo internalVar = Util.GetInternalVar(item, "dollarValueCurrent"); FieldInfo internalVar2 = Util.GetInternalVar(item, "dollarValueOriginal"); float num = (float)internalVar.GetValue(item); num *= mult; internalVar.SetValue(item, Mathf.RoundToInt(num)); internalVar2.SetValue(item, Mathf.Max(num, (float)internalVar2.GetValue(item))); } foreach (Modifier @event in Modifiers.Events) { if (@event is IncreaseValuableWorth) { Modifiers.Excludes.Add(@event); } } } } public class SpinEternally : Modifier { public SpinEternally() : base("evt_spin", "evt_spin_desc") { minTimer = 20f; maxTimer = 40f; ID = 17; } public override Modifier Clone() { return new SpinEternally { isClone = true, Instance = this }; } public override void Update() { //IL_0041: 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) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) base.Update(); foreach (EnemyParent spawnedEnemy in ChaosMod.Instance.spawnedEnemys) { if ((Object)(object)spawnedEnemy == (Object)null) { continue; } EnemyRigidbody component = ((Component)spawnedEnemy).GetComponent<EnemyRigidbody>(); if (!((Object)(object)component == (Object)null)) { Rigidbody component2 = ((Component)component).GetComponent<Rigidbody>(); Vector3 angularVelocity = component2.angularVelocity; if (((Vector3)(ref angularVelocity)).magnitude <= 1500f) { component2.AddTorque(((Component)component).transform.forward * 500f, (ForceMode)1); } } } } } public class FriendlyMonsters : Modifier { public FriendlyMonsters() : base("evt_friendly_monsters", "evt_friendly_monsters_desc") { minTimer = 60f; maxTimer = 120f; ID = 18; } public override Modifier Clone() { FriendlyMonsters friendlyMonsters = new FriendlyMonsters(); friendlyMonsters.isClone = true; friendlyMonsters.Instance = this; return friendlyMonsters; } public override void Start() { base.Start(); if (!Modifiers.Excludes.Contains(base.Instance)) { Modifiers.Excludes.Add(base.Instance); } Util.GetInternalVar(EnemyDirector.instance, "debugNoVision").SetValue(EnemyDirector.instance, true); } public override void OnFinished() { base.OnFinished(); if (Modifiers.Excludes.Contains(base.Instance)) { Modifiers.Excludes.Remove(base.Instance); } Util.GetInternalVar(EnemyDirector.instance, "debugNoVision").SetValue(EnemyDirector.instance, false); } } public class NoJumpAndSprint : Modifier { public NoJumpAndSprint() : base("evt_no_jump_sprint", "evt_no_jump_sprint_desc") { minTimer = 20f; maxTimer = 40f; ID = 19; } public override void Update() { base.Update(); PlayerController.instance.EnergyCurrent = 0f; PlayerController.instance.OverrideJumpCooldown(timerSelf); } public override void OnFinished() { base.OnFinished(); PlayerController.instance.EnergyCurrent = PlayerController.instance.EnergyStart; PlayerController.instance.OverrideJumpCooldown(0f); } public override Modifier Clone() { return new NoJumpAndSprint { isClone = true, Instance = this }; } } public class VoicePitch : Modifier { public float pitch; public float timeShit; public VoicePitch(float pitch, string name) : base("목소리 음조절", "목소리의 음을 조절합니다.") { minTimer = 30f; maxTimer = 60f; base.name = name; options.multiplayerOnly = true; this.pitch = pitch; ID = 20; } public override Modifier Clone() { return new VoicePitch(pitch, name) { isClone = true, Instance = this }; } public override void Update() { base.Update(); if (timeShit > 0f) { timeShit -= Time.unscaledDeltaTime; return; } timeShit = 0.5f; foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { PlayerVoiceChat internalVar = Util.GetInternalVar<PlayerVoiceChat>(item, "voiceChat"); internalVar.OverridePitch(pitch, 1f, 1f, 0.5f, 0f, 0f); } } } public class InvincibleOrb : Modifier { public InvincibleOrb() : base("evt_titanume_orb", "evt_titanume_orb_desc") { minTimer = 40f; maxTimer = 70f; ID = 21; } public override void Update() { base.Update(); EnemyValuable[] array = Object.FindObjectsByType<EnemyValuable>((FindObjectsSortMode)0); foreach (EnemyValuable val in array) { ((Component)val).GetComponent<PhysGrabObjectImpactDetector>().destroyDisable = true; } } public override Modifier Clone() { return new InvincibleOrb { isClone = true, Instance = this }; } } public class EyeBig : Modifier { public EyeBig() : base("evt_big_eyes", "evt_big_eyes_desc") { minTimer = 30f; maxTimer = 42.5f; options.multiplayerOnly = true; ID = 22; } public override void Update() { base.Update(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { item.OverridePupilSize(2f, 10, 1f, 1f, 5f, 0.5f, 0.1f); } } public override Modifier Clone() { return new EyeBig { isClone = true, Instance = this }; } } public class ReviveAllPlayers : Modifier { public ReviveAllPlayers() : base("evt_revive_all", "evt_revive_all_desc") { ID = 23; isOnce = true; } public override void Start() { base.Start(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { if (Util.GetInternalVar<bool>(item, "deadSet")) { item.Revive(false); item.playerHealth.Heal(1, true); } } } public override Modifier Clone() { return new ReviveAllPlayers { isClone = true, Instance = this }; } } public class SpawnValuables : Modifier { public SpawnValuables() : base("귀중품 소환", "무작위 귀중품을 아무 곳에 소환합니다.") { isOnce = true; options.oncePerLevel = true; ID = 24; } public override void Start() { base.Start(); } public override Modifier Clone() { return new SpawnValuables { isClone = true, Instance = this }; } } public class DisableLighting : Modifier { public AmbientMode ogAmbientMode; public Color ogAmbientLight; public DisableLighting() : base("evt_disable_all_lights", "evt_disable_all_lights_desc") { minTimer = 20f; maxTimer = 40f; ID = 25; } public override void Start() { //IL_0013: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) base.Start(); DisableLighting disableLighting = (DisableLighting)base.Instance; disableLighting.ogAmbientMode = RenderSettings