Decompiled source of ChaosMod v1.2.0
ChaosMod.dll
Decompiled a day 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.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 Photon.Pun; using Photon.Realtime; using REPOLib.Modules; using TMPro; using UnityEngine; using UnityEngine.AI; 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+17673c8bab141a510213c775e6cf5073c8fd16c1")] [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 { [CompilerGenerated] private sealed class <FindCar>d__17 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FindCar>d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)ChaosMod.Instance.carObject == (Object)null) { ChaosMod.Instance.carObject = GameObject.Find("Killer Joe(Clone)"); <>2__current = null; <>1__state = 1; return true; } AssetBundle car_assets = CarCrash.car_assets; ChaosMod.Instance.car = ChaosMod.Instance.carObject.AddComponent<CrazyCarAIScript>(); ChaosMod.Instance.car.honk = car_assets.LoadAsset<AudioClip>("car honk"); ChaosMod.Instance.car.exp_sprites = car_assets.LoadAssetWithSubAssets<Sprite>("spr_realisticexplosion").ToList(); if (ChaosMod.IsDebug) { ChaosMod.Logger.LogMessage((object)"Car Setup is done!"); } 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(); } } 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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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) 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 flag4 = ChaosMod.Instance.Exclude_Modifiers[tempMod.name]; bool flag5 = true; if ((multiplayerOnly && !GameManager.Multiplayer()) || (singleplayerOnly && GameManager.Multiplayer())) { flag5 = false; } if (ChaosMod.IsDebug) { MonoBehaviour.print((object)$"!isExcludedMod: {!flag} && chanceChoosen: {flag2} && hasTimerDoneOrIsOnce: {flag3} && isMultiplayerOnly: {multiplayerOnly} && !excludeOptions: {!flag4}"); } if (!(!flag && flag2 && flag3 && flag5) || flag4) { 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(); } [IteratorStateMachine(typeof(<FindCar>d__17))] private IEnumerator FindCar() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FindCar>d__17(0); } [PunRPC] public void FindCarRPC() { ((MonoBehaviour)this).StartCoroutine(FindCar()); } public void FartOnPlayer(PlayerAvatar avatar) { if (GameManager.Multiplayer()) { view.RPC("FartPlayerRPC", (RpcTarget)0, new object[1] { avatar.photonView.ViewID }); } } [PunRPC] private void FartPlayerRPC(int viewID) { PlayerAvatar component = ((Component)PhotonView.Find(viewID)).GetComponent<PlayerAvatar>(); PlayerVoiceChat internalVar = Util.GetInternalVar<PlayerVoiceChat>(component, "voiceChat"); AudioSource internalVar2 = Util.GetInternalVar<AudioSource>(internalVar, "audioSource"); } [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.0")] public class ChaosMod : BaseUnityPlugin { public static readonly bool DISABLE_TIMER; internal const float MaxEventTimer = 20f; internal List<EnemyParent> spawnedEnemys = new List<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<bool> ConfigKorean; internal ConfigEntry<int> ConfigBarColorR; internal ConfigEntry<int> ConfigBarColorG; internal ConfigEntry<int> ConfigBarColorB; internal ConfigEntry<bool> ConfigDizzyness; internal ConfigEntry<bool> ConfigFamilyFriendly; internal ConfigEntry<bool> ConfigDevMode; internal Dictionary<string, bool> Exclude_Modifiers = new Dictionary<string, bool>(); internal List<GameObject> PrefabToAddNetwork = new List<GameObject>(); private float canvasHeight; private float canvasWidth; internal GameObject timeBar; internal RectTransform textGroup; internal AssetBundle assets; internal TextMeshProUGUI creditTxt; internal TextMeshProUGUI DebugText; internal Image barImg; internal bool photonViewInited; internal GameObject carObject; internal CrazyCarAIScript car; internal AdManager adViewer; internal GameObject adObject; internal ChaosController controller; private float text_height = 55f; 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 float startTimer; private bool didReset; internal static ChaosMod Instance { get; private set; } internal static bool IsDebug { get { bool flag = true; 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() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Language.Init(); string text = Language.GetText("기본"); ConfigKorean = ((BaseUnityPlugin)this).Config.Bind<bool>(text, "한국어", false, "켜져 있으면 한국어를 사용합니다. If it's on, this mod will use korean."); ConfigBarColorR = ((BaseUnityPlugin)this).Config.Bind<int>(text, Language.GetText("게이지 빨간색 차지 비중"), 130, new ConfigDescription("바의 빨간 색입니다. Bar's Red Color.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 255), Array.Empty<object>())); ConfigBarColorG = ((BaseUnityPlugin)this).Config.Bind<int>(text, Language.GetText("게이지 초록색 차지 비중"), 0, new ConfigDescription("바의 초록 색입니다. Bar's Green Color.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 255), Array.Empty<object>())); ConfigBarColorB = ((BaseUnityPlugin)this).Config.Bind<int>(text, Language.GetText("게이지 파란색 차지 비중"), 0, new ConfigDescription("바의 파란 색입니다. Bar's Blue Color.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 255), Array.Empty<object>())); ConfigDizzyness = ((BaseUnityPlugin)this).Config.Bind<bool>(text, Language.GetText("어지러움"), true, "꺼져 있으면 어지러운 효과를 낮추거나 비활성화합니다. If it's off, disable or lowers some dizzy effect."); ConfigFamilyFriendly = ((BaseUnityPlugin)this).Config.Bind<bool>(text, Language.GetText("가족 친화적"), false, "켜져 있으면 비속어를 필터링합니다. (호스트 전용) If it's on, filters some bad words. (Host only)"); ConfigDevMode = ((BaseUnityPlugin)this).Config.Bind<bool>(text, Language.GetText("개발자 모드"), false, "말 그대로입니다. 개발자 모드죠. It's Devloper mode. Do I need to explan this??"); ConfigBarColorR.SettingChanged += delegate { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)barImg != (Object)null) { ((Graphic)barImg).color = new Color((float)ConfigBarColorR.Value / 255f, ((Graphic)barImg).color.g, ((Graphic)barImg).color.b, 1f); } }; ConfigBarColorG.SettingChanged += delegate { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)barImg != (Object)null) { ((Graphic)barImg).color = new Color(((Graphic)barImg).color.r, (float)ConfigBarColorG.Value / 255f, ((Graphic)barImg).color.b, 1f); } }; ConfigBarColorB.SettingChanged += delegate { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)barImg != (Object)null) { ((Graphic)barImg).color = new Color(((Graphic)barImg).color.r, ((Graphic)barImg).color.g, (float)ConfigBarColorB.Value / 255f, 1f); } }; ConfigDevMode.SettingChanged += delegate { DevMode = ConfigDevMode.Value; }; 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_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Expected O, but got Unknown //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Expected O, but got Unknown //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Expected O, but got Unknown //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Expected O, but got Unknown //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Expected O, but got Unknown //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Expected O, but got Unknown //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Expected O, but got Unknown //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_08e6: Expected O, but got Unknown //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Chaos Controller"); UICanvas = val.AddComponent<Canvas>(); UICanvas.sortingOrder = 999; UICanvas.renderMode = (RenderMode)0; CanvasScaler val2 = val.AddComponent<CanvasScaler>(); val2.screenMatchMode = (ScreenMatchMode)0; val.AddComponent<GraphicRaycaster>(); shaderOverlay = val.AddComponent<PostProcessVolume>(); GameObject val3 = new GameObject("Audio Sources"); val3.transform.parent = val.transform; val3.AddComponent<RectTransform>(); GameObject val4 = new GameObject("Enemy Sound Source"); val4.transform.parent = val3.transform; EnemyAS = val4.AddComponent<AudioSource>(); EnemyAS.dopplerLevel = 0f; EnemyAS.volume = 0.75f; EnemyAS.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; GameObject val5 = new GameObject("Rumble Sound Source"); val5.transform.parent = val3.transform; RumbleAS = val5.AddComponent<AudioSource>(); RumbleAS.dopplerLevel = 0f; RumbleAS.loop = true; RumbleAS.playOnAwake = false; RumbleAS.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; GameObject val6 = new GameObject("Master Sound Source"); val6.transform.parent = val3.transform; AudioSource = val6.AddComponent<AudioSource>(); AudioSource.dopplerLevel = 0f; AudioSource.playOnAwake = false; AudioSource.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; GameObject val7 = new GameObject("Club Music Source"); val7.transform.parent = val3.transform; ClubSource = val7.AddComponent<AudioSource>(); ClubSource.dopplerLevel = 0f; ClubSource.playOnAwake = false; ClubSource.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; GameObject val8 = Object.Instantiate<GameObject>(Resources.Load<GameObject>("valuables/04 big/Valuable Museum Boombox"), new Vector3(9E+09f, 0f, 0f), Quaternion.identity); val8.SetActive(false); ClubSource.clip = val8.GetComponent<ValuableBoombox>().soundBoomboxMusic.Sounds[0]; ClubSource.loop = true; Object.Destroy((Object)(object)val8); AudioReverbFilter val9 = val4.AddComponent<AudioReverbFilter>(); val9.reverbPreset = (AudioReverbPreset)8; val9.reverbLevel = 1f; val9.decayTime = 0.5f; ((Behaviour)val9).enabled = true; Rect rect = ((RectTransform)val.transform).rect; canvasHeight = ((Rect)(ref rect)).height; rect = ((RectTransform)val.transform).rect; canvasWidth = ((Rect)(ref rect)).width; Object.DontDestroyOnLoad((Object)(object)val); GameObject val10 = new GameObject("Scout TF2"); val10.transform.parent = val.transform; Util.RectTransformFullscreen(val10.AddComponent<RectTransform>()); ThinkFast.scout = val10.AddComponent<Image>(); GameObject val11 = new GameObject("Top Text"); RectTransform val12 = val11.AddComponent<RectTransform>(); val11.transform.parent = val.transform; Image val13 = val11.AddComponent<Image>(); ThinkFast.text1 = ((Component)val13).gameObject; val11.SetActive(false); val12.anchorMin = new Vector2(0.5f, 1f); val12.anchorMax = new Vector2(0.5f, 1f); val12.pivot = new Vector2(0.5f, 1f); val12.sizeDelta = new Vector2(674f, 94.5f); val12.anchoredPosition = new Vector2(0f, -40f); GameObject val14 = new GameObject("Bottom Text"); RectTransform val15 = val14.AddComponent<RectTransform>(); val14.transform.parent = val.transform; Image val16 = val14.AddComponent<Image>(); ThinkFast.text2 = ((Component)val16).gameObject; val14.SetActive(false); val15.anchorMin = new Vector2(0.5f, 0f); val15.anchorMax = new Vector2(0.5f, 0f); val15.pivot = new Vector2(0.5f, 0f); val15.sizeDelta = new Vector2(856f, 94.5f); val15.anchoredPosition = new Vector2(0f, 20f); GameObject val17 = new GameObject("Flash Sprite"); val17.transform.parent = val.transform; Util.RectTransformFullscreen(val17.AddComponent<RectTransform>()); ThinkFast.flash = val17.AddComponent<Image>(); ((Graphic)ThinkFast.flash).color = new Color(1f, 1f, 1f, 0f); timeBar = new GameObject("Time Bar"); timeBar.transform.parent = val.transform; timeBar.SetActive(false); Util.RectTransformFullscreen(timeBar.AddComponent<RectTransform>()); GameObject val18 = new GameObject("BG"); val18.transform.parent = timeBar.transform; GameObject val19 = new GameObject("FG"); val19.transform.parent = timeBar.transform; Image val20 = val18.AddComponent<Image>(); ((Graphic)val20).color = Color.black; ((Graphic)val20).rectTransform.anchorMin = Vector2.zero; ((Graphic)val20).rectTransform.anchorMax = Vector2.one; ((Graphic)val20).rectTransform.offsetMin = new Vector2(0f, canvasHeight - 30f); ((Graphic)val20).rectTransform.offsetMax = Vector2.zero; barImg = val19.AddComponent<Image>(); ((Graphic)barImg).color = new Color((float)ConfigBarColorR.Value / 255f, (float)ConfigBarColorG.Value / 255f, (float)ConfigBarColorB.Value / 255f, 1f); barRect = ((Graphic)barImg).rectTransform; barRect.anchorMin = Vector2.zero; barRect.anchorMax = Vector2.one; barRect.offsetMin = new Vector2(0f, canvasHeight - 25f); barRect.offsetMax = new Vector2(0f, -5f); GameObject val21 = new GameObject("Text Group"); val21.transform.parent = val.transform; textGroup = val21.AddComponent<RectTransform>(); textGroup.anchorMin = Vector2.zero; textGroup.anchorMax = Vector2.one; float num = canvasWidth / 2f; textGroup.offsetMin = new Vector2(num + num / 2f, 0f); textGroup.offsetMax = Vector2.zero; 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)"폰트 로드에 실패했습니다. 폰트가 깨질 수 있습니다."); } } RumbleAS.clip = assets.LoadAsset<AudioClip>("rumble"); RumbleAS.Stop(); SceneManager.sceneLoaded += OnSceneChange; photonViewInited = false; val13.sprite = assets.LoadAsset<Sprite>("THINK FAST"); val16.sprite = assets.LoadAsset<Sprite>("CHUCKLENUTS"); ThinkFast.scout.sprite = assets.LoadAsset<Sprite>("scout tf2"); val10.SetActive(false); GameObject val22 = new GameObject("Credit Text"); val22.transform.parent = val.transform; RectTransform val23 = val22.AddComponent<RectTransform>(); val23.anchorMin = Vector2.zero; val23.anchorMax = Vector2.one; val23.offsetMin = new Vector2(num + num / 2f, 0f); val23.offsetMax = Vector2.zero; creditTxt = val22.AddComponent<TextMeshProUGUI>(); ((TMP_Text)creditTxt).font = pretendard; ((TMP_Text)creditTxt).alignment = (TextAlignmentOptions)514; if (IsDebug) { TextMeshProUGUI obj = creditTxt; ((TMP_Text)obj).text = ((TMP_Text)obj).text + "\n<size=30>디버그 모드 활성화됨</size>"; } val22.SetActive(false); if (IsDebug) { GameObject val24 = new GameObject("Debug Text"); val24.transform.parent = val.transform; Vector2 val25 = Vector2.one * 100f; val23 = val24.AddComponent<RectTransform>(); val23.anchorMin = Vector2.zero; val23.anchorMax = Vector2.one; val23.offsetMin = val25; val23.offsetMax = val25 * -1f; DebugText = val24.AddComponent<TextMeshProUGUI>(); ((TMP_Text)DebugText).font = pretendard; ((TMP_Text)DebugText).text = ""; ((TMP_Text)DebugText).fontSize = 20f; } Exclude_Modifiers.Clear(); Modifiers.Init(delegate(Modifier mod) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown ConfigEntry<bool> config = ((BaseUnityPlugin)this).Config.Bind<bool>(Language.GetText("레벨 이벤트"), mod.GetName(), true, new ConfigDescription(mod.description, (AcceptableValueBase)null, Array.Empty<object>())); config.SettingChanged += delegate { OnEventSettingChanged(config, mod); }; OnEventSettingChanged(config, mod); }); 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. '-'"); } private void OnEventSettingChanged(ConfigEntry<bool> config, Modifier mod) { if (Exclude_Modifiers.ContainsKey(((ConfigEntryBase)config).Definition.Key)) { Exclude_Modifiers[mod.name] = !config.Value; } else { Exclude_Modifiers.Add(mod.name, !config.Value); } if (IsDebug) { Logger.LogInfo((object)$"이벤트 상태 변경: {mod.name} => {config.Value}"); } } 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) if (timeBar.activeSelf != Generated) { timeBar.SetActive(Generated); } 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; startTimer = 0f; if (((Component)creditTxt).gameObject.activeSelf) { ((Component)creditTxt).gameObject.SetActive(false); } if (IsDebug) { ((TMP_Text)DebugText).text = ""; } if (didReset) { return; } didReset = true; foreach (Modifier @event in Modifiers.Events) { @event.options.chance = 1f; } ModVars.Reset(); return; } if (didReset) { didReset = false; } if ((Object)(object)view == (Object)null || (Object)(object)controller == (Object)null) { photonViewInited = InitPhotonView(); } if ((Object)(object)carObject == (Object)null) { AssetBundle car_assets = CarCrash.car_assets; if (!GameManager.Multiplayer()) { carObject = Object.Instantiate<GameObject>(car_assets.LoadAsset<GameObject>("Killer Joe"), Vector3.zero, Quaternion.identity); car = carObject.AddComponent<CrazyCarAIScript>(); car.honk = car_assets.LoadAsset<AudioClip>("car honk"); car.exp_sprites = car_assets.LoadAssetWithSubAssets<Sprite>("spr_realisticexplosion").ToList(); } else if ((Object)(object)controller != (Object)null && (Object)(object)controller.view != (Object)null && SemiFunc.IsMasterClient()) { PhotonNetwork.Instantiate("Killer Joe", Vector3.zero, Quaternion.identity, (byte)0, (object[])null); } if (SemiFunc.IsMultiplayer()) { controller.FindCarRPC(); } } if (startTimer < 5f) { startTimer += Time.unscaledDeltaTime; if (!((Component)creditTxt).gameObject.activeSelf) { ((Component)creditTxt).gameObject.SetActive(true); } } else if (((Component)creditTxt).gameObject.activeSelf) { ((Component)creditTxt).gameObject.SetActive(false); } 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 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 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>(); } } } private 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>())); } [PunRPC] private void SpawnRPC() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (GameManager.Multiplayer()) { int num = (ChaosMod.Instance.ConfigFamilyFriendly.Value ? 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) 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); } } 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_00ed: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_00bd: 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)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); } } 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) if (photonEvent.Code == 1) { targetPos = (Vector3)photonEvent.CustomData; } } } public class SpawnMonster : Modifier { private string monsterPrefabPath = "enemies"; private GameObject[] monsters; public int count = 1; public SpawnMonster(int count) : base("몬스터 스폰", "몬스터를 스폰합니다.") { this.count = count; isOnce = true; name = $"몬스터 {count}마리 소환"; monsters = Resources.LoadAll<GameObject>(monsterPrefabPath); } 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("넘어지기", "강제로 넘어집니다.") { isOnce = true; } 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, string name) : base("게임 속도", "게임 속도를 늦추거나 빠르게 합니다.") { base.name = name; minTimer = 20f; maxTimer = 25f; this.mult = mult; } 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, name) { isClone = true, Instance = this }; } } public class KillAllMonsters : Modifier { public KillAllMonsters() : base("모든 몬스터 죽이기", "강제로 모든 몬스터를 죽입니다.") { isOnce = true; } 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("넓은 시야각", "시야각을 강제로 넓힙니다.") { minTimer = 20f; maxTimer = 30f; } public override void Update() { base.Update(); CameraZoom.Instance.OverrideZoomSet(ChaosMod.Instance.ConfigDizzyness.Value ? 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("모든 미닫이문 부수기", "모든 출입문, 서랍문 등이 부숴집니다.") { isOnce = true; } 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 string aud_name; public string modName; public int length; public List<AudioClip> sounds; public MonsterSound(string modName, string name, int length) : base("환청", "진짜일까요? 아니면 그냥 망상이였을까요?") { aud_name = name; this.length = length; this.modName = modName; base.name = modName; isOnce = true; sounds = new List<AudioClip>(); if (length <= 1) { sounds.Add(ChaosMod.Instance.assets.LoadAsset<AudioClip>(name)); return; } for (int i = 0; i < length; i++) { sounds.Add(ChaosMod.Instance.assets.LoadAsset<AudioClip>($"{name}{i}")); } } public override string GetName() { return Language.GetText("환청"); } public override void Start() { base.Start(); ((MonsterSound)base.Instance).options.chance -= 0.05f; if (length > 1) { ChaosMod.Instance.EnemyAS.PlayOneShot(sounds[Random.Range(1, length)], 0.5f); } else { ChaosMod.Instance.EnemyAS.PlayOneShot(sounds[0], 0.5f); } } public override Modifier Clone() { return new MonsterSound(name, aud_name, length) { isClone = true, Instance = this }; } } public class AddHealth : Modifier { public int amount; public AddHealth(int amount) : base("체력 추가", "플레이어를 힐하거나 딜합니다") { this.amount = amount; name = ((amount > 0) ? "+" : "") + $"{amount} HP"; isOnce = true; options.oncePerLevel = true; } 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("체력 숨기기", "체력 UI를 숨깁니다.") { minTimer = 20f; maxTimer = 35f; } 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("기력 숨기기", "에너지 UI를 숨깁니다.") { minTimer = 20f; maxTimer = 35f; } 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("화면 효과 비활성화", "화면에 적용된 효과를 제거합니다.") { minTimer = 30f; maxTimer = 60f; } 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("모든 서랍 문을 지도에 표시", "서랍 문, 냉장고 문 등을 지도에 표시합니다.") { isOnce = true; options.oncePerLevel = true; } 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 float chanceBefore; private GameObject rubberDuckPrefab; public List<ItemRubberDuck> ducks = new List<ItemRubberDuck>(); public DuckMadness() : base("축지법 쓰는 오리", "고무 오리가 축지법을 씁니다.") { minTimer = 25f; maxTimer = 30f; rubberDuckPrefab = Resources.Load<GameObject>(rubberDuckPath); if ((Object)(object)rubberDuckPrefab == (Object)null) { ChaosMod.Logger.LogError((object)"rubberDuckPrefab이 존재하지 않습니다!"); } } public override void Start() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) base.Start(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } chanceBefore = ((DuckMadness)base.Instance).options.chance; ((DuckMadness)base.Instance).options.chance = 0f; 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(); } public override Modifier Clone() { return new DuckMadness { isClone = true, Instance = this }; } } public class JumpJumpJump : Modifier { private float jumpTimer = 1f; public JumpJumpJump() : base("점핑! 예!", "플레이어가 1초마다 점프합니다.") { minTimer = 20f; maxTimer = 25f; } public override Modifier Clone() { return new JumpJumpJump { isClone = true, Instance = this }; } public override void Update() { base.Update(); if (jumpTimer > 0f) { jumpTimer -= Time.deltaTime; return; } jumpTimer = 1f; List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); foreach (PlayerAvatar item in list) { item.Jump(true); } CameraJump.instance.Jump(); } } public class SayRandomThnings : Modifier { public static string[] tries = new string[34] { "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!" }; 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("무작위 대사 말하기", "무작위 대사를 말합니다. (멀티플레이어 전용)") { isOnce = true; options.multiplayerOnly = true; } public override void Start() { //IL_00a9: 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_00d1: 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.ConfigFamilyFriendly.Value) { 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("지진", "강도 5.5의 지진") { minTimer = 15f; maxTimer = 20f; } public override Modifier Clone() { return new ShakeScreen { isClone = true, Instance = this }; } public override void Start() { base.Start(); if (ChaosMod.Instance.ConfigDizzyness.Value) { ChaosMod.Instance.RumbleAS.volume = 1f; ChaosMod.Instance.RumbleAS.Play(); } } public override void Update() { base.Update(); if (ChaosMod.Instance.ConfigDizzyness.Value) { GameDirector.instance.CameraShake.Shake(2f, 0.5f); GameDirector.instance.CameraImpact.Shake(2f, 0.5f); } } public override void OnFinished() { base.OnFinished(); if (ChaosMod.Instance.ConfigDizzyness.Value) { ((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, string name) : base("귀중품 가격 상승", "모든 귀중품의 가격을 올리거나 내립니다.") { isOnce = true; this.mult = mult; base.name = name; } public override Modifier Clone() { return new IncreaseValuableWorth(mult, name) { 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("회전회오리이이이", "몬스터 베이블레이드") { minTimer = 20f; maxTimer = 40f; } 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("친화적인 몬스터", "몬스터가 공격하지 않습니다.") { minTimer = 60f; maxTimer = 120f; } public override Modifier Clone() { FriendlyMonsters friendlyMonsters = new FriendlyMonsters(); friendlyMonsters.isClone = true; friendlyMonsters.Instance = this; friendlyMonsters.options.chance = options.chance; 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("점프 & 달리기 없음", "말 그대로.") { minTimer = 20f; maxTimer = 40f; } 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; } 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("티타늄 오브", "오브가 절대로 깨지지 않습니다.") { minTimer = 40f; maxTimer = 70f; } public override void Update() { base.Update(); EnemyValuab