using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DigitalRuby.ThunderAndLightning; using DiversityRemastered.Player; using DunGen.Graph; using GameNetcodeStuff; using HarmonyLib; using JLL.API; using JLL.API.Compatability; using JLL.API.Events; using JLL.API.JSON.Objects; using JLL.API.LevelProperties; using JLL.Components; using JLL.Components.Filters; using JLL.NetcodePatcher; using JLL.Patches; using JLL.ScriptableObjects; using LCCutscene; using LethalConfig; using LethalConfig.ConfigItems; using LethalLevelLoader; using LethalMoonUnlocks; using LittleCompany.modifications; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Unity.AI.Navigation; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Serialization; using WeatherRegistry; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("JLL")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("JLL")] [assembly: AssemblyTitle("JLL")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 JLL { [BepInPlugin("JacobG5.JLL", "JLL", "1.10.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class JLL : BaseUnityPlugin { private const string modGUID = "JacobG5.JLL"; private const string modName = "JLL"; private const string modVersion = "1.10.1"; private readonly Harmony harmony = new Harmony("JacobG5.JLL"); public static JLL Instance; internal ManualLogSource mls; internal ManualLogSource wesley; private static Transform JLLPrefabContainer; public GameObject networkObject; public JNetworkPrefabSet JLLNetworkPrefabs; internal GameObject ElevatorPrefab; public static ConfigEntry loggingLevel; public static ConfigEntry purgeWesley; public static ConfigEntry disableCutscenes; private void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance == (Object)null) { Instance = this; } JLLPrefabContainer = new GameObject("JLLPrefabContainer") { hideFlags = (HideFlags)61 }.transform; ((Component)JLLPrefabContainer).gameObject.SetActive(false); mls = Logger.CreateLogSource("JacobG5.JLL"); wesley = Logger.CreateLogSource("Wesley"); NetcodePatch(mls, typeof(JLLNetworkManager), typeof(DamageTriggerNetworking), typeof(ItemConsumer), typeof(JActionEvents), typeof(JBridgeTrigger), typeof(JClientSync), typeof(JDestructableObject), typeof(JPlayerInsideRegion), typeof(JTerminalController), typeof(RandomizedEvent), typeof(SeatController)); loggingLevel = ((BaseUnityPlugin)this).Config.Bind("Logging", "LoggingLevel", JLogLevel.User, "Changes the amount of logging JLL performs in it's scripts."); loggingLevel.SettingChanged += delegate { JLogHelper.UpdateLogLevel(); }; JLogHelper.UpdateLogLevel(); JLLNetworkPrefabs = ScriptableObject.CreateInstance(); JLLNetworkPrefabs.SetName = "JLL"; JLLNetworkPrefabs.AddPrefabs(new JNetworkPrefabSet.JIdentifiablePrefab { name = "JLL", prefab = (networkObject = CreateNetworkPrefab("JLL")) }, new JNetworkPrefabSet.JIdentifiablePrefab { name = "EmptyPrefab", prefab = (JNetworkPrefabSet.EmptyNetworkObject = CreateNetworkPrefab("EmptyPrefab")) }, new JNetworkPrefabSet.JIdentifiablePrefab { name = "ElevatorBody", prefab = (ElevatorPrefab = CreateNetworkPrefab("JLLElevator")) }); networkObject.AddComponent(); JNetworkPrefabSet.NetworkPrefabSets.Add(JLLNetworkPrefabs); purgeWesley = ((BaseUnityPlugin)this).Config.Bind("Logging", "PurgeWesley", false, "Destroys him."); if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LCCutscene)) { disableCutscenes = ((BaseUnityPlugin)this).Config.Bind("LCCutscene", "DisableJLLCutscenes", false, "A global shutoff for all cutscenes triggered by JLL using LCCutscene."); } if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalConfig)) { LethalConfigHelper.CreateJLLModConfig(); } HarmonyPatch(harmony, mls, typeof(ItemChargerPatch), typeof(TimeOfDayPatch), typeof(HudManagerPatch), typeof(StartOfRoundPatch), typeof(RoundManagerPatch), typeof(LungPropPatch), typeof(VehicleControllerPatch), typeof(MenuManagerPatch), typeof(BreakerBoxPatch), typeof(ItemDropshipPatch), typeof(GameNetworkManagerPatch), typeof(StormyWeatherPatch)); JFileHelper.LoadFilesInPlugins(); } public static GameObject CreateNetworkPrefab(string name) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown GameObject val = new GameObject("JLL") { hideFlags = (HideFlags)61 }; val.transform.SetParent(JLLPrefabContainer); byte[] value = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Assembly.GetCallingAssembly().GetName().Name + name)); Traverse.Create((object)val.AddComponent()).Field("GlobalObjectIdHash").SetValue((object)BitConverter.ToUInt32(value, 0)); return val; } public static void HarmonyPatch(Harmony harmony, ManualLogSource logSource, params Type[] patches) { foreach (Type type in patches) { try { harmony.PatchAll(type); } catch (Exception arg) { logSource.LogError((object)$"Caught Error while trying to patch {type.Name}\n{arg}"); } } } public static void NetcodePatch(ManualLogSource logSource) { NetcodePatch(logSource, Assembly.GetCallingAssembly().GetTypes()); } public static void NetcodePatch(ManualLogSource logSource, params Type[] types) { foreach (Type type in types) { try { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array = methods; foreach (MethodInfo methodInfo in array) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } catch { logSource.LogInfo((object)"Skipping Netcode Class"); } } logSource.LogInfo((object)"Netcode Successfully Patched!"); } } } namespace JLL.ScriptableObjects { [CreateAssetMenu(menuName = "JLL/JLevelProperties")] public class JLevelProperties : ScriptableObject { [Header("-=-EXPERIMENTAL-=-")] public JLevelPropertyEntry Properties = new JLevelPropertyEntry(); } public abstract class JLLAddon : ScriptableObject { public abstract void Init(JLLMod parent); } [CreateAssetMenu(menuName = "JLL/JLLMod")] public class JLLMod : ScriptableObject { [Serializable] public class ConfigValue { public string configName = "Example"; public string configCategory = "Main"; public string configDescription = ""; public T defaultValue; } private static readonly List m_ModList = new List(); public string modAuthor = ""; public string modName = ""; [Header("Network Prefabs")] public JNetworkPrefabSet[] prefabSets = new JNetworkPrefabSet[0]; [Header("Config Values")] public List> Booleans = new List>(); public List> Strings = new List>(); public List> Integers = new List>(); public List> Floats = new List>(); [Header("JLL Addons")] public JLLAddon[] jllAddons = new JLLAddon[0]; public static JLLMod GetMod(string name, string author) { return GetMod(author + "." + name); } public static JLLMod GetMod(string guid) { for (int i = 0; i < m_ModList.Count; i++) { if (m_ModList[i].GUID() == guid) { return m_ModList[i]; } } return null; } public static JLLMod[] GetModsFromAuthor(string author) { List list = new List(); for (int i = 0; i < m_ModList.Count; i++) { if (m_ModList[i].modAuthor == author) { list.Add(m_ModList[i]); } } return list.ToArray(); } public string GUID() { return modAuthor + "." + modName; } public bool Invalid() { return Utility.IsNullOrWhiteSpace(modAuthor) || Utility.IsNullOrWhiteSpace(modName); } public bool HasConfigs() { return Booleans.Count + Strings.Count + Integers.Count + Floats.Count > 0; } internal void Init() { if (!m_ModList.Contains(this)) { m_ModList.Add(this); } for (int i = 0; i < prefabSets.Length; i++) { if (!JNetworkPrefabSet.NetworkPrefabSets.Contains(prefabSets[i])) { JNetworkPrefabSet.NetworkPrefabSets.Add(prefabSets[i]); } } for (int j = 0; j < jllAddons.Length; j++) { try { jllAddons[j].Init(this); } catch (Exception arg) { JLogHelper.LogError($"JLL Addon failed to initialize from {GUID()}: {arg}"); } } } public JNetworkPrefabSet GetNetworkPrefabSet(string name) { for (int i = 0; i < prefabSets.Length; i++) { if (prefabSets[i].SetName == name) { return prefabSets[i]; } } return null; } } [CreateAssetMenu(menuName = "JLL/JNetworkPrefabSet")] public class JNetworkPrefabSet : ScriptableObject { [Serializable] public class JIdentifiablePrefab : IWeightedItem { public string name; public GameObject prefab; [Range(0f, 100f)] public int Weight = 20; public int GetWeight() { return Weight; } } public static readonly List NetworkPrefabSets = new List(); public string SetName; public JIdentifiablePrefab[] prefabList = new JIdentifiablePrefab[1] { new JIdentifiablePrefab() }; public static GameObject EmptyNetworkObject { get; internal set; } public void AddPrefabs(params JIdentifiablePrefab[] prefabsToAdd) { List list = prefabList.ToList(); list.AddRange(prefabsToAdd); prefabList = list.ToArray(); } public void AddPrefab(string name, GameObject prefab, int weight = 20) { AddPrefabs(new JIdentifiablePrefab { name = name, prefab = prefab, Weight = weight }); } internal static void RegisterPrefabs() { NetworkManager component = ((Component)GameNetworkManager.Instance).GetComponent(); List list = new List(); foreach (NetworkPrefab prefab in component.NetworkConfig.Prefabs.Prefabs) { list.Add(prefab.Prefab); } int num = 0; foreach (JNetworkPrefabSet networkPrefabSet in NetworkPrefabSets) { for (int i = 0; i < networkPrefabSet.prefabList.Length; i++) { if (!((Object)(object)networkPrefabSet.prefabList[i].prefab == (Object)null) && !list.Contains(networkPrefabSet.prefabList[i].prefab)) { try { component.AddNetworkPrefab(networkPrefabSet.prefabList[i].prefab); num++; JLogHelper.LogInfo("Registered Network Object: " + networkPrefabSet.prefabList[i].name + " (" + ((Object)networkPrefabSet.prefabList[i].prefab).name + ")", JLogLevel.Wesley); } catch (Exception arg) { JLogHelper.LogError($"JLL Addon failed to register network object: {arg}"); } } } } JLogHelper.LogInfo($"Registered {num} Network Objects"); } public GameObject GetPrefab(string name) { for (int i = 0; i < prefabList.Length; i++) { if (prefabList[i].name == name) { return prefabList[i].prefab; } } return EmptyNetworkObject; } public bool GetPrefab(string name, out GameObject prefab) { for (int i = 0; i < prefabList.Length; i++) { if (prefabList[i].name == name) { prefab = prefabList[i].prefab; return true; } } prefab = EmptyNetworkObject; return false; } public GameObject GetRandomPrefab() { return prefabList.GetWeightedRandom().prefab; } } } namespace JLL.Patches { [HarmonyPatch(typeof(BreakerBox))] internal static class BreakerBoxPatch { [HarmonyPatch("SwitchBreaker")] [HarmonyPostfix] public static void patchSwitchBreaker(bool on) { for (int i = 0; i < JLevelEventTriggers.EventTriggers.Count; i++) { JLevelEventTriggers.EventTriggers[i].ToggleBreakerBox(on); } } [HarmonyPatch("SetSwitchesOff")] [HarmonyPostfix] public static void patchSetSwitchesOff() { for (int i = 0; i < JLevelEventTriggers.EventTriggers.Count; i++) { JLevelEventTriggers.EventTriggers[i].ToggleBreakerBox(active: false); } } } [HarmonyPatch(typeof(GameNetworkManager))] internal static class GameNetworkManagerPatch { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(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 (!JFileHelper.HaveJLLBundlesLoaded) { JLogHelper.LogInfo($"{JFileHelper.JLLBundlesLoaded} {JFileHelper.LLLBundlesLoaded}"); <>2__current = null; <>1__state = 1; return true; } JNetworkPrefabSet.RegisterPrefabs(); 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 static bool registeredPrefabs; [HarmonyPatch("Start")] [HarmonyPostfix] public static void patchStart(GameNetworkManager __instance) { if (!registeredPrefabs) { registeredPrefabs = true; ((MonoBehaviour)__instance).StartCoroutine(RegisterNetworkPrefabs()); } } [IteratorStateMachine(typeof(d__2))] private static IEnumerator RegisterNetworkPrefabs() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0); } } [HarmonyPatch(typeof(HUDManager))] internal static class HudManagerPatch { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; JHudHelper.isTipActive = false; JHudHelper.DisplayNextTip(); 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 JWaterFilter customFilter; [HarmonyPatch("UnderwaterScreenFilters")] [HarmonyPrefix] public static bool patchUnderwaterScreenFilters(HUDManager __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayer = __instance.localPlayer; if ((Object)(object)__instance.localPlayer != (Object)null) { bool flag = false; PlayerControllerB spectatedPlayerScript = localPlayer.spectatedPlayerScript; if (localPlayer.isPlayerDead && (Object)(object)spectatedPlayerScript != (Object)null && (Object)(object)spectatedPlayerScript.underwaterCollider != (Object)null) { Bounds bounds = spectatedPlayerScript.underwaterCollider.bounds; if (((Bounds)(ref bounds)).Contains(((Component)StartOfRound.Instance.spectateCamera).transform.position)) { flag = true; ((Component)spectatedPlayerScript.underwaterCollider).TryGetComponent(ref customFilter); } } if ((Object)(object)customFilter == (Object)null && !localPlayer.isPlayerDead && (Object)(object)localPlayer.underwaterCollider != (Object)null) { ((Component)localPlayer.underwaterCollider).TryGetComponent(ref customFilter); } if ((Object)(object)customFilter != (Object)null) { if (__instance.setUnderwaterFilter || flag) { customFilter.UnderwaterFilters(__instance, flag); __instance.breathingUnderwaterAudio.volume = Mathf.Lerp(__instance.breathingUnderwaterAudio.volume, 1f, 10f * Time.deltaTime); if ((Object)(object)customFilter.customUnderwaterSounds != (Object)null) { customFilter.customUnderwaterSounds.volume = __instance.breathingUnderwaterAudio.volume; } } else { if (__instance.audioListenerLowPass.cutoffFrequency >= 19000f) { ((Behaviour)__instance.audioListenerLowPass).enabled = false; } else { __instance.audioListenerLowPass.cutoffFrequency = Mathf.Lerp(__instance.audioListenerLowPass.cutoffFrequency, 20000f, 10f * Time.deltaTime); } if (customFilter.underwaterFilter.weight < 0.05f) { customFilter.underwaterFilter.weight = 0f; __instance.breathingUnderwaterAudio.Stop(); if ((Object)(object)customFilter.customUnderwaterSounds != (Object)null) { customFilter.customUnderwaterSounds.Stop(); } customFilter = null; } else { __instance.breathingUnderwaterAudio.volume = Mathf.Lerp(__instance.breathingUnderwaterAudio.volume, 0f, 10f * Time.deltaTime); if ((Object)(object)customFilter.customUnderwaterSounds != (Object)null) { customFilter.customUnderwaterSounds.volume = __instance.breathingUnderwaterAudio.volume; } customFilter.underwaterFilter.weight = Mathf.Lerp(customFilter.underwaterFilter.weight, 0f, 10f * Time.deltaTime); } } return false; } } return true; } [HarmonyPatch("DisplayTip")] [HarmonyPrefix] public static void patchDisplayTip(HUDManager __instance) { JHudHelper.isTipActive = true; ((MonoBehaviour)__instance).StartCoroutine(TipQueueCheck()); } [IteratorStateMachine(typeof(d__3))] private static IEnumerator TipQueueCheck() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0); } } [HarmonyPatch(typeof(ItemCharger))] internal static class ItemChargerPatch { [HarmonyPatch("chargeItemDelayed")] [HarmonyPrefix] public static void patchChargeItemDelayed(ItemCharger __instance) { ChargeLimiter chargeLimiter = default(ChargeLimiter); if (((Component)__instance).TryGetComponent(ref chargeLimiter)) { JLogHelper.LogInfo("Found Limiter"); chargeLimiter.Charge(); } } } [HarmonyPatch(typeof(ItemDropship))] internal static class ItemDropshipPatch { [HarmonyPatch("OpenShipDoorsOnServer")] [HarmonyPostfix] public static void patchOpenShipDoorsOnServer(ItemDropship __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) JItemDropshipModifier jItemDropshipModifier = default(JItemDropshipModifier); if (!((Component)__instance).TryGetComponent(ref jItemDropshipModifier)) { return; } GrabbableObject val = default(GrabbableObject); for (int i = 0; i < __instance.itemSpawnPositions.Length; i++) { Collider[] array = Physics.OverlapSphere(__instance.itemSpawnPositions[i].position, 0.5f, 64); for (int j = 0; j < array.Length; j++) { if (((Component)array[j]).gameObject.TryGetComponent(ref val)) { JLogHelper.LogInfo("Found dropship item! " + val.itemProperties.itemName, JLogLevel.Wesley); jItemDropshipModifier.ModifyDroppedItems(val); } } } } } public static class JTranspilerHelper { [CompilerGenerated] private sealed class d__1 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private string debugName; public string <>3__debugName; private CodeOperation operation; public CodeOperation <>3__operation; private List 5__1; private int 5__2; private IEnumerator <>s__3; private CodeInstruction 5__4; private List.Enumerator <>s__5; private CodeInstruction 5__6; CodeInstruction IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__1 = null; <>s__3 = null; 5__4 = null; <>s__5 = default(List.Enumerator); 5__6 = null; <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new List(); 5__2 = 0; <>s__3 = instructions.GetEnumerator(); try { while (<>s__3.MoveNext()) { 5__4 = <>s__3.Current; 5__1.Add(5__4); if (operation.Check(5__4, ref 5__1)) { 5__2++; } 5__4 = null; } } finally { if (<>s__3 != null) { <>s__3.Dispose(); } } <>s__3 = null; JLogHelper.LogInfo($"Patched {debugName}: {5__2}"); <>s__5 = 5__1.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; 5__6 = null; break; } if (<>s__5.MoveNext()) { 5__6 = <>s__5.Current; <>2__current = 5__6; <>1__state = 1; return true; } <>m__Finally1(); <>s__5 = default(List.Enumerator); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__5).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__1 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__1(0); } d__.instructions = <>3__instructions; d__.debugName = <>3__debugName; d__.operation = <>3__operation; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } [CompilerGenerated] private sealed class d__2 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private string debugName; public string <>3__debugName; private CodeOperation[] operations; public CodeOperation[] <>3__operations; private List 5__1; private int[] 5__2; private int 5__3; private IEnumerator <>s__4; private CodeInstruction 5__5; private int 5__6; private CodeOperation[] <>s__7; private int <>s__8; private CodeOperation 5__9; private List.Enumerator <>s__10; private CodeInstruction 5__11; CodeInstruction IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__1 = null; 5__2 = null; <>s__4 = null; 5__5 = null; <>s__7 = null; 5__9 = null; <>s__10 = default(List.Enumerator); 5__11 = null; <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new List(); 5__2 = new int[operations.Length]; 5__3 = 0; while (5__3 < 5__2.Length) { 5__2[5__3] = 0; 5__3++; } <>s__4 = instructions.GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; 5__1.Add(5__5); 5__6 = 0; while (5__6 < operations.Length) { if (operations[5__6].Check(5__5, ref 5__1)) { 5__2[5__6]++; <>s__7 = operations; for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++) { 5__9 = <>s__7[<>s__8]; 5__9.matches = 0; 5__9 = null; } <>s__7 = null; break; } 5__6++; } 5__5 = null; } } finally { if (<>s__4 != null) { <>s__4.Dispose(); } } <>s__4 = null; JLogHelper.LogInfo("Patched " + debugName + ": [" + string.Join(", ", 5__2) + "]"); <>s__10 = 5__1.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; 5__11 = null; break; } if (<>s__10.MoveNext()) { 5__11 = <>s__10.Current; <>2__current = 5__11; <>1__state = 1; return true; } <>m__Finally1(); <>s__10 = default(List.Enumerator); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__10).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__2 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__2(0); } d__.instructions = <>3__instructions; d__.debugName = <>3__debugName; d__.operations = <>3__operations; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } public static IEnumerable CodeEdit(IEnumerable instructions, string debugName, CodeTest[] search, Action> action) { return CodeEdit(instructions, debugName, new CodeOperation(search, action)); } [IteratorStateMachine(typeof(d__1))] public static IEnumerable CodeEdit(IEnumerable instructions, string debugName, CodeOperation operation) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(-2) { <>3__instructions = instructions, <>3__debugName = debugName, <>3__operation = operation }; } [IteratorStateMachine(typeof(d__2))] public static IEnumerable MultiCodeEdit(IEnumerable instructions, string debugName, params CodeOperation[] operations) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(-2) { <>3__instructions = instructions, <>3__debugName = debugName, <>3__operations = operations }; } public static IEnumerable AddAfter(IEnumerable instructions, string debugName, CodeTest[] search, MethodInfo methodInfo, MethodParams methodParams = MethodParams.Empty, bool replace = false) { IEnumerable paramInstructions = ((IEnumerable)GetCodes(methodParams)).Select((Func)((OpCode code) => new CodeInstruction(code, (object)null))); Action> action = (replace ? ((Action>)delegate(List list) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown for (int i = 0; i < search.Length; i++) { list.RemoveAt(list.Count - 1); } list.AddRange(paramInstructions); list.Add(new CodeInstruction(OpCodes.Call, (object)methodInfo)); }) : ((Action>)delegate(List list) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown list.AddRange(paramInstructions); list.Add(new CodeInstruction(OpCodes.Call, (object)methodInfo)); })); return CodeEdit(instructions, debugName, new CodeOperation(search, action)); } public static IEnumerable AddAfter(IEnumerable instructions, string debugName, MethodInfo orig, MethodInfo methodInfo, MethodParams methodParams = MethodParams.Empty, bool replace = false) { List list = new List(); list.AddRange(from code in GetCodes(methodParams) select new CodeTest(code)); list.Add(new CodeTest(OpCodes.Call, (CodeInstruction code) => CodeInstructionExtensions.Calls(code, orig))); return AddAfter(instructions, debugName, list.ToArray(), methodInfo, methodParams, replace); } public static IEnumerable AddAfter(IEnumerable instructions, string debugName, FieldInfo orig, MethodInfo methodInfo, MethodParams methodParams = MethodParams.Empty, bool replace = false) { List list = new List(); list.AddRange(from code in GetCodes(methodParams) select new CodeTest(code)); list.Add(new CodeTest(OpCodes.Ldfld, (CodeInstruction code) => CodeInstructionExtensions.LoadsField(code, orig, false))); return AddAfter(instructions, debugName, list.ToArray(), methodInfo, methodParams, replace); } private static OpCode[] GetCodes(MethodParams methodParams) { if (1 == 0) { } OpCode[] result = methodParams switch { MethodParams.Self => new OpCode[1] { OpCodes.Ldarg_0 }, MethodParams.EnumerableSelf => new OpCode[1] { OpCodes.Ldloc_1 }, _ => Array.Empty(), }; if (1 == 0) { } return result; } } public struct CodeTest { public OpCode? OpCode; public Func Test; public CodeTest(OpCode code) { OpCode = code; Test = null; } public CodeTest(Func test) { OpCode = null; Test = test; } public CodeTest(OpCode code, Func test) { OpCode = code; Test = test; } public readonly bool Validate(CodeInstruction code) { if (OpCode.HasValue) { OpCode opcode = code.opcode; OpCode? opCode = OpCode; if (opcode != opCode) { return false; } } if (Test == null) { return true; } return Test(code); } } public class CodeOperation { public CodeTest[] Test; public Action> Action; public int matches; public CodeOperation(CodeTest[] test, Action> action) { Test = test; Action = action; matches = 0; base..ctor(); } public bool Check(CodeInstruction instruction, ref List newInstructions) { if (Test[matches].Validate(instruction)) { matches++; if (matches == Test.Length) { Action(newInstructions); matches = 0; return true; } } else { matches = 0; } return false; } } public enum MethodParams { Empty, Self, EnumerableSelf } [HarmonyPatch(typeof(LungProp))] internal static class LungPropPatch { private static EnemyType VanillaRadMech; [HarmonyPatch("EquipItem")] [HarmonyPrefix] public static void patchEquipItem(LungProp __instance) { if (__instance.isLungDocked) { if ((Object)(object)VanillaRadMech == (Object)null) { VanillaRadMech = JLevelPropertyRegistry.GetRegisteredEnemy("RadMech"); } __instance.radMechEnemyType = VanillaRadMech; JLevelPropertyRegistry.ApparatusPulled = true; for (int i = 0; i < JLevelEventTriggers.EventTriggers.Count; i++) { JLevelEventTriggers.EventTriggers[i].InvokeApparatus(); } } } } [HarmonyPatch(typeof(MenuManager))] internal static class MenuManagerPatch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void patchStart() { JLevelPropertyRegistry.RemoveLevelOverrides(); } } [HarmonyPatch(typeof(RoundManager))] internal static class RoundManagerPatch { [HarmonyPatch("FinishGeneratingLevel")] [HarmonyPrefix] public static void spawnFinishGeneratingLevel() { JMaterialReplacer[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { if (array[i].triggerPostDunGen) { array[i].SearchAndReplace(); } } } [HarmonyPatch("FinishGeneratingNewLevelClientRpc")] [HarmonyPostfix] public static void patchPostLevelGeneration() { if (JLevelPropertyRegistry.IsLevelGenerated) { return; } JLevelPropertyRegistry.ApplyLevelOverrides(); IDungeonLoadListener[] array = Object.FindObjectsOfType().OfType().ToArray(); if (array.Length != 0) { for (int i = 0; i < array.Length; i++) { array[i].PostDungeonGeneration(); } } } } [HarmonyPatch(typeof(StartOfRound))] internal static class StartOfRoundPatch { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List 5__1; private SelectableLevel 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = new List(); 5__2 = Object.FindObjectOfType().testAllEnemiesLevel; FindEnemyTypes(5__2.Enemies, ref 5__1); FindEnemyTypes(5__2.OutsideEnemies, ref 5__1); FindEnemyTypes(5__2.DaytimeEnemies, ref 5__1); JLevelPropertyRegistry.AllSortedEnemies.Clear(); JLevelPropertyRegistry.AllSortedEnemies.AddRange(5__1); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartOfRound_Start(StartOfRound __instance) { if (((NetworkBehaviour)__instance).IsHost || ((NetworkBehaviour)__instance).IsServer) { GameObject val = Object.Instantiate(JLL.Instance.networkObject); val.GetComponent().Spawn(false); JLogHelper.LogInfo("JLL Network Manager Initialized.", JLogLevel.User); } ((MonoBehaviour)__instance).StartCoroutine(StoreDefaults()); } [IteratorStateMachine(typeof(d__1))] private static IEnumerator StoreDefaults() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0); } private static void FindEnemyTypes(List spawnableEnemies, ref List enemyTypes) { for (int i = 0; i < spawnableEnemies.Count; i++) { if ((Object)(object)spawnableEnemies[i].enemyType != (Object)null && !enemyTypes.Contains(spawnableEnemies[i].enemyType)) { enemyTypes.Add(spawnableEnemies[i].enemyType); } } } [HarmonyPatch("EndOfGame")] [HarmonyPrefix] public static void patchEndOfGame() { JWeatherOverride.Instance = null; if ((Object)(object)HudManagerPatch.customFilter != (Object)null) { HudManagerPatch.customFilter.underwaterFilter.weight = 0f; HudManagerPatch.customFilter = null; } JLevelPropertyRegistry.RemoveLevelOverrides(); } [HarmonyPatch("OnShipLandedMiscEvents")] [HarmonyPrefix] public static void patchOnShipLandedMiscEvents() { for (int i = 0; i < JLevelEventTriggers.EventTriggers.Count; i++) { JLevelEventTriggers.EventTriggers[i].ShipLanded.Invoke(); } } [HarmonyPatch("ShipLeave")] [HarmonyPrefix] public static void patchShipLeave() { for (int i = 0; i < JLevelEventTriggers.EventTriggers.Count; i++) { JLevelEventTriggers.EventTriggers[i].ShipLeaving.Invoke(); } } } [HarmonyPatch(typeof(StormyWeather))] internal static class StormyWeatherPatch { [HarmonyPatch("LightningStrike")] [HarmonyPostfix] public static void patchLightningStrike(Vector3 strikePosition) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) foreach (JLightningRod item in JLightningRod.All) { if (Vector3.Distance(strikePosition, ((Component)item).transform.position) < item.detectDist) { item.onStrike.Invoke(); } } } } [HarmonyPatch(typeof(TimeOfDay))] internal static class TimeOfDayPatch { [HarmonyReversePatch(/*Could not decode attribute arguments.*/)] [HarmonyPatch(typeof(TimeOfDay), "DisableWeatherEffect")] public static void DisableWeatherEffect(object instance, WeatherEffect effect) { throw new NotImplementedException("It's a stub"); } [HarmonyReversePatch(/*Could not decode attribute arguments.*/)] [HarmonyPatch(typeof(TimeOfDay), "fadeOutEffect")] public static IEnumerator fadeOutEffect(object instance, WeatherEffect effect, Vector3 moveFromPosition) { throw new NotImplementedException("It's a stub"); } [HarmonyPatch("DisableWeatherEffect")] [HarmonyPrefix] public static void DisableWeatherEffect(WeatherEffect effect) { JWeatherOverride instance = JWeatherOverride.Instance; if ((Object)(object)instance != (Object)null) { WeatherEffect overrideEffect = instance.getOverrideEffect(effect.name); if (overrideEffect != null && (Object)(object)overrideEffect.effectObject != (Object)null) { overrideEffect.effectObject.SetActive(false); } } } [HarmonyPatch("DisableAllWeather")] [HarmonyPrefix] public static void DisableAllWeather(bool deactivateObjects) { JWeatherOverride instance = JWeatherOverride.Instance; if (!((Object)(object)instance != (Object)null)) { return; } for (int i = 0; i < instance.overrideEffects.Length; i++) { WeatherEffect val = instance.overrideEffects[i]; val.effectEnabled = false; if (deactivateObjects && (Object)(object)val.effectObject != (Object)null) { val.effectObject.SetActive(false); } } } [HarmonyPatch("MoveTimeOfDay")] [HarmonyTranspiler] private static IEnumerable MoveTimeOfDay_Transpiler(IEnumerable instructions) { FieldInfo HourField = AccessTools.Field(typeof(TimeOfDay), "hour"); FieldInfo PrevHourField = AccessTools.Field(typeof(TimeOfDay), "previousHour"); MethodInfo methodInfo = AccessTools.Method(typeof(TimeOfDayPatch), "ProgressHour", (Type[])null, (Type[])null); return JTranspilerHelper.AddAfter(instructions, "MoveTimeOfDay", new CodeTest[4] { new CodeTest(OpCodes.Ldarg_0), new CodeTest(OpCodes.Ldarg_0), new CodeTest(OpCodes.Ldfld, (CodeInstruction code) => CodeInstructionExtensions.LoadsField(code, HourField, false)), new CodeTest(OpCodes.Stfld, (CodeInstruction code) => CodeInstructionExtensions.StoresField(code, PrevHourField)) }, methodInfo, MethodParams.Self); } private static void ProgressHour(TimeOfDay timeOfDay) { try { foreach (JLevelEventTriggers eventTrigger in JLevelEventTriggers.EventTriggers) { JLevelEventTriggers.HourEvent[] hourlyEvents = eventTrigger.hourlyEvents; foreach (JLevelEventTriggers.HourEvent hourEvent in hourlyEvents) { if (hourEvent.hour == timeOfDay.hour) { hourEvent.hourEvent.Invoke(); } } } } catch (Exception ex) { JLogHelper.LogError(ex.ToString()); } } } [HarmonyPatch(typeof(VehicleController))] public static class VehicleControllerPatch { [HarmonyReversePatch(/*Could not decode attribute arguments.*/)] [HarmonyPatch(typeof(VehicleController), "DealPermanentDamage")] public static void DealPermanentDamage(object instance, int damageAmount, Vector3 damagePosition = default(Vector3)) { throw new NotImplementedException("It's a stub"); } } } namespace JLL.Components { public class AttatchToObject : MonoBehaviour { public Transform parent; public bool attatchPos = true; public bool attatchRot = true; private void Update() { UpdatePosition(); } private void LateUpdate() { UpdatePosition(); } public void UpdatePosition() { //IL_003d: 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) if (!((Object)(object)parent == (Object)null) && Object.op_Implicit((Object)(object)parent)) { if (attatchPos) { ((Component)this).transform.position = parent.position; } if (attatchRot) { ((Component)this).transform.rotation = parent.rotation; } } } } public class ChargeLimiter : MonoBehaviour { public int charges = 1; public InteractTrigger trigger; public GameObject disableObject; public void Charge() { charges--; if (charges <= 0) { SetHasCharge(value: false); } } public void SetHasCharge(bool value) { BoxCollider val = default(BoxCollider); if ((Object)(object)trigger != (Object)null && ((Component)trigger).TryGetComponent(ref val)) { ((Collider)val).enabled = value; } if ((Object)(object)disableObject != (Object)null) { disableObject.SetActive(value); } } public void AddCharges(int amount) { charges += amount; } } public class ClientSeperator : MonoBehaviour { [Tooltip("Event run for the given client.")] public InteractEvent eventsForClient = new InteractEvent(); [Tooltip("Event run for every client except the given one.")] public UnityEvent eventsForEveryoneElse = new UnityEvent(); public void SeperateClientEvents(PlayerControllerB player) { if (player.IsLocalPlayer()) { ((UnityEvent)(object)eventsForClient).Invoke(player); } else { eventsForEveryoneElse.Invoke(); } } } public class DamageTrigger : MonoBehaviour { [Serializable] public class DamageTarget { public bool enabled = false; public int damage = 1; public bool applyDamageMultiplier = true; public bool playCustomSounds = true; public UnityEvent hitEvent = new UnityEvent(); public int GetTotalDamage(float multiplier = 1f) { if (applyDamageMultiplier) { return Mathf.RoundToInt((float)damage * multiplier); } return damage; } } [SerializeField] public CauseOfDeath damageSource = (CauseOfDeath)0; public Vector3 hitDir = Vector3.zero; public RotationType hitRotation = RotationType.ObjectRotation; [Tooltip("Check RoundManager in the Ship Scene for corpse IDs\nA negative copseType will result in no corpse spawning.")] public int corpseType = 0; public Mesh OverrideCorpseMesh; public bool attachCorpseToPoint = false; public Transform corpseAttachPoint; public PlayerBone connectedBone = PlayerBone.Base; public bool matchPointExactly = false; [Tooltip("Negative number will stay stuck to a point indefinately.")] public float corpseStickTime = 2f; [Header("NetworkHelper")] [Tooltip("This is only required to trigger some network related events.")] public DamageTriggerNetworking DamageTriggerNetworking; [Header("Conditions")] [Tooltip("Damage when something enters a trigger collider")] public bool damageOnEnter = true; [Tooltip("Damage when something exits a trigger collider")] public bool damageOnExit = false; [Tooltip("Damage when something collides with a non trigger collider")] public bool damageOnCollision = true; [Header("Continuous Damage")] [Tooltip("Continuously damages anything inside of it's trigger collider")] public bool continuousDamage = true; [Tooltip("Continuously calculates a raycast and attempts to damage the whatever the ray hits")] public bool continuousRaycastDamage = false; public float hitInterval = 0.5f; private float timer = 0f; [Header("Raycast")] public float raycastLength = 6f; public Transform[] raycastDirections = Array.Empty(); public LayerMask raycastMask = LayerMask.op_Implicit(1202194760); [Header("Targets")] public float damageMultiplier = 1f; [Tooltip("Players have 100 HP")] public DamageTarget playerTargets = new DamageTarget(); [Tooltip("Any instance of EnemyAICollisionDetect converted to EnemyAI")] public DamageTarget enemyTargets = new DamageTarget(); [Tooltip("The Company Cruiser has 30 HP")] public DamageTarget vehicleTargets = new DamageTarget(); [Tooltip("Anything that is damageable by shovels but not one of the things above")] public DamageTarget objectTargets = new DamageTarget(); [Header("SFX")] public bool playNormalDamageSFX = true; public AudioClip[] clips = Array.Empty(); public AudioSource[] sources = Array.Empty(); private readonly Dictionary collidersInside = new Dictionary(); private readonly List markedForRemoval = new List(); private readonly List foundInside = new List(); private void Start() { if ((Object)(object)DamageTriggerNetworking != (Object)null) { DamageTriggerNetworking.DamageTrigger = this; } } public void OnTriggerStay(Collider collider) { foundInside.Add(((Component)collider).gameObject); if (collidersInside.ContainsKey(((Component)collider).gameObject)) { return; } int num = IdentifyCollider(((Component)collider).gameObject); if (!IsTargetDead(((Component)collider).gameObject, num)) { collidersInside.Add(((Component)collider).gameObject, num); if (damageOnEnter) { DamageType(((Component)collider).gameObject, num); } } } public void FixedUpdate() { foreach (KeyValuePair item in collidersInside) { if (!foundInside.Contains(item.Key)) { if (damageOnExit) { DamageType(item.Key, item.Value); } markedForRemoval.Add(item.Key); } } foundInside.Clear(); } public void OnDisable() { collidersInside.Clear(); } public void OnCollisionEnter(Collision collision) { if (damageOnCollision) { int num = IdentifyCollider(collision.gameObject); if (num != -1) { DamageType(collision.gameObject, num); } } } private void OnDrawGizmos() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (raycastLength > 0f) { for (int i = 0; i < raycastDirections.Length; i++) { Gizmos.color = Color.red; Gizmos.DrawRay(((Component)this).transform.position, GetRayDirection(raycastDirections[i]) * raycastLength); } } } public void Update() { for (int i = 0; i < markedForRemoval.Count; i++) { collidersInside.Remove(markedForRemoval[i]); } markedForRemoval.Clear(); if (!continuousDamage && !continuousRaycastDamage) { return; } timer -= Time.deltaTime; if (timer <= 0f) { timer = hitInterval; if (continuousDamage) { DamageAllInside(); } if (continuousRaycastDamage) { DamageRaycast(); } } } public void DamageAllInside() { foreach (KeyValuePair item in collidersInside) { DamageType(item.Key, item.Value); } } private void DamageType(GameObject target, int type) { switch (type) { case 0: if (playerTargets.enabled) { DamagePlayer(target.GetComponent()); } break; case 1: if (enemyTargets.enabled) { DamageEnemy(target.GetComponent().mainScript); } break; case 2: if (vehicleTargets.enabled) { DamageVehicle(target.GetComponent()); } break; case 3: if (objectTargets.enabled) { DamageObject(target.GetComponent()); } break; } } public static bool IsTargetDead(GameObject target, int type) { if (1 == 0) { } bool result = type switch { 0 => target.GetComponent().isPlayerDead, 1 => target.GetComponent().mainScript.isEnemyDead, 2 => target.GetComponent().carDestroyed, _ => false, }; if (1 == 0) { } return result; } public void DamageRaycast() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (!(raycastLength > 0f)) { return; } RaycastHit val = default(RaycastHit); for (int i = 0; i < raycastDirections.Length; i++) { if (Physics.Raycast(((Component)this).transform.position, GetRayDirection(raycastDirections[i]), ref val, raycastLength, LayerMask.op_Implicit(raycastMask))) { int num = IdentifyCollider(((Component)((RaycastHit)(ref val)).collider).gameObject); if (num != -1) { DamageType(((Component)((RaycastHit)(ref val)).collider).gameObject, num); } } } } private Vector3 GetRayDirection(Transform target) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) Vector3 val = target.position - ((Component)this).transform.position; return ((Vector3)(ref val)).normalized; } public static int IdentifyCollider(GameObject target) { if (target.CompareTag("Player")) { PlayerControllerB val = default(PlayerControllerB); if (target.TryGetComponent(ref val)) { return 0; } } else if (target.CompareTag("Enemy")) { EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); if (target.TryGetComponent(ref val2)) { return 1; } } else { VehicleController val3 = default(VehicleController); if (target.TryGetComponent(ref val3)) { return 2; } IHittable val4 = default(IHittable); if (target.TryGetComponent(ref val4)) { return 3; } } return -1; } private Vector3 CalcHitDir(Transform target) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0037: 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_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) RotationType rotationType = hitRotation; if (1 == 0) { } Vector3 result = (Vector3)(rotationType switch { RotationType.ObjectRotation => Quaternion.AngleAxis(((Component)this).transform.rotation.y, Vector3.up) * hitDir, RotationType.RandomRotation => Quaternion.AngleAxis(Random.Range(0f, 360f), Vector3.up) * hitDir, _ => hitDir, }); if (1 == 0) { } return result; } public void SetDamageMultiplier(float multiplier) { damageMultiplier = multiplier; } public void DamagePlayer(PlayerControllerB player) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_006f: Unknown result type (might be due to invalid IL or missing references) if (player.isPlayerDead) { markedForRemoval.Add(((Component)player).gameObject); return; } int totalDamage = playerTargets.GetTotalDamage(damageMultiplier); CauseOfDeath val = damageSource; Vector3 val2 = CalcHitDir(((Component)player).transform); player.DamagePlayer(totalDamage, playNormalDamageSFX, true, val, Mathf.Clamp(corpseType, 0, StartOfRound.Instance.playerRagdolls.Count - 1), false, val2); playerTargets.hitEvent.Invoke(player); if (player.isPlayerDead) { if ((Object)(object)DamageTriggerNetworking != (Object)null) { DamageTriggerNetworking.DamageTriggerKilledPlayerServerRpc(player.Index()); } else if (corpseType < 0) { JLLNetworkManager.Instance.DestroyPlayerCorpse(player); } } if (playerTargets.playCustomSounds) { PlayCustomAudio(); } } public void SetPlayerDamage(int damage) { playerTargets.damage = damage; } public void DamageEnemy(EnemyAI enemy) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (enemy.isEnemyDead) { markedForRemoval.Add(((Component)enemy).gameObject); return; } enemy.HitEnemyOnLocalClient(enemyTargets.GetTotalDamage(damageMultiplier), CalcHitDir(((Component)enemy).transform), (PlayerControllerB)null, playNormalDamageSFX, -1); enemyTargets.hitEvent.Invoke(enemy); if ((((NetworkBehaviour)RoundManager.Instance).IsHost || ((NetworkBehaviour)RoundManager.Instance).IsServer) && enemy.isEnemyDead && (Object)(object)DamageTriggerNetworking != (Object)null) { DamageTriggerNetworking.DamageTriggerKilledServerRpc(1); } if (enemyTargets.playCustomSounds) { PlayCustomAudio(); } } public void SetEnemyDamage(int damage) { enemyTargets.damage = damage; } public void DamageVehicle(VehicleController vehicle) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (vehicle.carDestroyed) { markedForRemoval.Add(((Component)vehicle).gameObject); return; } VehicleControllerPatch.DealPermanentDamage(vehicle, vehicleTargets.GetTotalDamage(damageMultiplier), CalcHitDir(((Component)vehicle).transform)); vehicleTargets.hitEvent.Invoke(vehicle); if (((NetworkBehaviour)vehicle).IsOwner && vehicle.carDestroyed && (Object)(object)DamageTriggerNetworking != (Object)null) { DamageTriggerNetworking.DamageTriggerKilledServerRpc(2); } if (vehicleTargets.playCustomSounds) { PlayCustomAudio(); } } public void SetVehicleDamage(int damage) { vehicleTargets.damage = damage; } public void DamageObject(IHittable obj) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) int totalDamage = objectTargets.GetTotalDamage(damageMultiplier); MonoBehaviour val = (MonoBehaviour)(object)((obj is MonoBehaviour) ? obj : null); obj.Hit(totalDamage, CalcHitDir((val != null) ? ((Component)val).transform : ((Component)this).transform), (PlayerControllerB)null, playNormalDamageSFX, -1); objectTargets.hitEvent.Invoke(obj); if (objectTargets.playCustomSounds) { PlayCustomAudio(); } } public void SetObjectDamage(int damage) { objectTargets.damage = damage; } private void PlayCustomAudio() { if (clips.Length != 0 && sources.Length != 0) { AudioClip clip = clips[Random.Range(0, clips.Length)]; AudioSource[] array = sources; foreach (AudioSource val in array) { val.clip = clip; val.Play(); } } } } public class DamageTriggerNetworking : NetworkBehaviour { private class PlayerCorpse { public PlayerControllerB player; public float startTime = 0f; public float stickTime = 0f; public bool permaStuck = false; private bool stuck = false; private bool initialized = false; public bool Update(DamageTrigger trigger) { if (permaStuck && initialized) { return true; } if ((Object)(object)player.deadBody != (Object)null) { if (!initialized) { if (trigger.corpseType < 0) { Object.Destroy((Object)(object)((Component)player.deadBody).gameObject); player.deadBody = null; return false; } if (permaStuck) { OverrideModel(trigger); } if (trigger.attachCorpseToPoint && (Object)(object)trigger.corpseAttachPoint != (Object)null) { JLogHelper.LogInfo("Attatching " + player.playerUsername + "'s corpse to " + ((Object)trigger.corpseAttachPoint).name); player.deadBody.matchPositionExactly = trigger.matchPointExactly; player.deadBody.attachedTo = trigger.corpseAttachPoint; player.deadBody.attachedLimb = player.deadBody.bodyParts[(int)trigger.connectedBone]; stuck = true; } initialized = true; } if (!(stickTime > 0f)) { OverrideModel(trigger); return false; } if (stuck) { stickTime -= Time.deltaTime; } if (stickTime <= 0f) { DetachCorpse(); } } else if (Time.realtimeSinceStartup - startTime > 2f) { JLogHelper.LogInfo("Player Corpse could not be found after two seconds!"); return false; } return true; } public void OverrideModel(DamageTrigger trigger) { if ((Object)(object)trigger.OverrideCorpseMesh != (Object)null) { player.deadBody.ChangeMesh(trigger.OverrideCorpseMesh, (Material)null); } } public void DetachCorpse() { JLogHelper.LogInfo("Releasing " + player.playerUsername + "'s corpse"); player.deadBody.matchPositionExactly = false; player.deadBody.attachedTo = null; player.deadBody.attachedLimb = null; stuck = false; permaStuck = false; stickTime = 0f; } } public DamageTrigger DamageTrigger; [Tooltip("Warning!\nThe player will be dead at the time of this event. Be careful what you do when passing a player to another method that you don't break anything.")] public InteractEvent PlayerKilled = new InteractEvent(); public UnityEvent EnemyKilled = new UnityEvent(); public UnityEvent VehicleKilled = new UnityEvent(); private readonly List playerCorpses = new List(); private readonly List removeCorpses = new List(); private void Update() { if ((Object)(object)DamageTrigger == (Object)null || playerCorpses.Count <= 0) { return; } for (int i = 0; i < playerCorpses.Count; i++) { if (!playerCorpses[i].Update(DamageTrigger)) { removeCorpses.Add(playerCorpses[i]); } } for (int j = 0; j < removeCorpses.Count; j++) { playerCorpses.Remove(removeCorpses[j]); } removeCorpses.Clear(); } [ServerRpc(RequireOwnership = false)] public void DamageTriggerKilledPlayerServerRpc(int playerTarget) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1067576157u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1067576157u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DamageTriggerKilledClientRpc(0, playerTarget); } } } [ServerRpc(RequireOwnership = true)] public void DamageTriggerKilledServerRpc(int type) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3711696475u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, type); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3711696475u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DamageTriggerKilledClientRpc(type); } } [ClientRpc] private void DamageTriggerKilledClientRpc(int type, int playerTarget = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3159405848u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, type); BytePacker.WriteValueBitPacked(val2, playerTarget); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3159405848u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)DamageTrigger == (Object)null) { JLogHelper.LogWarning(((Object)this).name + " DamageTriggerNetworking is missing a linked DamageTrigger!"); return; } switch (type) { case 0: if (playerTarget >= 0 && playerTarget < RoundManager.Instance.playersManager.allPlayerScripts.Length) { PlayerCorpse playerCorpse = new PlayerCorpse { player = StartOfRound.Instance.allPlayerScripts[playerTarget], startTime = Time.realtimeSinceStartup, stickTime = Mathf.Abs(DamageTrigger.corpseStickTime), permaStuck = (DamageTrigger.corpseStickTime < 0f) }; playerCorpses.Add(playerCorpse); ((UnityEvent)(object)PlayerKilled).Invoke(playerCorpse.player); } break; case 1: EnemyKilled.Invoke(); break; case 2: VehicleKilled.Invoke(); break; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1067576157u, new RpcReceiveHandler(__rpc_handler_1067576157), "DamageTriggerKilledPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3711696475u, new RpcReceiveHandler(__rpc_handler_3711696475), "DamageTriggerKilledServerRpc"); ((NetworkBehaviour)this).__registerRpc(3159405848u, new RpcReceiveHandler(__rpc_handler_3159405848), "DamageTriggerKilledClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1067576157(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((DamageTriggerNetworking)(object)target).DamageTriggerKilledPlayerServerRpc(playerTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3711696475(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int type = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref type); target.__rpc_exec_stage = (__RpcExecStage)1; ((DamageTriggerNetworking)(object)target).DamageTriggerKilledServerRpc(type); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3159405848(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int type = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref type); int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((DamageTriggerNetworking)(object)target).DamageTriggerKilledClientRpc(type, playerTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DamageTriggerNetworking"; } } public class DamageZoneTrigger : MonoBehaviour { [Header("-=-DEPRICATED-=-")] [SerializeField] public CauseOfDeath damageSource = (CauseOfDeath)0; public Vector3 hitDir = Vector3.zero; public int corpseType = 0; [Header("Conditions")] public bool damageOnEnter = true; public bool damageOnExit = false; public bool damageOnCollision = true; [Header("Damage")] public bool damagePlayers = true; public int damageForPlayers = 1; public bool damageEnemies = true; public int damageForEnemies = 1; public bool damageVehicles = false; public int damageForVehicles = 1; public bool damageObjects = false; public int damageForObjects = 1; [Header("Continuous Damage")] public bool continuousDamage = true; public float hitInterval = 0.5f; private float timer = 0f; [Header("SFX")] public bool playNormalDamageSFX = true; public AudioClip[] clips = Array.Empty(); public AudioSource[] sources = Array.Empty(); [Header("Player")] public InteractEvent OnPlayerDamaged = new InteractEvent(); private List playersInside = new List(); private List creaturesInside = new List(); private List vehiclesInside = new List(); private List objectsInside = new List(); public void OnTriggerEnter(Collider collider) { switch (DamageTarget(((Component)collider).gameObject, damageOnEnter)) { case 0: playersInside.Add(((Component)collider).GetComponent()); break; case 1: creaturesInside.Add(((Component)collider).GetComponent().mainScript); break; case 2: vehiclesInside.Add(((Component)collider).GetComponent()); break; case 3: objectsInside.Add(((Component)collider).GetComponent()); break; } } public void OnTriggerExit(Collider collider) { switch (DamageTarget(((Component)collider).gameObject, damageOnExit)) { case 0: playersInside.Remove(((Component)collider).GetComponent()); break; case 1: creaturesInside.Remove(((Component)collider).GetComponent().mainScript); break; case 2: vehiclesInside.Remove(((Component)collider).GetComponent()); break; case 3: objectsInside.Remove(((Component)collider).GetComponent()); break; } } public void OnCollisionEnter(Collision collision) { DamageTarget(collision.gameObject, damageOnCollision); } public void Update() { if (continuousDamage) { timer -= Time.deltaTime; if (timer <= 0f) { timer = hitInterval; DamageAllInside(); } } } public void DamageAllInside() { if (damagePlayers) { for (int i = 0; i < playersInside.Count; i++) { if (!playersInside[i].isPlayerDead) { DamagePlayer(playersInside[i]); } } } if (damageEnemies) { for (int j = 0; j < creaturesInside.Count; j++) { if (!creaturesInside[j].isEnemyDead) { DamageEnemy(creaturesInside[j]); } } } if (damageVehicles) { for (int k = 0; k < vehiclesInside.Count; k++) { DamageVehicle(vehiclesInside[k]); } } if (damageObjects) { for (int l = 0; l < objectsInside.Count; l++) { DamageObject(objectsInside[l]); } } } private int DamageTarget(GameObject target, bool condition = true) { if (target.CompareTag("Player")) { PlayerControllerB val = default(PlayerControllerB); if (target.TryGetComponent(ref val)) { if (condition && damagePlayers && !val.isPlayerDead) { DamagePlayer(val); } return 0; } } else if (target.CompareTag("Enemy")) { EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); if (target.TryGetComponent(ref val2)) { if (condition && damageEnemies && !val2.mainScript.isEnemyDead) { DamageEnemy(val2.mainScript); } return 1; } } else { VehicleController val3 = default(VehicleController); if (target.TryGetComponent(ref val3)) { if (condition && damageVehicles && !val3.carDestroyed) { DamageVehicle(val3); } return 2; } IHittable obj = default(IHittable); if (target.TryGetComponent(ref obj)) { if (condition && damageObjects) { DamageObject(obj); } return 3; } } return -1; } public void DamagePlayer(PlayerControllerB player, bool playCustomAudio = true) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) int num = damageForPlayers; CauseOfDeath val = damageSource; Vector3 val2 = hitDir; player.DamagePlayer(num, playNormalDamageSFX, true, val, Mathf.Clamp(corpseType, 0, StartOfRound.Instance.playerRagdolls.Count), false, val2); if (playCustomAudio) { PlayCustomAudio(); } ((UnityEvent)(object)OnPlayerDamaged).Invoke(player); } public void DamageEnemy(EnemyAI enemy, bool playCustomAudio = true) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) enemy.HitEnemyOnLocalClient(damageForEnemies, hitDir, (PlayerControllerB)null, playNormalDamageSFX, -1); if (playCustomAudio) { PlayCustomAudio(); } } public void DamageVehicle(VehicleController vehicle, bool playCustomAudio = true) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) VehicleControllerPatch.DealPermanentDamage(vehicle, damageForVehicles, hitDir); if (playCustomAudio) { PlayCustomAudio(); } } public void DamageObject(IHittable obj, bool playCustomAudio = true) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) obj.Hit(damageForObjects, hitDir, (PlayerControllerB)null, playNormalDamageSFX, -1); if (playCustomAudio) { PlayCustomAudio(); } } private void PlayCustomAudio() { if (clips.Length != 0 && sources.Length != 0) { AudioClip clip = clips[Random.Range(0, clips.Length)]; AudioSource[] array = sources; foreach (AudioSource val in array) { val.clip = clip; val.Play(); } } } } [RequireComponent(typeof(Animator))] public class DayCycleAnimator : MonoBehaviour { private Animator anim; [Tooltip("Scale of time the animation synced to the day progression will use. A value of 1 plays the animation from beginning to end once. Numbers larger than 1 requires the animation to have looping enabled otherwise it will stop on the final frame.")] [FormerlySerializedAs("timeScale")] public float fixedAnimEndTime = 1f; public void Start() { anim = ((Component)this).GetComponent(); } public void FixedUpdate() { float num = Mathf.Max(0f, TimeOfDay.Instance.currentDayTime - 100f); float num2 = num / TimeOfDay.Instance.totalTime; anim.SetFloat("time", num2 * fixedAnimEndTime); } public void SetFixedAnimTime(float time) { fixedAnimEndTime = time; } } public class DelayScript : MonoBehaviour { public class QueuedEvent { public PlayerControllerB target = null; public float timer; } [FormerlySerializedAs("waitOnAwake")] public bool waitOnEnabled = false; public bool clearOnDisable = false; public float delaySeconds = 2f; [Tooltip("Event run after StartWaiting() is called by another event.")] public UnityEvent events = new UnityEvent(); [Tooltip("Only gets triggered if a player is given on the StartWaiting() call.")] public InteractEvent playerEvents = new InteractEvent(); private readonly List queuedEvents = new List(); private readonly List expiredEvents = new List(); public void OnEnable() { if (waitOnEnabled) { StartWaiting(); } } public void OnDisable() { if (clearOnDisable) { ClearEventQueue(); } } public void Update() { for (int i = 0; i < queuedEvents.Count; i++) { queuedEvents[i].timer -= Time.deltaTime; if (queuedEvents[i].timer <= 0f) { expiredEvents.Add(queuedEvents[i]); } } if (expiredEvents.Count <= 0) { return; } for (int j = 0; j < expiredEvents.Count; j++) { events.Invoke(); if ((Object)(object)expiredEvents[j].target != (Object)null) { ((UnityEvent)(object)playerEvents).Invoke(expiredEvents[j].target); } queuedEvents.Remove(expiredEvents[j]); } expiredEvents.Clear(); } public void StartWaiting(PlayerControllerB player) { queuedEvents.Add(new QueuedEvent { timer = delaySeconds, target = player }); } public void StartWaiting() { JLogHelper.LogInfo($"{((Object)this).name} started waiting {delaySeconds}"); queuedEvents.Add(new QueuedEvent { timer = delaySeconds }); } public void StartWaiting(float delay) { JLogHelper.LogInfo($"{((Object)this).name} started waiting {delay}"); queuedEvents.Add(new QueuedEvent { timer = delay }); } public void StartWaiting(int delay) { JLogHelper.LogInfo($"{((Object)this).name} started waiting {delay}"); queuedEvents.Add(new QueuedEvent { timer = delay }); } public void ClearEventQueue() { queuedEvents.Clear(); } } public class EnemySpawner : MonoBehaviour { [Serializable] public class WeightedEnemyRefrence { public string enemyName = ""; public EnemyType enemyType; [Range(0f, 100f)] public int rarity; } [Tooltip("Determines weather to spawn a random enemy from the pool or to spawn the specified type")] public bool spawnRandom = false; public RotationType spawnRotation = RotationType.ObjectRotation; public List randomPool = new List(); public string enemyName = ""; public EnemyType type; [Tooltip("Ran after an enemy spawns. Enemy provided is the one that was just spawned.")] public EnemyEvent SpawnedEvent = new EnemyEvent(); [Header("NavMesh")] [Tooltip("The max distance from this transform that a navmesh will be found")] public float navMeshRange = 10f; [Header("Misc")] [FormerlySerializedAs("spawnOnAwake")] public bool spawnOnEnable = false; public bool checkRegistry = true; public bool spawnNests = true; public bool respectEnemyCap = false; public PowerCap respectPowerCap = PowerCap.None; public static float GetRot(RotationType rotation, float yRot = 0f) { if (1 == 0) { } float result = rotation switch { RotationType.ObjectRotation => yRot, RotationType.RandomRotation => Random.Range(0f, 360f), _ => 0f, }; if (1 == 0) { } return result; } public static Quaternion GetRot(RotationType rotation, Quaternion refrence) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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) //IL_0045: 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_003a: Unknown result type (might be due to invalid IL or missing references) if (1 == 0) { } Quaternion result = (Quaternion)(rotation switch { RotationType.ObjectRotation => refrence, RotationType.RandomRotation => Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), _ => Quaternion.identity, }); if (1 == 0) { } return result; } public void Awake() { if (!checkRegistry) { return; } if (!string.IsNullOrEmpty(enemyName)) { type = JLevelPropertyRegistry.GetRegisteredEnemy(enemyName); } else if ((Object)(object)type != (Object)null) { type = JLevelPropertyRegistry.GetRegisteredEnemy(type); } if (randomPool.Count > 0) { for (int i = 0; i < randomPool.Count; i++) { if (!string.IsNullOrEmpty(randomPool[i].enemyName)) { EnemyType registeredEnemy = JLevelPropertyRegistry.GetRegisteredEnemy(randomPool[i].enemyName); if ((Object)(object)registeredEnemy != (Object)null) { randomPool[i].enemyType = registeredEnemy; } } else if ((Object)(object)randomPool[i].enemyType != (Object)null) { randomPool[i].enemyType = JLevelPropertyRegistry.GetRegisteredEnemy(randomPool[i].enemyType); } else { JLogHelper.LogWarning($"({((Object)this).name}) Enemy spawner is missing enemy at {i}", JLogLevel.Debuging); } } } else { for (int j = 0; j < JLevelPropertyRegistry.AllSortedEnemies.Count; j++) { WeightedEnemyRefrence item = new WeightedEnemyRefrence { enemyType = JLevelPropertyRegistry.AllSortedEnemies[j], rarity = 10 }; randomPool.Add(item); } } checkRegistry = false; } public void OnEnable() { if (spawnOnEnable) { SpawnEnemy(); } } public void SpawnEnemy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SpawnEnemy(((Component)this).transform.position); } public void SpawnEnemy(GameObject target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SpawnEnemy(target.transform.position); } public void SpawnEnemy(MonoBehaviour target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SpawnEnemy(((Component)target).transform.position); } public void SpawnEnemy(Vector3 pos) { //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)RoundManager.Instance).IsHost && !((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } EnemyType enemyType; if (spawnRandom) { int weightedIndex = GetWeightedIndex(); JLogHelper.LogInfo($"({((Object)this).name}) Attempting to spawn enemy at index {weightedIndex}"); enemyType = randomPool[weightedIndex].enemyType; } else { enemyType = type; } if ((Object)(object)enemyType != (Object)null) { if (respectEnemyCap && enemyType.numberSpawned > enemyType.MaxCount) { return; } float powerLevel = enemyType.PowerLevel; PowerCap powerCap = respectPowerCap; if (1 == 0) { } float num = powerCap switch { PowerCap.Indoor => RoundManager.Instance.currentMaxInsidePower - RoundManager.Instance.currentEnemyPower, PowerCap.Daytime => (float)RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount - RoundManager.Instance.currentDaytimeEnemyPower, PowerCap.Nighttime => RoundManager.Instance.currentMaxOutsidePower - RoundManager.Instance.currentOutsideEnemyPower, _ => 1000000f, }; if (1 == 0) { } if (powerLevel > num || !((Object)(object)enemyType.enemyPrefab != (Object)null)) { return; } bool flag; NavMeshHit val = default(NavMeshHit); if ((flag = NavMesh.SamplePosition(pos, ref val, navMeshRange, -1)) || navMeshRange < 0f) { if (spawnNests && (Object)(object)enemyType.nestSpawnPrefab != (Object)null && enemyType.requireNestObjectsToSpawn && enemyType.isOutsideEnemy && !HasNest(enemyType)) { JLogHelper.LogInfo("(" + ((Object)this).name + ") Spawning Missing Outside Nest for: " + enemyType.enemyName); RoundManager.Instance.SpawnNestObjectForOutsideEnemy(enemyType, new Random()); RoundManager.Instance.SyncNestSpawnObjectsOrderServerRpc(RoundManager.Instance.enemyNestSpawnObjects.Select((EnemyAINestSpawnObject nest) => NetworkObjectReference.op_Implicit(((Component)nest).GetComponent())).ToArray()); } JLogHelper.LogInfo($"({((Object)this).name}) Spawning: {enemyType.enemyName} at {pos}"); GameObject val2 = NetworkObjectReference.op_Implicit(RoundManager.Instance.SpawnEnemyGameObject(flag ? ((NavMeshHit)(ref val)).position : pos, GetRot(spawnRotation, ((Component)((Component)this).transform).transform.eulerAngles.y), 0, enemyType)); EnemyAI val3 = default(EnemyAI); if (val2.TryGetComponent(ref val3)) { ((UnityEvent)SpawnedEvent).Invoke(val3); } } else { JLogHelper.LogInfo("(" + ((Object)this).name + ") Failed to spawn. (Couldn't Find NavMesh. If try increasing the EnemySpawner's navMeshDistance if you're having an issue.)"); } } else { JLogHelper.LogWarning("(" + ((Object)this).name + ") Enemy Spawner tried to spawn a null EnemyType!"); } } private bool HasNest(EnemyType enemyType) { foreach (EnemyAINestSpawnObject enemyNestSpawnObject in RoundManager.Instance.enemyNestSpawnObjects) { if ((Object)(object)enemyNestSpawnObject == (Object)null || !((Object)(object)enemyNestSpawnObject.enemyType == (Object)(object)enemyType)) { continue; } return true; } return false; } private int GetWeightedIndex() { int num = 0; for (int i = 0; i < randomPool.Count; i++) { num += randomPool[i].rarity; } int num2 = Random.Range(0, num); for (int j = 0; j < randomPool.Count; j++) { num2 -= randomPool[j].rarity; if (num2 <= 0) { return j; } } return Random.Range(0, randomPool.Count); } } public enum ColliderType { Unknown = -1, Player, Enemy, Vehicle, Object } public enum PlayerBone { Base = 6, Neck = 0, Spine = 5, RightArmUpper = 9, LeftArmUpper = 10, RightArmLower = 1, LeftArmLower = 2, RightThigh = 7, LeftThigh = 8, RightShin = 3, LeftShin = 4 } public enum RotationType { ObjectRotation, RandomRotation, NoRotation } public enum PowerCap { None, Indoor, Daytime, Nighttime } public enum SpawnPoolSource { CustomList, AllItems, LevelItems, StoreItems } public enum ActiveCondition { None, ActiveOutdoors, ActiveIndoors, ActiveOutdoorsOutsideShip } public enum SpawnRotation { Random, FacingWall, FacingAwayFromWall, BackToWall } public enum SpawnNodes { Children, OutsideAINodes, InsideAINodes, AINodes } public enum NavMeshToRebake { None = 0, Exterior = 1, Custom = -1 } public enum RandomTeleportRegion { Indoor, Outdoor, Moon, Nearby, RandomPlayer } public enum Region { None, Outdoor, Indoor } public enum TeleportEffect { None, ShipTeleport, InverseTeleport } public enum PlayerTarget { Local, Closest, Farthest } public class EventLimiter : MonoBehaviour { public int maxTriggers = 1; public UnityEvent Event = new UnityEvent(); public InteractEvent PlayerEvent = new InteractEvent(); public void Trigger() { Trigger(null); } public void Trigger(PlayerControllerB player) { if (maxTriggers > 0) { maxTriggers--; Event.Invoke(); if ((Object)(object)player != (Object)null) { ((UnityEvent)(object)PlayerEvent).Invoke(player); } } } public void AddUses(int num) { maxTriggers += num; } public void SetUses(int num) { maxTriggers = num; } } public class ExplosiveEmitter : MonoBehaviour { [Header("Explosion Size")] [FormerlySerializedAs("explodeOnAwake")] public bool explodeOnEnabled = false; public float killDistance = 5.7f; public float damageRange = 6f; [Header("Damage Properties")] public int nonLethalDamage = 50; public float pushForce = 0f; public bool goThroughCar = false; public GameObject overrideEffect = null; public bool spawnParticles = true; [Header("Screen Shake Emmision")] [FormerlySerializedAs("shakeOnAwake")] public bool shakeOnEnabled = false; [Tooltip("Bridge Destroyed Default: 30")] public float strongDistance = -1f; [Tooltip("Bridge Destroyed Default: 50")] public float longDistance = -1f; [Tooltip("Landmine Default: 14")] public float bigDistance = 14f; [Tooltip("Landmine Default = 25")] public float smallDistance = 25f; [Header("Stun Explosion")] [FormerlySerializedAs("stunOnAwake")] public bool stunOnEnabled = false; public bool affectAudio = true; public float flashSeverityMultiplier = 1f; public float enemyStunTime = 7.5f; public float flashSeverityDistanceRolloff = 1f; public void OnEnabled() { if (explodeOnEnabled) { Explode(); } if (shakeOnEnabled) { DistanceShakeScreen(); } if (stunOnEnabled) { StunFlash(); } } public void Explode() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Explode(((Component)this).transform.position); } public void Explode(MonoBehaviour target) { Explode(((Component)target).gameObject); } public void Explode(GameObject target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Explode(target.transform.position); } public void Explode(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Landmine.SpawnExplosion(position, spawnParticles, killDistance, damageRange, nonLethalDamage, pushForce, overrideEffect, goThroughCar); } private void OnDrawGizmosSelected() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) if (killDistance > 0f) { Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, killDistance); } if (damageRange > 0f) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, damageRange); } if (strongDistance > 0f) { Gizmos.color = Color.black; Gizmos.DrawWireSphere(((Component)this).transform.position, strongDistance); } if (longDistance > 0f) { Gizmos.color = Color.Lerp(Color.black, Color.gray, 0.5f); Gizmos.DrawWireSphere(((Component)this).transform.position, longDistance); } if (bigDistance > 0f) { Gizmos.color = Color.gray; Gizmos.DrawWireSphere(((Component)this).transform.position, bigDistance); } if (smallDistance > 0f) { Gizmos.color = Color.Lerp(Color.gray, Color.white, 0.5f); Gizmos.DrawWireSphere(((Component)this).transform.position, smallDistance); } } private float GetLocalPlayerDistance() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position); } public void DistanceShakeScreen() { float localPlayerDistance = GetLocalPlayerDistance(); if (strongDistance > 0f && localPlayerDistance < strongDistance) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); } else if (longDistance > 0f && localPlayerDistance < longDistance) { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } else if (bigDistance > 0f && localPlayerDistance < bigDistance) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (smallDistance > 0f && localPlayerDistance < smallDistance) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } } public void ShakeLocalClient(int intensity) { if (Enum.IsDefined(typeof(ScreenShakeType), intensity)) { HUDManager.Instance.ShakeCamera((ScreenShakeType)intensity); } } public void StunFlash() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) StunFlash(((Component)this).transform.position); } public void StunFlash(MonoBehaviour target) { StunFlash(((Component)target).gameObject); } public void StunFlash(GameObject target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) StunFlash(target.transform.position); } public void StunFlash(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) StunGrenadeItem.StunExplosion(position, affectAudio, flashSeverityMultiplier, enemyStunTime, flashSeverityDistanceRolloff, false, (PlayerControllerB)null, (PlayerControllerB)null, 0f); } } public class ExtendedLevelLocker : MonoBehaviour { public string sceneName; [Header("OnTriggerEnter")] public bool isTriggerActivated = false; public bool shouldUnlock = true; public void SetLevelLocked(bool locked) { if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader)) { LLLHelper.LockExtendedLevel(sceneName, locked); } } public void SetLevelHidden(bool hidden) { if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader)) { LLLHelper.HideExtendedLevel(sceneName, hidden); } } public void LockLevel(string sceneName) { if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader)) { LLLHelper.LockExtendedLevel(sceneName, !shouldUnlock); } } public void HideLevel(string sceneName) { if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader)) { LLLHelper.HideExtendedLevel(sceneName, !shouldUnlock); } } public void OnTriggerEnter(Collider other) { if (isTriggerActivated && ((Component)other).CompareTag("Player")) { SetLevelLocked(!shouldUnlock); } } } public interface IDungeonLoadListener { void PostDungeonGeneration(); } public interface IWeightedItem { int GetWeight(); static int GetRandomIndex(IWeightedItem[] weightedItems) { return GetRandomIndex(Random.Range(0, weightedItems.CombinedWeights() + 1), weightedItems, () => Random.Range(0, weightedItems.Length)); } static int GetRandomIndex(Random random, IWeightedItem[] weightedItems) { return GetRandomIndex(random.Next(0, weightedItems.CombinedWeights() + 1), weightedItems, () => random.Next(0, weightedItems.Length)); } private static int GetRandomIndex(int random, IWeightedItem[] weightedItems, Func failState) { for (int i = 0; i < weightedItems.Length; i++) { random -= weightedItems[i].GetWeight(); if (random <= 0) { return i; } } return failState(); } } public class InventoryRemover : MonoBehaviour { public string[] itemsToRemove; public ItemFilter.Properties[] removeByFilter = Array.Empty(); public bool removeAllInstances = false; public void RemoveItems(PlayerControllerB player) { if (!((Object)(object)player.ItemOnlySlot != (Object)null) || !CheckSlot(player, 50) || removeAllInstances) { for (int i = 0; i < player.ItemSlots.Length && ((Object)(object)player.ItemSlots[i] == (Object)null || !CheckSlot(player, i) || removeAllInstances); i++) { } } } public void ClearInventory(PlayerControllerB player) { for (int i = 0; i < player.ItemSlots.Length; i++) { if (!((Object)(object)player.ItemSlots[i] == (Object)null)) { player.DestroyItemInSlotAndSync(i); } } } public void RemoveHeld(PlayerControllerB player) { if ((Object)(object)player.currentlyHeldObjectServer != (Object)null) { CheckSlot(player, player.currentItemSlot); } } private bool CheckSlot(PlayerControllerB player, int slot) { GrabbableObject val = ((slot == 50) ? player.ItemOnlySlot : player.ItemSlots[slot]); for (int i = 0; i < itemsToRemove.Length; i++) { if (val.itemProperties.itemName.ToLower() == itemsToRemove[i].ToLower()) { player.DestroyItemInSlotAndSync(slot); return true; } } for (int j = 0; j < removeByFilter.Length; j++) { if (removeByFilter[j].Check(val)) { player.DestroyItemInSlotAndSync(slot); return true; } } return false; } } public class ItemConsumer : NetworkBehaviour { public Item[] validItems = Array.Empty(); public bool checkExact = false; public ItemFilter.Properties[] validItemFilters = Array.Empty(); public InteractEvent OnSuccess = new InteractEvent(); public bool runEventOnAllClients = true; public void CheckHeldItem(PlayerControllerB player) { CheckItemServerRpc(player.Index()); } [ServerRpc(RequireOwnership = false)] private void CheckItemServerRpc(int playerWhoSent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2913302232u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2913302232u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerWhoSent]; if ((Object)(object)val3.currentlyHeldObjectServer == (Object)null) { return; } GrabbableObject currentlyHeldObjectServer = val3.currentlyHeldObjectServer; int num = 0; while (true) { if (num < validItems.Length) { if (checkExact ? ((Object)(object)currentlyHeldObjectServer.itemProperties == (Object)(object)validItems[num]) : (currentlyHeldObjectServer.itemProperties.itemName == validItems[num].itemName)) { break; } num++; continue; } int num2 = 0; while (true) { if (num2 < validItemFilters.Length) { if (validItemFilters[num2].Check(currentlyHeldObjectServer)) { break; } num2++; continue; } return; } break; } RemoveItemFromClientRpc(playerWhoSent); } [ClientRpc] private void RemoveItemFromClientRpc(int playerWhoSent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2753840628u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2753840628u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerWhoSent]; bool flag = val3.IsLocalPlayer(); JLogHelper.LogInfo($"Destroying Item in {val3.playerUsername} {playerWhoSent} slot: {val3.currentItemSlot}"); val3.DestroyItemInSlot(val3.currentItemSlot); if (runEventOnAllClients || flag) { ((UnityEvent)(object)OnSuccess).Invoke(val3); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2913302232u, new RpcReceiveHandler(__rpc_handler_2913302232), "CheckItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2753840628u, new RpcReceiveHandler(__rpc_handler_2753840628), "RemoveItemFromClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2913302232(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)1; ((ItemConsumer)(object)target).CheckItemServerRpc(playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2753840628(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)1; ((ItemConsumer)(object)target).RemoveItemFromClientRpc(playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ItemConsumer"; } } public class ItemSpawner : MonoBehaviour { [Serializable] public class WeightedItemRefrence : IWeightedItem { [Range(0f, 100f)] public int Weight = 20; public string ItemName = ""; public Item Item; public bool FindRegisteredItem = true; public bool OverrideValue = false; public int ScrapValue = 0; public Vector3 SpawnOffset = Vector3.zero; public int GetWeight() { return Weight; } public void FindRegistered() { if (ItemName != "") { foreach (Item items in RoundManager.Instance.playersManager.allItemsList.itemsList) { if (ItemName == items.itemName) { Item = items; break; } } return; } if (!FindRegisteredItem || !((Object)(object)Item != (Object)null)) { return; } foreach (Item items2 in RoundManager.Instance.playersManager.allItemsList.itemsList) { if (Item.itemName == items2.itemName) { Item = items2; break; } } } } [FormerlySerializedAs("spawnOnAwake")] public bool spawnOnEnabled = true; public RotationType spawnRotation = RotationType.NoRotation; public SpawnPoolSource SourcePool = SpawnPoolSource.CustomList; public WeightedItemRefrence[] CustomList = new WeightedItemRefrence[1] { new WeightedItemRefrence() }; private bool checkRegistry = true; public void Awake() { if (checkRegistry) { WeightedItemRefrence[] customList = CustomList; foreach (WeightedItemRefrence weightedItemRefrence in customList) { weightedItemRefrence.FindRegistered(); } checkRegistry = false; } } public void OnEnable() { if (spawnOnEnabled) { SpawnRandom(); } } public static Item GetRandomItem(SpawnPoolSource source, out int overrideValue, out Vector3 offset, WeightedItemRefrence[] weightedItems = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) Item result = null; overrideValue = -1; offset = Vector3.zero; switch (source) { case SpawnPoolSource.CustomList: if (weightedItems != null && weightedItems.Length != 0) { WeightedItemRefrence weightedRandom = weightedItems.GetWeightedRandom(); result = weightedRandom.Item; if (weightedRandom.OverrideValue) { overrideValue = weightedRandom.ScrapValue; } offset = weightedRandom.SpawnOffset; } break; case SpawnPoolSource.AllItems: result = StartOfRound.Instance.allItemsList.itemsList[Random.Range(0, StartOfRound.Instance.allItemsList.itemsList.Count)]; break; case SpawnPoolSource.LevelItems: { List list = new List(); foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { list.Add(new WeightedItemRefrence { Item = item.spawnableItem, Weight = item.rarity }); } result = list.GetWeightedRandom().Item; break; } case SpawnPoolSource.StoreItems: { Terminal terminal = JLevelPropertyRegistry.GetTerminal(); if ((Object)(object)terminal != (Object)null) { result = terminal.buyableItemsList[Random.Range(0, terminal.buyableItemsList.Length)]; } break; } } return result; } public void SpawnRandom(int count = 1) { //IL_000d: 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) SpawnRandomItems(SourcePool, ((Component)this).transform.position, RoundManager.Instance.spawnedScrapContainer, ((Component)this).transform.rotation, CustomList, null, count, spawnOnNetwork: true, spawnRotation); } public void SpawnRandom(MonoBehaviour target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SpawnRandom(((Component)target).transform.position); } public void SpawnRandom(GameObject target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) SpawnRandom(target.transform.position); } public void SpawnRandom(Vector3 pos) { //IL_0007: 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) SpawnRandomItems(SourcePool, pos, RoundManager.Instance.spawnedScrapContainer, ((Component)this).transform.rotation, CustomList, null, 1, spawnOnNetwork: true, spawnRotation); } public static List> SpawnRandomItems(SpawnPoolSource sourcePool, Vector3 position, Transform parent, Quaternion sourceRot, WeightedItemRefrence[] customList = null, Vector3[] offsets = null, int count = 1, bool spawnOnNetwork = true, RotationType rotation = RotationType.NoRotation) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) List> list = new List>(); if (((NetworkBehaviour)RoundManager.Instance).IsServer || ((NetworkBehaviour)RoundManager.Instance).IsHost) { if (customList == null) { customList = new WeightedItemRefrence[0]; } if (offsets == null) { offsets = (Vector3[])(object)new Vector3[0]; } for (int i = 0; i < count; i++) { int overrideValue; Vector3 offset; Item randomItem = GetRandomItem(sourcePool, out overrideValue, out offset, customList); if ((Object)(object)randomItem != (Object)null && (Object)(object)randomItem.spawnPrefab != (Object)null) { if (offsets.Length > i) { offset += offsets[i]; } GrabbableObject val = SpawnItem(randomItem, position + offset, parent, sourceRot, overrideValue, spawnOnNetwork, rotation); if ((Object)(object)val != (Object)null) { list.Add(new KeyValuePair(val, overrideValue)); } } } } return list; } public static GrabbableObject SpawnItem(Item item, Vector3 pos, Transform parent, Quaternion sourceRot, int overrideValue = -1, bool spawnOnNetwork = true, RotationType rotation = RotationType.NoRotation) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) JLogHelper.LogInfo($"Spawn on network: {spawnOnNetwork}", JLogLevel.Wesley); if (((NetworkBehaviour)RoundManager.Instance).IsServer || ((NetworkBehaviour)RoundManager.Instance).IsHost) { GrabbableObject component = Object.Instantiate(item.spawnPrefab, pos, EnemySpawner.GetRot(rotation, sourceRot), parent).GetComponent(); component.fallTime = 0f; if (spawnOnNetwork) { JLogHelper.LogInfo("Spawning item on network.", JLogLevel.Wesley); ((NetworkBehaviour)component).NetworkObject.Spawn(false); OverrideScrapValue(component, overrideValue); } return component; } return null; } public static void OverrideScrapValue(GrabbableObject grabbable, int overrideValue = -1) { //IL_0033: 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) if (overrideValue >= 0) { JLLNetworkManager.Instance.UpdateScanNodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)grabbable).NetworkObject), overrideValue); } else { JLLNetworkManager.Instance.UpdateScanNodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)grabbable).NetworkObject), Mathf.RoundToInt((float)Random.Range(grabbable.itemProperties.minValue, grabbable.itemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier)); } } } public class JActionEvents : NetworkBehaviour, IHittable, IShockableWithGun, INoiseListener { [Header("Hittable")] public bool canBeHit = true; public IntEvent OnHit = new IntEvent(); public InteractEvent OnPlayerHit = new InteractEvent(); [Header("Shockable")] public bool canBeShocked = false; public float shockDifficulty = 1f; public Vector3 shockPositionOffset = Vector3.zero; public InteractEvent OnShock = new InteractEvent(); public UnityEvent OnStopShocking = new UnityEvent(); [Header("NoiseListener")] public bool isListening = false; public float minLoudness = 0.25f; public int minTimesInOneSpot = 0; public UnityEvent SoundListenedEvent = new UnityEvent(); public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (!canBeHit) { return false; } ((UnityEvent)OnHit).Invoke(force); if ((Object)(object)playerWhoHit != (Object)null) { ((UnityEvent)(object)OnPlayerHit).Invoke(playerWhoHit); } return true; } public bool CanBeShocked() { return canBeShocked; } public float GetDifficultyMultiplier() { return shockDifficulty; } public NetworkObject GetNetworkObject() { return ((NetworkBehaviour)this).NetworkObject; } public Vector3 GetShockablePosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return ((Component)this).transform.position + shockPositionOffset; } public Transform GetShockableTransform() { return ((Component)this).transform; } public void ShockWithGun(PlayerControllerB shockedByPlayer) { ((UnityEvent)(object)OnShock).Invoke(shockedByPlayer); } public void StopShockingWithGun() { OnStopShocking.Invoke(); } public void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (isListening) { if (Physics.Linecast(((Component)this).transform.position, noisePosition, 256)) { noiseLoudness /= 2f; } if (!(noiseLoudness < minLoudness) && timesPlayedInOneSpot >= minTimesInOneSpot) { SoundListenedEvent.Invoke(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "JActionEvents"; } } public class JBillboard : MonoBehaviour { public bool Active = true; public PlayerTarget Target = PlayerTarget.Local; public bool LerpRot = false; public float LerpSpeed = 1f; public bool X_Axis = false; public bool Y_Axis = true; public bool Z_Axis = false; public void Update() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (Active) { Transform transform = ((Component)GetPlayer(Target, ((Component)this).transform.position).gameplayCamera).transform; Vector3 val = ((Component)transform).transform.position - ((Component)this).transform.position; Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); Vector3 eulerAngles = ((Quaternion)(ref val2)).eulerAngles; Quaternion val3 = Quaternion.Euler(X_Axis ? eulerAngles.x : 0f, Y_Axis ? eulerAngles.y : 0f, Z_Axis ? eulerAngles.z : 0f); ((Component)this).transform.rotation = (LerpRot ? Quaternion.Slerp(((Component)this).transform.rotation, val3, Time.deltaTime * LerpSpeed) : val3); } } public static PlayerControllerB GetPlayer(PlayerTarget target, Vector3 refrencePos) { //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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) if (target == PlayerTarget.Local) { return StartOfRound.Instance.localPlayerController; } PlayerControllerB result = RoundManager.Instance.playersManager.allPlayerScripts[0]; float num = Vector3.Distance(((Component)RoundManager.Instance.playersManager.allPlayerScripts[0]).transform.position, refrencePos); switch (target) { case PlayerTarget.Closest: { for (int j = 1; j < RoundManager.Instance.playersManager.allPlayerScripts.Length; j++) { PlayerControllerB val2 = RoundManager.Instance.playersManager.allPlayerScripts[j]; if (!val2.isPlayerDead && !val2.disconnectedMidGame) { float num3 = Vector3.Distance(((Component)val2).transform.position, refrencePos); if (num3 < num) { num = num3; result = val2; } } } return result; } case PlayerTarget.Farthest: { for (int i = 1; i < RoundManager.Instance.playersManager.allPlayerScripts.Length; i++) { PlayerControllerB val = RoundManager.Instance.playersManager.allPlayerScripts[i]; if (!val.isPlayerDead && !val.disconnectedMidGame) { float num2 = Vector3.Distance(((Component)val).transform.position, refrencePos); if (num2 > num) { num = num2; result = val; } } } return result; } default: return StartOfRound.Instance.localPlayerController; } } } public class JBlowerFan : MonoBehaviour { public float forceMultiplier = 1f; public float vehicleforceMultiplier = 6f; public Transform sourcePos; public void OnTriggerStay(Collider other) { //IL_003a: 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_004b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; VehicleController val = default(VehicleController); if ((Object)(object)((Component)other).gameObject == (Object)(object)((Component)localPlayerController).gameObject && !localPlayerController.inVehicleAnimation && !localPlayerController.inSpecialInteractAnimation) { localPlayerController.externalForceAutoFade += CalcPushForce(((Component)localPlayerController).transform.position); localPlayerController.fallValue = -1f; localPlayerController.fallValueUncapped = -1f; } else if (((Component)other).gameObject.TryGetComponent(ref val) && ((NetworkBehaviour)val).IsOwner) { val.mainRigidbody.AddForce(CalcPushForce(((Component)val).transform.position) * vehicleforceMultiplier, (ForceMode)1); } } public Vector3 CalcPushForce(Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0031: 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_0041: 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) Vector3 val = pos - sourcePos.position; return ((Vector3)(ref val)).normalized * forceMultiplier * (1f / Vector3.Distance(pos, sourcePos.position)); } } public class JBridgeTrigger : NetworkBehaviour { public float bridgeDurability = 1f; public float bridgeMaxRegen = 1f; public float bridgeRegenerationRate = 0.2f; private readonly List playersOnBridge = new List(); private readonly List cruisersOnBridge = new List(); public AudioSource bridgeAudioSource; public AudioClip[] bridgeCreakSFX; public AudioClip bridgeFallSFX; public Animator bridgeAnimator; private bool hasBridgeFallen; public Transform bridgePhysicsPartsContainer; private bool giantOnBridge; private bool giantOnBridgeLastFrame; public Collider[] fallenBridgeColliders; public string fallType = "Fall"; public float weightCapacityAmount = 0.04f; public float playerCapacityAmount = 0.02f; public float cruiserCapacityAmount = 0.04f; private readonly bool LLLPresent = JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader); private void OnEnable() { ((UnityEvent)(object)StartOfRound.Instance.playerTeleportedEvent).AddListener((UnityAction)RemovePlayerFromBridge); } private void OnDisable() { ((UnityEvent)(object)StartOfRound.Instance.playerTeleportedEvent).RemoveListener((UnityAction)RemovePlayerFromBridge); } private void Update() { if (hasBridgeFallen) { return; } if (giantOnBridge) { bridgeDurability -= Time.deltaTime / 4.25f; } if (playersOnBridge.Count > 0) { bridgeDurability -= Time.deltaTime * (playerCapacityAmount * (float)(playersOnBridge.Count * playersOnBridge.Count)); foreach (PlayerControllerB item in playersOnBridge) { if (item.carryWeight > 1.1f) { bridgeDurability -= Time.deltaTime * (weightCapacityAmount * item.carryWeight); } } } if (cruisersOnBridge.Count > 0) { bridgeDurability -= Time.deltaTime * (cruiserCapacityAmount * (float)(cruisersOnBridge.Count * cruisersOnBridge.Count)); foreach (VehicleController item2 in cruisersOnBridge) { float num = 0f; GrabbableObject[] componentsInChildren = ((Component)item2.physicsRegion.physicsTransform).GetComponentsInChildren(); foreach (GrabbableObject val in componentsInChildren) { num += val.itemProperties.weight; } bridgeDurability -= Time.deltaTime * (weightCapacityAmount * num); } } if (playersOnBridge.Count + cruisersOnBridge.Count == 0 && !giantOnBridge && bridgeDurability < bridgeMaxRegen) { bridgeDurability = Mathf.Min(bridgeDurability + Time.deltaTime * bridgeRegenerationRate, bridgeMaxRegen); } if (((NetworkBehaviour)this).IsServer && bridgeDurability <= 0f && !hasBridgeFallen) { hasBridgeFallen = true; BridgeFallServerRpc(); Debug.Log((object)"Bridge collapsed! On server"); } if (bridgeMaxRegen > 0f) { bridgeAnimator.SetFloat("durability", (bridgeDurability > bridgeMaxRegen) ? 0f : Mathf.Clamp(Mathf.Abs(bridgeDurability - bridgeMaxRegen) / bridgeMaxRegen, 0f, 1f)); } } private void LateUpdate() { if (giantOnBridge) { if (giantOnBridgeLastFrame) { giantOnBridge = false; giantOnBridgeLastFrame = false; } else { giantOnBridgeLastFrame = true; } } } [ServerRpc] public void BridgeFallServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1249389005u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1249389005u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BridgeFallClientRpc(); } } [ClientRpc] public void BridgeFallClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1605581967u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1605581967u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; hasBridgeFallen = true; bridgeAnimator.SetTrigger(fallType); EnableFallenBridgeColliders(); bridgeAudioSource.PlayOneShot(bridgeFallSFX); float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)bridgeAudioSource).transform.position); if (num < 30f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); } else if (num < 50f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } } } private void EnableFallenBridgeColliders() { for (int i = 0; i < fallenBridgeColliders.Length; i++) { fallenBridgeColliders[i].enabled = true; } } private void OnTriggerStay(Collider other) { VehicleController item2 = default(VehicleController); if (((Component)other).gameObject.CompareTag("Player")) { PlayerControllerB item = default(PlayerControllerB); if (((Component)other).TryGetComponent(ref item) && !playersOnBridge.Contains(item)) { playersOnBridge.Add(item); if (Random.Range(Mathf.Min(playersOnBridge.Count * 25, 90), 100) > 60) { RoundManager.PlayRandomClip(bridgeAudioSource, bridgeCreakSFX, true, 1f, 0, 1000); } } } else if (((Component)other).gameObject.CompareTag("Enemy")) { EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (((Component)other).TryGetComponent(ref val) && (val.mainScript.enemyType.enemyName == "ForestGiant" || (LLLPresent && LLLHelper.EnemyHasTag(val.mainScript.enemyType, "Heavy")))) { giantOnBridge = true; giantOnBridgeLastFrame = false; } } else if (((Component)other).gameObject.TryGetComponent(ref item2) && !cruisersOnBridge.Contains(item2)) { cruisersOnBridge.Add(item2); if (Random.Range(Mathf.Min(cruisersOnBridge.Count * 40, 90), 100) > 60) { RoundManager.PlayRandomClip(bridgeAudioSource, bridgeCreakSFX, true, 1f, 0, 1000); } } } public void RemovePlayerFromBridge(PlayerControllerB playerOnBridge) { if ((Object)(object)playerOnBridge != (Object)null && playersOnBridge.Contains(playerOnBridge)) { playersOnBridge.Remove(playerOnBridge); } } private void OnTriggerExit(Collider other) { PlayerControllerB playerOnBridge = default(PlayerControllerB); VehicleController item = default(VehicleController); if (((Component)other).gameObject.CompareTag("Player") && ((Component)other).TryGetComponent(ref playerOnBridge)) { RemovePlayerFromBridge(playerOnBridge); } else if (((Component)other).TryGetComponent(ref item) && cruisersOnBridge.Contains(item)) { cruisersOnBridge.Remove(item); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1249389005u, new RpcReceiveHandler(__rpc_handler_1249389005), "BridgeFallServerRpc"); ((NetworkBehaviour)this).__registerRpc(1605581967u, new RpcReceiveHandler(__rpc_handler_1605581967), "BridgeFallClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1249389005(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((JBridgeTrigger)(object)target).BridgeFallServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1605581967(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((JBridgeTrigger)(object)target).BridgeFallClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JBridgeTrigger"; } } public class JClientAttatchedObject : MonoBehaviour { public GameObject target; public ActiveCondition enableCondition = ActiveCondition.ActiveOutdoors; [Header("Player Attatchment")] [Tooltip("When disabled the player will not attach to the target and isntead just enable / disable it's self based on the Enable Condition.")] public bool attachToLocalPlayer = false; public bool lerpPosition = false; public void Update() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return; } switch (enableCondition) { case ActiveCondition.ActiveOutdoors: target.SetActive(!RoundManager.Instance.playersManager.localPlayerController.isInsideFactory); break; case ActiveCondition.ActiveIndoors: target.SetActive(RoundManager.Instance.playersManager.localPlayerController.isInsideFactory); break; case ActiveCondition.ActiveOutdoorsOutsideShip: target.SetActive(!RoundManager.Instance.playersManager.localPlayerController.isInsideFactory && !RoundManager.Instance.playersManager.localPlayerController.isInHangarShipRoom); break; } if (target.activeSelf && attachToLocalPlayer) { Vector3 position = ((Component)RoundManager.Instance.playersManager.localPlayerController).transform.position; if (lerpPosition) { target.transform.position = Vector3.Lerp(target.transform.position, position, Time.deltaTime); } else { target.transform.position = position; } } } } public class JClientSync : NetworkBehaviour { [Header("Synced Filter")] [SerializeField] public JFilter hostFilter; public bool runFilterOnStart = false; public UnityEvent SyncedFilterSuccess = new UnityEvent(); public UnityEvent SyncedFilterFailure = new UnityEvent(); [Header("Host Only")] public bool runHostEventOnStart = false; public UnityEvent hostEvent = new UnityEvent(); public InteractEvent hostPlayerEvent = new InteractEvent(); [Header("Synced")] public bool runSyncedEventOnStart = false; public UnityEvent syncedEvent = new UnityEvent(); public InteractEvent syncedPlayerEvent = new InteractEvent(); public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { if ((Object)(object)hostFilter != (Object)null) { hostFilter.FilteredResult.AddListener((UnityAction)FilterResultServerRpc); if (runFilterOnStart) { hostFilter.FilterDefault(); } } if (runHostEventOnStart) { TriggerOnHost(); } if (runSyncedEventOnStart) { TriggerSyncedEvent(); } } ((NetworkBehaviour)this).OnNetworkSpawn(); } public void FilterOnHost() { RunFilterOnHostServerRpc(); } [ServerRpc(RequireOwnership = false)] private void RunFilterOnHostServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(402539773u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 402539773u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; hostFilter?.FilterDefault(); } } } [ServerRpc(RequireOwnership = false)] private void FilterResultServerRpc(bool success) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(146178854u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref success, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 146178854u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FilterResultClientRpc(success); } } } [ClientRpc] private void FilterResultClientRpc(bool success) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2990671980u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref success, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2990671980u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (success) { SyncedFilterSuccess.Invoke(); } else { SyncedFilterFailure.Invoke(); } } } public void TriggerOnHost() { RunOnHostServerRpc(); } public void TriggerOnHost(PlayerControllerB player) { RunOnHostServerRpc(player.Index()); } [ServerRpc(RequireOwnership = false)] private void RunOnHostServerRpc(int playerId = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1008602475u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1008602475u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; hostEvent.Invoke(); if (playerId >= 0) { ((UnityEvent)(object)hostPlayerEvent).Invoke(RoundManager.Instance.playersManager.allPlayerScripts[playerId]); } } } public void TriggerSyncedEvent() { SyncEventServerRpc(); } public void TriggerSyncedEvent(PlayerControllerB player) { SyncEventServerRpc(player.Index()); } [ServerRpc(RequireOwnership = false)] private void SyncEventServerRpc(int playerId = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2640758719u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2640758719u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncEventClientRpc(playerId); } } } [ClientRpc] private void SyncEventClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1503703506u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1503703506u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; syncedEvent.Invoke(); if (playerId >= 0) { ((UnityEvent)(object)syncedPlayerEvent).Invoke(RoundManager.Instance.playersManager.allPlayerScripts[playerId]); } } } public override void OnDestroy() { if ((Object)(object)hostFilter != (Object)null) { hostFilter.FilteredResult.RemoveListener((UnityAction)FilterResultServerRpc); } ((NetworkBehaviour)this).OnDestroy(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(402539773u, new RpcReceiveHandler(__rpc_handler_402539773), "RunFilterOnHostServerRpc"); ((NetworkBehaviour)this).__registerRpc(146178854u, new RpcReceiveHandler(__rpc_handler_146178854), "FilterResultServerRpc"); ((NetworkBehaviour)this).__registerRpc(2990671980u, new RpcReceiveHandler(__rpc_handler_2990671980), "FilterResultClientRpc"); ((NetworkBehaviour)this).__registerRpc(1008602475u, new RpcReceiveHandler(__rpc_handler_1008602475), "RunOnHostServerRpc"); ((NetworkBehaviour)this).__registerRpc(2640758719u, new RpcReceiveHandler(__rpc_handler_2640758719), "SyncEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(1503703506u, new RpcReceiveHandler(__rpc_handler_1503703506), "SyncEventClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_402539773(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((JClientSync)(object)target).RunFilterOnHostServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_146178854(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0044: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool success = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref success, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JClientSync)(object)target).FilterResultServerRpc(success); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2990671980(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0044: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool success = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref success, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JClientSync)(object)target).FilterResultClientRpc(success); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1008602475(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((JClientSync)(object)target).RunOnHostServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2640758719(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((JClientSync)(object)target).SyncEventServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1503703506(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((JClientSync)(object)target).SyncEventClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JClientSync"; } } public class JDestructableObject : NetworkBehaviour, IHittable { [Serializable] public class WeaponEventFilter { public ItemFilter WeaponFilter = new ItemFilter(); public float filteredDamageMultiplier = 1f; public InteractEvent FilteredDamageEvent = new InteractEvent(); public float GetMultiplier(GrabbableObject item, PlayerControllerB player) { if (WeaponFilter.Check(item)) { ((UnityEvent)(object)FilteredDamageEvent).Invoke(player); return filteredDamageMultiplier; } return 1f; } public void FilterEvent(GrabbableObject item, PlayerControllerB player) { if (WeaponFilter.shouldCheck && WeaponFilter.CheckValue(item)) { ((UnityEvent)(object)FilteredDamageEvent).Invoke(player); } } } public float maxHealth = 1f; [HideInInspector] public float currentHealth = 1f; [Tooltip("Damage multiplier when damage is not caused by a player.")] public float nonPlayerDamageMultiplier = 1f; public WeaponEventFilter[] weaponFilters = new WeaponEventFilter[1] { new WeaponEventFilter { WeaponFilter = new ItemFilter { shouldCheck = true } } }; public GameObject DisableObject; public UnityEvent DamageEvent = new UnityEvent(); public UnityEvent DestroyEvent = new UnityEvent(); [Header("FX")] public ParticleSystem destroyParticles; public AudioClip[] damageClips = Array.Empty(); public AudioClip[] destroyClips = Array.Empty(); public float minVolume = 0.8f; public float maxVolume = 1f; public float minPitch = 0.6f; public float maxPitch = 1f; public AudioSource audioSource; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); currentHealth = maxHealth; JLogHelper.LogInfo($"{((Object)this).name} Set Health: {currentHealth}"); } public void Hit(int force) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Hit(force, Vector3.zero); } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { JLogHelper.LogInfo(((Object)this).name + " Hit By Shovel:"); DamageObjectServerRpc(((Object)(object)playerWhoHit == (Object)null) ? (-1) : playerWhoHit.Index(), force); return true; } [ServerRpc(RequireOwnership = false)] private void DamageObjectServerRpc(int playerWhoSent, int force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2793803068u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerWhoSent); BytePacker.WriteValueBitPacked(val2, force); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2793803068u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; JLogHelper.LogInfo($"Server RPC | {currentHealth} | {playerWhoSent} {force}"); if (currentHealth <= 0f) { return; } float num = force; if (playerWhoSent >= 0) { PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerWhoSent]; JLogHelper.LogInfo($"Player: {val3.playerUsername} {(Object)(object)val3.currentlyHeldObjectServer == (Object)null}"); if ((Object)(object)val3.currentlyHeldObjectServer != (Object)null) { for (int i = 0; i < weaponFilters.Length; i++) { num *= weaponFilters[i].GetMultiplier(val3.currentlyHeldObjectServer, val3); JLogHelper.LogInfo($"New Damage: {num}"); } } } else { num *= nonPlayerDamageMultiplier; JLogHelper.LogInfo($"New Damage: {num}"); } if (num != 0f) { currentHealth = Mathf.Clamp(currentHealth - num, 0f, maxHealth); bool flag = currentHealth <= 0f; PlayDamageFX(flag); JLogHelper.LogInfo($"Sending Client RPC | Destroyed: {flag}"); DamageObjectClientRpc(playerWhoSent, flag); } } [ClientRpc] private void DamageObjectClientRpc(int playerWhoSent, bool destroyed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1619430403u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref destroyed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1619430403u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { return; } JLogHelper.LogInfo("Received Client RPC"); if (playerWhoSent >= 0) { PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerWhoSent]; for (int i = 0; i < weaponFilters.Length; i++) { weaponFilters[i].FilterEvent(val3.currentlyHeldObjectServer, val3); } } PlayDamageFX(destroyed); } private void PlayDamageFX(bool destroyed) { DamageEvent.Invoke(); if (destroyed) { if (destroyClips.Length != 0) { PlayRandomSound(destroyClips); } else if (damageClips.Length != 0) { PlayRandomSound(damageClips); } Destroy(); } else if (damageClips.Length != 0) { PlayRandomSound(damageClips); } } private void PlayRandomSound(AudioClip[] clips) { PlaySound(clips[Random.Range(0, clips.Length)]); } private void PlaySound(AudioClip clip) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) JLogHelper.LogInfo(((Object)this).name + " playing sound " + ((Object)clip).name + "."); if (!((Object)(object)audioSource == (Object)null)) { float num = Random.Range(minVolume, maxVolume); audioSource.pitch = Random.Range(minPitch, maxPitch); audioSource.PlayOneShot(clip, num); WalkieTalkie.TransmitOneShotAudio(audioSource, clip, num * 0.85f); RoundManager.Instance.PlayAudibleNoise(((Component)audioSource).transform.position, 4f * num, num * 0.5f, 0, false, 0); } } private void Destroy() { Collider[] components = ((Component)this).GetComponents(); foreach (Collider val in components) { val.enabled = false; } GameObject disableObject = DisableObject; if (disableObject != null) { disableObject.SetActive(false); } ParticleSystem obj = destroyParticles; if (obj != null) { obj.Play(); } DestroyEvent.Invoke(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2793803068u, new RpcReceiveHandler(__rpc_handler_2793803068), "DamageObjectServerRpc"); ((NetworkBehaviour)this).__registerRpc(1619430403u, new RpcReceiveHandler(__rpc_handler_1619430403), "DamageObjectClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2793803068(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); int force = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref force); target.__rpc_exec_stage = (__RpcExecStage)1; ((JDestructableObject)(object)target).DamageObjectServerRpc(playerWhoSent, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1619430403(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); bool destroyed = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroyed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JDestructableObject)(object)target).DamageObjectClientRpc(playerWhoSent, destroyed); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JDestructableObject"; } } public class JEventVariables : MonoBehaviour { [Serializable] public class JEventVariable { public T Variable; public UnityEvent Event = new UnityEvent(); public virtual void Trigger() { if (Variable != null) { Event.Invoke(Variable); } } public void Set(T var) { Variable = var; } } [Serializable] public class JNumberEventVariable : JEventVariable { public IntEvent RoundedEvent = new IntEvent(); public NumericFilter NumberCheck = new NumericFilter(); public UnityEvent FailedEvent = new UnityEvent(); public override void Trigger() { if (NumberCheck.shouldCheck && !NumberCheck.CheckValue(Variable)) { FailedEvent.Invoke(); return; } base.Trigger(); ((UnityEvent)RoundedEvent).Invoke(Mathf.RoundToInt(Variable)); } } public enum VariableType { Unknown = -1, Number, Boolean, GameObject, Player, Enemy } private int targetIndex = 0; [Header("Number Variables (\"number\")")] public List numberVariables = new List(); public UnityEvent allNumbersPassEvent = new UnityEvent(); [Header("Boolean Variables (\"bool\")")] public List> booleanVariables = new List>(); public UnityEvent allTrueEvent = new UnityEvent(); [Header("GameObjects")] public bool allowDuplicates = true; [Header("Player Variables (\"player\")")] public List> playerVariables = new List>(); public InteractEvent playerEvent = new InteractEvent(); [Header("Enemy Variables (\"enemy\")")] public List> enemyVariables = new List>(); public EnemyEvent enemyEvent = new EnemyEvent(); [Header("GameObject Variables (\"object\")")] public List> gameObjectVariables = new List>(); public ObjectEvent gameObjectEvent = new ObjectEvent(); private int GetIndex(VariableType id) { int count; switch (id) { case VariableType.Number: count = numberVariables.Count; break; case VariableType.Boolean: count = booleanVariables.Count; break; case VariableType.GameObject: count = gameObjectVariables.Count; break; case VariableType.Player: count = playerVariables.Count; break; case VariableType.Enemy: count = enemyVariables.Count; break; default: return -1; } if (count == 0 || targetIndex >= count || targetIndex < 0) { return -1; } return targetIndex; } private VariableType GetType(string identifier) { string text = identifier.ToLower().Replace("\"", ""); if (1 == 0) { } VariableType result = text switch { "number" => VariableType.Number, "bool" => VariableType.Boolean, "object" => VariableType.GameObject, "player" => VariableType.Player, "enemy" => VariableType.Enemy, _ => VariableType.Unknown, }; if (1 == 0) { } return result; } public void TargetIndex(int index) { targetIndex = index; } public void Trigger(string varType) { VariableType type = GetType(varType); int index = GetIndex(type); if (index >= 0) { switch (type) { case VariableType.Number: numberVariables[index].Trigger(); break; case VariableType.Boolean: booleanVariables[index].Trigger(); break; case VariableType.GameObject: gameObjectVariables[index].Trigger(); break; case VariableType.Player: playerVariables[index].Trigger(); break; case VariableType.Enemy: enemyVariables[index].Trigger(); break; } } } public void TriggerAll(string varType) { switch (GetType(varType)) { case VariableType.Number: { for (int j = 0; j < numberVariables.Count; j++) { numberVariables[j].Trigger(); } break; } case VariableType.Boolean: { for (int l = 0; l < booleanVariables.Count; l++) { booleanVariables[l].Trigger(); } break; } case VariableType.GameObject: { for (int m = 0; m < gameObjectVariables.Count; m++) { gameObjectVariables[m].Trigger(); if ((Object)(object)gameObjectVariables[m].Variable != (Object)null) { ((UnityEvent)gameObjectEvent).Invoke(gameObjectVariables[m].Variable); } } break; } case VariableType.Player: { for (int k = 0; k < playerVariables.Count; k++) { playerVariables[k].Trigger(); if ((Object)(object)playerVariables[k].Variable != (Object)null) { ((UnityEvent)(object)playerEvent).Invoke(playerVariables[k].Variable); } } break; } case VariableType.Enemy: { for (int i = 0; i < enemyVariables.Count; i++) { enemyVariables[i].Trigger(); if ((Object)(object)enemyVariables[i].Variable != (Object)null) { ((UnityEvent)enemyEvent).Invoke(enemyVariables[i].Variable); } } break; } } } public void Remove(string varType) { VariableType type = GetType(varType); int index = GetIndex(type); if (index >= 0) { switch (type) { case VariableType.Number: numberVariables.RemoveAt(index); break; case VariableType.Boolean: booleanVariables.RemoveAt(index); break; case VariableType.GameObject: gameObjectVariables.RemoveAt(index); break; case VariableType.Player: playerVariables.RemoveAt(index); break; case VariableType.Enemy: enemyVariables.RemoveAt(index); break; } } } public void SetNumber(float num) { int index = GetIndex(VariableType.Number); if (index >= 0) { numberVariables[index].Set(num); } } public void SetNumber(int num) { SetNumber(num); } public void AddNumber(float num) { int index = GetIndex(VariableType.Number); if (index >= 0) { numberVariables[index].Set(num + numberVariables[index].Variable); } } public void MultiplyNumber(float num) { int index = GetIndex(VariableType.Number); if (index >= 0) { numberVariables[index].Set(num * numberVariables[index].Variable); } } public void CheckAllNumbers() { foreach (JNumberEventVariable numberVariable in numberVariables) { if (numberVariable.NumberCheck.shouldCheck && !numberVariable.NumberCheck.CheckValue(numberVariable.Variable)) { return; } } allNumbersPassEvent.Invoke(); } public void SetBoolean(bool val) { int index = GetIndex(VariableType.Boolean); if (index >= 0) { booleanVariables[index].Set(val); } } public void AndBool(bool val) { int index = GetIndex(VariableType.Boolean); if (index >= 0) { booleanVariables[index].Set(val && booleanVariables[index].Variable); } } public void OrBool(bool val) { int index = GetIndex(VariableType.Boolean); if (index >= 0) { booleanVariables[index].Set(val || booleanVariables[index].Variable); } } public void NotBool(bool val) { int index = GetIndex(VariableType.Boolean); if (index >= 0) { booleanVariables[index].Set(val != booleanVariables[index].Variable); } } public void CheckAllBools() { foreach (JEventVariable booleanVariable in booleanVariables) { if (!booleanVariable.Variable) { return; } } allTrueEvent.Invoke(); } public void SetObject(GameObject obj) { int index = GetIndex(VariableType.GameObject); if (index >= 0) { gameObjectVariables[index].Set(obj); } } public void AddObject(GameObject obj) { if (!allowDuplicates) { for (int i = 0; i < gameObjectVariables.Count; i++) { if ((Object)(object)gameObjectVariables[i].Variable == (Object)(object)obj) { return; } } } gameObjectVariables.Add(new JEventVariable { Variable = obj }); } public void SetPlayer(PlayerControllerB player) { int index = GetIndex(VariableType.Player); if (index >= 0) { playerVariables[index].Set(player); } } public void AddPlayer(PlayerControllerB player) { if (!allowDuplicates) { for (int i = 0; i < playerVariables.Count; i++) { if ((Object)(object)playerVariables[i].Variable == (Object)(object)player) { return; } } } playerVariables.Add(new JEventVariable { Variable = player }); } public void SetEnemy(EnemyAI enemy) { int index = GetIndex(VariableType.Enemy); if (index >= 0) { enemyVariables[index].Set(enemy); } } public void AddEnemy(EnemyAI enemy) { if (!allowDuplicates) { for (int i = 0; i < enemyVariables.Count; i++) { if ((Object)(object)enemyVariables[i].Variable == (Object)(object)enemy) { return; } } } enemyVariables.Add(new JEventVariable { Variable = enemy }); } } [RequireComponent(typeof(ItemDropship))] public class JItemDropshipModifier : MonoBehaviour { public ItemDropship ItemDropship; [Header("Modifiers")] public Transform itemParent; public virtual void Start() { if ((Object)(object)ItemDropship == (Object)null) { ItemDropship = ((Component)this).GetComponent(); } } public virtual void ModifyDroppedItems(GrabbableObject item) { if ((Object)(object)itemParent != (Object)null) { ((Component)item).transform.parent = itemParent; } } } public class JLevelEventTriggers : MonoBehaviour, IDungeonLoadListener { [Serializable] public class HourEvent { public UnityEvent hourEvent = new UnityEvent(); [Range(0f, 18f)] public int hour; } public static List EventTriggers = new List(); [Tooltip("Invoked after the ship landing animation finishes")] public UnityEvent ShipLanded = new UnityEvent(); [Tooltip("Invoked when the level loads on the client")] public UnityEvent LevelLoaded = new UnityEvent(); [Tooltip("Invoked when the ship leaves")] public UnityEvent ShipLeaving = new UnityEvent(); [Tooltip("If you only want the Apparatus event to run 1 time then check this so interiors with multiple Apparatuses don't break things")] public bool onlyOnFirstApparatus = false; private bool apparatusWasPulled = false; [Tooltip("Invoked when an Apparatus gets pulled inside the facility")] public UnityEvent ApparatusPulled = new UnityEvent(); public bool breakerIgnoresApparatus = false; [Tooltip("Triggered on breaker box being toggled.")] public BoolEvent BreakerBox = new BoolEvent(); public HourEvent[] hourlyEvents = Array.Empty(); private void OnEnable() { EventTriggers.Add(this); JLogHelper.LogInfo("Enabled " + ((Object)this).name + " LevelEventTrigger", JLogLevel.Wesley); } private void OnDisable() { EventTriggers.Remove(this); JLogHelper.LogInfo("Disabled " + ((Object)this).name + " LevelEventTrigger", JLogLevel.Wesley); } public void InvokeApparatus() { if (!onlyOnFirstApparatus || !apparatusWasPulled) { apparatusWasPulled = true; ApparatusPulled.Invoke(); } } public void ToggleBreakerBox(bool active) { if (!apparatusWasPulled || breakerIgnoresApparatus) { ((UnityEvent)BreakerBox).Invoke(active); } } public void PostDungeonGeneration() { LevelLoaded.Invoke(); } } public class JLightningRod : MonoBehaviour { public static List All = new List(); [Header("Striking")] [Tooltip("Time in seconds between lighting strikes | negative number to disable")] public float strikeInterval = -1f; private float strikeTimer = 0f; [Tooltip("Valid positions for lighting strikes. Empty strikes self")] public Transform[] strikePos = Array.Empty(); public float killRange = 2.4f; public float damageRange = 5f; [Tooltip("Ignore ceiling checks allowing lightning to strike through objects to hit its target.")] public bool ignorePath = false; public float boltHeight = 80f; public int boltWidth = 32; [Tooltip("Default: only strike on stormy weather | Enable to strike reguardless of weather")] public bool ignoreCurrentWeather = false; [Header("Detection")] [Tooltip("Distance a lightning strike has to be from transform position to trigger event")] public float detectDist = 1f; public UnityEvent onStrike = new UnityEvent(); public void OnEnable() { All.Add(this); strikeTimer = strikeInterval; } public void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 if (((NetworkBehaviour)RoundManager.Instance).IsOwner && !(strikeInterval <= 0f) && (ignoreCurrentWeather || (int)TimeOfDay.Instance.currentLevelWeather == 2)) { strikeTimer -= Time.deltaTime; if (strikeTimer < 0f) { strikeTimer = strikeInterval; StrikeRandom(); } } } public void StrikeRandom() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) StrikeAt((strikePos.Length == 0) ? ((Component)this).transform.position : strikePos[Random.Range(0, strikePos.Length)].position); } public void StrikeAt(Vector3 pos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)JLLNetworkManager.Instance).IsOwner) { JLLNetworkManager.Instance.LightningStrikeRpc(pos, Random.Range(0, 1000000), killRange, damageRange, ignorePath, boltHeight, boltWidth); } } public void OnDisable() { All.Remove(this); } } public class JLineOfSight : NetworkBehaviour { public int range = 60; public float angle = 45f; public bool limitTriggers = false; public float interval = 0.5f; private float timer = 0f; private bool viewedLast = false; public UnityEvent OnViewed = new UnityEvent(); public UnityEvent OnLookAway = new UnityEvent(); public void OnEnable() { timer = interval; } public void Update() { //IL_0090: 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_00bd: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsServer) { return; } timer -= Time.deltaTime; if (timer > 0f) { return; } timer = Mathf.Max(0.05f, interval); bool flag = false; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerControlled && !val.isPlayerDead && Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) < (float)range && val.HasLineOfSightToPosition(((Component)this).transform.position, angle, range, -1f, -1)) { PlayerViewedRpc(val.Index()); flag = true; if (limitTriggers) { break; } } } if (viewedLast && !flag) { OnLookAwayRpc(); } viewedLast = flag; } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayerViewedRpc(int playerIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: 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) //IL_005f: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2103525600u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerIndex); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2103525600u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; OnViewed.Invoke(StartOfRound.Instance.allPlayerScripts[playerIndex]); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnLookAwayRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: 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) //IL_005f: 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_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2393323909u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2393323909u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; OnLookAway.Invoke(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2103525600u, new RpcReceiveHandler(__rpc_handler_2103525600), "PlayerViewedRpc"); ((NetworkBehaviour)this).__registerRpc(2393323909u, new RpcReceiveHandler(__rpc_handler_2393323909), "OnLookAwayRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2103525600(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLineOfSight)(object)target).PlayerViewedRpc(playerIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2393323909(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((JLineOfSight)(object)target).OnLookAwayRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JLineOfSight"; } } public class JMaterialReplacer : MonoBehaviour { [Serializable] public class MaterialReplacement { public Material original; public Material replacement; } public MaterialReplacement[] replacements = Array.Empty(); public bool searchChildren = true; public bool triggerPostDunGen = false; public void SearchAndReplace() { SearchAndReplace(((Component)this).transform); } private void SearchAndReplace(Transform target) { Renderer val = default(Renderer); if (((Component)target).TryGetComponent(ref val)) { int num = 0; for (int i = 0; i < replacements.Length; i++) { Material[] materials = val.materials; for (int j = 0; j < materials.Length; j++) { if (((Object)materials[j]).name.Equals(((Object)replacements[i].original).name + " (Instance)")) { materials[j] = replacements[i].replacement; num++; } } ((Component)target).GetComponent().materials = materials; } } if (searchChildren) { for (int k = 0; k < ((Component)target).transform.childCount; k++) { SearchAndReplace(((Component)target).transform.GetChild(k)); } } } } public class JMessageLogger : MonoBehaviour { [Tooltip("Used as the header of HUD Tips/Warnings & the name provided in logs after the location name")] public string logName = ""; public void LogMessage(string message) { string text = ""; if (StartOfRound.Instance.shipHasLanded) { text = RoundManager.Instance.currentLevel.PlanetName ?? ""; } JLogHelper.LogInfo("(" + text + ")<" + logName + ">: " + message, JLogLevel.User); } public void SendTip(string message) { JHudHelper.QueueDisplayTip(logName, message); } public void SendWarningTip(string message) { JHudHelper.QueueDisplayTip(logName, message, isWarning: true); } public void SendChatMessage(string message) { HUDManager.Instance.AddTextToChatOnServer(message, -1); } } public class JModConfigGrabber : MonoBehaviour { [Serializable] public class PropertyCheck where F : JFilterProperty { public string propertyName; [Tooltip("When filter is disabled the Success event gets triggered")] public F Filter; [FormerlySerializedAs("Event")] public UnityEvent Success = new UnityEvent(); public UnityEvent Failed = new UnityEvent(); public bool Check(T value) { JLogHelper.LogInfo($"{propertyName} = {value}"); if (Filter.shouldCheck && !Filter.CheckValue(value)) { Failed.Invoke(value); return false; } Success.Invoke(value); return true; } } public string modAuthor = ""; public string modName = ""; private string modGUID; private CustomConfigEntry modEntry; [FormerlySerializedAs("checkAllOnAwake")] public bool checkAllOnEnable = true; [Header("Mod Properties")] public PropertyCheck[] BoolChecks = Array.Empty>(); public PropertyCheck[] IntChecks = Array.Empty>(); public PropertyCheck[] FloatChecks = Array.Empty>(); public PropertyCheck[] StringChecks = Array.Empty>(); [Header("Check All Properties Result")] public UnityEvent CheckSuccess = new UnityEvent(); public UnityEvent CheckFailure = new UnityEvent(); private void Awake() { if (modEntry == null) { modGUID = modAuthor + "." + modName; if (CustomConfigRegistry.Mods.ContainsKey(modGUID)) { modEntry = CustomConfigRegistry.Mods[modGUID]; modEntry.LogInfo("Found JsonMod!"); } else { JLogHelper.LogWarning(modGUID + " JSON mod could not be found in registry."); } } } private void OnEnable() { if (checkAllOnEnable) { CheckAll(); } } public void CheckAll() { if (modEntry != null) { bool flag = true; PropertyCheck[] boolChecks = BoolChecks; foreach (PropertyCheck propertyCheck in boolChecks) { flag &= propertyCheck.Check(modEntry.GetBool(propertyCheck.propertyName)); } PropertyCheck[] intChecks = IntChecks; foreach (PropertyCheck propertyCheck2 in intChecks) { flag &= propertyCheck2.Check(modEntry.GetInt(propertyCheck2.propertyName)); } PropertyCheck[] floatChecks = FloatChecks; foreach (PropertyCheck propertyCheck3 in floatChecks) { flag &= propertyCheck3.Check(modEntry.GetFloat(propertyCheck3.propertyName)); } PropertyCheck[] stringChecks = StringChecks; foreach (PropertyCheck propertyCheck4 in stringChecks) { flag &= propertyCheck4.Check(modEntry.GetString(propertyCheck4.propertyName)); } if (flag) { CheckSuccess.Invoke(); } else { CheckFailure.Invoke(); } } } public void GetPropertyValue(string name) { if (modEntry == null || !modEntry.Configs.ContainsKey(name)) { return; } switch (modEntry.Configs[name].Value.type) { case CustomConfigEntry.EntryType.Bool: { for (int l = 0; l < BoolChecks.Length; l++) { if (BoolChecks[l].propertyName == name) { BoolChecks[l].Check(modEntry.GetBool(name)); break; } } break; } case CustomConfigEntry.EntryType.Int: { for (int j = 0; j < IntChecks.Length; j++) { if (IntChecks[j].propertyName == name) { IntChecks[j].Check(modEntry.GetInt(name)); break; } } break; } case CustomConfigEntry.EntryType.Float: { for (int k = 0; k < FloatChecks.Length; k++) { if (FloatChecks[k].propertyName == name) { FloatChecks[k].Check(modEntry.GetFloat(name)); break; } } break; } case CustomConfigEntry.EntryType.String: { for (int i = 0; i < StringChecks.Length; i++) { if (StringChecks[i].propertyName == name) { StringChecks[i].Check(modEntry.GetString(name)); break; } } break; } } } public void LogInfo(string message) { modEntry?.LogInfo(message); } public void LogWarning(string message) { modEntry?.LogWarning(message); } } public class JNetworkPrefabSpawner : MonoBehaviour { public JNetworkPrefabSet PrefabSet; [Header("Spawn Triggers")] public bool spawnOnEnable = false; [Header("Prefab Spawn Settings")] public bool spawnRandom = false; public string spawnPrefabName; [Tooltip("Spawns the prefab as a child of the spawner. When disabled will spawn it inside the level's map props container.")] public bool spawnAsChild = true; private void OnEnable() { if (spawnOnEnable) { SpawnPrefab(); } } public void SpawnPrefab() { //IL_0072: 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) if (!((NetworkBehaviour)RoundManager.Instance).IsServer && !((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } GameObject val = null; GameObject prefab; if (spawnRandom) { val = PrefabSet.GetRandomPrefab(); } else if (PrefabSet.GetPrefab(spawnPrefabName, out prefab)) { val = prefab; } if ((Object)(object)val != (Object)null) { GameObject val2 = Object.Instantiate(val, ((Component)this).transform.position, ((Component)this).transform.rotation, spawnAsChild ? ((Component)this).transform : RoundManager.Instance.mapPropsContainer.transform); NetworkObject val3 = default(NetworkObject); if (val2.TryGetComponent(ref val3)) { val3.Spawn(false); } } } } public class JPlayerInsideRegion : NetworkBehaviour { public InteractEvent PlayerEnterEvent = new InteractEvent(); [Header("Chance Event")] [Range(0f, 100f)] public float eventChance = 100f; public float chanceInterval = 1f; private float timeAtLastRoll = 0f; public UnityEvent ChanceEvent = new UnityEvent(); [Header("Limit Triggers")] public bool limitEventTriggers = true; public int maxEventTriggers = 1; private int eventTriggers = 0; private readonly List playersInside = new List(); private readonly List foundInside = new List(); private readonly List markRemoval = new List(); public void OnTriggerStay(Collider collider) { PlayerControllerB val = default(PlayerControllerB); if (((Component)collider).gameObject.CompareTag("Player") && ((Component)collider).gameObject.TryGetComponent(ref val)) { int item = val.Index(); foundInside.Add(item); if (!playersInside.Contains(item)) { playersInside.Add(item); ((UnityEvent)(object)PlayerEnterEvent).Invoke(val); } } } public void FixedUpdate() { for (int i = 0; i < playersInside.Count; i++) { if (!foundInside.Contains(playersInside[i])) { markRemoval.Add(playersInside[i]); } } foundInside.Clear(); for (int j = 0; j < markRemoval.Count; j++) { playersInside.Remove(markRemoval[j]); } markRemoval.Clear(); } public void Update() { if (((NetworkBehaviour)this).IsServer || ((NetworkBehaviour)this).IsHost) { ChanceEventServerRpc(); } } [ServerRpc(RequireOwnership = true)] private void ChanceEventServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1519001518u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1519001518u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playersInside.Count != 0 && (!limitEventTriggers || eventTriggers < maxEventTriggers) && Time.realtimeSinceStartup - timeAtLastRoll > chanceInterval) { timeAtLastRoll = Time.realtimeSinceStartup; if (Random.Range(0f, 100f) < eventChance) { eventTriggers++; ChanceEventClientRpc(); } } } [ClientRpc] private void ChanceEventClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3106571262u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3106571262u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ChanceEvent.Invoke(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1519001518u, new RpcReceiveHandler(__rpc_handler_1519001518), "ChanceEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(3106571262u, new RpcReceiveHandler(__rpc_handler_3106571262), "ChanceEventClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1519001518(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((JPlayerInsideRegion)(object)target).ChanceEventServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3106571262(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((JPlayerInsideRegion)(object)target).ChanceEventClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JPlayerInsideRegion"; } } public class JPOI : MonoBehaviour { public string POI; private void Start() { JLevelPropertyRegistry.CreatePOI(POI, ((Component)this).transform); } } public class JRandomPropPlacer : MonoBehaviour, IDungeonLoadListener { [Serializable] public class SpawnableProp { public GameObject prefabToSpawn; public AnimationCurve randomAmount = new AnimationCurve(); public float prefabWidth = 2f; public SpawnRotation spawnRotation = SpawnRotation.Random; public bool spawnFlushAgainstWall = false; public float distanceFromEntrances = 10f; public float distanceBetweenSpawns = 5f; public float randomSpawnRange = 10f; public Vector3 PositionEdgeCheck(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0025: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_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_0061: 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_0068: 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) NavMeshHit val = default(NavMeshHit); if (NavMesh.FindClosestEdge(position, ref val, -1) && ((NavMeshHit)(ref val)).distance < prefabWidth) { Vector3 position2 = ((NavMeshHit)(ref val)).position; Ray val2 = new Ray(position2, position - position2); if (NavMesh.SamplePosition(((Ray)(ref val2)).GetPoint(prefabWidth + 0.5f), ref val, 10f, -1)) { position = ((NavMeshHit)(ref val)).position; return position; } return Vector3.zero; } return position; } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JRandomPropPlacer <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(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; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SpawnProps(); 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 SpawnNodes spawnNodeSelection = SpawnNodes.Children; [Tooltip("When left empty will default to this gameobject.")] public Transform PropContainer; public SpawnableProp[] spawnableProps = new SpawnableProp[1] { new SpawnableProp() }; public NavMeshToRebake rebakeNavMesh = NavMeshToRebake.None; public NavMeshSurface[] rebakeSurfaces; private void Start() { if ((Object)(object)PropContainer == (Object)null) { PropContainer = ((Component)this).transform; } } public void PostDungeonGeneration() { ((MonoBehaviour)this).StartCoroutine(SpawnNextFrame()); } [IteratorStateMachine(typeof(d__8))] private IEnumerator SpawnNextFrame() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } private void SpawnProps() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) JLogHelper.LogInfo($"{((Object)this).name} Spawning map props. {(Object)(object)PropContainer == (Object)null} {spawnableProps.Length == 0}"); if ((Object)(object)PropContainer == (Object)null || spawnableProps.Length == 0) { return; } Random random = new Random(StartOfRound.Instance.randomMapSeed + 666); List list = new List(); switch (spawnNodeSelection) { case SpawnNodes.Children: { for (int l = 0; l < ((Component)this).transform.childCount; l++) { list.Add(((Component)this).transform.GetChild(l).position); } break; } case SpawnNodes.OutsideAINodes: { for (int m = 0; m < RoundManager.Instance.outsideAINodes.Length; m++) { list.Add(RoundManager.Instance.outsideAINodes[m].transform.position); } break; } case SpawnNodes.InsideAINodes: { for (int k = 0; k < RoundManager.Instance.insideAINodes.Length; k++) { list.Add(RoundManager.Instance.insideAINodes[k].transform.position); } break; } case SpawnNodes.AINodes: { for (int i = 0; i < RoundManager.Instance.outsideAINodes.Length; i++) { list.Add(RoundManager.Instance.outsideAINodes[i].transform.position); } for (int j = 0; j < RoundManager.Instance.insideAINodes.Length; j++) { list.Add(RoundManager.Instance.insideAINodes[j].transform.position); } break; } } JLogHelper.LogInfo($"{((Object)this).name} Found {list.Count} nodes available for random selection."); if (list.Count == 0) { return; } List list2 = new List(); int num = 0; RaycastHit val4 = default(RaycastHit); NetworkObject val5 = default(NetworkObject); for (int n = 0; n < spawnableProps.Length; n++) { int num2 = Mathf.RoundToInt(spawnableProps[n].randomAmount.Evaluate((float)random.NextDouble())); if (num2 <= 0) { continue; } SpawnableProp spawnableProp = spawnableProps[n]; bool flag = (Object)(object)spawnableProp.prefabToSpawn.GetComponent() != (Object)null && !((NetworkBehaviour)RoundManager.Instance).IsServer && !((NetworkBehaviour)RoundManager.Instance).IsHost; for (int num3 = 0; num3 < num2; num3++) { Vector3 randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(list[random.Next(0, list.Count)], spawnableProp.randomSpawnRange, default(NavMeshHit), random, -1, 1f); bool flag2 = false; if (spawnableProp.distanceFromEntrances > 0f) { for (int num4 = 0; num4 < JLevelPropertyRegistry.EntranceTeleports.Count; num4++) { if (Vector3.Distance(((Component)JLevelPropertyRegistry.EntranceTeleports[num4]).transform.position, randomNavMeshPositionInBoxPredictable) < spawnableProp.distanceFromEntrances) { flag2 = true; break; } } } if (flag2) { JLogHelper.LogInfo($"{((Object)this).name} Skiped spawning prop. (Too close to an entrance teleport) {randomNavMeshPositionInBoxPredictable}", JLogLevel.Wesley); continue; } if (spawnableProp.distanceBetweenSpawns > 0f) { for (int num5 = 0; num5 < list2.Count; num5++) { if (Vector3.Distance(randomNavMeshPositionInBoxPredictable, list2[num5]) < spawnableProp.distanceBetweenSpawns) { flag2 = true; break; } } } if (flag2) { JLogHelper.LogInfo($"{((Object)this).name} Skiped spawning prop. (Too close to another prop) {randomNavMeshPositionInBoxPredictable}", JLogLevel.Wesley); continue; } SpawnRotation spawnRotation = spawnableProp.spawnRotation; if (1 == 0) { } Vector3 val = (Vector3)(spawnRotation switch { SpawnRotation.FacingAwayFromWall => new Vector3(0f, RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(randomNavMeshPositionInBoxPredictable + Vector3.up * 0.2f, 25f, 6), 0f), SpawnRotation.FacingWall => new Vector3(0f, RoundManager.Instance.YRotationThatFacesTheNearestFromPosition(randomNavMeshPositionInBoxPredictable + Vector3.up * 0.2f, 25f, 6), 0f), SpawnRotation.BackToWall => RandomEulers(spawnableProp.prefabToSpawn.transform.eulerAngles, random), SpawnRotation.Random => RandomEulers(spawnableProp.prefabToSpawn.transform.eulerAngles, random), _ => new Vector3(spawnableProp.prefabToSpawn.transform.eulerAngles.x, 0f, spawnableProp.prefabToSpawn.transform.eulerAngles.z), }); if (1 == 0) { } Vector3 eulerAngles = val; Vector3 val2 = spawnableProp.PositionEdgeCheck(randomNavMeshPositionInBoxPredictable); list2.Add(val2); if (flag) { continue; } GameObject val3 = Object.Instantiate(spawnableProp.prefabToSpawn, val2, Quaternion.identity, PropContainer); val3.transform.eulerAngles = eulerAngles; if (spawnableProp.spawnRotation == SpawnRotation.BackToWall && Physics.Raycast(val3.transform.position, -val3.transform.forward, ref val4, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { val3.transform.position = ((RaycastHit)(ref val4)).point; if (spawnableProp.spawnFlushAgainstWall) { val3.transform.forward = ((RaycastHit)(ref val4)).normal; val3.transform.eulerAngles = new Vector3(0f, val3.transform.eulerAngles.y, 0f); } } if (val3.TryGetComponent(ref val5)) { val5.Spawn(true); } JLogHelper.LogInfo($"{((Object)this).name} spawned {((Object)val3).name} at {val3.transform.position}", JLogLevel.Wesley); num++; } } JLogHelper.LogInfo($"{((Object)this).name} spawned {num} props!"); if (num <= 0) { return; } switch (rebakeNavMesh) { case NavMeshToRebake.Exterior: { GameObject obj2 = GameObject.FindGameObjectWithTag("OutsideLevelNavMesh"); if (obj2 != null) { NavMeshSurface component = obj2.GetComponent(); if (component != null) { component.BuildNavMesh(); } } break; } case NavMeshToRebake.Custom: { for (int num6 = 0; num6 < rebakeSurfaces.Length; num6++) { NavMeshSurface obj = rebakeSurfaces[num6]; if (obj != null) { obj.BuildNavMesh(); } } break; } } } private Vector3 RandomEulers(Vector3 original, Random random) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) return new Vector3(original.x, (float)random.Next(0, 360), original.z); } } public class JShipController : MonoBehaviour { public void MakeShipLeave() { StartOfRound.Instance.ShipLeaveAutomatically(true); } public void PowerSurgeShip() { StartOfRound.Instance.PowerSurgeShip(); } public void ToggleMonitors(bool toggle) { StartOfRound.Instance.mapScreen.SwitchScreenOn(toggle); } public void ToggleShipLights(bool toggle) { StartOfRound.Instance.shipRoomLights.SetShipLightsServerRpc(toggle); } } public class JSlimePoint : MonoBehaviour { public float slimeDistance = 2.55f; public float slimePotency = 8f; public bool useColliderBounds = false; [Tooltip("This has no effect in game. it is just a tool for visualizing the effective range of this script with collider bounds.")] public Transform debugTransform; private void OnDrawGizmos() { //IL_0001: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) Gizmos.color = Color.green; if (useColliderBounds && Object.op_Implicit((Object)(object)debugTransform)) { Vector3 item = GetClosestPoint(debugTransform.position).point; Gizmos.DrawWireSphere(item, slimeDistance); Gizmos.color = Color.red; Gizmos.DrawLine(item, debugTransform.position); } else { Gizmos.DrawWireSphere(((Component)this).transform.position, slimeDistance); } } public void Update() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if (!localPlayerController.isPlayerDead && !(slimeDistance <= 0f)) { float num = (useColliderBounds ? GetClosestPoint(((Component)localPlayerController).transform.position).distance : Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController).transform.position)); if (num < slimeDistance) { localPlayerController.slipperyFloor = Mathf.Max(localPlayerController.slipperyFloor, Mathf.Lerp(slimePotency, 0f, num / slimeDistance)); } } } private (Vector3 point, float distance) GetClosestPoint(Vector3 pos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) float num = float.MaxValue; Vector3 item = Vector3.zero; Collider[] components = ((Component)this).GetComponents(); foreach (Collider val in components) { Vector3 val2 = val.ClosestPoint(pos); float num2 = Vector3.Distance(val2, pos); if (num2 < num) { num = num2; item = val2; } } return (item, num); } } public class JStaminaController : MonoBehaviour { public float passiveChange = -0.2f; public float changeMult = 1f; private float lastStamina = 0f; public void OnEnable() { lastStamina = StartOfRound.Instance.localPlayerController.sprintMeter; } public void Update() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if (localPlayerController.isPlayerDead) { return; } Collider[] components = ((Component)this).GetComponents(); foreach (Collider val in components) { if (Vector3.Distance(val.ClosestPoint(((Component)localPlayerController).transform.position), ((Component)localPlayerController).transform.position) < 0.1f) { float num = localPlayerController.sprintMeter - lastStamina; localPlayerController.sprintMeter = Mathf.Clamp(lastStamina + num * changeMult + passiveChange * Time.deltaTime, 0f, 1f); break; } } lastStamina = localPlayerController.sprintMeter; } } public class JTerminalController : NetworkBehaviour { public int transactionAmount = 200; public UnityEvent TransactionSuccess = new UnityEvent(); public UnityEvent TransactionFailed = new UnityEvent(); public void AwardCredits(int amount) { AwardCreditsServerRpc(amount); } [ServerRpc(RequireOwnership = false)] private void AwardCreditsServerRpc(int amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3987043362u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3987043362u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AwardCreditsClientRpc(amount); } } } [ClientRpc] private void AwardCreditsClientRpc(int amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(41614221u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 41614221u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Terminal terminal = JLevelPropertyRegistry.GetTerminal(); terminal.groupCredits += amount; } } } public void CreditTransaction(int amount) { CreditTransactionServerRpc(amount); } [ServerRpc(RequireOwnership = false)] private void CreditTransactionServerRpc(int amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(797093075u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 797093075u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CreditTransactionClientRpc(amount); } } } [ClientRpc] private void CreditTransactionClientRpc(int amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(488828564u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 488828564u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Terminal terminal = JLevelPropertyRegistry.GetTerminal(); if (terminal.groupCredits >= amount) { terminal.groupCredits -= amount; TransactionSuccess.Invoke(); } else { TransactionFailed.Invoke(); } } } public void TriggerSignalTranslator(string message) { SignalTranslator val = Object.FindObjectOfType(); if (!((Object)(object)val == (Object)null) && !(Time.realtimeSinceStartup - val.timeLastUsingSignalTranslator < 8f)) { TransmitMessage(message); } } public void TransmitMessage(string message) { HUDManager.Instance.UseSignalTranslatorServerRpc(message); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3987043362u, new RpcReceiveHandler(__rpc_handler_3987043362), "AwardCreditsServerRpc"); ((NetworkBehaviour)this).__registerRpc(41614221u, new RpcReceiveHandler(__rpc_handler_41614221), "AwardCreditsClientRpc"); ((NetworkBehaviour)this).__registerRpc(797093075u, new RpcReceiveHandler(__rpc_handler_797093075), "CreditTransactionServerRpc"); ((NetworkBehaviour)this).__registerRpc(488828564u, new RpcReceiveHandler(__rpc_handler_488828564), "CreditTransactionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3987043362(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); target.__rpc_exec_stage = (__RpcExecStage)1; ((JTerminalController)(object)target).AwardCreditsServerRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_41614221(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); target.__rpc_exec_stage = (__RpcExecStage)1; ((JTerminalController)(object)target).AwardCreditsClientRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_797093075(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); target.__rpc_exec_stage = (__RpcExecStage)1; ((JTerminalController)(object)target).CreditTransactionServerRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_488828564(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); target.__rpc_exec_stage = (__RpcExecStage)1; ((JTerminalController)(object)target).CreditTransactionClientRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JTerminalController"; } } public class JWaterFilter : MonoBehaviour { [Tooltip("If you have multiple of the same type of water in your level you can point all of your JWaterFilter scripts to the same Volume")] public Volume underwaterFilter; [Header("Audio")] public bool playBreathingSounds = true; public AudioSource customUnderwaterSounds; public bool enableUnderwaterLowPassFilter = true; public float underwaterLowPassCutoff = 700f; public void Start() { underwaterFilter.weight = 0f; } public void UnderwaterFilters(HUDManager manager, bool isSpectating) { ((Behaviour)manager.audioListenerLowPass).enabled = enableUnderwaterLowPassFilter; manager.audioListenerLowPass.cutoffFrequency = Mathf.Lerp(manager.audioListenerLowPass.cutoffFrequency, underwaterLowPassCutoff, 10f * Time.deltaTime); underwaterFilter.weight = 1f; if (playBreathingSounds && !isSpectating && !manager.breathingUnderwaterAudio.isPlaying) { manager.breathingUnderwaterAudio.Play(); } if (!isSpectating && (Object)(object)customUnderwaterSounds != (Object)null && !customUnderwaterSounds.isPlaying) { customUnderwaterSounds.Play(); } } } public class JWeatherObject : MonoBehaviour { public bool isWhitelist = true; public LevelWeatherType[] AllowedWeathers = Array.Empty(); [Header("Targets ")] public GameObject activeObject; public bool defaultToSelf = true; public GameObject inverseObject; [Header("Event Triggers")] public UnityEvent onActivate = new UnityEvent(); public UnityEvent onDeactivate = new UnityEvent(); [Header("Weather IDs (For Modded Weathers)")] public string[] WeatherStrings = Array.Empty(); public void Start() { if (defaultToSelf && (Object)(object)activeObject == (Object)null) { activeObject = ((Component)this).gameObject; } ToggleObjects(); } public void ToggleObjects() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) bool flag = (AllowedWeathers.Contains(RoundManager.Instance.currentLevel.currentWeather) || CheckWeatherStrings()) == isWhitelist; GameObject obj = activeObject; if (obj != null) { obj.SetActive(flag); } GameObject obj2 = inverseObject; if (obj2 != null) { obj2.SetActive(!flag); } if (flag) { onActivate.Invoke(); } else { onDeactivate.Invoke(); } } private bool CheckWeatherStrings() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected I4, but got Unknown int num = (int)RoundManager.Instance.currentLevel.currentWeather; string text = ""; if (num > 0) { WeatherEffect val = TimeOfDay.Instance.effects[num]; text = val.name; } bool flag = false; if (text != "") { flag = WeatherStrings.Contains(text); } if (!flag && JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.WeatherRegistry)) { WeatherStrings.Contains(JWeatherRegistryHelper.GetCurrentWeatherName()); } return flag; } } public class JWeatherOverride : MonoBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JWeatherOverride <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.overrideDelay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.OverrideWeatherObjects(); Instance = <>4__this; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static JWeatherOverride Instance; [Header("Overrides")] public WeatherEffect[] overrideEffects = Array.Empty(); [Header("Foggy Weather")] public LocalVolumetricFog[] foggyWeatherVolumes = Array.Empty(); public Volume[] foggyVolumes = Array.Empty(); [Header("Debug")] public float overrideDelay = 4f; public void Start() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 JLogHelper.LogInfo("Weather Override Start", JLogLevel.User); Random random = new Random(StartOfRound.Instance.randomMapSeed + 101); WeatherEffect[] array = overrideEffects; foreach (WeatherEffect val in array) { val.effectEnabled = false; GameObject effectPermanentObject = val.effectPermanentObject; if (effectPermanentObject != null) { effectPermanentObject.SetActive(false); } } if ((int)TimeOfDay.Instance.currentLevelWeather == 3) { float num = random.Next((int)TimeOfDay.Instance.currentWeatherVariable, (int)TimeOfDay.Instance.currentWeatherVariable2); LocalVolumetricFog[] array2 = foggyWeatherVolumes; foreach (LocalVolumetricFog val2 in array2) { val2.parameters.meanFreePath = num; } Volume[] array3 = foggyVolumes; Fog val4 = default(Fog); foreach (Volume val3 in array3) { VolumeProfile profile = val3.profile; if (profile.TryGet(ref val4)) { ((VolumeParameter)(object)val4.meanFreePath).value = num; } } } ((MonoBehaviour)this).StartCoroutine(OverrideWeather()); } public WeatherEffect getOverrideEffect(string original) { WeatherEffect[] array = overrideEffects; foreach (WeatherEffect val in array) { if (original.Equals(val.name)) { return val; } } return null; } [IteratorStateMachine(typeof(d__7))] private IEnumerator OverrideWeather() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } private void OverrideWeatherObjects() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.WeatherRegistry)) { JWeatherRegistryHelper.OverrideWeatherObjects(this); } if ((int)StartOfRound.Instance.currentLevel.currentWeather == -1) { return; } WeatherEffect val = TimeOfDay.Instance.effects[StartOfRound.Instance.currentLevel.currentWeather]; WeatherEffect overrideEffect = getOverrideEffect(val.name); if (overrideEffect == null) { return; } val.effectEnabled = false; overrideEffect.effectEnabled = true; if ((Object)(object)overrideEffect.effectPermanentObject != (Object)null) { if ((Object)(object)val.effectPermanentObject != (Object)null) { val.effectPermanentObject.SetActive(false); } overrideEffect.effectPermanentObject.SetActive(true); } if (!StartOfRound.Instance.currentLevel.overrideWeather) { val.effectEnabled = false; overrideEffect.effectEnabled = true; } } public void Update() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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) CheckWeatherEffectChanges(); Vector3 val = ((!GameNetworkManager.Instance.localPlayerController.isPlayerDead) ? ((Component)StartOfRound.Instance.localPlayerController).transform.position : ((Component)StartOfRound.Instance.spectateCamera).transform.position); for (int i = 0; i < overrideEffects.Length; i++) { if (overrideEffects[i].effectEnabled) { if (!string.IsNullOrEmpty(overrideEffects[i].sunAnimatorBool) && (Object)(object)TimeOfDay.Instance.sunAnimator != (Object)null) { TimeOfDay.Instance.sunAnimator.SetBool(overrideEffects[i].sunAnimatorBool, true); } overrideEffects[i].transitioning = false; if ((Object)(object)overrideEffects[i].effectObject != (Object)null) { overrideEffects[i].effectObject.SetActive(true); if (overrideEffects[i].lerpPosition) { overrideEffects[i].effectObject.transform.position = Vector3.Lerp(overrideEffects[i].effectObject.transform.position, val, Time.deltaTime); } else { overrideEffects[i].effectObject.transform.position = val; } } } else if (!overrideEffects[i].transitioning) { overrideEffects[i].transitioning = true; if (overrideEffects[i].lerpPosition) { ((MonoBehaviour)this).StartCoroutine(TimeOfDayPatch.fadeOutEffect(TimeOfDay.Instance, overrideEffects[i], val)); } else { TimeOfDayPatch.DisableWeatherEffect(TimeOfDay.Instance, overrideEffects[i]); } } } } private void CheckWeatherEffectChanges() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.WeatherRegistry)) { JWeatherRegistryHelper.CheckWeatherChanges(this); } if ((int)StartOfRound.Instance.currentLevel.currentWeather == -1) { return; } WeatherEffect val = TimeOfDay.Instance.effects[StartOfRound.Instance.currentLevel.currentWeather]; WeatherEffect overrideEffect = getOverrideEffect(val.name); if (overrideEffect != null) { if (val.effectEnabled) { val.effectEnabled = false; overrideEffect.effectEnabled = true; } if ((Object)(object)val.effectPermanentObject != (Object)null && (Object)(object)overrideEffect.effectPermanentObject != (Object)null && val.effectPermanentObject.activeSelf) { val.effectPermanentObject.SetActive(false); overrideEffect.effectPermanentObject.SetActive(true); } } } } public class MagicWesley : MonoBehaviour { public string favoriteQuote = ""; public bool inRubberRoom = false; public bool withRats = true; public void Start() { if (JLL.purgeWesley.Value) { Kill(); return; } if (!inRubberRoom && favoriteQuote != "") { WesleyLog(favoriteQuote); } if (withRats && Random.Range(0f, 10f) < 1.5f) { WesleyLog("This is why I haven't updated my moons..."); } } public void UpdateYourMoons() { WesleyLog("soon tm"); } public void PleaseSay(string txt) { if (Random.Range(0f, 10f) < 1f) { WesleyLog("No"); } else { WesleyLog(txt); } } public void Kill() { JLogHelper.LogInfo("Removing Wesley.", JLogLevel.User); WesleyLog("NOOOO-"); Object.Destroy((Object)(object)this); } private static void WesleyLog(string msg) { if (JLogHelper.AcceptableLogLevel(JLogLevel.User)) { JLL.Instance.wesley.LogInfo((object)msg); } } } public class ModLoadedCheck : MonoBehaviour { public bool checkOnStart = true; public JCompatabilityHelper.CachedMods checkedMod = JCompatabilityHelper.CachedMods.Other; public string modGUID = "JacobG5.JLL"; [Tooltip("Disables GameObject when the select mod isn't loaded.")] public GameObject hideWhenMissing; public UnityEvent ModFound = new UnityEvent(); public UnityEvent ModMissing = new UnityEvent(); private void Start() { if (checkOnStart) { CheckForMod(); } } public void CheckForMod() { if ((checkedMod == JCompatabilityHelper.CachedMods.Other) ? JCompatabilityHelper.IsLoaded(modGUID) : JCompatabilityHelper.IsLoaded(checkedMod)) { ModFound.Invoke(); return; } ModMissing.Invoke(); GameObject obj = hideWhenMissing; if (obj != null) { obj.SetActive(false); } } } public class RandomClipPlayer : MonoBehaviour { [Serializable] public class WeightedAudioClip : IWeightedItem { public AudioClip clip; public float volumeMultiplier = 1f; [Range(0f, 100f)] public int Weight = 20; public int GetWeight() { return Weight; } } public AudioSource audioSource; public WeightedAudioClip[] weightedClips = new WeightedAudioClip[1] { new WeightedAudioClip { Weight = 20 } }; public float minVolume = 0.8f; public float maxVolume = 1f; public bool changePitch = false; public float minPitch = 0.6f; public float maxPitch = 1f; [Header("Environment")] public bool walkieCanHear = true; public float walkieVolumeMultiplier = 0.85f; public bool creaturesCanHear = true; public float creatureVolumeMultiplier = 0.5f; public float creatureRangeMultiplier = 4f; public void PlayRandomClip() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)audioSource) || weightedClips.Length == 0) { return; } WeightedAudioClip weightedRandom = weightedClips.GetWeightedRandom(); if ((Object)(object)weightedRandom.clip != (Object)null) { if (changePitch) { audioSource.pitch = Random.Range(minPitch, maxPitch); } float num = Random.Range(minVolume, maxVolume) * weightedRandom.volumeMultiplier; audioSource.PlayOneShot(weightedRandom.clip, num); if (walkieCanHear) { WalkieTalkie.TransmitOneShotAudio(audioSource, weightedRandom.clip, num * walkieVolumeMultiplier); } if (creaturesCanHear) { RoundManager.Instance.PlayAudibleNoise(((Component)audioSource).transform.position, creatureRangeMultiplier * num, num * creatureVolumeMultiplier, 0, false, 0); } } } } public class RandomizedEvent : NetworkBehaviour { [Serializable] public class WeightedEvent : IWeightedItem { public UnityEvent Event = new UnityEvent(); public InteractEvent PlayerEvent = new InteractEvent(); [Range(0f, 100f)] public int Weight = 20; public bool SendClientRPC = true; public int GetWeight() { return Weight; } } [FormerlySerializedAs("triggerOnAwake")] [FormerlySerializedAs("triggerOnEnable")] public bool triggerOnStart = false; public WeightedEvent[] weightedEvents = new WeightedEvent[1] { new WeightedEvent { Weight = 20 } }; [Header("Triggered by StartRandomPlayerEvent() using a random player in the lobby")] [Tooltip("Event run on a random player in the lobby after StartRandomPlayerEvent() is called by another event.")] public InteractEvent RandomPlayerEvent = new InteractEvent(); [Header("Triggered by StartRandomNumberEvent() generating a random number between X & Y")] [Tooltip("Event run on all clients using a randomly generated number between two values.")] public FloatEvent RandomNumberEvent = new FloatEvent(); [Tooltip("Event run on all clients using a randomly generated number between two values.")] public IntEvent RandomRoundedNumberEvent = new IntEvent(); [Header("Advanced")] public bool isNetworkSynced = true; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (triggerOnStart && (!isNetworkSynced || ((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)) { RollEvent(); } } public void RollEvent() { JLogHelper.LogInfo(((Object)this).name + " starting random roll!"); if (isNetworkSynced) { RollRandomServerRpc(-1); return; } IWeightedItem[] weightedItems = weightedEvents; TriggerEvent(IWeightedItem.GetRandomIndex(weightedItems)); } public void RollPlayerEvent(PlayerControllerB player) { if (isNetworkSynced) { RollRandomServerRpc(player.Index()); return; } IWeightedItem[] weightedItems = weightedEvents; TriggerEvent(IWeightedItem.GetRandomIndex(weightedItems), player.Index()); } [ServerRpc(RequireOwnership = false)] private void RollRandomServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(862362801u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 862362801u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (weightedEvents.Length != 0) { IWeightedItem[] weightedItems = weightedEvents; int randomIndex = IWeightedItem.GetRandomIndex(weightedItems); JLogHelper.LogInfo($"{((Object)this).name} - Server Generated: {randomIndex}"); if (weightedEvents[randomIndex].SendClientRPC) { RollResultClientRpc(randomIndex, playerId); } else { TriggerEvent(randomIndex, playerId); } } } [ClientRpc] private void RollResultClientRpc(int value, int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2905441623u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2905441623u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; JLogHelper.LogInfo($"{((Object)this).name} - Client Received: {value}"); TriggerEvent(value, playerId); } } } private void TriggerEvent(int value, int playerId = -1) { weightedEvents[value].Event.Invoke(); if (playerId != -1) { ((UnityEvent)(object)weightedEvents[value].PlayerEvent).Invoke(RoundManager.Instance.playersManager.allPlayerScripts[playerId]); } } public void StartRandomPlayerEvent() { RandomPlayerEventServerRpc(); } [ServerRpc(RequireOwnership = false)] private void RandomPlayerEventServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2647303802u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2647303802u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RandomPlayerEventClientRpc(Random.Range(0, RoundManager.Instance.playersManager.allPlayerScripts.Length)); } } } [ClientRpc] private void RandomPlayerEventClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4072368991u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4072368991u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((UnityEvent)(object)RandomPlayerEvent).Invoke(RoundManager.Instance.playersManager.allPlayerScripts[Math.Clamp(playerId, 0, RoundManager.Instance.playersManager.allPlayerScripts.Length - 1)]); } } } public void StartRandomNumberEvent(Vector2 minMax) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) RandomNumberEventServerRpc(minMax); } [ServerRpc(RequireOwnership = false)] private void RandomNumberEventServerRpc(Vector2 minMax) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(510161519u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref minMax); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 510161519u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!(minMax.x > minMax.y)) { RandomNumberEventClientRpc((minMax.x == minMax.y) ? minMax.x : Random.Range(minMax.x, minMax.y)); } } } [ClientRpc] private void RandomNumberEventClientRpc(float number) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2527954809u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref number, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2527954809u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((UnityEvent)RandomNumberEvent).Invoke(number); ((UnityEvent)RandomRoundedNumberEvent).Invoke(Mathf.RoundToInt(number)); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(862362801u, new RpcReceiveHandler(__rpc_handler_862362801), "RollRandomServerRpc"); ((NetworkBehaviour)this).__registerRpc(2905441623u, new RpcReceiveHandler(__rpc_handler_2905441623), "RollResultClientRpc"); ((NetworkBehaviour)this).__registerRpc(2647303802u, new RpcReceiveHandler(__rpc_handler_2647303802), "RandomPlayerEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(4072368991u, new RpcReceiveHandler(__rpc_handler_4072368991), "RandomPlayerEventClientRpc"); ((NetworkBehaviour)this).__registerRpc(510161519u, new RpcReceiveHandler(__rpc_handler_510161519), "RandomNumberEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(2527954809u, new RpcReceiveHandler(__rpc_handler_2527954809), "RandomNumberEventClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_862362801(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomizedEvent)(object)target).RollRandomServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2905441623(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomizedEvent)(object)target).RollResultClientRpc(value, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2647303802(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomizedEvent)(object)target).RandomPlayerEventServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4072368991(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomizedEvent)(object)target).RandomPlayerEventClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_510161519(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector2 minMax = default(Vector2); ((FastBufferReader)(ref reader)).ReadValueSafe(ref minMax); target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomizedEvent)(object)target).RandomNumberEventServerRpc(minMax); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2527954809(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0044: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float number = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref number, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RandomizedEvent)(object)target).RandomNumberEventClientRpc(number); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RandomizedEvent"; } } public class RandomSeedEvent : MonoBehaviour, IDungeonLoadListener { [Serializable] public class WeightedPosEvent : IWeightedItem { public TransformMove[] MoveObjects = Array.Empty(); public UnityEvent Event = new UnityEvent(); [Range(0f, 100f)] public int Weight = 20; public int GetWeight() { return Weight; } } [Serializable] public class TransformMove { public Transform Object; public Transform TargetLocation; public void Move() { //IL_002f: 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) if ((Object)(object)Object != (Object)null && (Object)(object)TargetLocation != (Object)null) { Object.position = TargetLocation.position; Object.rotation = TargetLocation.rotation; } } } private Random Random; [Tooltip("Value gets added to level seed to determine random seed.")] public int relativeSeed = 25; [FormerlySerializedAs("rollOnStart")] public bool rollOnDungeonLoad = true; public WeightedPosEvent[] Events = new WeightedPosEvent[1] { new WeightedPosEvent() }; public void PostDungeonGeneration() { if (Random == null) { Random = new Random(RoundManager.Instance.playersManager.randomMapSeed + relativeSeed); } if (rollOnDungeonLoad) { Roll(); } } public void Roll() { if (Random != null) { WeightedPosEvent weightedRandom = Events.GetWeightedRandom(Random); TransformMove[] moveObjects = weightedRandom.MoveObjects; foreach (TransformMove transformMove in moveObjects) { transformMove.Move(); } weightedRandom.Event.Invoke(); } } } public class RigidBodyCuller : MonoBehaviour { [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RigidBodyCuller <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>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 switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => RoundManager.Instance.dungeonCompletedGenerating)); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.active = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public float threshold = 20f; public Rigidbody[] bodies = (Rigidbody[])(object)new Rigidbody[0]; public bool beStupid = false; private bool active = false; [HideInInspector] public bool Culled { get; private set; } = false; public void Start() { Rigidbody[] array = bodies; foreach (Rigidbody val in array) { if ((Object)(object)val != (Object)null) { val.Sleep(); } } ((MonoBehaviour)this).StartCoroutine(AwaitDungeonLoad()); } [IteratorStateMachine(typeof(d__9))] private IEnumerator AwaitDungeonLoad() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this }; } public void FixedUpdate() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0121: Unknown result type (might be due to invalid IL or missing references) if (!active) { return; } if (beStupid) { Culled = Vector3.Distance(((Component)StartOfRound.Instance.localPlayerController).transform.position, ((Component)this).transform.position) > threshold; Rigidbody[] array = bodies; foreach (Rigidbody val in array) { val.isKinematic = Culled; } return; } if (Vector3.Distance(((Component)StartOfRound.Instance.localPlayerController).transform.position, ((Component)this).transform.position) > threshold) { Rigidbody[] array2 = bodies; foreach (Rigidbody val2 in array2) { if (val2.IsSleeping()) { val2.Sleep(); } } Culled = true; return; } if (Culled) { Rigidbody[] array3 = bodies; foreach (Rigidbody val3 in array3) { val3.AddForce(Vector3.zero); } } Culled = false; } } public class SeatController : NetworkBehaviour { public InteractTrigger seatTrigger; public InteractTrigger exitTrigger; private Collider[] exitColliders = Array.Empty(); public Transform[] exitPoints = Array.Empty(); public bool disableExitTrigger = true; public AudioClip sitDown; [HideInInspector] public PlayerControllerB currentPassenger; [HideInInspector] public bool localPlayerInSeat = false; private static readonly int exitLayerMask = 2305; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); exitColliders = ((Component)exitTrigger).gameObject.GetComponents(); ToggleExitColliders(!disableExitTrigger); } private void ToggleExitColliders(bool enabled) { for (int i = 0; i < exitColliders.Length; i++) { exitColliders[i].enabled = enabled; } } [ServerRpc(RequireOwnership = false)] private void LeaveSeatServerRpc(int playerId, Vector3 exitPoint) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(947975618u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref exitPoint); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 947975618u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LeaveSeatClientRpc(playerId, exitPoint); } } } [ClientRpc] private void LeaveSeatClientRpc(int playerId, Vector3 exitPoint) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(420214053u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref exitPoint); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 420214053u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { LeaveSeat(val3, exitPoint); } } } private void LeaveSeat(PlayerControllerB player, Vector3 exitPoint, bool forced = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) player.TeleportPlayer(exitPoint, false, 0f, false, true); currentPassenger = null; if (!((NetworkBehaviour)this).IsOwner) { SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); } if (forced) { player.CancelSpecialTriggerAnimations(); if (((NetworkBehaviour)player).IsLocalPlayer && disableExitTrigger) { ToggleExitColliders(enabled: false); } } seatTrigger.interactable = true; } public void SetPlayerInSeat(PlayerControllerB player) { if ((Object)(object)player != (Object)null) { if ((Object)(object)sitDown != (Object)null) { player.movementAudio.PlayOneShot(sitDown); } if ((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController) { localPlayerInSeat = true; if (disableExitTrigger) { ToggleExitColliders(enabled: true); } } else { seatTrigger.interactable = false; } } currentPassenger = player; } private int GetExitPos() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < exitPoints.Length; i++) { if (!Physics.Linecast(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, exitPoints[i].position, exitLayerMask, (QueryTriggerInteraction)1)) { return i; } } return -1; } private Vector3 GetExitPoint() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_003d: Unknown result type (might be due to invalid IL or missing references) int exitPos = GetExitPos(); if (exitPos != -1) { return exitPoints[exitPos].position; } return ((Component)this).transform.position + Vector3.up; } public void OnCancelAnim() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) seatTrigger.interactable = true; localPlayerInSeat = false; currentPassenger = null; SetVehicleCollisionForPlayer(setEnabled: true, GameNetworkManager.Instance.localPlayerController); LeaveSeatServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); } private void OnDisable() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)currentPassenger != (Object)null) { LeaveSeat(currentPassenger, GetExitPoint(), forced: true); } } public override void OnDestroy() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)currentPassenger != (Object)null) { LeaveSeat(currentPassenger, GetExitPoint(), forced: true); } ((NetworkBehaviour)this).OnDestroy(); } public void ExitSeat() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (localPlayerInSeat) { if (disableExitTrigger) { ToggleExitColliders(enabled: false); } GameNetworkManager.Instance.localPlayerController.TeleportPlayer(GetExitPoint(), false, 0f, false, true); } } public void SetVehicleCollisionForPlayer(bool setEnabled, PlayerControllerB player) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (setEnabled) { ((Collider)((Component)player).GetComponent()).excludeLayers = LayerMask.op_Implicit(0); } else { ((Collider)((Component)player).GetComponent()).excludeLayers = LayerMask.op_Implicit(1073741824); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(947975618u, new RpcReceiveHandler(__rpc_handler_947975618), "LeaveSeatServerRpc"); ((NetworkBehaviour)this).__registerRpc(420214053u, new RpcReceiveHandler(__rpc_handler_420214053), "LeaveSeatClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_947975618(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 exitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeatController)(object)target).LeaveSeatServerRpc(playerId, exitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_420214053(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 exitPoint = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exitPoint); target.__rpc_exec_stage = (__RpcExecStage)1; ((SeatController)(object)target).LeaveSeatClientRpc(playerId, exitPoint); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SeatController"; } } public class TelePoint : MonoBehaviour { private class TeleportEntry { public PlayerControllerB player; public float startTime; public float delay; public bool random; public Region region; public TeleportEntry(PlayerControllerB player, float delay, bool random, Region region = Region.None) { this.player = player; startTime = Time.realtimeSinceStartup; this.delay = delay; this.random = random; this.region = region; base..ctor(); } public bool Update(TelePoint telePoint) { //IL_0070: 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_004a: Unknown result type (might be due to invalid IL or missing references) if (Time.realtimeSinceStartup - startTime > delay) { if (random) { JLLNetworkManager.Instance.RandomTeleportServerRpc(player.Index(), (int)telePoint.randomTeleportRegion, telePoint.rotatePlayer, ((Component)telePoint).transform.rotation.y, telePoint.randomRange); } else { player.TeleportPlayer(((Component)telePoint).transform.position, telePoint.rotatePlayer, ((Component)telePoint).transform.eulerAngles.y, false, true); switch (region) { case Region.Outdoor: player.isInsideFactory = false; break; case Region.Indoor: player.isInsideFactory = true; break; } } return true; } return false; } } public bool rotateObjects = true; [Header("Players")] [Tooltip("Used to set the player as inside or outside the facility.\n'None' will leave the player in whatever state they were before teleporting.")] public Region region = Region.None; public bool rotatePlayer = false; [Tooltip("Ship teleporters have a delay of 1.\nParticle effects are predetermined to last this amount of time.\nTeleport delay is not applied to teleporting game objects currently.\nThis gets ignored when triggering a random teleport in favor of what the random teleport region is.")] public float teleportDelay = 0f; public TeleportEffect teleportEffect = TeleportEffect.None; public AudioClip teleportSound; public AudioSource audioSource; [Header("Random Teleport")] public float randomRange = 10f; public RandomTeleportRegion randomTeleportRegion = RandomTeleportRegion.Indoor; private readonly List TeleportPlayers = new List(); private readonly List Expired = new List(); public void Update() { foreach (TeleportEntry teleportPlayer in TeleportPlayers) { if (teleportPlayer.Update(this)) { Expired.Add(teleportPlayer); } } if (Expired.Count <= 0) { return; } foreach (TeleportEntry item in Expired) { TeleportPlayers.Remove(item); } Expired.Clear(); } public void Teleport(GameObject obj) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) PlayEffects(); obj.transform.position = ((Component)this).transform.position; if (rotateObjects) { obj.transform.rotation = ((Component)this).transform.rotation; } } public void TeleportPlayer(PlayerControllerB player) { PlayEffects(player); TeleportPlayers.Add(new TeleportEntry(player, teleportDelay, random: false, region)); } public void RandomTeleport(PlayerControllerB player) { PlayEffects(player); TeleportPlayers.Add(new TeleportEntry(player, teleportDelay, random: true)); } private void PlayEffects(PlayerControllerB player = null) { int[] values = RoundManager.Instance.playersManager.allPlayerScripts.Select((PlayerControllerB x) => x.Index()).ToArray(); JLogHelper.LogInfo(string.Join(", ", values), JLogLevel.User); if ((Object)(object)player != (Object)null) { switch (teleportEffect) { case TeleportEffect.ShipTeleport: player.beamUpParticle.Play(); break; case TeleportEffect.InverseTeleport: player.beamOutParticle.Play(); break; } if ((Object)(object)teleportSound != (Object)null) { player.movementAudio.PlayOneShot(teleportSound); } } if ((Object)(object)teleportSound != (Object)null && (Object)(object)audioSource != (Object)null) { audioSource.PlayOneShot(teleportSound); } } } public class TerrainObstacle : MonoBehaviour { public int health = 5; public float damageThreshold = 5f; [Header("FX")] public GameObject breakFX; private GameObject oldBreakFX; public AudioClip[] clips = Array.Empty(); [Header("Collision Types")] public bool detectTriggers = true; public bool detectColliders = true; public UnityEvent OnDamage = new UnityEvent(); public UnityEvent OnDestroy = new UnityEvent(); public void OnTriggerEnter(Collider other) { if (detectTriggers) { CalcCollision(other); } } public void OnCollisionEnter(Collision collision) { if (detectColliders) { CalcCollision(collision.collider); } } public void CalcCollision(Collider detected) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) VehicleController val = default(VehicleController); if (((Component)detected).TryGetComponent(ref val)) { float magnitude = ((Vector3)(ref val.averageVelocity)).magnitude; JLogHelper.LogInfo($"Hit by cruiser: {magnitude}", JLogLevel.Wesley); if (!((Object)(object)val == (Object)null) && ((NetworkBehaviour)val).IsOwner && magnitude > damageThreshold && Vector3.Angle(val.averageVelocity, ((Component)this).transform.position - val.mainRigidbody.position) < 80f) { JLLNetworkManager.Instance.DestroyTerrainObstacleOnLocalClient(((Component)this).transform.position, Mathf.RoundToInt(magnitude)); val.CarReactToObstacle(val.mainRigidbody.position - ((Component)this).transform.position, ((Component)this).transform.position, Vector3.zero, (CarObstacleType)2, 1f, (EnemyAI)null, true); } } } public void Damage(int ammount) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (health <= 0) { return; } health -= ammount; JLogHelper.LogInfo($"{((Object)this).name} hit for {ammount} dmg! HP = {health}", JLogLevel.Wesley); if ((Object)(object)breakFX != (Object)null) { if ((Object)(object)oldBreakFX != (Object)null) { Object.Destroy((Object)(object)oldBreakFX); } AudioSource val = default(AudioSource); if ((oldBreakFX = Object.Instantiate(breakFX, ((Component)this).gameObject.transform.position + Vector3.up, Quaternion.identity)).TryGetComponent(ref val)) { if (clips.Length != 0) { val.clip = clips[Random.Range(0, clips.Length - 1)]; } val.Play(); } } if (health <= 0) { OnDestroy.Invoke(); Object.Destroy((Object)(object)((Component)this).gameObject); } else { OnDamage.Invoke(); } } } public class TriggerEnterEvent : MonoBehaviour { [FormerlySerializedAs("onAwake")] public UnityEvent onEnabled = new UnityEvent(); [Header("OnTriggerEnter")] [Tooltip("Event run when a GameObject enters the trigger")] public ObjectEvent anythingEntered = new ObjectEvent(); [Space(15f)] [Tooltip("Event run when the entered collider is a Player")] public InteractEvent playerEntered = new InteractEvent(); [Tooltip("Event run when the entered collider is an Enemy")] public EnemyEvent enemyEntered = new EnemyEvent(); [Tooltip("Event run when the entered collider is a Vehicle")] public VehicleEvent vehicleEntered = new VehicleEvent(); [Tooltip("Event run when the entered collider is damagable by weapons and not any of the above types")] public DamageableEvent hittableEntered = new DamageableEvent(); [Tooltip("Event run when the entered collider is not identified as any of the above things")] public ObjectEvent unknownEntered = new ObjectEvent(); public void OnEnable() { onEnabled.Invoke(); } public void OnTriggerEnter(Collider other) { ((UnityEvent)anythingEntered).Invoke(((Component)other).gameObject); InvokeType(((Component)other).gameObject, DamageTrigger.IdentifyCollider(((Component)other).gameObject)); } private void InvokeType(GameObject target, int type) { switch (type) { case 0: ((UnityEvent)(object)playerEntered).Invoke(target.GetComponent()); break; case 1: ((UnityEvent)enemyEntered).Invoke(target.GetComponent().mainScript); break; case 2: ((UnityEvent)vehicleEntered).Invoke(target.GetComponent()); break; case 3: ((UnityEvent)hittableEntered).Invoke(target.GetComponent()); break; default: ((UnityEvent)unknownEntered).Invoke(target); break; } } } } namespace JLL.Components.Helpers { public class BooleanHelper : MonoBehaviour { public UnityEvent OnTrue = new UnityEvent(); public UnityEvent OnFalse = new UnityEvent(); public BooleanEvent InverseEvent = new BooleanEvent(); public void Split(bool value) { if (value) { OnTrue.Invoke(); } else { OnFalse.Invoke(); } } public void Inverse(bool value) { ((UnityEvent)(object)InverseEvent).Invoke(!value); } } public class MathHelper : MonoBehaviour { [Serializable] public class MathOperation { public Operation operation; public float value; public float Perform(float number) { Operation operation = this.operation; if (1 == 0) { } float result = operation switch { Operation.Add => number + value, Operation.Subtract => number - value, Operation.Multiply => number * value, Operation.Divide => number / value, Operation.Min => Mathf.Min(number, value), Operation.Max => Mathf.Max(number, value), Operation.AbsoluteValue => Mathf.Abs(number), Operation.Power => Mathf.Pow(number, value), _ => number, }; if (1 == 0) { } return result; } } public enum Operation { Add, Subtract, Multiply, Divide, Min, Max, AbsoluteValue, Power } public MathOperation[] Operations = Array.Empty(); public FloatEvent Value = new FloatEvent(); public IntEvent RoundedValue = new IntEvent(); public void DoMath(float value) { for (int i = 0; i < Operations.Length; i++) { value = Operations[i].Perform(value); } ((UnityEvent)Value).Invoke(value); ((UnityEvent)RoundedValue).Invoke(Mathf.RoundToInt(value)); } public void DoMath(int value) { DoMath((float)value); } } public class ObjectConverter : MonoBehaviour { public ObjectEvent OutputObject = new ObjectEvent(); public InteractEvent OutputPlayer = new InteractEvent(); public EnemyEvent OutputEnemyAI = new EnemyEvent(); public VehicleEvent OutputVehicle = new VehicleEvent(); public void AsGameObject(MonoBehaviour behaviour) { ((UnityEvent)OutputObject).Invoke(((Component)behaviour).gameObject); } public void AsPlayer(GameObject obj) { PlayerControllerB val = default(PlayerControllerB); if (obj.TryGetComponent(ref val)) { ((UnityEvent)(object)OutputPlayer).Invoke(val); } } public void AsEnemy(GameObject obj) { EnemyAI val = default(EnemyAI); EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); if (obj.TryGetComponent(ref val)) { ((UnityEvent)OutputEnemyAI).Invoke(val); } else if (obj.TryGetComponent(ref val2)) { ((UnityEvent)OutputEnemyAI).Invoke(val2.mainScript); } } public void AsVehicle(GameObject obj) { VehicleController val = default(VehicleController); if (obj.TryGetComponent(ref val)) { ((UnityEvent)OutputVehicle).Invoke(val); } } } public class TransformHelper : MonoBehaviour { public void ParentToThis(MonoBehaviour target) { ParentToThis(((Component)target).gameObject); } public void ParentToThis(GameObject target) { target.transform.parent = ((Component)this).transform; } public void Unparent(MonoBehaviour target) { Unparent(((Component)target).gameObject); } public void Unparent(GameObject target) { target.transform.parent = null; } public void ParentTo(MonoBehaviour target) { ParentTo(((Component)target).gameObject); } public void ParentTo(GameObject target) { ((Component)this).transform.parent = target.transform; } } } namespace JLL.Components.Filters { public class DateFilter : JFilter { [Serializable] public class DateEntryFilter { public WeekDayFilter dayOfWeek = new WeekDayFilter { value = DayOfWeek.Monday }; public IntFilter day = new IntFilter { value = 1 }; public MonthFilter month = new MonthFilter { value = Month.January }; public IntFilter year = new IntFilter { value = 2000 }; } [Serializable] public class DateEntry { public int day = 1; public Month month = Month.January; public DateTime ToDateTime() { return new DateTime(DateTime.Now.Year, (int)month, day); } } [Serializable] public class DateRange { public DateEntry startDate = new DateEntry(); public DateEntry endDate = new DateEntry { month = Month.February }; public bool IsBetweenDates(DateTime time) { return time.Ticks > startDate.ToDateTime().Ticks && time.Ticks < endDate.ToDateTime().Ticks; } } [Serializable] public class MonthFilter : NumFilter { public override bool CheckValue(Month val) { return CheckNum((float)val, (float)value); } } [Serializable] public class WeekDayFilter : NumFilter { public override bool CheckValue(DayOfWeek val) { return CheckNum((float)val, (float)value); } } public enum Month { January = 1, February, March, April, May, June, July, August, September, October, November, December } [FormerlySerializedAs("filterOnStart")] public bool checkDateOnEnable = true; [Header("Date")] [Tooltip("When checked: All DateFilters must be true in order for the filter to succeed.\nWhen unchecked: Only one filter passing is required to succeed.")] public bool mustPassAllFilters = false; public DateEntryFilter[] DateFilters = new DateEntryFilter[1] { new DateEntryFilter() }; public bool checkDateWithinRange = false; public DateRange dateRange = new DateRange(); [Header("Time")] [Tooltip("Number between 0 - 23")] public IntFilter hour = new IntFilter { value = 12 }; [Tooltip("Number between 0 - 59")] public IntFilter minute = new IntFilter { value = 30 }; public static Month GetMonth(int num) { if (Enum.IsDefined(typeof(Month), num)) { return (Month)num; } return Month.January; } public void OnEnable() { if (checkDateOnEnable) { FilterCurrentDate(); } } public override void Filter(DateTime date) { if (DateFilters.Length != 0) { int num = 0; for (int i = 0; i < DateFilters.Length; i++) { if (DateFilters[i].dayOfWeek.Check(date.DayOfWeek) && DateFilters[i].day.Check(date.Day) && DateFilters[i].month.Check(GetMonth(date.Month)) && DateFilters[i].year.Check(date.Year)) { num++; } } if (mustPassAllFilters ? (num != DateFilters.Length) : (num == 0)) { goto IL_015a; } } if ((checkDateWithinRange && !dateRange.IsBetweenDates(date)) || !hour.Check(date.Hour) || !minute.Check(date.Minute)) { goto IL_015a; } Result(date, success: true); return; IL_015a: Result(date); } public void FilterCurrentDate() { Filter(DateTime.Now); } public override void FilterDefault() { FilterCurrentDate(); } } public class DungeonFilter : JFilter, IDungeonLoadListener { public bool checkPostDunGen = true; [Header("Dungeon Properties")] public NameFilter dungeonName = new NameFilter(); public string[] dungeonContentTags = new string[0]; public bool mustHaveAllDungeonTags = true; public override void Filter(DungeonFlow dungeon) { if ((Object)(object)dungeon == (Object)null) { FilteredResult.Invoke(false); } else if (!JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader) || LLLHelper.ExtendedDungeonFilters(this, dungeon)) { Result(dungeon, success: true); } else { Result(dungeon); } } public override void FilterDefault() { if (RoundManager.Instance.currentDungeonType >= 0) { Filter(RoundManager.Instance.dungeonFlowTypes[RoundManager.Instance.currentDungeonType].dungeonFlow); } } public void FilterDungeon(int id) { if (id < 0 || id >= RoundManager.Instance.dungeonFlowTypes.Length) { JLogHelper.LogWarning($"Dungeon {id} is out of bounds of the DungeonFlowTypes array."); } else { Filter(RoundManager.Instance.dungeonFlowTypes[id].dungeonFlow); } } public void PostDungeonGeneration() { FilterDefault(); } } public class EnemyFilter : JFilter { [Header("EnemyType")] [Tooltip("Checks if the name of the EnemyType matches the given name")] public NameFilter enemyType = new NameFilter(); [Tooltip("Checks EnemyType's 'canDie' property")] public CheckFilter isInvulnerable = new CheckFilter(); [Header("Enemy Stats")] public NumericFilter healthCheck = new NumericFilter { value = 2f }; public override void Filter(EnemyAI enemy) { if (!enemy.isEnemyDead && enemyType.Check(enemy.enemyType.enemyName) && isInvulnerable.Check(!enemy.enemyType.canDie) && healthCheck.Check(enemy.enemyHP)) { Result(enemy, success: true); } else { Result(enemy); } } } public abstract class JFilter : JFilter { [Header("JFilter")] public UnityEvent filteredEvent = new UnityEvent(); public UnityEvent failedEvent = new UnityEvent(); public abstract void Filter(T input); public void Result(T input, bool success = false) { if (success) { filteredEvent.Invoke(input); } else { failedEvent.Invoke(input); } FilteredResult.Invoke(success); } public override void FilterDefault() { } } public abstract class JFilter : MonoBehaviour { [HideInInspector] public UnityEvent FilteredResult = new UnityEvent(); public abstract void FilterDefault(); } [Serializable] public abstract class JFilterProperty { public bool shouldCheck = false; public F value; public bool Check(T val) { if (shouldCheck && !CheckValue(val)) { return false; } return true; } public abstract bool CheckValue(T val); } [Serializable] public abstract class JFilterProperty : JFilterProperty { } [Serializable] public abstract class NumFilter : JFilterProperty { public enum FilterOpperand { GreaterThan, LessThan, EqualTo, GreaterThanOrEqual, LessThanOrEqual, ModuloZero, NotEqualTo } public FilterOpperand operation = FilterOpperand.EqualTo; public bool CheckNum(float check, float current) { FilterOpperand filterOpperand = operation; if (1 == 0) { } bool result = filterOpperand switch { FilterOpperand.EqualTo => check == current, FilterOpperand.GreaterThan => check > current, FilterOpperand.LessThan => check < current, FilterOpperand.GreaterThanOrEqual => check >= current, FilterOpperand.LessThanOrEqual => check <= current, FilterOpperand.ModuloZero => check % current == 0f, FilterOpperand.NotEqualTo => check != current, _ => false, }; if (1 == 0) { } return result; } } [Serializable] public class NumericFilter : NumFilter { public override bool CheckValue(float val) { return CheckNum(val, value); } } [Serializable] public class IntFilter : NumFilter { public override bool CheckValue(int val) { return CheckNum(val, value); } } [Serializable] public class NameFilter : JFilterProperty { public enum CompareFilter { Equal, Contains, StartsWith, EndsWith } public CompareFilter compareMethod = CompareFilter.Equal; public bool caseSensitive = false; public override bool CheckValue(string val) { string text = (caseSensitive ? value : value.ToLower()); if (!caseSensitive) { val = val.ToLower(); } CompareFilter compareFilter = compareMethod; if (1 == 0) { } bool result = compareFilter switch { CompareFilter.Equal => val == text, CompareFilter.Contains => val.Contains(text), CompareFilter.StartsWith => val.StartsWith(text), CompareFilter.EndsWith => val.EndsWith(text), _ => false, }; if (1 == 0) { } return result; } } [Serializable] public class CheckFilter : JFilterProperty { public override bool CheckValue(bool val) { return val == value; } } [Serializable] public class ItemFilter : JFilterProperty { [Serializable] public class Properties { public NameFilter itemName = new NameFilter(); public CheckFilter twoHanded = new CheckFilter(); public CheckFilter isScrap = new CheckFilter(); public NumericFilter scrapValue = new NumericFilter { value = 100f, operation = NumFilter.FilterOpperand.GreaterThan }; public NumericFilter itemCharge = new NumericFilter { value = 20f, operation = NumFilter.FilterOpperand.LessThan }; public CheckFilter insideFactory = new CheckFilter(); public string[] contentTags = new string[0]; public bool mustHaveAllTags = true; public bool Check(GrabbableObject item) { if ((Object)(object)item == (Object)null) { return false; } if (itemName.shouldCheck && !itemName.CheckValue(item.itemProperties.itemName)) { return false; } if (twoHanded.shouldCheck && !twoHanded.CheckValue(item.itemProperties.twoHanded)) { return false; } if (isScrap.shouldCheck && !isScrap.CheckValue(item.itemProperties.isScrap)) { return false; } if (scrapValue.shouldCheck && !scrapValue.CheckValue(item.scrapValue)) { return false; } if (itemCharge.shouldCheck && item.insertedBattery != null && !itemCharge.CheckValue(item.insertedBattery.charge)) { return false; } if (insideFactory.shouldCheck && !insideFactory.CheckValue(item.isInFactory)) { return false; } if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader) && contentTags.Length != 0 && !LLLHelper.ItemTagFilter(item.itemProperties, contentTags, mustHaveAllTags)) { return false; } return true; } } public override bool CheckValue(GrabbableObject item) { return value.Check(item); } } public class LevelFilter : JFilter { public bool checkCurrentLevelOnEnable = true; [Header("Level Info")] public NameFilter sceneName = new NameFilter { caseSensitive = true }; public NameFilter planetName = new NameFilter(); public string[] contentTags = new string[0]; public bool mustHaveAllTags = true; [Header("Level Properties")] public IntFilter routePrice = new IntFilter { value = 600 }; public IntFilter calculatedDifficulty = new IntFilter(); public NumericFilter scrapInside = new NumericFilter { value = 500f }; public IntFilter moldIterations = new IntFilter(); public void OnEnable() { if (checkCurrentLevelOnEnable) { FilterCurrentLevel(); } } public override void Filter(SelectableLevel level) { if (sceneName.Check(level.sceneName) && planetName.Check(level.PlanetName) && scrapInside.Check(RoundManager.Instance.totalScrapValueInLevel) && moldIterations.Check(level.moldSpreadIterations) && (!JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader) || LLLHelper.ExtendedLevelFilters(this, level))) { Result(level, success: true); } else { Result(level); } } public void FilterCurrentLevel() { Filter(RoundManager.Instance.currentLevel); } public override void FilterDefault() { FilterCurrentLevel(); } } public class PlayerFilter : JFilter { [Serializable] public class HeldItemFilter { public bool shouldCheck = false; public NameFilter itemName = new NameFilter(); public NumericFilter itemCharge = new NumericFilter { value = 100f }; public string[] contentTags = new string[0]; public bool mustHaveAllTags = true; public bool CheckValue(PlayerControllerB player) { if (shouldCheck && (Object)(object)player.currentlyHeldObjectServer != (Object)null) { GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if (itemName.shouldCheck && !itemName.CheckValue(currentlyHeldObjectServer.itemProperties.itemName)) { return false; } if (itemCharge.shouldCheck && currentlyHeldObjectServer.insertedBattery != null && !itemCharge.CheckValue(currentlyHeldObjectServer.insertedBattery.charge)) { return false; } if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader) && contentTags.Length != 0 && !LLLHelper.ItemTagFilter(currentlyHeldObjectServer.itemProperties, contentTags, mustHaveAllTags)) { return false; } return true; } return false; } } [Header("Inventory")] public ItemFilter heldItemFilter = new ItemFilter(); [Tooltip("Checks inventory for Items with matching names\nNot case sensitive")] public string[] inventoryContents = new string[0]; [Header("Player Stats")] [Tooltip("Players have 100 HP")] public NumericFilter healthCheck = new NumericFilter { value = 20f }; [Tooltip("Stamina is a value between 0 and 1")] public NumericFilter staminaCheck = new NumericFilter { value = 0.5f }; [Tooltip("Vanilla Weight Calculation: (weight - 1) * 105 lbs")] public NumericFilter weightCheck = new NumericFilter { value = 2f }; public CheckFilter inFacility = new CheckFilter { value = false }; [Header("Player Info")] public NameFilter username = new NameFilter { value = "Player" }; public CheckFilter isLocalPlayer = new CheckFilter { value = true }; [Header("Player Actions")] public CheckFilter isWalking = new CheckFilter { value = true }; public CheckFilter isSprinting = new CheckFilter { value = true }; public CheckFilter isCrouching = new CheckFilter { value = true }; public CheckFilter isExhausted = new CheckFilter { value = true }; public CheckFilter isUnderwater = new CheckFilter { value = true }; public CheckFilter isSinking = new CheckFilter { value = true }; public CheckFilter isClimbing = new CheckFilter { value = true }; public CheckFilter isInVehicle = new CheckFilter { value = true }; public CheckFilter isBleeding = new CheckFilter { value = true }; public CheckFilter isAlone = new CheckFilter { value = true }; public CheckFilter isEmoting = new CheckFilter { value = true }; public CheckFilter isInSpecialAnim = new CheckFilter { value = true }; [Header("Legacy (May be removed in the future)")] public HeldItemFilter heldItem = new HeldItemFilter(); public bool ignoreDeadCheck = false; public override void Filter(PlayerControllerB player) { if ((ignoreDeadCheck || !player.isPlayerDead) && heldItemFilter.Check(player.currentlyHeldObjectServer) && (!heldItem.shouldCheck || heldItem.CheckValue(player))) { if (inventoryContents.Length != 0) { int num = 0; for (int i = 0; i < inventoryContents.Length; i++) { for (int j = 0; j < player.ItemSlots.Length; j++) { if (!((Object)(object)player.ItemSlots[j] == (Object)null) && player.ItemSlots[j].itemProperties.itemName.ToLower().Equals(inventoryContents[i].ToLower())) { num++; break; } } } if (num != inventoryContents.Length) { goto IL_039f; } } if (healthCheck.Check(player.health) && staminaCheck.Check(player.sprintMeter) && weightCheck.Check(player.carryWeight) && inFacility.Check(player.isInsideFactory) && isLocalPlayer.Check(player.IsLocalPlayer()) && username.Check(player.playerUsername)) { if (isWalking.shouldCheck) { try { Traverse val = Traverse.Create((object)player); if (!isWalking.Check(val.Field("isWalking").GetValue())) { goto IL_039f; } } catch { JLogHelper.LogInfo(((Object)this).name + " isWalking check failed on " + player.playerUsername + ".", JLogLevel.Wesley); } } if (isSprinting.Check(player.isSprinting) && isCrouching.Check(player.isCrouching) && isExhausted.Check(player.isExhausted) && isUnderwater.Check(player.isUnderwater) && isSinking.Check(player.isSinking) && isClimbing.Check(player.isClimbingLadder) && isInVehicle.Check(player.inVehicleAnimation) && isBleeding.Check(player.bleedingHeavily) && isAlone.Check(player.isPlayerAlone) && isEmoting.Check(player.performingEmote) && isInSpecialAnim.Check(player.inSpecialInteractAnimation)) { Result(player, success: true); return; } } } goto IL_039f; IL_039f: Result(player); } public void FilterLocalClient() { Filter(StartOfRound.Instance.localPlayerController); } public void FilterAllPlayers() { for (int i = 0; i < RoundManager.Instance.playersManager.allPlayerScripts.Length; i++) { Filter(RoundManager.Instance.playersManager.allPlayerScripts[i]); } } public override void FilterDefault() { FilterAllPlayers(); } } } namespace JLL.Components.Compats { public interface CompatibilityComponent { bool IsModLoaded(); } public class DiversityFocusPoint : MonoBehaviour, CompatibilityComponent { public float maxDistance = 4f; private PlayerControllerB player = null; private bool beingUsed = false; private static bool? Loaded; public bool IsModLoaded() { bool valueOrDefault = Loaded.GetValueOrDefault(); if (!Loaded.HasValue) { valueOrDefault = JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.Diversity); Loaded = valueOrDefault; } return Loaded.Value; } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)player).transform.position) >= maxDistance) { DrawFocus(player); } } public void DrawFocus(PlayerControllerB player) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (IsModLoaded()) { beingUsed = !beingUsed; this.player = (beingUsed ? player : null); DiversityHelper.DrawFocus(player, beingUsed, ((Component)this).transform.position); } } } public class LCCutsceneTrigger : MonoBehaviour, CompatibilityComponent { public Transform cameraHolder; public float cutsceneLength = 4f; [Header("Player")] public bool allowDeath = true; public bool allowMovement = false; [Header("Transitions")] public float startTransition = 1f; public float endTransition = 1f; [Header("Animator")] public Animator animator; public string triggerName = "Cutscene"; private static bool? Loaded; public bool IsModLoaded() { bool valueOrDefault = Loaded.GetValueOrDefault(); if (!Loaded.HasValue) { valueOrDefault = JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LCCutscene); Loaded = valueOrDefault; } return Loaded.Value; } public void StartCutscene() { if (IsModLoaded()) { CutsceneHelper.StartCutscene(cameraHolder, cutsceneLength, allowDeath, allowMovement, startTransition, endTransition); if ((Object)(object)animator != (Object)null) { animator.ResetTrigger(triggerName); animator.SetTrigger(triggerName); } } } } public class LittleCompanyScaleModifier : NetworkBehaviour, CompatibilityComponent { public enum ScaleModificationType { Shrinking = 1, Growing = 2, Normalizing = 0 } public ScaleModificationType ModificationType = ScaleModificationType.Shrinking; public float multiplayer = 1f; public InteractEvent ScaledSuccess = new InteractEvent(); private static bool? Loaded; public bool IsModLoaded() { bool valueOrDefault = Loaded.GetValueOrDefault(); if (!Loaded.HasValue) { valueOrDefault = JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LittleCompany); Loaded = valueOrDefault; } return Loaded.Value; } public void Modify(PlayerControllerB target) { ModifyPlayerServerRpc(target.Index()); } [ServerRpc(RequireOwnership = false)] private void ModifyPlayerServerRpc(int playerTarget) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3304953096u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3304953096u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (IsModLoaded()) { ModifyPlayerClientRpc(playerTarget); } } } [ClientRpc] private void ModifyPlayerClientRpc(int playerTarget) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(898652876u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 898652876u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (IsModLoaded()) { PlayerControllerB player = RoundManager.Instance.playersManager.allPlayerScripts[playerTarget]; LittleCompanyHelper.ApplyModification(player, (int)ModificationType, multiplayer, delegate { OnSuccess(player); }); } } private void OnSuccess(PlayerControllerB player) { ((UnityEvent)(object)ScaledSuccess).Invoke(player); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3304953096u, new RpcReceiveHandler(__rpc_handler_3304953096), "ModifyPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(898652876u, new RpcReceiveHandler(__rpc_handler_898652876), "ModifyPlayerClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3304953096(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((LittleCompanyScaleModifier)(object)target).ModifyPlayerServerRpc(playerTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_898652876(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((LittleCompanyScaleModifier)(object)target).ModifyPlayerClientRpc(playerTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "LittleCompanyScaleModifier"; } } } namespace JLL.API { public class CustomConfigRegistry { public static Dictionary Mods = new Dictionary(); public static bool Register(string guid, CustomConfigEntry entry) { if (Mods.ContainsKey(guid)) { JLogHelper.LogWarning("Found duplicate entry of " + guid + ", skipping for now."); return false; } Mods.Add(guid, entry); return true; } public static bool RegisterMod(JLLMod mod) { if (mod.Invalid()) { return false; } if (!mod.HasConfigs()) { return true; } CustomConfigEntry customConfigEntry = CustomConfigEntry.Create(mod); if (Register(customConfigEntry.GUID, customConfigEntry)) { foreach (JLLMod.ConfigValue boolean in mod.Booleans) { customConfigEntry.RegisterConfig(boolean); } foreach (JLLMod.ConfigValue @string in mod.Strings) { customConfigEntry.RegisterConfig(@string); } foreach (JLLMod.ConfigValue integer in mod.Integers) { customConfigEntry.RegisterConfig(integer); } foreach (JLLMod.ConfigValue @float in mod.Floats) { customConfigEntry.RegisterConfig(@float); } return true; } return false; } } public class CustomConfigEntry { public enum EntryType { Unknown, Bool, Int, Float, String } public class JLLModProperties { public EntryType type; } public string GUID; private ManualLogSource Logger; public JLLMod ScriptableObject; public ConfigFile Config { get; } public Dictionary> Configs { get; } = new Dictionary>(); private CustomConfigEntry(JLLMod mod) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown ScriptableObject = mod; GUID = mod.GUID(); Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "JLL", GUID + ".cfg"), true); Logger = Logger.CreateLogSource("JLL." + GUID); } public static CustomConfigEntry Create(JLLMod jllMod) { return new CustomConfigEntry(jllMod); } public void LogInfo(string message, JLogLevel level = JLogLevel.Debuging) { if (JLogHelper.AcceptableLogLevel(level)) { Logger.LogInfo((object)message); } } public void LogWarning(string message, JLogLevel level = JLogLevel.Debuging) { if (JLogHelper.AcceptableLogLevel(level)) { Logger.LogWarning((object)message); } } public void RegisterConfig(JLLMod.ConfigValue config) { if (!Configs.ContainsKey(config.configName)) { EntryType type = EntryType.Unknown; if (config.defaultValue is bool) { type = EntryType.Bool; } else if (config.defaultValue is int) { type = EntryType.Int; } else if (config.defaultValue is float) { type = EntryType.Float; } else if (config.defaultValue is string) { type = EntryType.String; } LogInfo($"Registered config for {GUID}: {config.configName} default({config.defaultValue})"); Configs.Add(config.configName, new KeyValuePair((ConfigEntryBase)(object)Config.Bind(config.configCategory, config.configName, config.defaultValue, config.configDescription), new JLLModProperties { type = type })); } } public ConfigEntry GetConfigEntry(string name) { if (Configs.ContainsKey(name) && Configs[name].Key is ConfigEntry result) { return result; } return null; } public bool GetBool(string name) { return GetConfigEntry(name)?.Value ?? false; } public int GetInt(string name) { return GetConfigEntry(name)?.Value ?? (-1); } public float GetFloat(string name) { return GetConfigEntry(name)?.Value ?? (-1f); } public string GetString(string name) { ConfigEntry configEntry = GetConfigEntry(name); if (configEntry != null) { return configEntry.Value; } return ""; } } public class JCompatabilityHelper { public enum CachedMods { Other = -1, SimpleCommands, WeatherRegistry, LethalLevelLoader, LethalLib, ReservedSlotCore, LethalConfig, MoreCompany, LittleCompany, Diversity, Frailty, LCCutscene, StarlancerAIFix, StarlancerEnemyFix, Mirage, SellBodies, FacilityMeltdown, WesleyMoons, LethalMoonUnlocks, PathfindingLib } public static bool IsLoaded(CachedMods mod) { if (1 == 0) { } bool result = mod switch { CachedMods.SimpleCommands => IsLoaded("JacobG5.SimpleCommands"), CachedMods.WeatherRegistry => IsLoaded("mrov.WeatherRegistry"), CachedMods.LethalLevelLoader => IsLoaded("imabatby.lethallevelloader"), CachedMods.LethalLib => IsLoaded("evaisa.lethallib"), CachedMods.ReservedSlotCore => IsLoaded("FlipMods.ReservedItemSlotCore"), CachedMods.LethalConfig => IsLoaded("ainavt.lc.lethalconfig"), CachedMods.MoreCompany => IsLoaded("me.swipez.melonloader.morecompany"), CachedMods.LittleCompany => IsLoaded("Toybox.LittleCompany"), CachedMods.Diversity => IsLoaded("Chaos.Diversity"), CachedMods.Frailty => IsLoaded("Chaos.Frailty"), CachedMods.LCCutscene => IsLoaded("Chaos.LCCutscene"), CachedMods.StarlancerAIFix => IsLoaded("AudioKnight.StarlancerAIFix"), CachedMods.StarlancerEnemyFix => IsLoaded("AudioKnight.StarlancerEnemyEscape"), CachedMods.Mirage => IsLoaded("qwbarch.Mirage"), CachedMods.SellBodies => IsLoaded("Entity378.sellbodies"), CachedMods.FacilityMeltdown => IsLoaded("me.loaforc.facilitymeltdown"), CachedMods.WesleyMoons => IsLoaded("JacobG5.WesleyMoons"), CachedMods.LethalMoonUnlocks => IsLoaded("com.xmods.lethalmoonunlocks"), CachedMods.PathfindingLib => IsLoaded("Zaggy1024.PathfindingLib"), _ => false, }; if (1 == 0) { } return result; } public static bool IsLoaded(string guid, StringComparison comparison = StringComparison.InvariantCultureIgnoreCase) { foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { if (pluginInfo.Value.Metadata.GUID.Equals(guid, comparison)) { return true; } } return false; } } public class JFileHelper { public static readonly List JLLBundles = new List(); internal static bool JLLBundlesLoaded = false; internal static bool LLLBundlesLoaded = true; private static int filesRead = 0; private static int jllModsCount = 0; private static int levelPropertyOverrides = 0; public static UnityEvent OnJLLBundlesLoaded = new UnityEvent(); public static bool HaveJLLBundlesLoaded => JLLBundlesLoaded && LLLBundlesLoaded; public static string AsJson(T type, bool formatted = true) { return JsonConvert.SerializeObject((object)type, (Formatting)(formatted ? 1 : 0)); } public static bool ConvertJson(string json, out T output) { output = JsonConvert.DeserializeObject(json); if (output != null) { return true; } return false; } public static string[] GetJsonFilesInDirectory(string directory, bool searchSubs = true) { return GetFilesInDirectory(directory, new List { ".json" }, searchSubs); } public static string[] GetFilesInDirectory(string directory, List extensions, bool searchSubs = true) { return (from file in Directory.GetFiles(directory, "*.*", searchSubs ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly) where extensions.Any((string extension) => file.EndsWith(extension)) select file).ToArray(); } public static List GetTextFromFiles(string[] files) { List list = new List(); for (int i = 0; i < files.Length; i++) { try { list.Add(File.ReadAllText(files[i])); } catch { JLogHelper.LogWarning("Something went wrong reading: " + files[i]); } } return list; } public static List ParseJsonFiles(string[] files) { List list = new List(); for (int i = 0; i < files.Length; i++) { try { if (ConvertJson(File.ReadAllText(files[i]), out var output)) { list.Add(output); } } catch { JLogHelper.LogWarning("Something went wrong reading: " + files[i]); } } return list; } public static List ParseJsonFiles(string directory) { return ParseJsonFiles(GetJsonFilesInDirectory(directory)); } public static void LoadFilesInPlugins() { bool flag = JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalLevelLoader); if (flag) { JLogHelper.LogInfo("Linking to LLL"); LLLHelper.LinkBundlesLoadedEvent(); } JLogHelper.LogInfo("Searching for Bundles and JSONs....", JLogLevel.User); string[] files = Directory.GetFiles(Paths.PluginPath, "*.*", SearchOption.AllDirectories); int num = 0; for (int i = 0; i < files.Length; i++) { string text = files[i].ToLower(); if (text.EndsWith("jllmod.json")) { JLogHelper.LogInfo("Parsing JSON: " + files[i]); filesRead++; try { if (!ConvertJson(File.ReadAllText(files[i]), out var output)) { continue; } JLLMod jLLMod = output.ToMod(); if (CustomConfigRegistry.RegisterMod(jLLMod)) { jllModsCount++; for (int j = 0; j < output.levelPropertyOverrides.Length; j++) { levelPropertyOverrides++; JLevelPropertyRegistry.RegisterLevelProperties(new JLevelPropertyEntry { sceneName = output.levelPropertyOverrides[j].sceneName, enemyPropertyOverrides = output.levelPropertyOverrides[j].enemyPropertyOverrides }); } jLLMod.Init(); } else { Object.Destroy((Object)(object)jLLMod); } } catch (Exception arg) { JLogHelper.LogWarning($"Error Parsing {files[i]}\n{arg}"); } } else if (text.EndsWith(".jllmod")) { JLogHelper.LogInfo("Parsing Bundle: " + files[i]); filesRead++; AssetBundle item = AssetBundle.LoadFromFile(files[i]); JLLBundles.Add(item); } else if (text.EndsWith(".lethalbundle")) { num++; } } JLogHelper.LogInfo($"Finished reading {filesRead} files.", JLogLevel.User); if (flag && num == 0) { LLLBundlesLoaded = true; JLogHelper.LogInfo("Found 0 '.lethalbundle' files. Skipping LLL check."); } JLLBundlesLoaded = true; SearchAllBundles(); } internal static void SearchAllBundles() { if (!HaveJLLBundlesLoaded) { return; } foreach (AssetBundle allLoadedAssetBundle in AssetBundle.GetAllLoadedAssetBundles()) { if (allLoadedAssetBundle.isStreamedSceneAssetBundle) { continue; } try { JLLMod[] array = allLoadedAssetBundle.LoadAllAssets(); foreach (JLLMod jLLMod in array) { if (CustomConfigRegistry.RegisterMod(jLLMod)) { jllModsCount++; jLLMod.Init(); } else { Object.Destroy((Object)(object)jLLMod); } } JLevelProperties[] array2 = allLoadedAssetBundle.LoadAllAssets(); for (int j = 0; j < array2.Length; j++) { levelPropertyOverrides++; JLevelPropertyRegistry.RegisterLevelProperties(array2[j].Properties); } } catch (Exception arg) { JLogHelper.LogWarning($"Failed to read a bundle!\n{arg}"); } } JLogHelper.LogInfo($"Successfully Registered {jllModsCount} JLLMods and {levelPropertyOverrides} LevelPropertyOverrides.", JLogLevel.User); OnJLLBundlesLoaded.Invoke(); } } public class JHudHelper { private class DisplayTip { public string headerText; public string bodyText; public bool isWarning; public bool useSave; public string prefsKey; public DisplayTip(string headerText, string bodyText, bool isWarning, bool useSave, string prefsKey) { this.headerText = headerText; this.bodyText = bodyText; this.isWarning = isWarning; this.useSave = useSave; this.prefsKey = prefsKey; } } internal static bool isTipActive = false; private static List displayTipQueue = new List(); public static void QueueDisplayTip(string headerText, string bodyText, bool isWarning = false, bool useSave = false, string prefsKey = "LC_Tip1") { displayTipQueue.Add(new DisplayTip(headerText, bodyText, isWarning, useSave, prefsKey)); DisplayNextTip(); } public static void ClearDisplayTipQueue() { displayTipQueue = new List(); } internal static bool DisplayNextTip() { if (isTipActive) { return false; } if (displayTipQueue.Count > 0) { DisplayTip displayTip = displayTipQueue[0]; displayTipQueue.RemoveAt(0); HUDManager.Instance.DisplayTip(displayTip.headerText, displayTip.bodyText, displayTip.isWarning, displayTip.useSave, displayTip.prefsKey); return true; } return false; } } public static class JLLExtentions { internal static readonly Dictionary PlayerIndexes = new Dictionary(); public static int Index(this PlayerControllerB player) { if (PlayerIndexes.TryGetValue(player, out var value)) { return value; } for (int i = 0; i < RoundManager.Instance.playersManager.allPlayerScripts.Length; i++) { if ((Object)(object)RoundManager.Instance.playersManager.allPlayerScripts[i] == (Object)(object)player) { PlayerIndexes.Add(player, i); return i; } } return -1; } public static T GetWeightedRandom(this IEnumerable weightedItems) where T : class, IWeightedItem { T[] array = weightedItems.ToArray(); IWeightedItem[] weightedItems2 = array; return array[IWeightedItem.GetRandomIndex(weightedItems2)]; } public static T GetWeightedRandom(this IEnumerable weightedItems, Random random) where T : class, IWeightedItem { T[] array = weightedItems.ToArray(); IWeightedItem[] weightedItems2 = array; return array[IWeightedItem.GetRandomIndex(random, weightedItems2)]; } public static bool IsLocalPlayer(this PlayerControllerB player) { if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { return (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController; } return false; } public static int CombinedWeights(this IEnumerable weightedItems) where T : class, IWeightedItem { int num = 0; foreach (T weightedItem in weightedItems) { num += weightedItem.GetWeight(); } return num; } } public class JLLNetworkManager : NetworkBehaviour { public static JLLNetworkManager Instance; public Collider[] tempColliderResults = (Collider[])(object)new Collider[20]; private StormyWeather _stormyWeather = null; private LightningBoltPrefabScript lightningBolt = null; private AudioSource lightningSource = null; private ParticleSystem lightningExplosion = null; public StormyWeather StormyWeather { get { if ((Object)(object)_stormyWeather == (Object)null || !Object.op_Implicit((Object)(object)_stormyWeather)) { _stormyWeather = Object.FindObjectOfType(true); JLogHelper.LogInfo($"Copying Stormy Lighting: {(Object)(object)_stormyWeather != (Object)null}"); if ((Object)(object)lightningBolt == (Object)null || !Object.op_Implicit((Object)(object)lightningBolt)) { lightningBolt = Object.Instantiate(((Component)_stormyWeather.randomThunder).gameObject, ((Component)this).transform).GetComponent(); ((Component)lightningBolt).gameObject.SetActive(true); } if ((Object)(object)lightningSource == (Object)null || !Object.op_Implicit((Object)(object)lightningSource)) { lightningSource = Object.Instantiate(((Component)_stormyWeather.targetedStrikeAudio).gameObject, ((Component)this).transform).GetComponent(); ((Component)lightningSource).gameObject.SetActive(true); lightningSource.Stop(); } if ((Object)(object)lightningExplosion == (Object)null || !Object.op_Implicit((Object)(object)lightningExplosion)) { lightningExplosion = Object.Instantiate(((Component)_stormyWeather.explosionEffectParticle).gameObject, ((Component)this).transform).GetComponent(); ((Component)lightningExplosion).gameObject.SetActive(true); lightningExplosion.Stop(); } } return _stormyWeather; } } public void Awake() { Instance = this; } public void DestroyTerrainObstacleOnLocalClient(Vector3 pos, int damage) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (DestroyTerrainObstacleAtPosition(pos, damage)) { JLogHelper.LogInfo($"Sending Terrain Obstacle RPC! {pos} {damage}", JLogLevel.Wesley); BreakTerrainObstacleServerRpc(pos, damage, GameNetworkManager.Instance.localPlayerController.Index()); } } private bool DestroyTerrainObstacleAtPosition(Vector3 pos, int damage) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) int num = Physics.OverlapSphereNonAlloc(pos, 5f, tempColliderResults, 33554432, (QueryTriggerInteraction)1); if (num == 0) { return false; } bool flag = false; TerrainObstacle terrainObstacle = default(TerrainObstacle); for (int i = 0; i < num; i++) { if (((Component)tempColliderResults[i]).TryGetComponent(ref terrainObstacle)) { terrainObstacle.Damage(damage); flag = true; } JLogHelper.LogInfo($"Damaging {tempColliderResults[i]} {flag}", JLogLevel.Wesley); } if (flag) { float num2 = Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, pos); if (num2 < 15f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num2 < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } return true; } return false; } [ServerRpc(RequireOwnership = false)] private void BreakTerrainObstacleServerRpc(Vector3 pos, int damage, int playerWhoSent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3355487482u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); BytePacker.WriteValueBitPacked(val2, damage); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3355487482u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BreakTerrainObstacleClientRpc(pos, damage, playerWhoSent); } } } [ClientRpc] private void BreakTerrainObstacleClientRpc(Vector3 pos, int damage, int playerWhoSent) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2193294584u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); BytePacker.WriteValueBitPacked(val2, damage); BytePacker.WriteValueBitPacked(val2, playerWhoSent); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2193294584u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; JLogHelper.LogInfo($"Received RPC! {pos} {damage} {playerWhoSent}", JLogLevel.Wesley); if (GameNetworkManager.Instance.localPlayerController.Index() != playerWhoSent) { DestroyTerrainObstacleAtPosition(pos, damage); } } } public void DestroyPlayerCorpse(PlayerControllerB player) { DestroyPlayerCorpseServerRpc(player.Index()); } [ServerRpc(RequireOwnership = false)] private void DestroyPlayerCorpseServerRpc(int playerTarget) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(544472266u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 544472266u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DestroyPlayerCorpseClientRpc(playerTarget); } } } [ClientRpc] private void DestroyPlayerCorpseClientRpc(int playerTarget) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(280523205u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 280523205u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerTarget]; if (val3.isPlayerDead && (Object)(object)val3.deadBody != (Object)null) { Object.Destroy((Object)(object)((Component)val3.deadBody).gameObject); val3.deadBody = null; } } } [ServerRpc(RequireOwnership = false)] public void RandomTeleportServerRpc(int playerTarget, int selection, bool withRotation = false, float rotation = 0f, float range = 10f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(584103563u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); BytePacker.WriteValueBitPacked(val2, selection); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref withRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref range, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 584103563u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!Enum.IsDefined(typeof(RandomTeleportRegion), selection)) { return; } GameObject val3 = null; bool inside = false; switch (selection) { case 0: val3 = GetRandom(RoundManager.Instance.insideAINodes); inside = true; break; case 1: val3 = GetRandom(RoundManager.Instance.outsideAINodes); break; case 2: { int num = Random.Range(0, RoundManager.Instance.outsideAINodes.Length + RoundManager.Instance.insideAINodes.Length); if (num < RoundManager.Instance.outsideAINodes.Length) { val3 = RoundManager.Instance.insideAINodes[num]; break; } inside = true; val3 = RoundManager.Instance.outsideAINodes[num - RoundManager.Instance.outsideAINodes.Length]; break; } case 3: { PlayerControllerB val4 = RoundManager.Instance.playersManager.allPlayerScripts[playerTarget]; val3 = ((Component)val4).gameObject; inside = val4.isInsideFactory; break; } case 4: { PlayerControllerB random = GetRandom(RoundManager.Instance.playersManager.allPlayerScripts); val3 = ((Component)random).gameObject; inside = random.isInsideFactory; break; } } if ((Object)(object)val3 != (Object)null) { RandomTeleportClientRpc(playerTarget, RoundManager.Instance.GetRandomNavMeshPositionInRadius(val3.transform.position, range, default(NavMeshHit)), inside, withRotation, rotation); } } [ClientRpc] private void RandomTeleportClientRpc(int playerTarget, Vector3 pos, bool inside, bool withRotation = false, float rotation = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_015c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2968007244u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerTarget); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref inside, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref withRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2968007244u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; JLogHelper.LogInfo($"Random Teleporting {playerTarget}"); PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerTarget]; val3.TeleportPlayer(pos, withRotation, rotation, false, true); val3.isInsideFactory = inside; } } } public static T GetRandom(T[] array) { return array[Random.Range(0, array.Length)]; } public static string GetPath(Transform current) { if ((Object)(object)current.parent == (Object)null) { return "/" + ((Object)current).name; } return GetPath(current.parent) + "/" + ((Object)current).name; } [ServerRpc(RequireOwnership = true)] public void UpdateScanNodeServerRpc(NetworkObjectReference target, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1050834121u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref target, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1050834121u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdateScanNodeClientRpc(target, value); } } [ClientRpc] private void UpdateScanNodeClientRpc(NetworkObjectReference target, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3115731467u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref target, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3115731467u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); GrabbableObject val4 = default(GrabbableObject); if (((NetworkObjectReference)(ref target)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent(ref val4)) { val4.SetScrapValue(value); } else { JLogHelper.LogInfo("Networked GrabbableObject could not be found. Safely ignoring operation."); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void LightningStrikeRpc(Vector3 strikePos, int seed, float killRange = 2.4f, float damangeRange = 5f, bool ignorePath = false, float boltHeight = 80f, int boltWidth = 32) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Invalid comparison between Unknown and I4 //IL_0043: 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) //IL_005f: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00f3: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2827889430u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref strikePos); BytePacker.WriteValueBitPacked(val3, seed); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref killRange, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref damangeRange, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref ignorePath, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref boltHeight, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, boltWidth); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2827889430u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; _ = StormyWeather; Random random = new Random(seed); bool flag = false; Vector3 val4 = strikePos + new Vector3(0f, boltHeight, 0f); Vector3 val5 = strikePos + new Vector3(0f, 0.5f, 0f); if (ignorePath) { val4 = strikePos + new Vector3((float)random.Next(-boltWidth, boltWidth), boltHeight, (float)random.Next(-boltWidth, boltWidth)); } else { RaycastHit val7 = default(RaycastHit); for (int i = 0; i < 6; i++) { Vector3 val6 = strikePos + new Vector3((float)random.Next(-boltWidth, boltWidth), boltHeight, (float)random.Next(-boltWidth, boltWidth)); if (!Physics.Linecast(val6, val5, ref val7, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { flag = true; val4 = val6; break; } } if (!flag && Physics.Linecast(val4, val5, ref val7, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { RaycastHit val8 = default(RaycastHit); if (!Physics.Raycast(val4, strikePos - val4, ref val8, boltHeight + 20f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } strikePos = ((RaycastHit)(ref val8)).point; } } lightningBolt.Source.transform.position = val4; lightningBolt.Destination.transform.position = strikePos; ((LightningBoltPrefabScriptBase)lightningBolt).AutomaticModeSeconds = 0.2f; Landmine.SpawnExplosion(strikePos + new Vector3(0f, 0.25f, 0f), false, killRange, damangeRange, 50, 0f, (GameObject)null, false); ((Component)lightningExplosion).transform.position = strikePos + new Vector3(0f, 0.25f, 0f); lightningExplosion.Play(); PlayerControllerB val9 = GameNetworkManager.Instance.localPlayerController; if (val9.isPlayerDead && (Object)(object)val9.spectatedPlayerScript != (Object)null) { val9 = val9.spectatedPlayerScript; } float num = Vector3.Distance(((Component)val9.gameplayCamera).transform.position, strikePos); AudioClip[] array = null; if (num < 40f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 110f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } else { array = StormyWeather.distantThunderSFX; } if (array == null) { array = StormyWeather.strikeSFX; } ((Component)lightningSource).transform.position = val5; if (!val9.isInsideFactory) { RoundManager.PlayRandomClip(lightningSource, array, true, 1f, 0, 1000); } WalkieTalkie.TransmitOneShotAudio(lightningSource, array[Random.Range(0, array.Length)], 1f); Bounds bounds = StartOfRound.Instance.shipBounds.bounds; if (((Bounds)(ref bounds)).Contains(strikePos)) { ((Component)StartOfRound.Instance.shipAnimatorObject).GetComponent().SetTrigger("shipShake"); RoundManager.PlayRandomClip(StartOfRound.Instance.ship3DAudio, StartOfRound.Instance.shipCreakSFX, false, 1f, 0, 1000); StartOfRound.Instance.PowerSurgeShip(); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3355487482u, new RpcReceiveHandler(__rpc_handler_3355487482), "BreakTerrainObstacleServerRpc"); ((NetworkBehaviour)this).__registerRpc(2193294584u, new RpcReceiveHandler(__rpc_handler_2193294584), "BreakTerrainObstacleClientRpc"); ((NetworkBehaviour)this).__registerRpc(544472266u, new RpcReceiveHandler(__rpc_handler_544472266), "DestroyPlayerCorpseServerRpc"); ((NetworkBehaviour)this).__registerRpc(280523205u, new RpcReceiveHandler(__rpc_handler_280523205), "DestroyPlayerCorpseClientRpc"); ((NetworkBehaviour)this).__registerRpc(584103563u, new RpcReceiveHandler(__rpc_handler_584103563), "RandomTeleportServerRpc"); ((NetworkBehaviour)this).__registerRpc(2968007244u, new RpcReceiveHandler(__rpc_handler_2968007244), "RandomTeleportClientRpc"); ((NetworkBehaviour)this).__registerRpc(1050834121u, new RpcReceiveHandler(__rpc_handler_1050834121), "UpdateScanNodeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3115731467u, new RpcReceiveHandler(__rpc_handler_3115731467), "UpdateScanNodeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2827889430u, new RpcReceiveHandler(__rpc_handler_2827889430), "LightningStrikeRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3355487482(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).BreakTerrainObstacleServerRpc(pos, damage, playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2193294584(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); int playerWhoSent = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).BreakTerrainObstacleClientRpc(pos, damage, playerWhoSent); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_544472266(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).DestroyPlayerCorpseServerRpc(playerTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_280523205(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).DestroyPlayerCorpseClientRpc(playerTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_584103563(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_007f: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); int selection = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref selection); bool withRotation = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref withRotation, default(ForPrimitives)); float rotation = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation, default(ForPrimitives)); float range = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref range, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).RandomTeleportServerRpc(playerTarget, selection, withRotation, rotation, range); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2968007244(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_004f: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerTarget); Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); bool inside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inside, default(ForPrimitives)); bool withRotation = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref withRotation, default(ForPrimitives)); float rotation = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).RandomTeleportClientRpc(playerTarget, pos, inside, withRotation, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1050834121(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference target2 = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref target2, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).UpdateScanNodeServerRpc(target2, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3115731467(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference target2 = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref target2, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).UpdateScanNodeClientRpc(target2, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2827889430(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: 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_004f: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 strikePos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref strikePos); int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); float killRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref killRange, default(ForPrimitives)); float damangeRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damangeRange, default(ForPrimitives)); bool ignorePath = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ignorePath, default(ForPrimitives)); float boltHeight = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boltHeight, default(ForPrimitives)); int boltWidth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref boltWidth); target.__rpc_exec_stage = (__RpcExecStage)1; ((JLLNetworkManager)(object)target).LightningStrikeRpc(strikePos, seed, killRange, damangeRange, ignorePath, boltHeight, boltWidth); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JLLNetworkManager"; } } public class JLogHelper { public static JLogLevel LogLevel { get; private set; } internal static void UpdateLogLevel() { LogLevel = JLL.loggingLevel.Value; GetSource().LogInfo((object)$"JLL Logging Level set to: {LogLevel}"); } public static ManualLogSource GetSource() { return JLL.Instance.mls; } public static bool AcceptableLogLevel(JLogLevel logLevel) { return logLevel <= LogLevel; } public static void LogInfo(string message, JLogLevel level = JLogLevel.Debuging) { if (AcceptableLogLevel(level)) { GetSource().LogInfo((object)("[" + level.ToString() + "] " + message)); } } public static void LogWarning(string message, JLogLevel level = JLogLevel.User) { if (AcceptableLogLevel(level)) { GetSource().LogWarning((object)("[" + level.ToString() + "] " + message)); } } public static void LogError(string message, JLogLevel level = JLogLevel.User) { if (AcceptableLogLevel(level)) { GetSource().LogError((object)("[" + level.ToString() + "] " + message)); } } public static void LogFatal(string message, JLogLevel level = JLogLevel.ImportantOnly) { if (AcceptableLogLevel(level)) { GetSource().LogFatal((object)("[" + level.ToString() + "] " + message)); } } } public enum JLogLevel { ImportantOnly, User, Debuging, Wesley } } namespace JLL.API.LevelProperties { [Serializable] public class JLevelPropertyEntry { public string sceneName = ""; public LevelPrefab[] levelPrefabs = new LevelPrefab[0]; public EnemyPropertyOverride[] enemyPropertyOverrides = new EnemyPropertyOverride[0]; public void MergeWith(JLevelPropertyEntry other) { List list = enemyPropertyOverrides.ToList(); list.AddRange(other.enemyPropertyOverrides); enemyPropertyOverrides = list.ToArray(); List list2 = levelPrefabs.ToList(); list2.AddRange(other.levelPrefabs); levelPrefabs = list2.ToArray(); } } public class JLevelPropertyRegistry { private static readonly Dictionary Registry = new Dictionary(); public static UnityEvent PostLevelSettup = new UnityEvent(); public static readonly List AllSortedEnemies = new List(); public static readonly List EntranceTeleports = new List(); private static readonly Dictionary LevelPOIs = new Dictionary(); private static Terminal Terminal; private static JLevelPropertyEntry original = new JLevelPropertyEntry(); public static bool IsLevelGenerated { get; private set; } = false; public static bool ApparatusPulled { get; internal set; } = false; public static JLevelPropertyEntry GetLevelProperties(SelectableLevel level) { return GetLevelProperties(level.sceneName); } public static JLevelPropertyEntry GetLevelProperties(string name) { if (Registry.TryGetValue(name, out var value)) { return value; } return new JLevelPropertyEntry(); } public static void RegisterLevelProperties(JLevelPropertyEntry properties) { RegisterLevelProperties(properties.sceneName, properties); } public static void RegisterLevelProperties(string name, JLevelPropertyEntry properties) { if (Registry.TryGetValue(name, out var value)) { value.MergeWith(properties); } else { Registry.Add(name, properties); } } public static bool HasEntranceTeleports() { return EntranceTeleports.Count > 0; } public static Vector3? GetEntranceTeleportLocation(int id = 0, bool getOutsideEntrance = false, bool getTeleportPosition = false) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < EntranceTeleports.Count; i++) { if (EntranceTeleports[i].entranceId == id && getOutsideEntrance == EntranceTeleports[i].isEntranceToBuilding) { if (getTeleportPosition) { return EntranceTeleports[i].entrancePoint.position; } return ((Component)EntranceTeleports[i]).transform.position; } } return null; } public static bool GetPOI(string name, int id, out Transform pos) { if (LevelPOIs.ContainsKey(name) && LevelPOIs[name].Count() > 0) { pos = LevelPOIs[name].GetTransform(id); return true; } pos = null; return false; } public static bool GetPOI(string name, out Transform pos) { return GetPOI(name, 0, out pos); } public static bool GetPOI(string name, int id, out Vector3 pos) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Transform pos2; bool pOI = GetPOI(name, id, out pos2); pos = (pOI ? pos2.position : Vector3.zero); return pOI; } public static bool GetPOI(string name, out Vector3 pos) { return GetPOI(name, 0, out pos); } public static void CreatePOI(string name, Transform pos) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) name = Regex.Replace(name, "[\\d-]", string.Empty); if (!LevelPOIs.ContainsKey(name)) { LevelPOIs.Add(name, LevelPOI.Create()); } JLogHelper.LogInfo($"Registering POI {name} at {pos.position}"); LevelPOIs[name].Add(pos); } public static bool HasPOI(string name) { return LevelPOIs.ContainsKey(name); } public static Terminal GetTerminal() { if ((Object)(object)Terminal == (Object)null) { Terminal = Object.FindObjectOfType(); } return Terminal; } internal static void ApplyLevelOverrides() { //IL_005a: 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) EntranceTeleport[] collection = Object.FindObjectsOfType(false); EntranceTeleports.AddRange(collection); IsLevelGenerated = true; SelectableLevel currentLevel = RoundManager.Instance.currentLevel; JLevelPropertyEntry levelProperties = GetLevelProperties(currentLevel); LevelPrefab[] levelPrefabs = levelProperties.levelPrefabs; foreach (LevelPrefab levelPrefab in levelPrefabs) { GameObject val = Object.Instantiate(levelPrefab.prefab); val.transform.position = levelPrefab.position; val.transform.rotation = levelPrefab.rotation; } List list = new List(); EnemyPropertyOverride[] enemyPropertyOverrides = levelProperties.enemyPropertyOverrides; foreach (EnemyPropertyOverride enemyPropertyOverride in enemyPropertyOverrides) { EnemyPropertyOverride enemyPropertyOverride2 = new EnemyPropertyOverride(); EnemyType registeredEnemy = GetRegisteredEnemy(enemyPropertyOverride.enemyName); if ((Object)(object)registeredEnemy != (Object)null) { if (enemyPropertyOverride.MaxCount >= 0) { enemyPropertyOverride2.MaxCount = registeredEnemy.MaxCount; registeredEnemy.MaxCount = enemyPropertyOverride.MaxCount; } if (enemyPropertyOverride.PowerLevel >= 0f) { enemyPropertyOverride2.PowerLevel = registeredEnemy.PowerLevel; registeredEnemy.PowerLevel = enemyPropertyOverride.PowerLevel; } } list.Add(enemyPropertyOverride2); } original.enemyPropertyOverrides = list.ToArray(); PostLevelSettup.Invoke(); } internal static void RemoveLevelOverrides() { ApparatusPulled = false; IsLevelGenerated = false; EntranceTeleports.Clear(); LevelPOIs.Clear(); EnemyPropertyOverride[] enemyPropertyOverrides = original.enemyPropertyOverrides; foreach (EnemyPropertyOverride enemyPropertyOverride in enemyPropertyOverrides) { EnemyType registeredEnemy = GetRegisteredEnemy(enemyPropertyOverride.enemyName); if ((Object)(object)registeredEnemy != (Object)null) { if (enemyPropertyOverride.MaxCount >= 0) { registeredEnemy.MaxCount = enemyPropertyOverride.MaxCount; } if (enemyPropertyOverride.PowerLevel >= 0f) { registeredEnemy.PowerLevel = enemyPropertyOverride.PowerLevel; } } } original = new JLevelPropertyEntry(); } public static EnemyType GetRegisteredEnemy(string enemyName) { for (int i = 0; i < AllSortedEnemies.Count; i++) { if (AllSortedEnemies[i].enemyName == enemyName) { return AllSortedEnemies[i]; } } return null; } public static EnemyType GetRegisteredEnemy(EnemyType enemyType) { if (GetRegisteredEnemy(enemyType.enemyName, out var match)) { return match; } return enemyType; } public static bool GetRegisteredEnemy(string enemyName, out EnemyType match) { JLogHelper.LogInfo("Searching registry for " + enemyName, JLogLevel.Wesley); for (int i = 0; i < AllSortedEnemies.Count; i++) { if (AllSortedEnemies[i].enemyName == enemyName) { match = AllSortedEnemies[i]; return true; } } match = AllSortedEnemies[0]; return false; } } [Serializable] public class EnemyPropertyOverride { [Header("Identifier")] public string enemyName = ""; [Header("Properties")] public float PowerLevel = -1f; public int MaxCount = -1; } [Serializable] public class LevelPrefab { public GameObject prefab; public Vector3 position; public Quaternion rotation; } [Serializable] public class LevelPOI { private readonly List Points = new List(); private LevelPOI() { } public static LevelPOI Create() { return new LevelPOI(); } public int Count() { return Points.Count; } public Vector3 GetPoint(int index) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) return Points[Math.Clamp(index, 0, Points.Count - 1)].position; } public Transform GetTransform(int index) { return Points[Math.Clamp(index, 0, Points.Count - 1)]; } public void Add(Transform t) { Points.Add(t); } } } namespace JLL.API.JSON.Objects { public class JsonModSettings { public string modAuthor = ""; public string modName = ""; public JsonConfigValue[] configOptions = new JsonConfigValue[0]; public JsonLevelPropertyOverrides[] levelPropertyOverrides = new JsonLevelPropertyOverrides[0]; public JLLMod ToMod() { JLLMod jLLMod = ScriptableObject.CreateInstance(); jLLMod.modAuthor = modAuthor; jLLMod.modName = modName; JsonConfigValue[] array = configOptions; foreach (JsonConfigValue jsonConfigValue in array) { switch (jsonConfigValue.type.ToLower()) { case "bool": { List list = new List { "true", "1", "t" }; jLLMod.Booleans.Add(ParseConfig(jsonConfigValue, list.Contains(jsonConfigValue.defaultValue.ToLower()))); break; } case "int": { int defaultValue2 = 1; if (int.TryParse(jsonConfigValue.defaultValue, out var result2)) { defaultValue2 = result2; } jLLMod.Integers.Add(ParseConfig(jsonConfigValue, defaultValue2)); break; } case "float": { float defaultValue = 1f; if (float.TryParse(jsonConfigValue.defaultValue, out var result)) { defaultValue = result; } jLLMod.Floats.Add(ParseConfig(jsonConfigValue, defaultValue)); break; } case "string": jLLMod.Strings.Add(ParseConfig(jsonConfigValue, jsonConfigValue.defaultValue)); break; } } return jLLMod; } private JLLMod.ConfigValue ParseConfig(JsonConfigValue config, T defaultValue) { return new JLLMod.ConfigValue { configName = config.configName, configCategory = config.configCategory, configDescription = config.configDescription, defaultValue = defaultValue }; } } public class JsonConfigValue { public string configName = "Example"; public string configCategory = "Main"; public string configDescription = ""; public string type = "bool"; public string defaultValue = "false"; public bool isSlider = false; public int max = 100; public int min = 0; } public class JsonLevelPropertyOverrides { public string sceneName = ""; public EnemyPropertyOverride[] enemyPropertyOverrides = new EnemyPropertyOverride[0]; } public class JsonVector { public float x = 0f; public float y = 0f; public float z = 0f; public Vector3 GetUnityVector() { //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_001b: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, y, z); } public static JsonVector Create(Vector3 vector) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return new JsonVector { x = vector.x, y = vector.y, z = vector.z }; } } } namespace JLL.API.Events { [Serializable] public class EnemyEvent : UnityEvent { } [Serializable] public class VehicleEvent : UnityEvent { } [Serializable] public class DamageableEvent : UnityEvent { } [Serializable] public class ObjectEvent : UnityEvent { } [Serializable] public class FloatEvent : UnityEvent { } [Serializable] public class BoolEvent : UnityEvent { } [Serializable] public class IntEvent : UnityEvent { } [Serializable] public class StringEvent : UnityEvent { } } namespace JLL.API.Compatability { public static class CutsceneHelper { public static void StartCutscene(Transform cameraTrans, float length, bool allowDeath = true, bool allowMovement = false, float startTransition = 1f, float endTransition = 1f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown if (JLL.disableCutscenes.Value) { return; } try { CutsceneManager.Instance.PlayScene(new Cutscene(cameraTrans, length) { AllowPlayerDeath = allowDeath, AllowPlayerMovement = allowMovement, TransitionInSpeed = startTransition, TransitionOutSpeed = endTransition }); } catch (Exception arg) { JLogHelper.LogWarning($"LCCutscene failed to start.\n{arg}", JLogLevel.Debuging); } } } public static class DiversityHelper { public static void DrawFocus(PlayerControllerB player, bool beingUsed, Vector3 pos) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) try { PlayerRevamp val = default(PlayerRevamp); if (((Component)player).TryGetComponent(ref val)) { player.IsInspectingItem = beingUsed; val.forceLook = beingUsed; val.forceLookPosition = pos; } } catch (Exception arg) { JLogHelper.LogWarning($"Diversity focus failed.\n{arg}"); } } } public static class JWeatherRegistryHelper { public static bool HasCustomWeather(string name) { return GetCustomWeather(name) != null; } public static Weather GetCustomWeather(string name) { foreach (Weather weather in WeatherManager.Weathers) { if (weather.Name.Equals(name)) { return weather; } } return null; } public static void ChangeWeather(string weatherName, SelectableLevel level) { Weather customWeather = GetCustomWeather(weatherName); if (customWeather != null) { WeatherController.ChangeWeather(level, customWeather); } } public static void ChangeCurrentWeather(string weatherName) { ChangeWeather(weatherName, RoundManager.Instance.currentLevel); } public static List GetCustomWeatherNames() { return WeatherManager.Weathers.Select((Weather weather) => weather.Name).ToList(); } public static string GetCurrentWeatherName() { return GetCurrentWeather().Name; } private static Weather GetCurrentWeather() { SelectableLevel currentLevel = RoundManager.Instance.currentLevel; return WeatherManager.GetCurrentWeather(currentLevel); } public static void OverrideWeatherObjects(JWeatherOverride jWeatherOverride) { Weather currentWeather = GetCurrentWeather(); ImprovedWeatherEffect effect = currentWeather.Effect; WeatherEffect overrideEffect = jWeatherOverride.getOverrideEffect(currentWeather.Name); if (overrideEffect == null) { return; } effect.EffectEnabled = false; overrideEffect.effectEnabled = true; if ((Object)(object)overrideEffect.effectPermanentObject != (Object)null) { if ((Object)(object)effect.WorldObject != (Object)null) { effect.WorldObject.SetActive(false); } overrideEffect.effectPermanentObject.SetActive(true); } if (!StartOfRound.Instance.currentLevel.overrideWeather) { effect.EffectEnabled = false; overrideEffect.effectEnabled = true; } } public static void CheckWeatherChanges(JWeatherOverride jWeatherOverride) { Weather currentWeather = GetCurrentWeather(); ImprovedWeatherEffect effect = currentWeather.Effect; WeatherEffect overrideEffect = jWeatherOverride.getOverrideEffect(currentWeather.Name); if (overrideEffect != null) { if (effect.EffectEnabled) { effect.EffectEnabled = false; overrideEffect.effectEnabled = true; } if ((Object)(object)effect.WorldObject != (Object)null && (Object)(object)overrideEffect.effectPermanentObject != (Object)null && effect.WorldObject.activeSelf) { effect.WorldObject.SetActive(false); overrideEffect.effectPermanentObject.SetActive(true); } } } } public static class LethalConfigHelper { internal static void CreateJLLModConfig() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(JLL.loggingLevel, false)); LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(JLL.purgeWesley, false)); if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LCCutscene)) { LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(JLL.disableCutscenes, false)); } } public static void CreateJsonModConfigs(CustomConfigEntry jsonMod) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown foreach (KeyValuePair> config in jsonMod.Configs) { CustomConfigEntry.JLLModProperties value = config.Value.Value; switch (value.type) { case CustomConfigEntry.EntryType.Bool: LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(jsonMod.GetConfigEntry(config.Key))); break; case CustomConfigEntry.EntryType.String: LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(jsonMod.GetConfigEntry(config.Key))); break; case CustomConfigEntry.EntryType.Int: LethalConfigManager.AddConfigItem((BaseConfigItem)new IntInputFieldConfigItem(jsonMod.GetConfigEntry(config.Key))); break; case CustomConfigEntry.EntryType.Float: LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatInputFieldConfigItem(jsonMod.GetConfigEntry(config.Key))); break; } } } } public static class LittleCompanyHelper { public static void ApplyModification(PlayerControllerB target, int type, float multiplier = 1f, Action onComplete = null) { //IL_0003: 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) //IL_001f: 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) try { ModificationType val = (ModificationType)0; if (Enum.IsDefined(typeof(ModificationType), type)) { val = (ModificationType)type; } if (PlayerModification.CanApplyModificationTo(target, val, target, multiplier)) { PlayerModification.ApplyModificationTo(target, val, target, multiplier, onComplete); } } catch (Exception arg) { JLogHelper.LogWarning($"LittleCompany modification failed.\n{arg}"); } } } public static class LLLHelper { [CompilerGenerated] private static class <>O { public static BundlesFinishedLoading <0>__LLLBundlesLoaded; } public static void LockExtendedLevel(string sceneName, bool isLocked = true) { ExtendedLevel level = GetLevel(sceneName); if (!((Object)(object)level != (Object)null)) { return; } if (JCompatabilityHelper.IsLoaded(JCompatabilityHelper.CachedMods.LethalMoonUnlocks)) { if (!isLocked) { LMUHelper.ReleaseLock(level.NumberlessPlanetName); } } else { level.IsRouteLocked = isLocked; } JLogHelper.LogInfo($"{level.SelectableLevel.PlanetName} Locked: {level.IsRouteLocked}"); } public static void HideExtendedLevel(string sceneName, bool isHidden = true) { ExtendedLevel level = GetLevel(sceneName); if ((Object)(object)level != (Object)null) { level.IsRouteHidden = isHidden; JLogHelper.LogInfo($"{level.SelectableLevel.PlanetName} Hidden: {level.IsRouteHidden}"); } } public static ExtendedLevel GetLevel(SelectableLevel level) { return GetLevel(level.sceneName); } public static ExtendedLevel GetLevel(string sceneName) { foreach (ExtendedLevel extendedLevel in PatchedContent.ExtendedLevels) { if (extendedLevel.SelectableLevel.sceneName == sceneName) { return extendedLevel; } } return null; } public static ExtendedDungeonFlow GetDungeon(DungeonFlow flow) { for (int i = 0; i < PatchedContent.ExtendedDungeonFlows.Count; i++) { if ((Object)(object)PatchedContent.ExtendedDungeonFlows[i].DungeonFlow == (Object)(object)flow) { return PatchedContent.ExtendedDungeonFlows[i]; } } return null; } public static ExtendedItem GetItem(Item item) { for (int i = 0; i < PatchedContent.ExtendedItems.Count; i++) { if ((Object)(object)PatchedContent.ExtendedItems[i].Item == (Object)(object)item) { return PatchedContent.ExtendedItems[i]; } } return null; } public static ExtendedEnemyType GetEnemy(EnemyType enemy) { for (int i = 0; i < PatchedContent.ExtendedEnemyTypes.Count; i++) { if ((Object)(object)PatchedContent.ExtendedEnemyTypes[i].EnemyType == (Object)(object)enemy) { return PatchedContent.ExtendedEnemyTypes[i]; } } return null; } public static bool LevelHasTag(SelectableLevel level, string tag) { ExtendedLevel level2 = GetLevel(level); if ((Object)(object)level2 != (Object)null) { return ((ExtendedContent)level2).TryGetTag(tag); } return false; } public static bool ItemHasTag(Item item, string tag) { ExtendedItem item2 = GetItem(item); if ((Object)(object)item2 != (Object)null) { return ((ExtendedContent)item2).TryGetTag(tag); } return false; } public static bool EnemyHasTag(EnemyType enemy, string tag) { ExtendedEnemyType enemy2 = GetEnemy(enemy); if ((Object)(object)enemy2 != (Object)null) { return ((ExtendedContent)enemy2).TryGetTag(tag); } return false; } public static List GetItemTags(Item item) { ExtendedItem item2 = GetItem(item); if ((Object)(object)item2 != (Object)null) { return GetExtendedTags((ExtendedContent)(object)item2); } return new List(); } public static List GetLevelTags(SelectableLevel level) { ExtendedLevel level2 = GetLevel(level); if ((Object)(object)level2 != (Object)null) { return GetExtendedTags((ExtendedContent)(object)level2); } return new List(); } public static List GetExtendedTags(ExtendedContent content) { List list = new List(); for (int i = 0; i < content.ContentTags.Count; i++) { list.Add(content.ContentTags[i].contentTagName); } return list; } internal static bool ExtendedLevelFilters(LevelFilter levelFilter, SelectableLevel level) { ExtendedLevel level2 = GetLevel(level); if ((Object)(object)level2 != (Object)null) { if (levelFilter.contentTags.Length != 0 && !CheckTags((ExtendedContent)(object)level2, levelFilter.contentTags, levelFilter.mustHaveAllTags)) { return false; } if (!levelFilter.routePrice.Check(level2.RoutePrice)) { return false; } if (!levelFilter.calculatedDifficulty.Check(level2.CalculatedDifficultyRating)) { return false; } } return true; } internal static bool ExtendedDungeonFilters(DungeonFilter dungeonFilter, DungeonFlow flow) { ExtendedDungeonFlow dungeon = GetDungeon(flow); if ((Object)(object)dungeon != (Object)null) { if (!dungeonFilter.dungeonName.Check(dungeon.DungeonName)) { return false; } if (dungeonFilter.dungeonContentTags.Length != 0 && !CheckTags((ExtendedContent)(object)dungeon, dungeonFilter.dungeonContentTags, dungeonFilter.mustHaveAllDungeonTags)) { return false; } } else { JLogHelper.LogInfo("(" + ((Object)dungeonFilter).name + ") Couldn't find ExtendedDungeonFlow"); } return true; } internal static bool ItemTagFilter(Item item, string[] contentTags, bool mustHaveAllTags) { ExtendedItem item2 = GetItem(item); if ((Object)(object)item2 != (Object)null) { if (!CheckTags((ExtendedContent)(object)item2, contentTags, mustHaveAllTags)) { return false; } return true; } JLogHelper.LogInfo("Extended Item couldn't be found for: " + item.itemName, JLogLevel.Wesley); return false; } private static bool CheckTags(ExtendedContent content, string[] contentTags, bool mustHaveAllTags) { List extendedTags = GetExtendedTags(content); int num = 0; for (int i = 0; i < contentTags.Length; i++) { for (int j = 0; j < extendedTags.Count; j++) { if (extendedTags[j].ToLower().Equals(contentTags[i].ToLower())) { if (!mustHaveAllTags) { return true; } num++; break; } } } return num == contentTags.Length; } internal static void LinkBundlesLoadedEvent() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //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) //IL_0029: Expected O, but got Unknown JFileHelper.LLLBundlesLoaded = (int)AssetBundleLoader.CurrentLoadingStatus == 2; object obj = <>O.<0>__LLLBundlesLoaded; if (obj == null) { BundlesFinishedLoading val = LLLBundlesLoaded; <>O.<0>__LLLBundlesLoaded = val; obj = (object)val; } AssetBundleLoader.onBundlesFinishedLoading += (BundlesFinishedLoading)obj; } internal static void LLLBundlesLoaded() { JFileHelper.LLLBundlesLoaded = true; JFileHelper.SearchAllBundles(); } } public static class LMUHelper { public static void ReleaseLock(string numberlessPlanetName) { UnlockManager.TryReleaseStoryLock(numberlessPlanetName); } public static void SubscribeStoryLocks(params string[] numberlessPlanetNames) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown UnlockManager.OnCollectStoryLockedMoons += (DesignateStoryUnlocks)(() => numberlessPlanetNames.ToList()); } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace JLL.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }